|
4 | 4 | * @namespace Extras
|
5 | 5 | * @class ResetPasswordDialog
|
6 | 6 | */
|
7 |
| -if (typeof Extras === undefined || !Extras) { |
| 7 | +if (typeof Extras === undefined || !Extras) |
| 8 | +{ |
8 | 9 | var Extras = {};
|
9 | 10 | }
|
10 | 11 |
|
11 |
| -(function () { |
| 12 | +(function () |
| 13 | +{ |
12 | 14 | // Define constructor...
|
13 |
| - Extras.ResetPasswordDialog = function RPD_constructor(htmlId) { |
| 15 | + Extras.ResetPasswordDialog = function RPD_constructor(htmlId) |
| 16 | + { |
14 | 17 | Extras.ResetPasswordDialog.superclass.constructor.call(this, "Extras.ResetPasswordDialog", htmlId, ["button", "container"]);
|
15 | 18 | return this;
|
16 | 19 | };
|
17 | 20 |
|
18 | 21 | // Extend default Base component...
|
19 |
| - YAHOO.extend(Extras.ResetPasswordDialog, Alfresco.component.Base, { |
20 |
| - |
| 22 | + YAHOO.extend(Extras.ResetPasswordDialog, Alfresco.component.Base, |
| 23 | + { |
21 | 24 | resetPasswordDialog: null,
|
22 | 25 |
|
23 |
| - onReady: function RPD_onReady() { |
| 26 | + onReady: function RPD_onReady() |
| 27 | + { |
24 | 28 | // .. hook up or lost password link event handler code
|
25 |
| - YAHOO.util.Event.addListener(this.id + "-link", "click", function (e) { |
| 29 | + YAHOO.util.Event.addListener(this.id + "-link", "click", function (e) |
| 30 | + { |
26 | 31 | var actionUrl = Alfresco.constants.PROXY_URI_RELATIVE.replace("/alfresco/", "/alfresco-noauth/") + "extras/modules/reset-user-password";
|
27 | 32 | YAHOO.util.Event.stopEvent(e);
|
28 |
| - if (!this.resetPasswordDialog) { |
29 |
| - this.resetPasswordDialog = new Alfresco.module.SimpleDialog("resetPasswordDialog").setOptions({ |
| 33 | + if (!this.resetPasswordDialog) |
| 34 | + { |
| 35 | + this.resetPasswordDialog = new Alfresco.module.SimpleDialog("resetPasswordDialog").setOptions( |
| 36 | + { |
30 | 37 | width: "30em",
|
31 | 38 | templateUrl: Alfresco.constants.URL_SERVICECONTEXT + "extras/modules/reset-password-dialog",
|
32 | 39 | actionUrl: actionUrl,
|
33 |
| - |
34 |
| - onSuccess: { |
35 |
| - fn: function resetPasswordDialog_successCallback(response) { |
| 40 | + onSuccess: |
| 41 | + { |
| 42 | + fn: function resetPasswordDialog_successCallback(response) |
| 43 | + { |
36 | 44 | Alfresco.util.PopupManager.displayMessage({
|
37 | 45 | text: Alfresco.util.message("message.passwordSent")
|
38 | 46 | });
|
39 | 47 | },
|
40 | 48 | scope: this
|
41 | 49 | },
|
42 |
| - |
43 |
| - onFailure: { |
44 |
| - fn: function resetPasswordDialog_failCallback(response) { |
| 50 | + onFailure: |
| 51 | + { |
| 52 | + fn: function resetPasswordDialog_failCallback(response) |
| 53 | + { |
45 | 54 | var errorText = (response.json && response.json.message) ? response.json.message : Alfresco.util.message("message.unknownError"),
|
46 | 55 | errorTitle = (response.json && response.json.status && response.json.status.name) ? response.json.status.name : Alfresco.util.message("message.unknownErrorTitle");
|
47 | 56 |
|
48 |
| - Alfresco.util.PopupManager.displayPrompt({ |
| 57 | + Alfresco.util.PopupManager.displayPrompt( |
| 58 | + { |
49 | 59 | title: errorTitle,
|
50 | 60 | text: errorText
|
51 | 61 | });
|
52 | 62 | },
|
53 | 63 | scope: this
|
54 | 64 | },
|
55 |
| - |
56 |
| - doSetupFormsValidation: { |
| 65 | + doSetupFormsValidation: |
| 66 | + { |
57 | 67 | fn: function resetPasswordDialog_doSetupForm_callback(form) {},
|
58 | 68 | scope: this
|
59 | 69 | }
|
60 | 70 | });
|
61 |
| - } else { |
62 |
| - this.resetPasswordDialog.setOptions({ |
| 71 | + } |
| 72 | + else |
| 73 | + { |
| 74 | + this.resetPasswordDialog.setOptions( |
| 75 | + { |
63 | 76 | actionUrl: actionUrl
|
64 | 77 | });
|
65 | 78 | }
|
66 | 79 |
|
67 | 80 | this.resetPasswordDialog.show();
|
68 |
| - },null, this); |
| 81 | + |
| 82 | + }, null, this); |
69 | 83 | }
|
70 | 84 |
|
71 | 85 | });
|
|
0 commit comments