Make Account Center only usable when logged in
[blerg.git] / www / jssrc / blerg / ExternalURLPost.js
1 enyo.kind({
2     name: "blerg.ExternalURLPost",
3     published: {
4         title: "",
5         url: ""
6     },
7     statics: {
8         locationDetect: function(l) {
9             var m = l.search.match(/^\?post\/([^/]+)\/(.+)/);
10             if (m) {
11                 return {
12                     kind: "blerg.ExternalURLPost",
13                     title: decodeURIComponent(m[1]).replace(']','').replace('[',''),
14                     url: decodeURIComponent(m[2])
15                 };
16             } else {
17                 return false;
18             }
19         }
20     },
21     create: function() {
22         this.inherited(arguments);
23
24         this.bubble("onSetTitle", {section: "Blerg It!"});
25         this.bubble("onPostVisibility", {
26             showing: true,
27             data: '[' + this.title + '](' + this.url + ')'
28         });
29     },
30 });