X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FBlerg.js;h=827dc06e1e8fbc97786db73d2417c8f6f34511b4;hb=6eee0074c07ce85359975621ff832943d320493a;hp=3228d67ef61e41e597e0c118fcf9e1570e579410;hpb=04a4fdf9d85e0d0b193300abe0c0e433449cd285;p=blerg.git diff --git a/www/jssrc/blerg/Blerg.js b/www/jssrc/blerg/Blerg.js index 3228d67..827dc06 100644 --- a/www/jssrc/blerg/Blerg.js +++ b/www/jssrc/blerg/Blerg.js @@ -2,18 +2,22 @@ enyo.kind({ name: "blerg.Blerg", kind: "Control", lastHash: null, + pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.ExternalURLPost, blerg.Welcome ], handlers: { onStartSignup: "showSignupDialog", onTryLogin: "tryLogin", onTryLogout: "tryLogout", onSetTitle: "setTitle", - onPostVisibility: "postVisibilityUpdate" + onPostVisibility: "postVisibilityUpdate", + onReload: "sendReload", + onShowChangePassword: "showChangePassword", + onClearFeedStatus: "clearFeedStatus" }, components: [ {classes: "blerg-header", components: [ {name: "title", kind: "blerg.Title"}, {name: "controls", kind: "blerg.Controls"}, - {style: "clear: both"}, + {style: "clear: both;"}, {name: "post", kind: "blerg.Post", showing: false}, {name: "help", kind: "blerg.Help"} ]}, @@ -25,13 +29,6 @@ enyo.kind({ onLoginFailed: "loginFailed", onLogoutSuccessful: "logout"} ], - urlmap: [ - ['search', /^\?post\/([^/]+)\/(.+)/, "blerg.ExternalURLPost"], - ['hash', /^#\/(ref|tag)\/([A-Za-z0-9_-]+)(?:\/p(\d+))?$/, "blerg.Tag"], - ['hash', /^#\/feed(?:\/p(\d+))?$/, "blerg.Feed"], - ['hash', /^#([A-Za-z0-9_-]+)(?:\/(p)?(\d+))?$/, "blerg.User"] - ], - pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.Welcome ], rendered: function() { this.inherited(arguments); @@ -42,10 +39,10 @@ enyo.kind({ document.body.addEventListener('keyup', function(event) { if (event.shiftKey && event.keyCode == 32) { - this.$.post.show(); + this.waterfall('onPostVisibility', {showing: true}); event.stopPropagation(); } - }, false); + }.bind(this), false); }, hashCheck: function() { if (location.hash != this.lastHash) { @@ -94,5 +91,14 @@ enyo.kind({ postVisibilityUpdate: function(inSender, inEvent) { this.$.post.waterfall('onPostVisibility', inEvent); this.$.controls.waterfall('onPostVisibility', inEvent); + }, + sendReload: function() { + this.$.main.waterfall('onReload'); + }, + showChangePassword: function() { + this.$.passwdDialog.show(); + }, + clearFeedStatus: function() { + this.$.controls.waterfall('onClearFeedStatus'); } });