X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FControls.js;h=cc8ae8d9d1697751db5b3844bc3ccf99ccac0531;hb=f1c5b259b364aa5480bfd3939a46cf301fce3c8b;hp=abd43ea424d2be7a80a494f5845c77352609660a;hpb=21ea25fe5cfe8337ff9c3aa123f71e975c6c85d7;p=blerg.git diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js index abd43ea..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: [ @@ -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(); } });