X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FControls.js;h=cc8ae8d9d1697751db5b3844bc3ccf99ccac0531;hb=4210d2d20df6635e19c20f5b303d498f4657968b;hp=eb3275c5d3732095dace10c0d5399b316b9664bb;hpb=626be60457401042854cab447a01ed4120b78886;p=blerg.git diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js index eb3275c..cc8ae8d 100644 --- a/www/jssrc/blerg/Controls.js +++ b/www/jssrc/blerg/Controls.js @@ -10,7 +10,8 @@ enyo.kind({ handlers: { onLogin: "login", onLogout: "logout", - onPostVisibility: "postVisibilityUpdate" + onPostVisibility: "postVisibilityUpdate", + onShowForgotPasswordLink: "showForgotPasswordLink" }, components: [ {name: "loggedOutControls", components: [ @@ -23,7 +24,10 @@ enyo.kind({ {name: "password", kind: "onyx.Input", placeholder: "Password", type: "password", attributes: {tabindex: 2}} ]}, ]}, - {kind: "onyx.Button", content: "Login", onclick: "loginClicked", attributes: {tabindex: 3}} + {kind: "onyx.Button", content: "Login", onclick: "loginClicked", attributes: {tabindex: 3}}, + {name: "forgotPassword", showing: false, style: "margin-top: 10px; text-align: left", components: [ + {kind: "blerg.Link", content: "Forgot your password?", onNavigate: "popupForgotPasswordDialog"} + ]} ]} ]}, {name: "loggedInControls", showing: false, components: [ @@ -34,7 +38,7 @@ enyo.kind({ {kind: "blerg.Link", content: "Logout", onNavigate: "logoutClicked"}, {tag: null, content: "."}, {tag: "br"}, - {kind: "blerg.Link", content: "Change Password", onNavigate: "changePasswordClicked"}, + {kind: "blerg.Link", content: "Account Center", href: '/#/account'}, {tag: null, content: "."} ]}, {classes: "blerg-controls-toolbar", components: [ @@ -43,6 +47,7 @@ enyo.kind({ {name: "spewButton", kind: "onyx.Button", classes: "spew-button", content: "Spew It!", onclick: "spewToggle"} ]}, ]}, + {name: "forgotPasswordDialog", kind: "blerg.ForgotPasswordDialog"}, {name: "api", kind: "blerg.API", onStatus: "gotStatus"}, {kind: "Signals", @@ -89,6 +94,7 @@ enyo.kind({ }, login: function(inSender, inEvent) { this.$.password.setValue(''); + this.$.forgotPassword.hide(); // TODO: Replace with regular blur() call in future enyo this.$.password.node.blur(); this.setLoggedIn(true); @@ -146,5 +152,12 @@ enyo.kind({ } else if (inEvent.type == 'mentioned') { this.gotStatus(this, {mentioned: false}); } + }, + showForgotPasswordLink: function(inSender, inevent) { + this.$.forgotPassword.show(); + }, + popupForgotPasswordDialog: function() { + this.$.forgotPasswordDialog.setUsername(this.$.username.getValue()); + this.$.forgotPasswordDialog.show(); } });