X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FAccountCenter.js;h=981fcb11dbf5bd4528e0dd76288e9e8c3ef8eb28;hb=HEAD;hp=c3d4667a4f72b8a96555b57fa8fc23c39816c7d0;hpb=848df2d1d186a30c4f1dc0401e6911d2230b3c63;p=blerg.git
diff --git a/www/jssrc/blerg/AccountCenter.js b/www/jssrc/blerg/AccountCenter.js
index c3d4667..981fcb1 100644
--- a/www/jssrc/blerg/AccountCenter.js
+++ b/www/jssrc/blerg/AccountCenter.js
@@ -1,18 +1,5 @@
enyo.kind({
name: "blerg.AccountCenter",
- components: [
- {tag: 'h2', content: "Change Password"},
- {kind: "blerg.PasswdForm"},
- {tag: 'h2', content: "Generate recovery link"},
- {content: "A recovery link is a URL that will allow you to reset the password on your account at a later time. Whoever has this link will be able to gain control of your account. This link should be kept in a safe place like an encrypted password manager or a physical piece of paper locked in a safe. The link will expire after one year or the next password change (either via a recovery link or by changing it manually above). To indicate that you understand this, please copy blërg
into the textbox below.", tag: 'p', allowHtml: true},
- {tag: 'form', onsubmit: 'generateRecoveryLink', components: [
- {kind: 'onyx.InputDecorator', classes: "recovery", components: [
- {kind: 'onyx.Input', name: "recoveryVerifier"}
- ]},
- {kind: 'onyx.Button', content: "Generate", classes: "recovery", onclick: "generateRecoveryLink"}
- ]},
- {tag: 'p', name: 'recoveryLinkOutput', classes: 'recovery'}
- ],
statics: {
locationDetect: function(l) {
var m = l.hash.match(/^#\/account$/);
@@ -23,9 +10,32 @@ enyo.kind({
}
}
},
+ handlers: {
+ onLogin: "loginStatusChange",
+ onLogout: "loginStatusChange"
+ },
+ components: [
+ {name: 'accountCenterContent', showing: false, components: [
+ {tag: 'h2', content: "Change Password"},
+ {kind: "blerg.PasswdForm"},
+ {tag: 'h2', content: "Email"},
+ {kind: 'blerg.EmailForm'},
+ {tag: 'h2', content: "Generate recovery link"},
+ {content: "A recovery link is a URL that will allow you to reset the password on your account at a later time. Whoever has this link will be able to gain control of your account. This link should be kept in a safe place like an encrypted password manager or a physical piece of paper locked in a safe. The link will expire after one year or the next password change (either via a recovery link or by changing it manually above). To indicate that you understand this, please copy blërg
into the textbox below.", tag: 'p', allowHtml: true},
+ {tag: 'form', onsubmit: 'generateRecoveryLink', components: [
+ {kind: 'onyx.InputDecorator', classes: "recovery", components: [
+ {kind: 'onyx.Input', name: "recoveryVerifier"}
+ ]},
+ {kind: 'onyx.Button', content: "Generate", classes: "recovery", onclick: "generateRecoveryLink"}
+ ]},
+ {tag: 'p', name: 'recoveryLinkOutput', classes: 'recovery'}
+ ]},
+ {name: 'pleaseLogIn', content: 'Please log in above to use the Account Center.'}
+ ],
create: function() {
this.inherited(arguments);
this.bubble('onSetTitle', {section: 'Account Center'});
+ this.loginStatusChange();
},
generateRecoveryLink: function(inSender, inEvent) {
if (this.$.recoveryVerifier.getValue() != 'blërg') {
@@ -47,5 +57,9 @@ enyo.kind({
});
req.go();
+ },
+ loginStatusChange: function(inSender, inEvent) {
+ this.$.pleaseLogIn.setShowing(!blerg.API.loggedIn);
+ this.$.accountCenterContent.setShowing(blerg.API.loggedIn);
}
});