X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;ds=sidebyside;f=www%2Fjssrc%2Fblerg%2FBlerg.js;h=944c0c1cfe429356395d46b8a38db37d59a312d9;hb=f1c5b259b364aa5480bfd3939a46cf301fce3c8b;hp=45b7d5f2cf373bd80fcb11dd3b6a339dd0fd4c90;hpb=4720a1f90f7d42f3611f064cc5ba3d768a92b5c6;p=blerg.git diff --git a/www/jssrc/blerg/Blerg.js b/www/jssrc/blerg/Blerg.js index 45b7d5f..944c0c1 100644 --- a/www/jssrc/blerg/Blerg.js +++ b/www/jssrc/blerg/Blerg.js @@ -1,26 +1,31 @@ +// Listen for onsubmit events +enyo.dispatcher.listen(document, "submit"); + enyo.kind({ name: "blerg.Blerg", kind: "Control", lastHash: null, - pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.ExternalURLPost, blerg.Welcome ], + pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.ExternalURLPost, blerg.Welcome, blerg.AccountCenter, blerg.Recovery, blerg.EmailVerify ], handlers: { onStartSignup: "showSignupDialog", onTryLogin: "tryLogin", onTryLogout: "tryLogout", onSetTitle: "setTitle", - onPostVisibility: "postVisibilityUpdate" + onPostVisibility: "postVisibilityUpdate", + onReload: "sendReload", + onShowChangePassword: "showChangePassword", + onAuthFailure: "authFailure" }, 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"} ]}, {name: "main", kind: "blerg.Main"}, {name: "signupDialog", kind: "blerg.SignupDialog"}, - {name: "passwdDialog", kind: "blerg.PasswdDialog"}, {name: "api", kind: "blerg.API", onLoginSuccessful: "loginSuccessful", onLoginFailed: "loginFailed", @@ -79,6 +84,7 @@ enyo.kind({ }, loginFailed: function(inSender, inEvent) { alert('Login failed'); + this.waterfall('onShowForgotPasswordLink'); this.logout(); }, logout: function(inSender, inEvent) { @@ -88,5 +94,11 @@ enyo.kind({ postVisibilityUpdate: function(inSender, inEvent) { this.$.post.waterfall('onPostVisibility', inEvent); this.$.controls.waterfall('onPostVisibility', inEvent); + }, + sendReload: function() { + this.$.main.waterfall('onReload'); + }, + authFailure: function(inSender, inEvent) { + this.logout(); } });