Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js b/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js index 8195f2e..87c52b2 100644 --- a/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js +++ b/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
32 | 29 | ||
33 | Clipperz.PM.Components.PasswordGenerator = function(anElement, aFieldValueComponent, args) { | 30 | Clipperz.PM.Components.PasswordGenerator = function(anElement, aFieldValueComponent, args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | 32 | ||
36 | //MochiKit.Logging.logDebug(">>> new TextFormField"); | 33 | //MochiKit.Logging.logDebug(">>> new TextFormField"); |
37 | Clipperz.PM.Components.PasswordGenerator.superclass.constructor.call(this, anElement, args); | 34 | Clipperz.PM.Components.PasswordGenerator.superclass.constructor.call(this, anElement, args); |
38 | 35 | ||
39 | this._fieldValueComponent = aFieldValueComponent; | 36 | this._fieldValueComponent = aFieldValueComponent; |
40 | this._panelButton = null; | 37 | this._panelButton = null; |
41 | this.render(); | 38 | this.render(); |
42 | //MochiKit.Logging.logDebug("<<< new TextFormField"); | 39 | //MochiKit.Logging.logDebug("<<< new TextFormField"); |
43 | 40 | ||
44 | return this; | 41 | return this; |
45 | }; | 42 | }; |
46 | 43 | ||
47 | YAHOO.extendX(Clipperz.PM.Components.PasswordGenerator, Clipperz.PM.Components.BaseComponent, { | 44 | YAHOO.extendX(Clipperz.PM.Components.PasswordGenerator, Clipperz.PM.Components.BaseComponent, { |
48 | 45 | ||
49 | 'toString': function() { | 46 | 'toString': function() { |
50 | return "Clipperz.PM.Components.PasswordGenerator"; | 47 | return "Clipperz.PM.Components.PasswordGenerator"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //----------------------------------------------------- | 50 | //----------------------------------------------------- |
54 | 51 | ||
55 | 'fieldValueComponent': function() { | 52 | 'fieldValueComponent': function() { |
56 | return this._fieldValueComponent; | 53 | return this._fieldValueComponent; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //----------------------------------------------------- | 56 | //----------------------------------------------------- |
60 | 57 | ||
61 | 'render': function() { | 58 | 'render': function() { |
62 | MochiKit.Signal.disconnectAllTo(this); | 59 | MochiKit.Signal.disconnectAllTo(this); |
63 | 60 | ||
64 | // this._panelButton = new YAHOO.ext.Button(this.element().dom, {text:Clipperz.PM.Strings['passwordGeneratorButtonLabel'], handler:this.openPasswordPanel, scope:this}); | 61 | // this._panelButton = new YAHOO.ext.Button(this.element().dom, {text:Clipperz.PM.Strings['passwordGeneratorButtonLabel'], handler:this.openPasswordPanel, scope:this}); |
65 | MochiKit.Signal.connect(this.element().dom, 'onmouseenter', this, 'onMouseEnter'); | 62 | MochiKit.Signal.connect(this.element().dom, 'onmouseenter', this, 'onMouseEnter'); |
66 | MochiKit.Signal.connect(this.element().dom, 'onmouseleave', this, 'onMouseLeave'); | 63 | MochiKit.Signal.connect(this.element().dom, 'onmouseleave', this, 'onMouseLeave'); |
67 | MochiKit.Signal.connect(this.element().dom, 'onclick', this, 'openPasswordPanel'); | 64 | MochiKit.Signal.connect(this.element().dom, 'onclick', this, 'openPasswordPanel'); |
68 | }, | 65 | }, |
69 | 66 | ||
70 | //----------------------------------------------------- | 67 | //----------------------------------------------------- |
71 | 68 | ||
72 | 'onMouseEnter': function() { | 69 | 'onMouseEnter': function() { |
73 | this.element().addClass('hover'); | 70 | this.element().addClass('hover'); |
74 | }, | 71 | }, |
75 | 72 | ||
76 | 'onMouseLeave': function() { | 73 | 'onMouseLeave': function() { |
77 | this.element().removeClass('hover'); | 74 | this.element().removeClass('hover'); |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //----------------------------------------------------- | 77 | //----------------------------------------------------- |
81 | 78 | ||
82 | 'panelButton': function() { | 79 | 'panelButton': function() { |
83 | return this._panelButton; | 80 | return this._panelButton; |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //----------------------------------------------------- | 83 | //----------------------------------------------------- |
87 | 84 | ||
88 | 'openPasswordPanel': function() { | 85 | 'openPasswordPanel': function() { |
89 | var passwordGeneratorElement; | 86 | var passwordGeneratorElement; |
90 | var passwordGeneratorDialog; | 87 | var passwordGeneratorDialog; |
91 | var cancelButton; | 88 | var cancelButton; |
92 | var okButton; | 89 | var okButton; |
93 | var cancelFunction; | 90 | var cancelFunction; |
94 | var okFunction; | 91 | var okFunction; |
95 | 92 | ||
96 | //MochiKit.Logging.logDebug(">>> PasswordGenerator.openPasswordPanel"); | 93 | //MochiKit.Logging.logDebug(">>> PasswordGenerator.openPasswordPanel"); |
97 | passwordGeneratorElement = Clipperz.YUI.DomHelper.append(document.body, {tag:'div', id:'passwordGenerator', children:[ | 94 | passwordGeneratorElement = Clipperz.YUI.DomHelper.append(document.body, {tag:'div', id:'passwordGenerator', children:[ |
98 | {tag:'div', cls:'ydlg-hd', htmlString:Clipperz.PM.Strings['passwordGeneratorPanelTitle']}, | 95 | {tag:'div', cls:'ydlg-hd', htmlString:Clipperz.PM.Strings['passwordGeneratorPanelTitle']}, |
99 | {tag:'div', cls:'ydlg-bd', children:[ | 96 | {tag:'div', cls:'ydlg-bd', children:[ |
100 | {tag:'form', id:this.getId('passwordGeneratorForm'), cls:'passwordGenerator', children:[ | 97 | {tag:'form', id:this.getId('passwordGeneratorForm'), cls:'passwordGenerator', children:[ |
101 | {tag:'input', type:'text', cls:'clipperz_passwordGenerator_password', id:this.getId('passwordField')}, | 98 | {tag:'input', type:'text', cls:'clipperz_passwordGenerator_password', id:this.getId('passwordField')}, |
102 | {tag:'table', children:[ | 99 | {tag:'table', children:[ |
103 | {tag:'tbody', children:[ | 100 | {tag:'tbody', children:[ |
104 | {tag:'tr', children:[ | 101 | {tag:'tr', children:[ |
105 | {tag:'td', width:'20%', children:[ | 102 | {tag:'td', width:'20%', children:[ |
106 | {tag:'input', type:'checkbox', name:'lowercase', id:this.getId('lowercase'), checked:true}, | 103 | {tag:'input', type:'checkbox', name:'lowercase', id:this.getId('lowercase'), checked:true}, |
107 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLowercaseLabel']} | 104 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLowercaseLabel']} |
108 | ]}, | 105 | ]}, |
109 | {tag:'td', width:'20%', children:[ | 106 | {tag:'td', width:'20%', children:[ |
110 | {tag:'input', type:'checkbox', name:'uppercase', id:this.getId('uppercase'), checked:true}, | 107 | {tag:'input', type:'checkbox', name:'uppercase', id:this.getId('uppercase'), checked:true}, |
111 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorUppercaseLabel']} | 108 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorUppercaseLabel']} |
112 | ]}, | 109 | ]}, |
113 | {tag:'td', width:'20%', children:[ | 110 | {tag:'td', width:'20%', children:[ |
114 | {tag:'input', type:'checkbox', name:'numbers', id:this.getId('numbers'), checked:true}, | 111 | {tag:'input', type:'checkbox', name:'numbers', id:this.getId('numbers'), checked:true}, |
115 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorNumberLabel']} | 112 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorNumberLabel']} |
116 | ]}, | 113 | ]}, |
117 | {tag:'td', width:'20%', children:[ | 114 | {tag:'td', width:'20%', children:[ |
118 | {tag:'input', type:'checkbox', name:'symbols', id:this.getId('symbols'), checked:true}, | 115 | {tag:'input', type:'checkbox', name:'symbols', id:this.getId('symbols'), checked:true}, |
119 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorSymbolLabel']} | 116 | {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorSymbolLabel']} |
120 | ]}, | 117 | ]}, |