/www/jssrc/blerg/ExternalURLPost.js
enyo.kind({
    name: "blerg.ExternalURLPost",
    published: {
        title: "",
        url: ""
    },
    statics: {
        locationDetect: function(l) {
            var m = l.search.match(/^\?post\/([^/]+)\/(.+)/);
            if (m) {
                return {
                    kind: "blerg.ExternalURLPost",
                    title: decodeURIComponent(m[1]).replace(']','').replace('[',''),
                    url: decodeURIComponent(m[2])
                };
            } else {
                return false;
            }
        }
    },
    create: function() {
        this.inherited(arguments);

        this.bubble("onSetTitle", {section: "Blerg It!"});
        this.bubble("onPostVisibility", {
            showing: true,
            data: '[' + this.title + '](' + this.url + ')'
        });
    },
});