2 name: "blerg.Recovery",
4 {tag: 'h2', content: "Reset Your Password"},
5 {tag: 'form', onsubmit: 'submitRecovery', components: [
6 {kind: 'onyx.InputDecorator', classes: "recovery", components: [
7 {kind: 'onyx.Input', name: "newPassword", type: 'password'}
9 {kind: 'onyx.Button', content: "Set", onclick: "submitRecovery", classes: "recovery"}
13 locationDetect: function(l) {
14 var m = l.hash.match(/^#\/recovery\//);
17 kind: 'blerg.Recovery'
23 this.inherited(arguments);
24 this.bubble('onSetTitle', {section: 'Reset Password'});
26 submitRecovery: function(inSender, inEvent) {
27 var m = location.hash.match(new RegExp('^#/recovery/(.*)$'));
29 alert('Validation failed');
33 var req = new enyo.Ajax({
34 url: '/aux/recovery/validate',
38 password: this.$.newPassword.getValue()
42 req.response(this, function(inSender, inResponse) {
43 if (inResponse.status == 'success') {
44 alert('Password changed successfully');
47 alert('Password change failed');
51 req.error(this, function(inSender, inResponse) {
52 alert('Password change failed');