136 files changed, 816 insertions, 1224 deletions
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js index e80c3a2..7c9d783 100644 --- a/frontend/gamma/js/Clipperz/Async.js +++ b/frontend/gamma/js/Clipperz/Async.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //Clipperz.Async = MochiKit.Async; | 26 | //Clipperz.Async = MochiKit.Async; |
30 | 27 | ||
31 | 28 | ||
32 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
33 | if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; } | 30 | if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; } |
34 | 31 | ||
35 | Clipperz.Async.VERSION = "0.1"; | 32 | Clipperz.Async.VERSION = "0.1"; |
36 | Clipperz.Async.NAME = "Clipperz.Async"; | 33 | Clipperz.Async.NAME = "Clipperz.Async"; |
37 | 34 | ||
38 | Clipperz.Async.Deferred = function(aName, args) { | 35 | Clipperz.Async.Deferred = function(aName, args) { |
39 | args = args || {}; | 36 | args = args || {}; |
40 | 37 | ||
41 | Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller); | 38 | Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller); |
42 | 39 | ||
43 | this._args = args; | 40 | this._args = args; |
44 | this._name = aName || "Anonymous deferred"; | 41 | this._name = aName || "Anonymous deferred"; |
45 | this._count = 0; | 42 | this._count = 0; |
46 | this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true)); | 43 | this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true)); |
47 | this._vars = null; | 44 | this._vars = null; |
48 | 45 | ||
49 | return this; | 46 | return this; |
50 | } | 47 | } |
51 | 48 | ||
52 | //============================================================================= | 49 | //============================================================================= |
53 | 50 | ||
54 | Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, { | 51 | Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, { |
55 | 52 | ||
56 | 'name': function () { | 53 | 'name': function () { |
57 | return this._name; | 54 | return this._name; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | 'args': function () { | 57 | 'args': function () { |
61 | return this._args; | 58 | return this._args; |
62 | }, | 59 | }, |
63 | 60 | ||
64 | //----------------------------------------------------------------------------- | 61 | //----------------------------------------------------------------------------- |
65 | 62 | ||
66 | 'callback': function (aValue) { | 63 | 'callback': function (aValue) { |
67 | if (this._shouldTrace) { | 64 | if (this._shouldTrace) { |
68 | Clipperz.log("CALLBACK " + this._name, aValue); | 65 | Clipperz.log("CALLBACK " + this._name, aValue); |
69 | } | 66 | } |
70 | 67 | ||
71 | if (this.chained == false) { | 68 | if (this.chained == false) { |
72 | var message; | 69 | var message; |
73 | 70 | ||
74 | message = "ERROR [" + this._name + "]"; | 71 | message = "ERROR [" + this._name + "]"; |
75 | this.addErrback(function(aResult) { | 72 | this.addErrback(function(aResult) { |
76 | if (! (aResult instanceof MochiKit.Async.CancelledError)) { | 73 | if (! (aResult instanceof MochiKit.Async.CancelledError)) { |
77 | Clipperz.log(message, aResult); | 74 | Clipperz.log(message, aResult); |
78 | } | 75 | } |
79 | return aResult; | 76 | return aResult; |
80 | }); | 77 | }); |
81 | 78 | ||
82 | if (this._shouldTrace) { | 79 | if (this._shouldTrace) { |
83 | var resultMessage; | 80 | var resultMessage; |
84 | 81 | ||
85 | resultMessage = "RESULT " + this._name + " <=="; | 82 | resultMessage = "RESULT " + this._name + " <=="; |
86 | // this.addCallback(function(aResult) { | 83 | // this.addCallback(function(aResult) { |
87 | Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) { | 84 | Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) { |
88 | Clipperz.log(resultMessage, aResult); | 85 | Clipperz.log(resultMessage, aResult); |
89 | 86 | ||
90 | return aResult; | 87 | return aResult; |
91 | }); | 88 | }); |
92 | } | 89 | } |
93 | } | 90 | } |
94 | 91 | ||
95 | if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) { | 92 | if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) { |
96 | Clipperz.log("callback " + this._name, this); | 93 | Clipperz.log("callback " + this._name, this); |
97 | } | 94 | } |
98 | 95 | ||
99 | return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments); | 96 | return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments); |
100 | }, | 97 | }, |
101 | 98 | ||
102 | //----------------------------------------------------------------------------- | 99 | //----------------------------------------------------------------------------- |
103 | 100 | ||
104 | 'addCallback': function () { | 101 | 'addCallback': function () { |
105 | var message; | 102 | var message; |
106 | 103 | ||
107 | if (this._shouldTrace) { | 104 | if (this._shouldTrace) { |
108 | this._count ++; | 105 | this._count ++; |
109 | message = "[" + this._count + "] " + this._name + " "; | 106 | message = "[" + this._count + "] " + this._name + " "; |
110 | // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;}); | 107 | // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;}); |
111 | this.addCallbacks( | 108 | this.addCallbacks( |
112 | function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, | 109 | function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, |
113 | function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;} | 110 | function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;} |
114 | ); | 111 | ); |
115 | } | 112 | } |
116 | 113 | ||
117 | Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments); | 114 | Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments); |
118 | 115 | ||
119 | if (this._shouldTrace) { | 116 | if (this._shouldTrace) { |
120 | // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;}); | 117 | // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;}); |
121 | this.addCallbacks( | 118 | this.addCallbacks( |
122 | function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;}, | 119 | function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;}, |
123 | function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;} | 120 | function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;} |
124 | ); | 121 | ); |
125 | } | 122 | } |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //============================================================================= | 125 | //============================================================================= |
129 | 126 | ||
130 | 'addCallbackPass': function() { | 127 | 'addCallbackPass': function() { |
131 | var passFunction; | 128 | var passFunction; |
132 | 129 | ||
133 | passFunction = MochiKit.Base.partial.apply(null, arguments); | 130 | passFunction = MochiKit.Base.partial.apply(null, arguments); |
134 | 131 | ||
135 | this.addCallback(function() { | 132 | this.addCallback(function() { |
136 | var result; | 133 | var result; |
137 | 134 | ||
138 | result = arguments[arguments.length -1]; | 135 | result = arguments[arguments.length -1]; |
139 | passFunction(); | 136 | passFunction(); |
140 | 137 | ||
141 | return result; | 138 | return result; |
142 | }); | 139 | }); |
143 | }, | 140 | }, |
144 | 141 | ||
145 | //----------------------------------------------------------------------------- | 142 | //----------------------------------------------------------------------------- |
146 | 143 | ||
147 | 'addErrbackPass': function() { | 144 | 'addErrbackPass': function() { |
148 | var passFunction; | 145 | var passFunction; |
149 | 146 | ||
150 | passFunction = MochiKit.Base.partial.apply(null, arguments); | 147 | passFunction = MochiKit.Base.partial.apply(null, arguments); |
151 | 148 | ||
152 | this.addErrback(function() { | 149 | this.addErrback(function() { |
153 | var result; | 150 | var result; |
154 | 151 | ||
155 | result = arguments[arguments.length -1]; | 152 | result = arguments[arguments.length -1]; |
156 | passFunction(); | 153 | passFunction(); |
157 | 154 | ||
158 | return result; | 155 | return result; |
159 | }); | 156 | }); |
160 | }, | 157 | }, |
161 | 158 | ||
162 | //----------------------------------------------------------------------------- | 159 | //----------------------------------------------------------------------------- |
163 | 160 | ||
164 | 'addBothPass': function() { | 161 | 'addBothPass': function() { |
165 | var passFunction; | 162 | var passFunction; |
166 | 163 | ||
167 | passFunction = MochiKit.Base.partial.apply(null, arguments); | 164 | passFunction = MochiKit.Base.partial.apply(null, arguments); |
168 | 165 | ||
169 | this.addBoth(function() { | 166 | this.addBoth(function() { |
170 | var result; | 167 | var result; |
171 | 168 | ||
172 | result = arguments[arguments.length -1]; | 169 | result = arguments[arguments.length -1]; |
173 | passFunction(); | 170 | passFunction(); |
174 | 171 | ||
175 | return result; | 172 | return result; |
176 | }); | 173 | }); |
177 | }, | 174 | }, |
178 | 175 | ||
179 | //----------------------------------------------------------------------------- | 176 | //----------------------------------------------------------------------------- |
180 | 177 | ||
181 | 'addIf': function (aThenBlock, anElseBlock) { | 178 | 'addIf': function (aThenBlock, anElseBlock) { |
182 | this.addCallback(MochiKit.Base.bind(function (aValue) { | 179 | this.addCallback(MochiKit.Base.bind(function (aValue) { |
183 | var deferredResult; | 180 | var deferredResult; |
184 | 181 | ||
185 | if (!MochiKit.Base.isUndefinedOrNull(aValue) && aValue) { | 182 | if (!MochiKit.Base.isUndefinedOrNull(aValue) && aValue) { |
186 | deferredResult = Clipperz.Async.callbacks(this._name + " <then>", aThenBlock, null, aValue); | 183 | deferredResult = Clipperz.Async.callbacks(this._name + " <then>", aThenBlock, null, aValue); |
187 | } else { | 184 | } else { |
188 | deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue); | 185 | deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue); |
189 | } | 186 | } |
190 | 187 | ||
191 | return deferredResult; | 188 | return deferredResult; |
192 | })) | 189 | })) |
193 | }, | 190 | }, |
194 | 191 | ||
195 | //----------------------------------------------------------------------------- | 192 | //----------------------------------------------------------------------------- |
196 | 193 | ||
197 | 'addMethod': function () { | 194 | 'addMethod': function () { |
198 | this.addCallback(MochiKit.Base.method.apply(this, arguments)); | 195 | this.addCallback(MochiKit.Base.method.apply(this, arguments)); |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //----------------------------------------------------------------------------- | 198 | //----------------------------------------------------------------------------- |
202 | 199 | ||
203 | 'addMethodcaller': function () { | 200 | 'addMethodcaller': function () { |
204 | this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments)); | 201 | this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments)); |
205 | }, | 202 | }, |
206 | 203 | ||
207 | //============================================================================= | 204 | //============================================================================= |
208 | 205 | ||
209 | 'addLog': function (aLog) { | 206 | 'addLog': function (aLog) { |
210 | if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { | 207 | if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { |
211 | this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);}); | 208 | this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);}); |
212 | // this.addBothPass(function(res) {console.log(aLog + " ", res);}); | 209 | // this.addBothPass(function(res) {console.log(aLog + " ", res);}); |
213 | } | 210 | } |
214 | }, | 211 | }, |
215 | 212 | ||
216 | //============================================================================= | 213 | //============================================================================= |
diff --git a/frontend/gamma/js/Clipperz/Base.js b/frontend/gamma/js/Clipperz/Base.js index 7f321ef..76b2c3f 100644 --- a/frontend/gamma/js/Clipperz/Base.js +++ b/frontend/gamma/js/Clipperz/Base.js | |||
@@ -1,216 +1,213 @@ | |||
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.Base) == 'undefined') { Clipperz.Base = {}; } | 27 | if (typeof(Clipperz.Base) == 'undefined') { Clipperz.Base = {}; } |
31 | 28 | ||
32 | Clipperz.Base.VERSION = "0.2"; | 29 | Clipperz.Base.VERSION = "0.2"; |
33 | Clipperz.Base.NAME = "Clipperz.Base"; | 30 | Clipperz.Base.NAME = "Clipperz.Base"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Base, { | 32 | MochiKit.Base.update(Clipperz.Base, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'itemgetter': function (aKeyPath) { | 48 | 'itemgetter': function (aKeyPath) { |
52 | // return MochiKit.Base.compose.apply(null, [MochiKit.Base.itemgetter('key3')]); | 49 | // return MochiKit.Base.compose.apply(null, [MochiKit.Base.itemgetter('key3')]); |
53 | return MochiKit.Base.compose.apply(null, | 50 | return MochiKit.Base.compose.apply(null, |
54 | MochiKit.Base.map( | 51 | MochiKit.Base.map( |
55 | MochiKit.Base.itemgetter, | 52 | MochiKit.Base.itemgetter, |
56 | MochiKit.Iter.reversed( | 53 | MochiKit.Iter.reversed( |
57 | aKeyPath.split('.') | 54 | aKeyPath.split('.') |
58 | ) | 55 | ) |
59 | ) | 56 | ) |
60 | ); | 57 | ); |
61 | }, | 58 | }, |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'isUrl': function (aValue) { | 62 | 'isUrl': function (aValue) { |
66 | return (MochiKit.Base.urlRegExp.test(aValue)); | 63 | return (MochiKit.Base.urlRegExp.test(aValue)); |
67 | }, | 64 | }, |
68 | 65 | ||
69 | 'isEmail': function (aValue) { | 66 | 'isEmail': function (aValue) { |
70 | return (MochiKit.Base.emailRegExp.test(aValue)); | 67 | return (MochiKit.Base.emailRegExp.test(aValue)); |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'caseInsensitiveCompare': function (a, b) { | 72 | 'caseInsensitiveCompare': function (a, b) { |
76 | return MochiKit.Base.compare(a.toLowerCase(), b.toLowerCase()); | 73 | return MochiKit.Base.compare(a.toLowerCase(), b.toLowerCase()); |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'reverseComparator': function (aComparator) { | 76 | 'reverseComparator': function (aComparator) { |
80 | return MochiKit.Base.compose(function(aResult) { return -aResult; }, aComparator); | 77 | return MochiKit.Base.compose(function(aResult) { return -aResult; }, aComparator); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | /* | 81 | /* |
85 | 'dependsOn': function(module, deps) { | 82 | 'dependsOn': function(module, deps) { |
86 | if (!(module in Clipperz)) { | 83 | if (!(module in Clipperz)) { |
87 | MochiKit[module] = {}; | 84 | MochiKit[module] = {}; |
88 | } | 85 | } |
89 | 86 | ||
90 | if (typeof(dojo) != 'undefined') { | 87 | if (typeof(dojo) != 'undefined') { |
91 | dojo.provide('Clipperz.' + module); | 88 | dojo.provide('Clipperz.' + module); |
92 | } | 89 | } |
93 | for (var i = 0; i < deps.length; i++) { | 90 | for (var i = 0; i < deps.length; i++) { |
94 | if (typeof(dojo) != 'undefined') { | 91 | if (typeof(dojo) != 'undefined') { |
95 | dojo.require('Clipperz.' + deps[i]); | 92 | dojo.require('Clipperz.' + deps[i]); |
96 | } | 93 | } |
97 | if (typeof(JSAN) != 'undefined') { | 94 | if (typeof(JSAN) != 'undefined') { |
98 | JSAN.use('Clipperz.' + deps[i], []); | 95 | JSAN.use('Clipperz.' + deps[i], []); |
99 | } | 96 | } |
100 | if (!(deps[i] in Clipperz)) { | 97 | if (!(deps[i] in Clipperz)) { |
101 | throw 'Clipperz.' + module + ' depends on Clipperz.' + deps[i] + '!' | 98 | throw 'Clipperz.' + module + ' depends on Clipperz.' + deps[i] + '!' |
102 | } | 99 | } |
103 | } | 100 | } |
104 | }, | 101 | }, |
105 | */ | 102 | */ |
106 | //------------------------------------------------------------------------- | 103 | //------------------------------------------------------------------------- |
107 | 104 | ||
108 | 'trim': function (aValue) { | 105 | 'trim': function (aValue) { |
109 | return aValue.replace(/^\s+|\s+$/g, ""); | 106 | return aValue.replace(/^\s+|\s+$/g, ""); |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'stringToByteArray': function (aValue) { | 111 | 'stringToByteArray': function (aValue) { |
115 | varresult; | 112 | varresult; |
116 | var i, c; | 113 | var i, c; |
117 | 114 | ||
118 | result = []; | 115 | result = []; |
119 | 116 | ||
120 | c = aValue.length; | 117 | c = aValue.length; |
121 | for (i=0; i<c; i++) { | 118 | for (i=0; i<c; i++) { |
122 | result[i] = aValue.charCodeAt(i); | 119 | result[i] = aValue.charCodeAt(i); |
123 | } | 120 | } |
124 | 121 | ||
125 | return result; | 122 | return result; |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //......................................................................... | 125 | //......................................................................... |
129 | 126 | ||
130 | 'byteArrayToString': function (anArrayOfBytes) { | 127 | 'byteArrayToString': function (anArrayOfBytes) { |
131 | varresult; | 128 | varresult; |
132 | var i, c; | 129 | var i, c; |
133 | 130 | ||
134 | result = ""; | 131 | result = ""; |
135 | 132 | ||
136 | c = anArrayOfBytes.length; | 133 | c = anArrayOfBytes.length; |
137 | for (i=0; i<c; i++) { | 134 | for (i=0; i<c; i++) { |
138 | result += String.fromCharCode(anArrayOfBytes[i]); | 135 | result += String.fromCharCode(anArrayOfBytes[i]); |
139 | } | 136 | } |
140 | 137 | ||
141 | return result; | 138 | return result; |
142 | }, | 139 | }, |
143 | 140 | ||
144 | //------------------------------------------------------------------------- | 141 | //------------------------------------------------------------------------- |
145 | 142 | ||
146 | 'getValueForKeyInFormContent': function (aFormContent, aKey) { | 143 | 'getValueForKeyInFormContent': function (aFormContent, aKey) { |
147 | return aFormContent[1][MochiKit.Base.find(aFormContent[0], aKey)]; | 144 | return aFormContent[1][MochiKit.Base.find(aFormContent[0], aKey)]; |
148 | }, | 145 | }, |
149 | 146 | ||
150 | //------------------------------------------------------------------------- | 147 | //------------------------------------------------------------------------- |
151 | 148 | ||
152 | 'indexOfObjectInArray': function(anObject, anArray) { | 149 | 'indexOfObjectInArray': function(anObject, anArray) { |
153 | varresult; | 150 | varresult; |
154 | vari, c; | 151 | vari, c; |
155 | 152 | ||
156 | result = -1; | 153 | result = -1; |
157 | 154 | ||
158 | c = anArray.length; | 155 | c = anArray.length; |
159 | for (i=0; ((i<c) && (result < 0)); i++) { | 156 | for (i=0; ((i<c) && (result < 0)); i++) { |
160 | if (anArray[i] === anObject) { | 157 | if (anArray[i] === anObject) { |
161 | result = i; | 158 | result = i; |
162 | } | 159 | } |
163 | } | 160 | } |
164 | 161 | ||
165 | return result; | 162 | return result; |
166 | }, | 163 | }, |
167 | 164 | ||
168 | //------------------------------------------------------------------------- | 165 | //------------------------------------------------------------------------- |
169 | 166 | ||
170 | 'removeObjectAtIndexFromArray': function(anIndex, anArray) { | 167 | 'removeObjectAtIndexFromArray': function(anIndex, anArray) { |
171 | anArray.splice(anIndex, 1); | 168 | anArray.splice(anIndex, 1); |
172 | }, | 169 | }, |
173 | 170 | ||
174 | //------------------------------------------------------------------------- | 171 | //------------------------------------------------------------------------- |
175 | 172 | ||
176 | 'removeObjectFromArray': function(anObject, anArray) { | 173 | 'removeObjectFromArray': function(anObject, anArray) { |
177 | varobjectIndex; | 174 | varobjectIndex; |
178 | 175 | ||
179 | objectIndex = Clipperz.Base.indexOfObjectInArray(anObject, anArray); | 176 | objectIndex = Clipperz.Base.indexOfObjectInArray(anObject, anArray); |
180 | if (objectIndex > -1) { | 177 | if (objectIndex > -1) { |
181 | Clipperz.Base.removeObjectAtIndexFromArray(objectIndex, anArray); | 178 | Clipperz.Base.removeObjectAtIndexFromArray(objectIndex, anArray); |
182 | } else { | 179 | } else { |
183 | Clipperz.log("Trying to remove an object not present in the array"); | 180 | Clipperz.log("Trying to remove an object not present in the array"); |
184 | throw Clipperz.Base.exception.ObjectNotFound; | 181 | throw Clipperz.Base.exception.ObjectNotFound; |
185 | } | 182 | } |
186 | }, | 183 | }, |
187 | 184 | ||
188 | 'removeFromArray': function(anArray, anObject) { | 185 | 'removeFromArray': function(anArray, anObject) { |
189 | return Clipperz.Base.removeObjectFromArray(anObject, anArray); | 186 | return Clipperz.Base.removeObjectFromArray(anObject, anArray); |
190 | }, | 187 | }, |
191 | 188 | ||
192 | //------------------------------------------------------------------------- | 189 | //------------------------------------------------------------------------- |
193 | 190 | ||
194 | 'splitStringAtFixedTokenSize': function(aString, aTokenSize) { | 191 | 'splitStringAtFixedTokenSize': function(aString, aTokenSize) { |
195 | var result; | 192 | var result; |
196 | varstringToProcess; | 193 | varstringToProcess; |
197 | 194 | ||
198 | stringToProcess = aString; | 195 | stringToProcess = aString; |
199 | result = []; | 196 | result = []; |
200 | if (stringToProcess != null) { | 197 | if (stringToProcess != null) { |
201 | while (stringToProcess.length > aTokenSize) { | 198 | while (stringToProcess.length > aTokenSize) { |
202 | result.push(stringToProcess.substring(0, aTokenSize)); | 199 | result.push(stringToProcess.substring(0, aTokenSize)); |
203 | stringToProcess = stringToProcess.substring(aTokenSize); | 200 | stringToProcess = stringToProcess.substring(aTokenSize); |
204 | } | 201 | } |
205 | 202 | ||
206 | result.push(stringToProcess); | 203 | result.push(stringToProcess); |
207 | } | 204 | } |
208 | 205 | ||
209 | return result; | 206 | return result; |
210 | }, | 207 | }, |
211 | 208 | ||
212 | //------------------------------------------------------------------------- | 209 | //------------------------------------------------------------------------- |
213 | 210 | ||
214 | 'objectType': function(anObject) { | 211 | 'objectType': function(anObject) { |
215 | var result; | 212 | var result; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/ByteArray.js b/frontend/gamma/js/Clipperz/ByteArray.js index 86136c8..ae586e7 100644 --- a/frontend/gamma/js/Clipperz/ByteArray.js +++ b/frontend/gamma/js/Clipperz/ByteArray.js | |||
@@ -1,216 +1,213 @@ | |||
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 | 27 | ||
31 | //============================================================================= | 28 | //============================================================================= |
32 | 29 | ||
33 | Clipperz.ByteArray_abstract = function(args) { | 30 | Clipperz.ByteArray_abstract = function(args) { |
34 | return this; | 31 | return this; |
35 | } | 32 | } |
36 | 33 | ||
37 | Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, { | 34 | Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, { |
38 | 35 | ||
39 | //------------------------------------------------------------------------- | 36 | //------------------------------------------------------------------------- |
40 | 37 | ||
41 | 'toString': function() { | 38 | 'toString': function() { |
42 | return "Clipperz.ByteArray_abstract"; | 39 | return "Clipperz.ByteArray_abstract"; |
43 | }, | 40 | }, |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'equals': function(aValue) { | 44 | 'equals': function(aValue) { |
48 | return (this.compare(aValue) == 0); | 45 | return (this.compare(aValue) == 0); |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'compare': function(aValue) { | 50 | 'compare': function(aValue) { |
54 | var result; | 51 | var result; |
55 | var i; | 52 | var i; |
56 | 53 | ||
57 | result = MochiKit.Base.compare(this.length(), aValue.length()); | 54 | result = MochiKit.Base.compare(this.length(), aValue.length()); |
58 | i = this.length(); | 55 | i = this.length(); |
59 | 56 | ||
60 | while ((result == 0) && (i>0)) { | 57 | while ((result == 0) && (i>0)) { |
61 | i--; | 58 | i--; |
62 | result = MochiKit.Base.compare(this.byteAtIndex(i), aValue.byteAtIndex(i)); | 59 | result = MochiKit.Base.compare(this.byteAtIndex(i), aValue.byteAtIndex(i)); |
63 | } | 60 | } |
64 | 61 | ||
65 | return result; | 62 | return result; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'clone': function() { | 67 | 'clone': function() { |
71 | throw Clipperz.Base.exception.AbstractMethod; | 68 | throw Clipperz.Base.exception.AbstractMethod; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | //------------------------------------------------------------------------- | 71 | //------------------------------------------------------------------------- |
75 | 72 | ||
76 | 'newInstance': function() { | 73 | 'newInstance': function() { |
77 | throw Clipperz.Base.exception.AbstractMethod; | 74 | throw Clipperz.Base.exception.AbstractMethod; |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //------------------------------------------------------------------------- | 77 | //------------------------------------------------------------------------- |
81 | 78 | ||
82 | 'reset': function() { | 79 | 'reset': function() { |
83 | throw Clipperz.Base.exception.AbstractMethod; | 80 | throw Clipperz.Base.exception.AbstractMethod; |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
87 | 84 | ||
88 | 'length': function() { | 85 | 'length': function() { |
89 | throw Clipperz.Base.exception.AbstractMethod; | 86 | throw Clipperz.Base.exception.AbstractMethod; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //------------------------------------------------------------------------- | 89 | //------------------------------------------------------------------------- |
93 | 90 | ||
94 | 'checkByteValue': function(aValue) { | 91 | 'checkByteValue': function(aValue) { |
95 | //Clipperz.log("aValue", aValue.toString(16)); | 92 | //Clipperz.log("aValue", aValue.toString(16)); |
96 | //Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16)); | 93 | //Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16)); |
97 | 94 | ||
98 | if ((aValue & 0xff) != aValue) { | 95 | if ((aValue & 0xff) != aValue) { |
99 | MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value."); | 96 | MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value."); |
100 | throw Clipperz.ByteArray.exception.InvalidValue; | 97 | throw Clipperz.ByteArray.exception.InvalidValue; |
101 | } | 98 | } |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
105 | 102 | ||
106 | 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) { | 103 | 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) { |
107 | var result; | 104 | var result; |
108 | var a, b; | 105 | var a, b; |
109 | var aLength; | 106 | var aLength; |
110 | var bLength; | 107 | var bLength; |
111 | var i, c; | 108 | var i, c; |
112 | 109 | ||
113 | if (this.length() > aBlock.length()) { | 110 | if (this.length() > aBlock.length()) { |
114 | a = this; | 111 | a = this; |
115 | b = aBlock; | 112 | b = aBlock; |
116 | } else { | 113 | } else { |
117 | a = aBlock; | 114 | a = aBlock; |
118 | b = this; | 115 | b = this; |
119 | } | 116 | } |
120 | 117 | ||
121 | aLength = a.length(); | 118 | aLength = a.length(); |
122 | bLength = b.length(); | 119 | bLength = b.length(); |
123 | 120 | ||
124 | if (aLength != bLength) { | 121 | if (aLength != bLength) { |
125 | if (paddingMode == 'truncate') { | 122 | if (paddingMode == 'truncate') { |
126 | if (anAllignment == 'left') { | 123 | if (anAllignment == 'left') { |
127 | a = a.split(0, bLength); | 124 | a = a.split(0, bLength); |
128 | } else { | 125 | } else { |
129 | a = a.split(aLength - bLength); | 126 | a = a.split(aLength - bLength); |
130 | } | 127 | } |
131 | } else { | 128 | } else { |
132 | var ii, cc; | 129 | var ii, cc; |
133 | var padding; | 130 | var padding; |
134 | 131 | ||
135 | // padding = new Clipperz.ByteArray(); | 132 | // padding = new Clipperz.ByteArray(); |
136 | padding = this.newInstance(); | 133 | padding = this.newInstance(); |
137 | cc = aLength - bLength; | 134 | cc = aLength - bLength; |
138 | for (ii=0; ii<cc; ii++) { | 135 | for (ii=0; ii<cc; ii++) { |
139 | padding.appendByte(0); | 136 | padding.appendByte(0); |
140 | } | 137 | } |
141 | 138 | ||
142 | if (anAllignment == 'left') { | 139 | if (anAllignment == 'left') { |
143 | b = b.appendBlock(padding); | 140 | b = b.appendBlock(padding); |
144 | } else { | 141 | } else { |
145 | b = padding.appendBlock(b); | 142 | b = padding.appendBlock(b); |
146 | } | 143 | } |
147 | } | 144 | } |
148 | } | 145 | } |
149 | 146 | ||
150 | 147 | ||
151 | // result = new Clipperz.ByteArray(); | 148 | // result = new Clipperz.ByteArray(); |
152 | result = this.newInstance(); | 149 | result = this.newInstance(); |
153 | c = a.length(); | 150 | c = a.length(); |
154 | for (i=0; i<c; i++) { | 151 | for (i=0; i<c; i++) { |
155 | result.appendByte(a.byteAtIndex(i) ^ b.byteAtIndex(i)); | 152 | result.appendByte(a.byteAtIndex(i) ^ b.byteAtIndex(i)); |
156 | } | 153 | } |
157 | 154 | ||
158 | return result; | 155 | return result; |
159 | }, | 156 | }, |
160 | 157 | ||
161 | //------------------------------------------------------------------------- | 158 | //------------------------------------------------------------------------- |
162 | /* | 159 | /* |
163 | 'shiftLeft': function(aNumberOfBitsToShift) { | 160 | 'shiftLeft': function(aNumberOfBitsToShift) { |
164 | var result; | 161 | var result; |
165 | 162 | ||
166 | result = this.clone(); //??????????? | 163 | result = this.clone(); //??????????? |
167 | 164 | ||
168 | return result; | 165 | return result; |
169 | }, | 166 | }, |
170 | */ | 167 | */ |
171 | //------------------------------------------------------------------------- | 168 | //------------------------------------------------------------------------- |
172 | 169 | ||
173 | 'appendBlock': function(aBlock) { | 170 | 'appendBlock': function(aBlock) { |
174 | throw Clipperz.Base.exception.AbstractMethod; | 171 | throw Clipperz.Base.exception.AbstractMethod; |
175 | }, | 172 | }, |
176 | 173 | ||
177 | //------------------------------------------------------------------------- | 174 | //------------------------------------------------------------------------- |
178 | 175 | ||
179 | 'appendByte': function(aValue) { | 176 | 'appendByte': function(aValue) { |
180 | throw Clipperz.Base.exception.AbstractMethod; | 177 | throw Clipperz.Base.exception.AbstractMethod; |
181 | }, | 178 | }, |
182 | 179 | ||
183 | 'appendBytes': function(args) { | 180 | 'appendBytes': function(args) { |
184 | varvalues; | 181 | varvalues; |
185 | vari,c; | 182 | vari,c; |
186 | 183 | ||
187 | if (args.constructor == Array) { | 184 | if (args.constructor == Array) { |
188 | values = args; | 185 | values = args; |
189 | } else { | 186 | } else { |
190 | values = arguments; | 187 | values = arguments; |
191 | } | 188 | } |
192 | 189 | ||
193 | c = values.length; | 190 | c = values.length; |
194 | for (i=0; i<c; i++) { | 191 | for (i=0; i<c; i++) { |
195 | this.appendByte(values[i]); | 192 | this.appendByte(values[i]); |
196 | } | 193 | } |
197 | 194 | ||
198 | return this; | 195 | return this; |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //------------------------------------------------------------------------- | 198 | //------------------------------------------------------------------------- |
202 | 199 | ||
203 | 'appendWord': function(aValue, isLittleEndian) { | 200 | 'appendWord': function(aValue, isLittleEndian) { |
204 | var result; | 201 | var result; |
205 | var processAsLittleEndian; | 202 | var processAsLittleEndian; |
206 | 203 | ||
207 | processAsLittleEndian = isLittleEndian === true ? true : false; | 204 | processAsLittleEndian = isLittleEndian === true ? true : false; |
208 | 205 | ||
209 | if (processAsLittleEndian) { | 206 | if (processAsLittleEndian) { |
210 | result = this.appendBytes( (aValue) & 0xff, (aValue >> 8) & 0xff, (aValue >> 16) & 0xff, (aValue >> 24) & 0xff ); //little endian | 207 | result = this.appendBytes( (aValue) & 0xff, (aValue >> 8) & 0xff, (aValue >> 16) & 0xff, (aValue >> 24) & 0xff ); //little endian |
211 | } else { | 208 | } else { |
212 | result = this.appendBytes( (aValue >> 24) & 0xff, (aValue >> 16) & 0xff, (aValue >> 8) & 0xff, (aValue) & 0xff ); //big endian - DEFAULT | 209 | result = this.appendBytes( (aValue >> 24) & 0xff, (aValue >> 16) & 0xff, (aValue >> 8) & 0xff, (aValue) & 0xff ); //big endian - DEFAULT |
213 | } | 210 | } |
214 | 211 | ||
215 | return result; | 212 | return result; |
216 | }, | 213 | }, |
diff --git a/frontend/gamma/js/Clipperz/CSVProcessor.js b/frontend/gamma/js/Clipperz/CSVProcessor.js index d481ba2..0b18731 100644 --- a/frontend/gamma/js/Clipperz/CSVProcessor.js +++ b/frontend/gamma/js/Clipperz/CSVProcessor.js | |||
@@ -1,216 +1,213 @@ | |||
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 | 27 | ||
31 | 28 | ||
32 | Clipperz.CSVProcessor = function(args) { | 29 | Clipperz.CSVProcessor = function(args) { |
33 | args = args || {}; | 30 | args = args || {}; |
34 | 31 | ||
35 | // this._status = undefined; | 32 | // this._status = undefined; |
36 | // this._error_input= undefined; | 33 | // this._error_input= undefined; |
37 | // this._string = undefined; | 34 | // this._string = undefined; |
38 | // this._fields = undefined; | 35 | // this._fields = undefined; |
39 | 36 | ||
40 | this._quoteChar = args['quoteChar'] ||"\042"; | 37 | this._quoteChar = args['quoteChar'] ||"\042"; |
41 | this._eol = args['eol'] ||""; | 38 | this._eol = args['eol'] ||""; |
42 | this._escapeChar = args['escapeChar'] ||"\042"; | 39 | this._escapeChar = args['escapeChar'] ||"\042"; |
43 | this._separatorChar = args['separatorChar'] ||","; | 40 | this._separatorChar = args['separatorChar'] ||","; |
44 | this._binary = args['binary'] ||false; | 41 | this._binary = args['binary'] ||false; |
45 | this._alwaysQuote = args['alwaysQuote'] ||false; | 42 | this._alwaysQuote = args['alwaysQuote'] ||false; |
46 | 43 | ||
47 | return this; | 44 | return this; |
48 | } | 45 | } |
49 | 46 | ||
50 | //============================================================================= | 47 | //============================================================================= |
51 | 48 | ||
52 | Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { | 49 | Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, { |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'quoteChar': function() { | 53 | 'quoteChar': function() { |
57 | return this._quoteChar; | 54 | return this._quoteChar; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'eol': function() { | 59 | 'eol': function() { |
63 | return this._eol; | 60 | return this._eol; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'escapeChar': function() { | 65 | 'escapeChar': function() { |
69 | return this._escapeChar; | 66 | return this._escapeChar; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'separatorChar': function() { | 71 | 'separatorChar': function() { |
75 | return this._separatorChar; | 72 | return this._separatorChar; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'setSeparatorChar': function(aValue) { | 75 | 'setSeparatorChar': function(aValue) { |
79 | this._separatorChar = aValue; | 76 | this._separatorChar = aValue; |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'binary': function() { | 81 | 'binary': function() { |
85 | return this._binary; | 82 | return this._binary; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'alwaysQuote': function() { | 87 | 'alwaysQuote': function() { |
91 | return this._alwaysQuote; | 88 | return this._alwaysQuote; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
95 | /* | 92 | /* |
96 | 'parse': function(aValue) { | 93 | 'parse': function(aValue) { |
97 | var result; | 94 | var result; |
98 | var lines; | 95 | var lines; |
99 | var parameter; | 96 | var parameter; |
100 | 97 | ||
101 | //MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); | 98 | //MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); |
102 | result = []; | 99 | result = []; |
103 | 100 | ||
104 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");; | 101 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");; |
105 | parameter = { | 102 | parameter = { |
106 | line: lines | 103 | line: lines |
107 | } | 104 | } |
108 | 105 | ||
109 | do { | 106 | do { |
110 | var fields; | 107 | var fields; |
111 | 108 | ||
112 | fields = this.parseLine(parameter); | 109 | fields = this.parseLine(parameter); |
113 | 110 | ||
114 | if (fields != null) { | 111 | if (fields != null) { |
115 | result.push(fields); | 112 | result.push(fields); |
116 | } | 113 | } |
117 | 114 | ||
118 | parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, ""); | 115 | parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, ""); |
119 | 116 | ||
120 | //MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); | 117 | //MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); |
121 | } while (parameter.line != ""); | 118 | } while (parameter.line != ""); |
122 | //MochiKit.Logging.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); | 119 | //MochiKit.Logging.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); |
123 | //MochiKit.Logging.logDebug("<<< CSVProcessor.parse"); | 120 | //MochiKit.Logging.logDebug("<<< CSVProcessor.parse"); |
124 | 121 | ||
125 | return result; | 122 | return result; |
126 | }, | 123 | }, |
127 | */ | 124 | */ |
128 | //------------------------------------------------------------------------- | 125 | //------------------------------------------------------------------------- |
129 | 126 | ||
130 | 'deferredParse_core': function(aContext) { | 127 | 'deferredParse_core': function(aContext) { |
131 | var deferredResult; | 128 | var deferredResult; |
132 | 129 | ||
133 | if (aContext.line == "") { | 130 | if (aContext.line == "") { |
134 | deferredResult = MochiKit.Async.succeed(aContext.result); | 131 | deferredResult = MochiKit.Async.succeed(aContext.result); |
135 | } else { | 132 | } else { |
136 | var fields; | 133 | var fields; |
137 | 134 | ||
138 | fields = this.parseLine(aContext); | 135 | fields = this.parseLine(aContext); |
139 | if (fields != null) { | 136 | if (fields != null) { |
140 | aContext.result.push(fields); | 137 | aContext.result.push(fields); |
141 | } | 138 | } |
142 | 139 | ||
143 | aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); | 140 | aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); |
144 | 141 | ||
145 | deferredResult = new Clipperz.Async.Deferred("CVSProcessor.deferredParse_core"); | 142 | deferredResult = new Clipperz.Async.Deferred("CVSProcessor.deferredParse_core"); |
146 | // deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); | 143 | // deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); |
147 | deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); | 144 | deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); |
148 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); | 145 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); |
149 | deferredResult.addMethod(this, 'deferredParse_core') | 146 | deferredResult.addMethod(this, 'deferredParse_core') |
150 | deferredResult.callback(aContext); | 147 | deferredResult.callback(aContext); |
151 | } | 148 | } |
152 | 149 | ||
153 | return deferredResult; | 150 | return deferredResult; |
154 | }, | 151 | }, |
155 | 152 | ||
156 | //......................................................................... | 153 | //......................................................................... |
157 | 154 | ||
158 | 'deferredParse': function(aValue) { | 155 | 'deferredParse': function(aValue) { |
159 | var deferredResult; | 156 | var deferredResult; |
160 | var lines; | 157 | var lines; |
161 | var context; | 158 | var context; |
162 | 159 | ||
163 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n*/g, "").replace(/\n$/g, ""); | 160 | lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n*/g, "").replace(/\n$/g, ""); |
164 | 161 | ||
165 | context = { | 162 | context = { |
166 | line: lines, | 163 | line: lines, |
167 | size: lines.length, | 164 | size: lines.length, |
168 | result: [] | 165 | result: [] |
169 | } | 166 | } |
170 | 167 | ||
171 | deferredResult = new Clipperz.Async.Deferred("CSVProcessor.deferredParse"); | 168 | deferredResult = new Clipperz.Async.Deferred("CSVProcessor.deferredParse"); |
172 | deferredResult.addMethod(this, 'deferredParse_core'); | 169 | deferredResult.addMethod(this, 'deferredParse_core'); |
173 | deferredResult.callback(context); | 170 | deferredResult.callback(context); |
174 | 171 | ||
175 | return deferredResult; | 172 | return deferredResult; |
176 | }, | 173 | }, |
177 | 174 | ||
178 | //------------------------------------------------------------------------- | 175 | //------------------------------------------------------------------------- |
179 | 176 | ||
180 | 'parseLine': function(aParameter) { | 177 | 'parseLine': function(aParameter) { |
181 | var result; | 178 | var result; |
182 | var palatable; | 179 | var palatable; |
183 | var line; | 180 | var line; |
184 | var processedField; | 181 | var processedField; |
185 | 182 | ||
186 | result = []; | 183 | result = []; |
187 | 184 | ||
188 | do { | 185 | do { |
189 | processedField = this.parseField(aParameter); | 186 | processedField = this.parseField(aParameter); |
190 | if (processedField != null) { | 187 | if (processedField != null) { |
191 | result.push(processedField) | 188 | result.push(processedField) |
192 | }; | 189 | }; |
193 | } while (processedField != null); | 190 | } while (processedField != null); |
194 | 191 | ||
195 | return result; | 192 | return result; |
196 | }, | 193 | }, |
197 | 194 | ||
198 | //------------------------------------------------------------------------- | 195 | //------------------------------------------------------------------------- |
199 | 196 | ||
200 | 'parseField': function(aParameter) { | 197 | 'parseField': function(aParameter) { |
201 | var result; | 198 | var result; |
202 | 199 | ||
203 | var inQuotes; | 200 | var inQuotes; |
204 | var validRegExp; | 201 | var validRegExp; |
205 | var singleQuoteBeginRegexp; | 202 | var singleQuoteBeginRegexp; |
206 | var escapedQuoteBeginRegexp; | 203 | var escapedQuoteBeginRegexp; |
207 | var singleQuoteCommaEndRegexp; | 204 | var singleQuoteCommaEndRegexp; |
208 | var singleQuoteNewLineEndRegexp; | 205 | var singleQuoteNewLineEndRegexp; |
209 | var commaBeginRegexp; | 206 | var commaBeginRegexp; |
210 | var newlineRegexp; | 207 | var newlineRegexp; |
211 | 208 | ||
212 | 209 | ||
213 | singleQuoteBeginRegexp = new RegExp("^" + '\\' + this.quoteChar()); | 210 | singleQuoteBeginRegexp = new RegExp("^" + '\\' + this.quoteChar()); |
214 | escapedQuoteBeginRegexp = new RegExp("^" + '\\' + this.escapeChar() + '\\' + this.quoteChar()); | 211 | escapedQuoteBeginRegexp = new RegExp("^" + '\\' + this.escapeChar() + '\\' + this.quoteChar()); |
215 | singleQuoteCommaEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + '\\' + this.separatorChar()); | 212 | singleQuoteCommaEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + '\\' + this.separatorChar()); |
216 | singleQuoteNewLineEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + "\n"); | 213 | singleQuoteNewLineEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + "\n"); |
diff --git a/frontend/gamma/js/Clipperz/Crypto/AES.js b/frontend/gamma/js/Clipperz/Crypto/AES.js index 36fc731..c811f1c 100644 --- a/frontend/gamma/js/Clipperz/Crypto/AES.js +++ b/frontend/gamma/js/Clipperz/Crypto/AES.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.AES depends on Clipperz.ByteArray!"; | 27 | throw "Clipperz.Crypto.AES depends on Clipperz.ByteArray!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | //Dependency commented to avoid a circular reference | 30 | //Dependency commented to avoid a circular reference |
34 | //try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { | 31 | //try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { |
35 | //throw "Clipperz.Crypto.AES depends on Clipperz.Crypto.PRNG!"; | 32 | //throw "Clipperz.Crypto.AES depends on Clipperz.Crypto.PRNG!"; |
36 | //} | 33 | //} |
37 | 34 | ||
38 | if (typeof(Clipperz.Crypto.AES) == 'undefined') { Clipperz.Crypto.AES = {}; } | 35 | if (typeof(Clipperz.Crypto.AES) == 'undefined') { Clipperz.Crypto.AES = {}; } |
39 | 36 | ||
40 | //############################################################################# | 37 | //############################################################################# |
41 | 38 | ||
42 | Clipperz.Crypto.AES.DeferredExecutionContext = function(args) { | 39 | Clipperz.Crypto.AES.DeferredExecutionContext = function(args) { |
43 | args = args || {}; | 40 | args = args || {}; |
44 | 41 | ||
45 | this._key = args.key; | 42 | this._key = args.key; |
46 | this._message = args.message; | 43 | this._message = args.message; |
47 | this._result = args.message.clone(); | 44 | this._result = args.message.clone(); |
48 | this._nonce = args.nonce; | 45 | this._nonce = args.nonce; |
49 | this._messageLength = this._message.length(); | 46 | this._messageLength = this._message.length(); |
50 | 47 | ||
51 | this._messageArray = this._message.arrayValues(); | 48 | this._messageArray = this._message.arrayValues(); |
52 | this._resultArray = this._result.arrayValues(); | 49 | this._resultArray = this._result.arrayValues(); |
53 | this._nonceArray = this._nonce.arrayValues(); | 50 | this._nonceArray = this._nonce.arrayValues(); |
54 | 51 | ||
55 | this._executionStep = 0; | 52 | this._executionStep = 0; |
56 | 53 | ||
57 | // this._elaborationChunkSize = 1024; // 4096; // 16384; //4096; | 54 | // this._elaborationChunkSize = 1024; // 4096; // 16384; //4096; |
58 | this._elaborationChunks = 10; | 55 | this._elaborationChunks = 10; |
59 | this._pauseTime = 0.02; // 0.02 //0.2; | 56 | this._pauseTime = 0.02; // 0.02 //0.2; |
60 | 57 | ||
61 | return this; | 58 | return this; |
62 | } | 59 | } |
63 | 60 | ||
64 | Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(null, { | 61 | Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(null, { |
65 | 62 | ||
66 | 'key': function() { | 63 | 'key': function() { |
67 | return this._key; | 64 | return this._key; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | 'message': function() { | 67 | 'message': function() { |
71 | return this._message; | 68 | return this._message; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'messageLength': function() { | 71 | 'messageLength': function() { |
75 | return this._messageLength; | 72 | return this._messageLength; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'result': function() { | 75 | 'result': function() { |
79 | return new Clipperz.ByteArray(this.resultArray()); | 76 | return new Clipperz.ByteArray(this.resultArray()); |
80 | }, | 77 | }, |
81 | 78 | ||
82 | 'nonce': function() { | 79 | 'nonce': function() { |
83 | return this._nonce; | 80 | return this._nonce; |
84 | }, | 81 | }, |
85 | 82 | ||
86 | 'messageArray': function() { | 83 | 'messageArray': function() { |
87 | return this._messageArray; | 84 | return this._messageArray; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | 'resultArray': function() { | 87 | 'resultArray': function() { |
91 | return this._resultArray; | 88 | return this._resultArray; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | 'nonceArray': function() { | 91 | 'nonceArray': function() { |
95 | return this._nonceArray; | 92 | return this._nonceArray; |
96 | }, | 93 | }, |
97 | 94 | ||
98 | 'elaborationChunkSize': function() { | 95 | 'elaborationChunkSize': function() { |
99 | // return Clipperz.Crypto.AES.DeferredExecution.chunkSize; | 96 | // return Clipperz.Crypto.AES.DeferredExecution.chunkSize; |
100 | // return this._elaborationChunkSize; | 97 | // return this._elaborationChunkSize; |
101 | return (this._elaborationChunks * 1024); | 98 | return (this._elaborationChunks * 1024); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | 'executionStep': function() { | 101 | 'executionStep': function() { |
105 | return this._executionStep; | 102 | return this._executionStep; |
106 | }, | 103 | }, |
107 | 104 | ||
108 | 'setExecutionStep': function(aValue) { | 105 | 'setExecutionStep': function(aValue) { |
109 | this._executionStep = aValue; | 106 | this._executionStep = aValue; |
110 | }, | 107 | }, |
111 | 108 | ||
112 | 'tuneExecutionParameters': function (anElapsedTime) { | 109 | 'tuneExecutionParameters': function (anElapsedTime) { |
113 | //var originalChunks = this._elaborationChunks; | 110 | //var originalChunks = this._elaborationChunks; |
114 | if (anElapsedTime > 0) { | 111 | if (anElapsedTime > 0) { |
115 | this._elaborationChunks = Math.round(this._elaborationChunks * ((anElapsedTime + 1000)/(anElapsedTime * 2))); | 112 | this._elaborationChunks = Math.round(this._elaborationChunks * ((anElapsedTime + 1000)/(anElapsedTime * 2))); |
116 | } | 113 | } |
117 | //Clipperz.log("tuneExecutionParameters - elapsedTime: " + anElapsedTime + /*originalChunks,*/ " chunks # " + this._elaborationChunks + " [" + this._executionStep + " / " + this._messageLength + "]"); | 114 | //Clipperz.log("tuneExecutionParameters - elapsedTime: " + anElapsedTime + /*originalChunks,*/ " chunks # " + this._elaborationChunks + " [" + this._executionStep + " / " + this._messageLength + "]"); |
118 | }, | 115 | }, |
119 | 116 | ||
120 | 'pause': function(aValue) { | 117 | 'pause': function(aValue) { |
121 | // return MochiKit.Async.wait(Clipperz.Crypto.AES.DeferredExecution.pauseTime, aValue); | 118 | // return MochiKit.Async.wait(Clipperz.Crypto.AES.DeferredExecution.pauseTime, aValue); |
122 | return MochiKit.Async.wait(this._pauseTime, aValue); | 119 | return MochiKit.Async.wait(this._pauseTime, aValue); |
123 | }, | 120 | }, |
124 | 121 | ||
125 | 'isDone': function () { | 122 | 'isDone': function () { |
126 | //console.log("isDone", this.executionStep(), this.messageLength()); | 123 | //console.log("isDone", this.executionStep(), this.messageLength()); |
127 | return (this._executionStep >= this._messageLength); | 124 | return (this._executionStep >= this._messageLength); |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //----------------------------------------------------------------------------- | 127 | //----------------------------------------------------------------------------- |
131 | __syntaxFix__: "syntax fix" | 128 | __syntaxFix__: "syntax fix" |
132 | 129 | ||
133 | }); | 130 | }); |
134 | 131 | ||
135 | //############################################################################# | 132 | //############################################################################# |
136 | 133 | ||
137 | Clipperz.Crypto.AES.Key = function(args) { | 134 | Clipperz.Crypto.AES.Key = function(args) { |
138 | args = args || {}; | 135 | args = args || {}; |
139 | 136 | ||
140 | this._key = args.key; | 137 | this._key = args.key; |
141 | this._keySize = args.keySize || this.key().length(); | 138 | this._keySize = args.keySize || this.key().length(); |
142 | 139 | ||
143 | if (this.keySize() == 128/8) { | 140 | if (this.keySize() == 128/8) { |
144 | this._b = 176; | 141 | this._b = 176; |
145 | this._numberOfRounds = 10; | 142 | this._numberOfRounds = 10; |
146 | } else if (this.keySize() == 256/8) { | 143 | } else if (this.keySize() == 256/8) { |
147 | this._b = 240; | 144 | this._b = 240; |
148 | this._numberOfRounds = 14; | 145 | this._numberOfRounds = 14; |
149 | } else { | 146 | } else { |
150 | MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits"); | 147 | MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits"); |
151 | throw Clipperz.Crypto.AES.exception.UnsupportedKeySize; | 148 | throw Clipperz.Crypto.AES.exception.UnsupportedKeySize; |
152 | } | 149 | } |
153 | 150 | ||
154 | this._stretchedKey = null; | 151 | this._stretchedKey = null; |
155 | 152 | ||
156 | return this; | 153 | return this; |
157 | } | 154 | } |
158 | 155 | ||
159 | Clipperz.Crypto.AES.Key.prototype = MochiKit.Base.update(null, { | 156 | Clipperz.Crypto.AES.Key.prototype = MochiKit.Base.update(null, { |
160 | 157 | ||
161 | 'asString': function() { | 158 | 'asString': function() { |
162 | return "Clipperz.Crypto.AES.Key (" + this.key().toHexString() + ")"; | 159 | return "Clipperz.Crypto.AES.Key (" + this.key().toHexString() + ")"; |
163 | }, | 160 | }, |
164 | 161 | ||
165 | //----------------------------------------------------------------------------- | 162 | //----------------------------------------------------------------------------- |
166 | 163 | ||
167 | 'key': function() { | 164 | 'key': function() { |
168 | return this._key; | 165 | return this._key; |
169 | }, | 166 | }, |
170 | 167 | ||
171 | 'keySize': function() { | 168 | 'keySize': function() { |
172 | return this._keySize; | 169 | return this._keySize; |
173 | }, | 170 | }, |
174 | 171 | ||
175 | 'b': function() { | 172 | 'b': function() { |
176 | return this._b; | 173 | return this._b; |
177 | }, | 174 | }, |
178 | 175 | ||
179 | 'numberOfRounds': function() { | 176 | 'numberOfRounds': function() { |
180 | return this._numberOfRounds; | 177 | return this._numberOfRounds; |
181 | }, | 178 | }, |
182 | //========================================================================= | 179 | //========================================================================= |
183 | 180 | ||
184 | 'keyScheduleCore': function(aWord, aRoundConstantsIndex) { | 181 | 'keyScheduleCore': function(aWord, aRoundConstantsIndex) { |
185 | varresult; | 182 | varresult; |
186 | var sbox; | 183 | var sbox; |
187 | 184 | ||
188 | sbox = Clipperz.Crypto.AES.sbox(); | 185 | sbox = Clipperz.Crypto.AES.sbox(); |
189 | 186 | ||
190 | result = [sbox[aWord[1]] ^ Clipperz.Crypto.AES.roundConstants()[aRoundConstantsIndex], | 187 | result = [sbox[aWord[1]] ^ Clipperz.Crypto.AES.roundConstants()[aRoundConstantsIndex], |
191 | sbox[aWord[2]], | 188 | sbox[aWord[2]], |
192 | sbox[aWord[3]], | 189 | sbox[aWord[3]], |
193 | sbox[aWord[0]]]; | 190 | sbox[aWord[0]]]; |
194 | 191 | ||
195 | return result; | 192 | return result; |
196 | }, | 193 | }, |
197 | 194 | ||
198 | //----------------------------------------------------------------------------- | 195 | //----------------------------------------------------------------------------- |
199 | 196 | ||
200 | 'xorWithPreviousStretchValues': function(aKey, aWord, aPreviousWordIndex) { | 197 | 'xorWithPreviousStretchValues': function(aKey, aWord, aPreviousWordIndex) { |
201 | varresult; | 198 | varresult; |
202 | var i,c; | 199 | var i,c; |
203 | 200 | ||
204 | result = []; | 201 | result = []; |
205 | c = 4; | 202 | c = 4; |
206 | for (i=0; i<c; i++) { | 203 | for (i=0; i<c; i++) { |
207 | result[i] = aWord[i] ^ aKey.byteAtIndex(aPreviousWordIndex + i); | 204 | result[i] = aWord[i] ^ aKey.byteAtIndex(aPreviousWordIndex + i); |
208 | } | 205 | } |
209 | 206 | ||
210 | return result; | 207 | return result; |
211 | }, | 208 | }, |
212 | 209 | ||
213 | //----------------------------------------------------------------------------- | 210 | //----------------------------------------------------------------------------- |
214 | 211 | ||
215 | 'sboxShakeup': function(aWord) { | 212 | 'sboxShakeup': function(aWord) { |
216 | var result; | 213 | var result; |
diff --git a/frontend/gamma/js/Clipperz/Crypto/Base.js b/frontend/gamma/js/Clipperz/Crypto/Base.js index b69dcc8..d3a8e36 100644 --- a/frontend/gamma/js/Clipperz/Crypto/Base.js +++ b/frontend/gamma/js/Clipperz/Crypto/Base.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.Base) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.Base) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.Base depends on Clipperz.Base!"; | 27 | throw "Clipperz.Crypto.Base depends on Clipperz.Base!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } | 30 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } |
34 | if (typeof(Clipperz.Crypto.Base) == 'undefined') { Clipperz.Crypto.Base = {}; } | 31 | if (typeof(Clipperz.Crypto.Base) == 'undefined') { Clipperz.Crypto.Base = {}; } |
35 | 32 | ||
36 | Clipperz.Crypto.Base.VERSION = "0.1"; | 33 | Clipperz.Crypto.Base.VERSION = "0.1"; |
37 | Clipperz.Crypto.Base.NAME = "Clipperz.Crypto.Base"; | 34 | Clipperz.Crypto.Base.NAME = "Clipperz.Crypto.Base"; |
38 | 35 | ||
39 | //############################################################################# | 36 | //############################################################################# |
40 | //Downloaded on March 30, 2006 from http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip (jsSha2/sha256.js) | 37 | //Downloaded on March 30, 2006 from http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip (jsSha2/sha256.js) |
41 | //############################################################################# | 38 | //############################################################################# |
42 | 39 | ||
43 | /* A JavaScript implementation of the Secure Hash Algorithm, SHA-256 | 40 | /* A JavaScript implementation of the Secure Hash Algorithm, SHA-256 |
44 | * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/ | 41 | * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/ |
45 | * Distributed under the BSD License | 42 | * Distributed under the BSD License |
46 | * Some bits taken from Paul Johnston's SHA-1 implementation | 43 | * Some bits taken from Paul Johnston's SHA-1 implementation |
47 | */ | 44 | */ |
48 | var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ | 45 | var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ |
49 | function safe_add (x, y) { | 46 | function safe_add (x, y) { |
50 | var lsw = (x & 0xFFFF) + (y & 0xFFFF); | 47 | var lsw = (x & 0xFFFF) + (y & 0xFFFF); |
51 | var msw = (x >> 16) + (y >> 16) + (lsw >> 16); | 48 | var msw = (x >> 16) + (y >> 16) + (lsw >> 16); |
52 | return (msw << 16) | (lsw & 0xFFFF); | 49 | return (msw << 16) | (lsw & 0xFFFF); |
53 | } | 50 | } |
54 | function S (X, n) {return ( X >>> n ) | (X << (32 - n));} | 51 | function S (X, n) {return ( X >>> n ) | (X << (32 - n));} |
55 | function R (X, n) {return ( X >>> n );} | 52 | function R (X, n) {return ( X >>> n );} |
56 | function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));} | 53 | function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));} |
57 | function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));} | 54 | function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));} |
58 | function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));} | 55 | function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));} |
59 | function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));} | 56 | function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));} |
60 | function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));} | 57 | function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));} |
61 | function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));} | 58 | function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));} |
62 | function core_sha256 (m, l) { | 59 | function core_sha256 (m, l) { |
63 | var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,0x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,0x81C2C92E,0x92722C85,0xA2BFE8A1,0xA81A664B,0xC24B8B70,0xC76C51A3,0xD192E819,0xD6990624,0xF40E3585,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,0x682E6FF3,0x748F82EE,0x78A5636F,0x84C87814,0x8CC70208,0x90BEFFFA,0xA4506CEB,0xBEF9A3F7,0xC67178F2); | 60 | var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,0x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,0x81C2C92E,0x92722C85,0xA2BFE8A1,0xA81A664B,0xC24B8B70,0xC76C51A3,0xD192E819,0xD6990624,0xF40E3585,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,0x682E6FF3,0x748F82EE,0x78A5636F,0x84C87814,0x8CC70208,0x90BEFFFA,0xA4506CEB,0xBEF9A3F7,0xC67178F2); |
64 | var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); | 61 | var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); |
65 | var W = new Array(64); | 62 | var W = new Array(64); |
66 | var a, b, c, d, e, f, g, h, i, j; | 63 | var a, b, c, d, e, f, g, h, i, j; |
67 | var T1, T2; | 64 | var T1, T2; |
68 | /* append padding */ | 65 | /* append padding */ |
69 | m[l >> 5] |= 0x80 << (24 - l % 32); | 66 | m[l >> 5] |= 0x80 << (24 - l % 32); |
70 | m[((l + 64 >> 9) << 4) + 15] = l; | 67 | m[((l + 64 >> 9) << 4) + 15] = l; |
71 | for ( var i = 0; i<m.length; i+=16 ) { | 68 | for ( var i = 0; i<m.length; i+=16 ) { |
72 | a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7]; | 69 | a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7]; |
73 | for ( var j = 0; j<64; j++) { | 70 | for ( var j = 0; j<64; j++) { |
74 | if (j < 16) W[j] = m[j + i]; | 71 | if (j < 16) W[j] = m[j + i]; |
75 | else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); | 72 | else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); |
76 | T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); | 73 | T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); |
77 | T2 = safe_add(Sigma0256(a), Maj(a, b, c)); | 74 | T2 = safe_add(Sigma0256(a), Maj(a, b, c)); |
78 | h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2); | 75 | h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2); |
79 | } | 76 | } |
80 | HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]); HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]); | 77 | HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]); HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]); |
81 | } | 78 | } |
82 | return HASH; | 79 | return HASH; |
83 | } | 80 | } |
84 | function str2binb (str) { | 81 | function str2binb (str) { |
85 | var bin = Array(); | 82 | var bin = Array(); |
86 | var mask = (1 << chrsz) - 1; | 83 | var mask = (1 << chrsz) - 1; |
87 | for(var i = 0; i < str.length * chrsz; i += chrsz) | 84 | for(var i = 0; i < str.length * chrsz; i += chrsz) |
88 | bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32); | 85 | bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32); |
89 | return bin; | 86 | return bin; |
90 | } | 87 | } |
91 | function binb2hex (binarray) { | 88 | function binb2hex (binarray) { |
92 | var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ | 89 | var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ |
93 | var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; | 90 | var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; |
94 | var str = ""; | 91 | var str = ""; |
95 | for (var i = 0; i < binarray.length * 4; i++) { | 92 | for (var i = 0; i < binarray.length * 4; i++) { |
96 | str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); | 93 | str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); |
97 | } | 94 | } |
98 | return str; | 95 | return str; |
99 | } | 96 | } |
100 | function hex_sha256(s){return binb2hex(core_sha256(str2binb(s),s.length * chrsz));} | 97 | function hex_sha256(s){return binb2hex(core_sha256(str2binb(s),s.length * chrsz));} |
101 | 98 | ||
102 | 99 | ||
103 | 100 | ||
104 | //############################################################################# | 101 | //############################################################################# |
105 | //Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (entropy.js) | 102 | //Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (entropy.js) |
106 | //############################################################################# | 103 | //############################################################################# |
107 | 104 | ||
108 | // Entropy collection utilities | 105 | // Entropy collection utilities |
109 | 106 | ||
110 | /*Start by declaring static storage and initialise | 107 | /*Start by declaring static storage and initialise |
111 | the entropy vector from the time we come through | 108 | the entropy vector from the time we come through |
112 | here. */ | 109 | here. */ |
113 | 110 | ||
114 | var entropyData = new Array(); // Collected entropy data | 111 | var entropyData = new Array(); // Collected entropy data |
115 | var edlen = 0; // Keyboard array data length | 112 | var edlen = 0; // Keyboard array data length |
116 | 113 | ||
117 | addEntropyTime(); // Start entropy collection with page load time | 114 | addEntropyTime(); // Start entropy collection with page load time |
118 | ce(); // Roll milliseconds into initial entropy | 115 | ce(); // Roll milliseconds into initial entropy |
119 | 116 | ||
120 | //Add a byte to the entropy vector | 117 | //Add a byte to the entropy vector |
121 | 118 | ||
122 | function addEntropyByte(b) { | 119 | function addEntropyByte(b) { |
123 | entropyData[edlen++] = b; | 120 | entropyData[edlen++] = b; |
124 | } | 121 | } |
125 | 122 | ||
126 | /*Capture entropy. When the user presses a key or performs | 123 | /*Capture entropy. When the user presses a key or performs |
127 | various other events for which we can request | 124 | various other events for which we can request |
128 | notification, add the time in 255ths of a second to the | 125 | notification, add the time in 255ths of a second to the |
129 | entropyData array. The name of the function is short | 126 | entropyData array. The name of the function is short |
130 | so it doesn't bloat the form object declarations in | 127 | so it doesn't bloat the form object declarations in |
131 | which it appears in various "onXXX" events. */ | 128 | which it appears in various "onXXX" events. */ |
132 | 129 | ||
133 | function ce() { | 130 | function ce() { |
134 | addEntropyByte(Math.floor((((new Date).getMilliseconds()) * 255) / 999)); | 131 | addEntropyByte(Math.floor((((new Date).getMilliseconds()) * 255) / 999)); |
135 | } | 132 | } |
136 | 133 | ||
137 | //Add a 32 bit quantity to the entropy vector | 134 | //Add a 32 bit quantity to the entropy vector |
138 | 135 | ||
139 | function addEntropy32(w) { | 136 | function addEntropy32(w) { |
140 | var i; | 137 | var i; |
141 | 138 | ||
142 | for (i = 0; i < 4; i++) { | 139 | for (i = 0; i < 4; i++) { |
143 | addEntropyByte(w & 0xFF); | 140 | addEntropyByte(w & 0xFF); |
144 | w >>= 8; | 141 | w >>= 8; |
145 | } | 142 | } |
146 | } | 143 | } |
147 | 144 | ||
148 | /*Add the current time and date (milliseconds since the epoch, | 145 | /*Add the current time and date (milliseconds since the epoch, |
149 | truncated to 32 bits) to the entropy vector. */ | 146 | truncated to 32 bits) to the entropy vector. */ |
150 | 147 | ||
151 | function addEntropyTime() { | 148 | function addEntropyTime() { |
152 | addEntropy32((new Date()).getTime()); | 149 | addEntropy32((new Date()).getTime()); |
153 | } | 150 | } |
154 | 151 | ||
155 | /* Start collection of entropy from mouse movements. The | 152 | /* Start collection of entropy from mouse movements. The |
156 | argument specifies the number of entropy items to be | 153 | argument specifies the number of entropy items to be |
157 | obtained from mouse motion, after which mouse motion | 154 | obtained from mouse motion, after which mouse motion |
158 | will be ignored. Note that you can re-enable mouse | 155 | will be ignored. Note that you can re-enable mouse |
159 | motion collection at any time if not already underway. */ | 156 | motion collection at any time if not already underway. */ |
160 | 157 | ||
161 | var mouseMotionCollect = 0; | 158 | var mouseMotionCollect = 0; |
162 | var oldMoveHandler; // For saving and restoring mouse move handler in IE4 | 159 | var oldMoveHandler; // For saving and restoring mouse move handler in IE4 |
163 | 160 | ||
164 | function mouseMotionEntropy(maxsamp) { | 161 | function mouseMotionEntropy(maxsamp) { |
165 | if (mouseMotionCollect <= 0) { | 162 | if (mouseMotionCollect <= 0) { |
166 | mouseMotionCollect = maxsamp; | 163 | mouseMotionCollect = maxsamp; |
167 | if ((document.implementation.hasFeature("Events", "2.0")) && | 164 | if ((document.implementation.hasFeature("Events", "2.0")) && |
168 | document.addEventListener) { | 165 | document.addEventListener) { |
169 | // Browser supports Document Object Model (DOM) 2 events | 166 | // Browser supports Document Object Model (DOM) 2 events |
170 | document.addEventListener("mousemove", mouseMoveEntropy, false); | 167 | document.addEventListener("mousemove", mouseMoveEntropy, false); |
171 | } else { | 168 | } else { |
172 | if (document.attachEvent) { | 169 | if (document.attachEvent) { |
173 | // Internet Explorer 5 and above event model | 170 | // Internet Explorer 5 and above event model |
174 | document.attachEvent("onmousemove", mouseMoveEntropy); | 171 | document.attachEvent("onmousemove", mouseMoveEntropy); |
175 | } else { | 172 | } else { |
176 | //Internet Explorer 4 event model | 173 | //Internet Explorer 4 event model |
177 | oldMoveHandler = document.onmousemove; | 174 | oldMoveHandler = document.onmousemove; |
178 | document.onmousemove = mouseMoveEntropy; | 175 | document.onmousemove = mouseMoveEntropy; |
179 | } | 176 | } |
180 | } | 177 | } |
181 | //dump("Mouse enable", mouseMotionCollect); | 178 | //dump("Mouse enable", mouseMotionCollect); |
182 | } | 179 | } |
183 | } | 180 | } |
184 | 181 | ||
185 | /*Collect entropy from mouse motion events. Note that | 182 | /*Collect entropy from mouse motion events. Note that |
186 | this is craftily coded to work with either DOM2 or Internet | 183 | this is craftily coded to work with either DOM2 or Internet |
187 | Explorer style events. Note that we don't use every successive | 184 | Explorer style events. Note that we don't use every successive |
188 | mouse movement event. Instead, we XOR the three bytes collected | 185 | mouse movement event. Instead, we XOR the three bytes collected |
189 | from the mouse and use that to determine how many subsequent | 186 | from the mouse and use that to determine how many subsequent |
190 | mouse movements we ignore before capturing the next one. */ | 187 | mouse movements we ignore before capturing the next one. */ |
191 | 188 | ||
192 | var mouseEntropyTime = 0; // Delay counter for mouse entropy collection | 189 | var mouseEntropyTime = 0; // Delay counter for mouse entropy collection |
193 | 190 | ||
194 | function mouseMoveEntropy(e) { | 191 | function mouseMoveEntropy(e) { |
195 | if (!e) { | 192 | if (!e) { |
196 | e = window.event; // Internet Explorer event model | 193 | e = window.event; // Internet Explorer event model |
197 | } | 194 | } |
198 | if (mouseMotionCollect > 0) { | 195 | if (mouseMotionCollect > 0) { |
199 | if (mouseEntropyTime-- <= 0) { | 196 | if (mouseEntropyTime-- <= 0) { |
200 | addEntropyByte(e.screenX & 0xFF); | 197 | addEntropyByte(e.screenX & 0xFF); |
201 | addEntropyByte(e.screenY & 0xFF); | 198 | addEntropyByte(e.screenY & 0xFF); |
202 | ce(); | 199 | ce(); |
203 | mouseMotionCollect--; | 200 | mouseMotionCollect--; |
204 | mouseEntropyTime = (entropyData[edlen - 3] ^ entropyData[edlen - 2] ^ | 201 | mouseEntropyTime = (entropyData[edlen - 3] ^ entropyData[edlen - 2] ^ |
205 | entropyData[edlen - 1]) % 19; | 202 | entropyData[edlen - 1]) % 19; |
206 | //dump("Mouse Move", byteArrayToHex(entropyData.slice(-3))); | 203 | //dump("Mouse Move", byteArrayToHex(entropyData.slice(-3))); |
207 | } | 204 | } |
208 | if (mouseMotionCollect <= 0) { | 205 | if (mouseMotionCollect <= 0) { |
209 | if (document.removeEventListener) { | 206 | if (document.removeEventListener) { |
210 | document.removeEventListener("mousemove", mouseMoveEntropy, false); | 207 | document.removeEventListener("mousemove", mouseMoveEntropy, false); |
211 | } else if (document.detachEvent) { | 208 | } else if (document.detachEvent) { |
212 | document.detachEvent("onmousemove", mouseMoveEntropy); | 209 | document.detachEvent("onmousemove", mouseMoveEntropy); |
213 | } else { | 210 | } else { |
214 | document.onmousemove = oldMoveHandler; | 211 | document.onmousemove = oldMoveHandler; |
215 | } | 212 | } |
216 | //dump("Spung!", 0); | 213 | //dump("Spung!", 0); |
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt.js b/frontend/gamma/js/Clipperz/Crypto/BigInt.js index d4d05d2..41483a3 100644 --- a/frontend/gamma/js/Clipperz/Crypto/BigInt.js +++ b/frontend/gamma/js/Clipperz/Crypto/BigInt.js | |||
@@ -1,216 +1,213 @@ | |||
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.Crypto) == 'undefined') { Clipperz.Crypto = {}; } | 27 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } |
31 | 28 | ||
32 | //############################################################################# | 29 | //############################################################################# |
33 | //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js | 30 | //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js |
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | 33 | ||
37 | //////////////////////////////////////////////////////////////////////////////////////// | 34 | //////////////////////////////////////////////////////////////////////////////////////// |
38 | // Big Integer Library v. 5.0 | 35 | // Big Integer Library v. 5.0 |
39 | // Created 2000, last modified 2006 | 36 | // Created 2000, last modified 2006 |
40 | // Leemon Baird | 37 | // Leemon Baird |
41 | // www.leemon.com | 38 | // www.leemon.com |
42 | // | 39 | // |
43 | // This file is public domain. You can use it for any purpose without restriction. | 40 | // This file is public domain. You can use it for any purpose without restriction. |
44 | // I do not guarantee that it is correct, so use it at your own risk. If you use | 41 | // I do not guarantee that it is correct, so use it at your own risk. If you use |
45 | // it for something interesting, I'd appreciate hearing about it. If you find | 42 | // it for something interesting, I'd appreciate hearing about it. If you find |
46 | // any bugs or make any improvements, I'd appreciate hearing about those too. | 43 | // any bugs or make any improvements, I'd appreciate hearing about those too. |
47 | // It would also be nice if my name and address were left in the comments. | 44 | // It would also be nice if my name and address were left in the comments. |
48 | // But none of that is required. | 45 | // But none of that is required. |
49 | // | 46 | // |
50 | // This code defines a bigInt library for arbitrary-precision integers. | 47 | // This code defines a bigInt library for arbitrary-precision integers. |
51 | // A bigInt is an array of integers storing the value in chunks of bpe bits, | 48 | // A bigInt is an array of integers storing the value in chunks of bpe bits, |
52 | // little endian (buff[0] is the least significant word). | 49 | // little endian (buff[0] is the least significant word). |
53 | // Negative bigInts are stored two's complement. | 50 | // Negative bigInts are stored two's complement. |
54 | // Some functions assume their parameters have at least one leading zero element. | 51 | // Some functions assume their parameters have at least one leading zero element. |
55 | // Functions with an underscore at the end of the name have unpredictable behavior in case of overflow, | 52 | // Functions with an underscore at the end of the name have unpredictable behavior in case of overflow, |
56 | // so the caller must make sure overflow won't happen. | 53 | // so the caller must make sure overflow won't happen. |
57 | // For each function where a parameter is modified, that same | 54 | // For each function where a parameter is modified, that same |
58 | // variable must not be used as another argument too. | 55 | // variable must not be used as another argument too. |
59 | // So, you cannot square x by doing multMod_(x,x,n). | 56 | // So, you cannot square x by doing multMod_(x,x,n). |
60 | // You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n). | 57 | // You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n). |
61 | // | 58 | // |
62 | // These functions are designed to avoid frequent dynamic memory allocation in the inner loop. | 59 | // These functions are designed to avoid frequent dynamic memory allocation in the inner loop. |
63 | // For most functions, if it needs a BigInt as a local variable it will actually use | 60 | // For most functions, if it needs a BigInt as a local variable it will actually use |
64 | // a global, and will only allocate to it when it's not the right size. This ensures | 61 | // a global, and will only allocate to it when it's not the right size. This ensures |
65 | // that when a function is called repeatedly with same-sized parameters, it only allocates | 62 | // that when a function is called repeatedly with same-sized parameters, it only allocates |
66 | // memory on the first call. | 63 | // memory on the first call. |
67 | // | 64 | // |
68 | // Note that for cryptographic purposes, the calls to Math.random() must | 65 | // Note that for cryptographic purposes, the calls to Math.random() must |
69 | // be replaced with calls to a better pseudorandom number generator. | 66 | // be replaced with calls to a better pseudorandom number generator. |
70 | // | 67 | // |
71 | // In the following, "bigInt" means a bigInt with at least one leading zero element, | 68 | // In the following, "bigInt" means a bigInt with at least one leading zero element, |
72 | // and "integer" means a nonnegative integer less than radix. In some cases, integer | 69 | // and "integer" means a nonnegative integer less than radix. In some cases, integer |
73 | // can be negative. Negative bigInts are 2s complement. | 70 | // can be negative. Negative bigInts are 2s complement. |
74 | // | 71 | // |
75 | // The following functions do not modify their inputs, but dynamically allocate memory every time they are called: | 72 | // The following functions do not modify their inputs, but dynamically allocate memory every time they are called: |
76 | // | 73 | // |
77 | // function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95 | 74 | // function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95 |
78 | // function dup(x) //returns a copy of bigInt x | 75 | // function dup(x) //returns a copy of bigInt x |
79 | // function findPrimes(n) //return array of all primes less than integer n | 76 | // function findPrimes(n) //return array of all primes less than integer n |
80 | // function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements | 77 | // function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements |
81 | // function int2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements | 78 | // function int2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements |
82 | // function trim(x,k) //return a copy of x with exactly k leading zero elements | 79 | // function trim(x,k) //return a copy of x with exactly k leading zero elements |
83 | // | 80 | // |
84 | // The following functions do not modify their inputs, so there is never a problem with the result being too big: | 81 | // The following functions do not modify their inputs, so there is never a problem with the result being too big: |
85 | // | 82 | // |
86 | // function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros | 83 | // function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros |
87 | // function equals(x,y) //is the bigInt x equal to the bigint y? | 84 | // function equals(x,y) //is the bigInt x equal to the bigint y? |
88 | // function equalsInt(x,y) //is bigint x equal to integer y? | 85 | // function equalsInt(x,y) //is bigint x equal to integer y? |
89 | // function greater(x,y) //is x>y? (x and y are nonnegative bigInts) | 86 | // function greater(x,y) //is x>y? (x and y are nonnegative bigInts) |
90 | // function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y? | 87 | // function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y? |
91 | // function isZero(x) //is the bigInt x equal to zero? | 88 | // function isZero(x) //is the bigInt x equal to zero? |
92 | // function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)? | 89 | // function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)? |
93 | // function modInt(x,n) //return x mod n for bigInt x and integer n. | 90 | // function modInt(x,n) //return x mod n for bigInt x and integer n. |
94 | // function negative(x) //is bigInt x negative? | 91 | // function negative(x) //is bigInt x negative? |
95 | // | 92 | // |
96 | // The following functions do not modify their inputs, but allocate memory and call functions with underscores | 93 | // The following functions do not modify their inputs, but allocate memory and call functions with underscores |
97 | // | 94 | // |
98 | // function add(x,y) //return (x+y) for bigInts x and y. | 95 | // function add(x,y) //return (x+y) for bigInts x and y. |
99 | // function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer. | 96 | // function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer. |
100 | // function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed | 97 | // function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed |
101 | // function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null | 98 | // function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null |
102 | // function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n. | 99 | // function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n. |
103 | // function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x. | 100 | // function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x. |
104 | // function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x. | 101 | // function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x. |
105 | // function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n. | 102 | // function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n. |
106 | // function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm. | 103 | // function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm. |
107 | // function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement | 104 | // function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement |
108 | // | 105 | // |
109 | // The following functions write a bigInt result to one of the parameters, but | 106 | // The following functions write a bigInt result to one of the parameters, but |
110 | // the result is never bigger than the original, so there can't be overflow problems: | 107 | // the result is never bigger than the original, so there can't be overflow problems: |
111 | // | 108 | // |
112 | // function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder | 109 | // function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder |
113 | // function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed). | 110 | // function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed). |
114 | // function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement | 111 | // function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement |
115 | // function mod_(x,n) //do x=x mod n for bigInts x and n. | 112 | // function mod_(x,n) //do x=x mod n for bigInts x and n. |
116 | // function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe. | 113 | // function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe. |
117 | // | 114 | // |
118 | // The following functions write a bigInt result to one of the parameters. The caller is responsible for | 115 | // The following functions write a bigInt result to one of the parameters. The caller is responsible for |
119 | // ensuring it is large enough to hold the result. | 116 | // ensuring it is large enough to hold the result. |
120 | // | 117 | // |
121 | // function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer | 118 | // function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer |
122 | // function add_(x,y) //do x=x+y for bigInts x and y | 119 | // function add_(x,y) //do x=x+y for bigInts x and y |
123 | // function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe)) | 120 | // function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe)) |
124 | // function copy_(x,y) //do x=y on bigInts x and y | 121 | // function copy_(x,y) //do x=y on bigInts x and y |
125 | // function copyInt_(x,n) //do x=n on bigInt x and integer n | 122 | // function copyInt_(x,n) //do x=n on bigInt x and integer n |
126 | // function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits. | 123 | // function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits. |
127 | // function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r | 124 | // function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r |
128 | // function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y | 125 | // function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y |
129 | // function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist | 126 | // function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist |
130 | // function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse | 127 | // function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse |
131 | // function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe. | 128 | // function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe. |
132 | // function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b | 129 | // function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b |
133 | // function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys | 130 | // function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys |
134 | // function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined) | 131 | // function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined) |
135 | // function mult_(x,y) //do x=x*y for bigInts x and y. | 132 | // function mult_(x,y) //do x=x*y for bigInts x and y. |
136 | // function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer. | 133 | // function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer. |
137 | // function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n. | 134 | // function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n. |
138 | // function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1. | 135 | // function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1. |
139 | // function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1. | 136 | // function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1. |
140 | // function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb. | 137 | // function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb. |
141 | // function squareMod_(x,n) //do x=x*x mod n for bigInts x,n | 138 | // function squareMod_(x,n) //do x=x*x mod n for bigInts x,n |
142 | // function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement. | 139 | // function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement. |
143 | // function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement. | 140 | // function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement. |
144 | // | 141 | // |
145 | // The following functions are based on algorithms from the _Handbook of Applied Cryptography_ | 142 | // The following functions are based on algorithms from the _Handbook of Applied Cryptography_ |
146 | // powMod_() = algorithm 14.94, Montgomery exponentiation | 143 | // powMod_() = algorithm 14.94, Montgomery exponentiation |
147 | // eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_ | 144 | // eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_ |
148 | // GCD_() = algorothm 14.57, Lehmer's algorithm | 145 | // GCD_() = algorothm 14.57, Lehmer's algorithm |
149 | // mont_() = algorithm 14.36, Montgomery multiplication | 146 | // mont_() = algorithm 14.36, Montgomery multiplication |
150 | // divide_() = algorithm 14.20 Multiple-precision division | 147 | // divide_() = algorithm 14.20 Multiple-precision division |
151 | // squareMod_() = algorithm 14.16 Multiple-precision squaring | 148 | // squareMod_() = algorithm 14.16 Multiple-precision squaring |
152 | // randTruePrime_() = algorithm 4.62, Maurer's algorithm | 149 | // randTruePrime_() = algorithm 4.62, Maurer's algorithm |
153 | // millerRabin() = algorithm 4.24, Miller-Rabin algorithm | 150 | // millerRabin() = algorithm 4.24, Miller-Rabin algorithm |
154 | // | 151 | // |
155 | // Profiling shows: | 152 | // Profiling shows: |
156 | // randTruePrime_() spends: | 153 | // randTruePrime_() spends: |
157 | // 10% of its time in calls to powMod_() | 154 | // 10% of its time in calls to powMod_() |
158 | // 85% of its time in calls to millerRabin() | 155 | // 85% of its time in calls to millerRabin() |
159 | // millerRabin() spends: | 156 | // millerRabin() spends: |
160 | // 99% of its time in calls to powMod_() (always with a base of 2) | 157 | // 99% of its time in calls to powMod_() (always with a base of 2) |
161 | // powMod_() spends: | 158 | // powMod_() spends: |
162 | // 94% of its time in calls to mont_() (almost always with x==y) | 159 | // 94% of its time in calls to mont_() (almost always with x==y) |
163 | // | 160 | // |
164 | // This suggests there are several ways to speed up this library slightly: | 161 | // This suggests there are several ways to speed up this library slightly: |
165 | // - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window) | 162 | // - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window) |
166 | // -- this should especially focus on being fast when raising 2 to a power mod n | 163 | // -- this should especially focus on being fast when raising 2 to a power mod n |
167 | // - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test | 164 | // - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test |
168 | // - tune the parameters in randTruePrime_(), including c, m, and recLimit | 165 | // - tune the parameters in randTruePrime_(), including c, m, and recLimit |
169 | // - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking | 166 | // - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking |
170 | // within the loop when all the parameters are the same length. | 167 | // within the loop when all the parameters are the same length. |
171 | // | 168 | // |
172 | // There are several ideas that look like they wouldn't help much at all: | 169 | // There are several ideas that look like they wouldn't help much at all: |
173 | // - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway) | 170 | // - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway) |
174 | // - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32) | 171 | // - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32) |
175 | // - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square | 172 | // - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square |
176 | // followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that | 173 | // followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that |
177 | // method would be slower. This is unfortunate because the code currently spends almost all of its time | 174 | // method would be slower. This is unfortunate because the code currently spends almost all of its time |
178 | // doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring | 175 | // doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring |
179 | // would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded | 176 | // would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded |
180 | // sentences that seem to imply it's faster to do a non-modular square followed by a single | 177 | // sentences that seem to imply it's faster to do a non-modular square followed by a single |
181 | // Montgomery reduction, but that's obviously wrong. | 178 | // Montgomery reduction, but that's obviously wrong. |
182 | //////////////////////////////////////////////////////////////////////////////////////// | 179 | //////////////////////////////////////////////////////////////////////////////////////// |
183 | 180 | ||
184 | //globals | 181 | //globals |
185 | bpe=0; //bits stored per array element | 182 | bpe=0; //bits stored per array element |
186 | mask=0; //AND this with an array element to chop it down to bpe bits | 183 | mask=0; //AND this with an array element to chop it down to bpe bits |
187 | radix=mask+1; //equals 2^bpe. A single 1 bit to the left of the last bit of mask. | 184 | radix=mask+1; //equals 2^bpe. A single 1 bit to the left of the last bit of mask. |
188 | 185 | ||
189 | //the digits for converting to different bases | 186 | //the digits for converting to different bases |
190 | digitsStr='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-'; | 187 | digitsStr='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-'; |
191 | 188 | ||
192 | //initialize the global variables | 189 | //initialize the global variables |
193 | for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform | 190 | for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform |
194 | bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt | 191 | bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt |
195 | mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits | 192 | mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits |
196 | radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask | 193 | radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask |
197 | one=int2bigInt(1,1,1); //constant used in powMod_() | 194 | one=int2bigInt(1,1,1); //constant used in powMod_() |
198 | 195 | ||
199 | //the following global variables are scratchpad memory to | 196 | //the following global variables are scratchpad memory to |
200 | //reduce dynamic memory allocation in the inner loop | 197 | //reduce dynamic memory allocation in the inner loop |
201 | t=new Array(0); | 198 | t=new Array(0); |
202 | ss=t; //used in mult_() | 199 | ss=t; //used in mult_() |
203 | s0=t; //used in multMod_(), squareMod_() | 200 | s0=t; //used in multMod_(), squareMod_() |
204 | s1=t; //used in powMod_(), multMod_(), squareMod_() | 201 | s1=t; //used in powMod_(), multMod_(), squareMod_() |
205 | s2=t; //used in powMod_(), multMod_() | 202 | s2=t; //used in powMod_(), multMod_() |
206 | s3=t; //used in powMod_() | 203 | s3=t; //used in powMod_() |
207 | s4=t; s5=t; //used in mod_() | 204 | s4=t; s5=t; //used in mod_() |
208 | s6=t; //used in bigInt2str() | 205 | s6=t; //used in bigInt2str() |
209 | s7=t; //used in powMod_() | 206 | s7=t; //used in powMod_() |
210 | T=t; //used in GCD_() | 207 | T=t; //used in GCD_() |
211 | sa=t; //used in mont_() | 208 | sa=t; //used in mont_() |
212 | mr_x1=t; mr_r=t; mr_a=t; //used in millerRabin() | 209 | mr_x1=t; mr_r=t; mr_a=t; //used in millerRabin() |
213 | eg_v=t; eg_u=t; eg_A=t; eg_B=t; eg_C=t; eg_D=t; //used in eGCD_(), inverseMod_() | 210 | eg_v=t; eg_u=t; eg_A=t; eg_B=t; eg_C=t; eg_D=t; //used in eGCD_(), inverseMod_() |
214 | md_q1=t; md_q2=t; md_q3=t; md_r=t; md_r1=t; md_r2=t; md_tt=t; //used in mod_() | 211 | md_q1=t; md_q2=t; md_q3=t; md_r=t; md_r1=t; md_r2=t; md_tt=t; //used in mod_() |
215 | 212 | ||
216 | primes=t; pows=t; s_i=t; s_i2=t; s_R=t; s_rm=t; s_q=t; s_n1=t; | 213 | primes=t; pows=t; s_i=t; s_i2=t; s_R=t; s_rm=t; s_q=t; s_n1=t; |
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js index e91e823..f91c7e9 100644 --- a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js +++ b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js | |||
@@ -1,216 +1,213 @@ | |||
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.Crypto) == 'undefined') { Clipperz.Crypto = {}; } | 27 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } |
31 | 28 | ||
32 | if (typeof(Leemon) == 'undefined') { Leemon = {}; } | 29 | if (typeof(Leemon) == 'undefined') { Leemon = {}; } |
33 | if (typeof(Baird.Crypto) == 'undefined') { Baird.Crypto = {}; } | 30 | if (typeof(Baird.Crypto) == 'undefined') { Baird.Crypto = {}; } |
34 | if (typeof(Baird.Crypto.BigInt) == 'undefined') { Baird.Crypto.BigInt = {}; } | 31 | if (typeof(Baird.Crypto.BigInt) == 'undefined') { Baird.Crypto.BigInt = {}; } |
35 | 32 | ||
36 | 33 | ||
37 | //############################################################################# | 34 | //############################################################################# |
38 | //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js | 35 | //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js |
39 | //############################################################################# | 36 | //############################################################################# |
40 | 37 | ||
41 | //////////////////////////////////////////////////////////////////////////////////////// | 38 | //////////////////////////////////////////////////////////////////////////////////////// |
42 | // Big Integer Library v. 5.0 | 39 | // Big Integer Library v. 5.0 |
43 | // Created 2000, last modified 2006 | 40 | // Created 2000, last modified 2006 |
44 | // Leemon Baird | 41 | // Leemon Baird |
45 | // www.leemon.com | 42 | // www.leemon.com |
46 | // | 43 | // |
47 | // This file is public domain. You can use it for any purpose without restriction. | 44 | // This file is public domain. You can use it for any purpose without restriction. |
48 | // I do not guarantee that it is correct, so use it at your own risk. If you use | 45 | // I do not guarantee that it is correct, so use it at your own risk. If you use |
49 | // it for something interesting, I'd appreciate hearing about it. If you find | 46 | // it for something interesting, I'd appreciate hearing about it. If you find |
50 | // any bugs or make any improvements, I'd appreciate hearing about those too. | 47 | // any bugs or make any improvements, I'd appreciate hearing about those too. |
51 | // It would also be nice if my name and address were left in the comments. | 48 | // It would also be nice if my name and address were left in the comments. |
52 | // But none of that is required. | 49 | // But none of that is required. |
53 | // | 50 | // |
54 | // This code defines a bigInt library for arbitrary-precision integers. | 51 | // This code defines a bigInt library for arbitrary-precision integers. |
55 | // A bigInt is an array of integers storing the value in chunks of bpe bits, | 52 | // A bigInt is an array of integers storing the value in chunks of bpe bits, |
56 | // little endian (buff[0] is the least significant word). | 53 | // little endian (buff[0] is the least significant word). |
57 | // Negative bigInts are stored two's complement. | 54 | // Negative bigInts are stored two's complement. |
58 | // Some functions assume their parameters have at least one leading zero element. | 55 | // Some functions assume their parameters have at least one leading zero element. |
59 | // Functions with an underscore at the end of the name have unpredictable behavior in case of overflow, | 56 | // Functions with an underscore at the end of the name have unpredictable behavior in case of overflow, |
60 | // so the caller must make sure overflow won't happen. | 57 | // so the caller must make sure overflow won't happen. |
61 | // For each function where a parameter is modified, that same | 58 | // For each function where a parameter is modified, that same |
62 | // variable must not be used as another argument too. | 59 | // variable must not be used as another argument too. |
63 | // So, you cannot square x by doing multMod_(x,x,n). | 60 | // So, you cannot square x by doing multMod_(x,x,n). |
64 | // You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n). | 61 | // You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n). |
65 | // | 62 | // |
66 | // These functions are designed to avoid frequent dynamic memory allocation in the inner loop. | 63 | // These functions are designed to avoid frequent dynamic memory allocation in the inner loop. |
67 | // For most functions, if it needs a BigInt as a local variable it will actually use | 64 | // For most functions, if it needs a BigInt as a local variable it will actually use |
68 | // a global, and will only allocate to it when it's not the right size. This ensures | 65 | // a global, and will only allocate to it when it's not the right size. This ensures |
69 | // that when a function is called repeatedly with same-sized parameters, it only allocates | 66 | // that when a function is called repeatedly with same-sized parameters, it only allocates |
70 | // memory on the first call. | 67 | // memory on the first call. |
71 | // | 68 | // |
72 | // Note that for cryptographic purposes, the calls to Math.random() must | 69 | // Note that for cryptographic purposes, the calls to Math.random() must |
73 | // be replaced with calls to a better pseudorandom number generator. | 70 | // be replaced with calls to a better pseudorandom number generator. |
74 | // | 71 | // |
75 | // In the following, "bigInt" means a bigInt with at least one leading zero element, | 72 | // In the following, "bigInt" means a bigInt with at least one leading zero element, |
76 | // and "integer" means a nonnegative integer less than radix. In some cases, integer | 73 | // and "integer" means a nonnegative integer less than radix. In some cases, integer |
77 | // can be negative. Negative bigInts are 2s complement. | 74 | // can be negative. Negative bigInts are 2s complement. |
78 | // | 75 | // |
79 | // The following functions do not modify their inputs, but dynamically allocate memory every time they are called: | 76 | // The following functions do not modify their inputs, but dynamically allocate memory every time they are called: |
80 | // | 77 | // |
81 | // function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95 | 78 | // function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95 |
82 | // function dup(x) //returns a copy of bigInt x | 79 | // function dup(x) //returns a copy of bigInt x |
83 | // function findPrimes(n) //return array of all primes less than integer n | 80 | // function findPrimes(n) //return array of all primes less than integer n |
84 | // function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements | 81 | // function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements |
85 | // function str2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements | 82 | // function str2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements |
86 | // function trim(x,k) //return a copy of x with exactly k leading zero elements | 83 | // function trim(x,k) //return a copy of x with exactly k leading zero elements |
87 | // | 84 | // |
88 | // The following functions do not modify their inputs, so there is never a problem with the result being too big: | 85 | // The following functions do not modify their inputs, so there is never a problem with the result being too big: |
89 | // | 86 | // |
90 | // function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros | 87 | // function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros |
91 | // function equals(x,y) //is the bigInt x equal to the bigint y? | 88 | // function equals(x,y) //is the bigInt x equal to the bigint y? |
92 | // function equalsInt(x,y) //is bigint x equal to integer y? | 89 | // function equalsInt(x,y) //is bigint x equal to integer y? |
93 | // function greater(x,y) //is x>y? (x and y are nonnegative bigInts) | 90 | // function greater(x,y) //is x>y? (x and y are nonnegative bigInts) |
94 | // function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y? | 91 | // function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y? |
95 | // function isZero(x) //is the bigInt x equal to zero? | 92 | // function isZero(x) //is the bigInt x equal to zero? |
96 | // function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)? | 93 | // function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)? |
97 | // function modInt(x,n) //return x mod n for bigInt x and integer n. | 94 | // function modInt(x,n) //return x mod n for bigInt x and integer n. |
98 | // function negative(x) //is bigInt x negative? | 95 | // function negative(x) //is bigInt x negative? |
99 | // | 96 | // |
100 | // The following functions do not modify their inputs, but allocate memory and call functions with underscores | 97 | // The following functions do not modify their inputs, but allocate memory and call functions with underscores |
101 | // | 98 | // |
102 | // function add(x,y) //return (x+y) for bigInts x and y. | 99 | // function add(x,y) //return (x+y) for bigInts x and y. |
103 | // function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer. | 100 | // function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer. |
104 | // function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed | 101 | // function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed |
105 | // function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null | 102 | // function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null |
106 | // function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n. | 103 | // function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n. |
107 | // function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x. | 104 | // function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x. |
108 | // function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x. | 105 | // function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x. |
109 | // function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n. | 106 | // function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n. |
110 | // function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm. | 107 | // function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm. |
111 | // function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement | 108 | // function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement |
112 | // | 109 | // |
113 | // The following functions write a bigInt result to one of the parameters, but | 110 | // The following functions write a bigInt result to one of the parameters, but |
114 | // the result is never bigger than the original, so there can't be overflow problems: | 111 | // the result is never bigger than the original, so there can't be overflow problems: |
115 | // | 112 | // |
116 | // function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder | 113 | // function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder |
117 | // function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed). | 114 | // function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed). |
118 | // function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement | 115 | // function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement |
119 | // function mod_(x,n) //do x=x mod n for bigInts x and n. | 116 | // function mod_(x,n) //do x=x mod n for bigInts x and n. |
120 | // function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe. | 117 | // function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe. |
121 | // | 118 | // |
122 | // The following functions write a bigInt result to one of the parameters. The caller is responsible for | 119 | // The following functions write a bigInt result to one of the parameters. The caller is responsible for |
123 | // ensuring it is large enough to hold the result. | 120 | // ensuring it is large enough to hold the result. |
124 | // | 121 | // |
125 | // function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer | 122 | // function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer |
126 | // function add_(x,y) //do x=x+y for bigInts x and y | 123 | // function add_(x,y) //do x=x+y for bigInts x and y |
127 | // function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe)) | 124 | // function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe)) |
128 | // function copy_(x,y) //do x=y on bigInts x and y | 125 | // function copy_(x,y) //do x=y on bigInts x and y |
129 | // function copyInt_(x,n) //do x=n on bigInt x and integer n | 126 | // function copyInt_(x,n) //do x=n on bigInt x and integer n |
130 | // function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits. | 127 | // function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits. |
131 | // function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r | 128 | // function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r |
132 | // function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y | 129 | // function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y |
133 | // function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist | 130 | // function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist |
134 | // function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse | 131 | // function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse |
135 | // function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe. | 132 | // function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe. |
136 | // function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b | 133 | // function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b |
137 | // function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys | 134 | // function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys |
138 | // function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined) | 135 | // function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined) |
139 | // function mult_(x,y) //do x=x*y for bigInts x and y. | 136 | // function mult_(x,y) //do x=x*y for bigInts x and y. |
140 | // function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer. | 137 | // function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer. |
141 | // function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n. | 138 | // function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n. |
142 | // function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1. | 139 | // function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1. |
143 | // function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1. | 140 | // function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1. |
144 | // function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb. | 141 | // function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb. |
145 | // function squareMod_(x,n) //do x=x*x mod n for bigInts x,n | 142 | // function squareMod_(x,n) //do x=x*x mod n for bigInts x,n |
146 | // function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement. | 143 | // function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement. |
147 | // function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement. | 144 | // function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement. |
148 | // | 145 | // |
149 | // The following functions are based on algorithms from the _Handbook of Applied Cryptography_ | 146 | // The following functions are based on algorithms from the _Handbook of Applied Cryptography_ |
150 | // powMod_() = algorithm 14.94, Montgomery exponentiation | 147 | // powMod_() = algorithm 14.94, Montgomery exponentiation |
151 | // eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_ | 148 | // eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_ |
152 | // GCD_() = algorothm 14.57, Lehmer's algorithm | 149 | // GCD_() = algorothm 14.57, Lehmer's algorithm |
153 | // mont_() = algorithm 14.36, Montgomery multiplication | 150 | // mont_() = algorithm 14.36, Montgomery multiplication |
154 | // divide_() = algorithm 14.20 Multiple-precision division | 151 | // divide_() = algorithm 14.20 Multiple-precision division |
155 | // squareMod_() = algorithm 14.16 Multiple-precision squaring | 152 | // squareMod_() = algorithm 14.16 Multiple-precision squaring |
156 | // randTruePrime_() = algorithm 4.62, Maurer's algorithm | 153 | // randTruePrime_() = algorithm 4.62, Maurer's algorithm |
157 | // millerRabin() = algorithm 4.24, Miller-Rabin algorithm | 154 | // millerRabin() = algorithm 4.24, Miller-Rabin algorithm |
158 | // | 155 | // |
159 | // Profiling shows: | 156 | // Profiling shows: |
160 | // randTruePrime_() spends: | 157 | // randTruePrime_() spends: |
161 | // 10% of its time in calls to powMod_() | 158 | // 10% of its time in calls to powMod_() |
162 | // 85% of its time in calls to millerRabin() | 159 | // 85% of its time in calls to millerRabin() |
163 | // millerRabin() spends: | 160 | // millerRabin() spends: |
164 | // 99% of its time in calls to powMod_() (always with a base of 2) | 161 | // 99% of its time in calls to powMod_() (always with a base of 2) |
165 | // powMod_() spends: | 162 | // powMod_() spends: |
166 | // 94% of its time in calls to mont_() (almost always with x==y) | 163 | // 94% of its time in calls to mont_() (almost always with x==y) |
167 | // | 164 | // |
168 | // This suggests there are several ways to speed up this library slightly: | 165 | // This suggests there are several ways to speed up this library slightly: |
169 | // - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window) | 166 | // - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window) |
170 | // -- this should especially focus on being fast when raising 2 to a power mod n | 167 | // -- this should especially focus on being fast when raising 2 to a power mod n |
171 | // - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test | 168 | // - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test |
172 | // - tune the parameters in randTruePrime_(), including c, m, and recLimit | 169 | // - tune the parameters in randTruePrime_(), including c, m, and recLimit |
173 | // - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking | 170 | // - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking |
174 | // within the loop when all the parameters are the same length. | 171 | // within the loop when all the parameters are the same length. |
175 | // | 172 | // |
176 | // There are several ideas that look like they wouldn't help much at all: | 173 | // There are several ideas that look like they wouldn't help much at all: |
177 | // - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway) | 174 | // - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway) |
178 | // - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32) | 175 | // - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32) |
179 | // - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square | 176 | // - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square |
180 | // followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that | 177 | // followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that |
181 | // method would be slower. This is unfortunate because the code currently spends almost all of its time | 178 | // method would be slower. This is unfortunate because the code currently spends almost all of its time |
182 | // doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring | 179 | // doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring |
183 | // would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded | 180 | // would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded |
184 | // sentences that seem to imply it's faster to do a non-modular square followed by a single | 181 | // sentences that seem to imply it's faster to do a non-modular square followed by a single |
185 | // Montgomery reduction, but that's obviously wrong. | 182 | // Montgomery reduction, but that's obviously wrong. |
186 | //////////////////////////////////////////////////////////////////////////////////////// | 183 | //////////////////////////////////////////////////////////////////////////////////////// |
187 | 184 | ||
188 | // | 185 | // |
189 | //The whole library has been moved into the Baird.Crypto.BigInt scope by Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 186 | //The whole library has been moved into the Baird.Crypto.BigInt scope by Giulio Cesare Solaroli <giulio.cesare@clipperz.com> |
190 | // | 187 | // |
191 | Baird.Crypto.BigInt.VERSION = "5.0"; | 188 | Baird.Crypto.BigInt.VERSION = "5.0"; |
192 | Baird.Crypto.BigInt.NAME = "Baird.Crypto.BigInt"; | 189 | Baird.Crypto.BigInt.NAME = "Baird.Crypto.BigInt"; |
193 | 190 | ||
194 | MochiKit.Base.update(Baird.Crypto.BigInt, { | 191 | MochiKit.Base.update(Baird.Crypto.BigInt, { |
195 | //globals | 192 | //globals |
196 | 'bpe': 0, //bits stored per array element | 193 | 'bpe': 0, //bits stored per array element |
197 | 'mask': 0, //AND this with an array element to chop it down to bpe bits | 194 | 'mask': 0, //AND this with an array element to chop it down to bpe bits |
198 | 'radix': Baird.Crypto.BigInt.mask + 1,//equals 2^bpe. A single 1 bit to the left of the last bit of mask. | 195 | 'radix': Baird.Crypto.BigInt.mask + 1,//equals 2^bpe. A single 1 bit to the left of the last bit of mask. |
199 | 196 | ||
200 | //the digits for converting to different bases | 197 | //the digits for converting to different bases |
201 | 'digitsStr': '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-', | 198 | 'digitsStr': '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-', |
202 | 199 | ||
203 | //initialize the global variables | 200 | //initialize the global variables |
204 | for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform | 201 | for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform |
205 | bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt | 202 | bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt |
206 | mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits | 203 | mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits |
207 | radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask | 204 | radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask |
208 | one=int2bigInt(1,1,1); //constant used in powMod_() | 205 | one=int2bigInt(1,1,1); //constant used in powMod_() |
209 | 206 | ||
210 | //the following global variables are scratchpad memory to | 207 | //the following global variables are scratchpad memory to |
211 | //reduce dynamic memory allocation in the inner loop | 208 | //reduce dynamic memory allocation in the inner loop |
212 | t=new Array(0); | 209 | t=new Array(0); |
213 | ss=t; //used in mult_() | 210 | ss=t; //used in mult_() |
214 | s0=t; //used in multMod_(), squareMod_() | 211 | s0=t; //used in multMod_(), squareMod_() |
215 | s1=t; //used in powMod_(), multMod_(), squareMod_() | 212 | s1=t; //used in powMod_(), multMod_(), squareMod_() |
216 | s2=t; //used in powMod_(), multMod_() | 213 | s2=t; //used in powMod_(), multMod_() |
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js index 2033eb4..19f19c2 100644 --- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js +++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; | 27 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; |
31 | //} | 28 | //} |
32 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } | 29 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } |
33 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } | 30 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } |
34 | 31 | ||
35 | Clipperz.Crypto.ECC.BinaryField.Curve = function(args) { | 32 | Clipperz.Crypto.ECC.BinaryField.Curve = function(args) { |
36 | args = args || {}; | 33 | args = args || {}; |
37 | 34 | ||
38 | this._modulus = args.modulus; | 35 | this._modulus = args.modulus; |
39 | 36 | ||
40 | this._a = args.a; | 37 | this._a = args.a; |
41 | this._b = args.b; | 38 | this._b = args.b; |
42 | this._G = args.G; | 39 | this._G = args.G; |
43 | this._r = args.r; | 40 | this._r = args.r; |
44 | this._h = args.h; | 41 | this._h = args.h; |
45 | 42 | ||
46 | this._finiteField = null; | 43 | this._finiteField = null; |
47 | 44 | ||
48 | return this; | 45 | return this; |
49 | } | 46 | } |
50 | 47 | ||
51 | Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, { | 48 | Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, { |
52 | 49 | ||
53 | 'asString': function() { | 50 | 'asString': function() { |
54 | return "Clipperz.Crypto.ECC.BinaryField.Curve"; | 51 | return "Clipperz.Crypto.ECC.BinaryField.Curve"; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //----------------------------------------------------------------------------- | 54 | //----------------------------------------------------------------------------- |
58 | 55 | ||
59 | 'modulus': function() { | 56 | 'modulus': function() { |
60 | return this._modulus; | 57 | return this._modulus; |
61 | }, | 58 | }, |
62 | 59 | ||
63 | 'a': function() { | 60 | 'a': function() { |
64 | return this._a; | 61 | return this._a; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'b': function() { | 64 | 'b': function() { |
68 | return this._b; | 65 | return this._b; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | 'G': function() { | 68 | 'G': function() { |
72 | return this._G; | 69 | return this._G; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | 'r': function() { | 72 | 'r': function() { |
76 | return this._r; | 73 | return this._r; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'h': function() { | 76 | 'h': function() { |
80 | return this._h; | 77 | return this._h; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //----------------------------------------------------------------------------- | 80 | //----------------------------------------------------------------------------- |
84 | 81 | ||
85 | 'finiteField': function() { | 82 | 'finiteField': function() { |
86 | if (this._finiteField == null) { | 83 | if (this._finiteField == null) { |
87 | this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()}) | 84 | this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()}) |
88 | } | 85 | } |
89 | 86 | ||
90 | return this._finiteField; | 87 | return this._finiteField; |
91 | }, | 88 | }, |
92 | 89 | ||
93 | //----------------------------------------------------------------------------- | 90 | //----------------------------------------------------------------------------- |
94 | 91 | ||
95 | 'negate': function(aPointA) { | 92 | 'negate': function(aPointA) { |
96 | var result; | 93 | var result; |
97 | 94 | ||
98 | result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())}) | 95 | result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())}) |
99 | 96 | ||
100 | return result; | 97 | return result; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //----------------------------------------------------------------------------- | 100 | //----------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'add': function(aPointA, aPointB) { | 102 | 'add': function(aPointA, aPointB) { |
106 | var result; | 103 | var result; |
107 | 104 | ||
108 | //console.log(">>> ECC.BinaryField.Curve.add"); | 105 | //console.log(">>> ECC.BinaryField.Curve.add"); |
109 | if (aPointA.isZero()) { | 106 | if (aPointA.isZero()) { |
110 | //console.log("--- pointA == zero"); | 107 | //console.log("--- pointA == zero"); |
111 | result = aPointB; | 108 | result = aPointB; |
112 | } else if (aPointB.isZero()) { | 109 | } else if (aPointB.isZero()) { |
113 | //console.log("--- pointB == zero"); | 110 | //console.log("--- pointB == zero"); |
114 | result = aPointA; | 111 | result = aPointA; |
115 | } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { | 112 | } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { |
116 | //console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x())); | 113 | //console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x())); |
117 | //console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0)); | 114 | //console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0)); |
118 | //console.log("compare B.x.isZero(): ", aPointB.x().isZero()); | 115 | //console.log("compare B.x.isZero(): ", aPointB.x().isZero()); |
119 | 116 | ||
120 | //console.log("--- result = zero"); | 117 | //console.log("--- result = zero"); |
121 | result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); | 118 | result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); |
122 | } else { | 119 | } else { |
123 | //console.log("--- result = ELSE"); | 120 | //console.log("--- result = ELSE"); |
124 | varf2m; | 121 | varf2m; |
125 | var x, y; | 122 | var x, y; |
126 | var lambda; | 123 | var lambda; |
127 | var aX, aY, bX, bY; | 124 | var aX, aY, bX, bY; |
128 | 125 | ||
129 | aX = aPointA.x()._value; | 126 | aX = aPointA.x()._value; |
130 | aY = aPointA.y()._value; | 127 | aY = aPointA.y()._value; |
131 | bX = aPointB.x()._value; | 128 | bX = aPointB.x()._value; |
132 | bY = aPointB.y()._value; | 129 | bY = aPointB.y()._value; |
133 | 130 | ||
134 | f2m = this.finiteField(); | 131 | f2m = this.finiteField(); |
135 | 132 | ||
136 | if (aPointA.x().compare(aPointB.x()) != 0) { | 133 | if (aPointA.x().compare(aPointB.x()) != 0) { |
137 | //console.log(" a.x != b.x"); | 134 | //console.log(" a.x != b.x"); |
138 | lambda =f2m._fastMultiply( | 135 | lambda =f2m._fastMultiply( |
139 | f2m._add(aY, bY), | 136 | f2m._add(aY, bY), |
140 | f2m._inverse(f2m._add(aX, bX)) | 137 | f2m._inverse(f2m._add(aX, bX)) |
141 | ); | 138 | ); |
142 | x = f2m._add(this.a()._value, f2m._square(lambda)); | 139 | x = f2m._add(this.a()._value, f2m._square(lambda)); |
143 | f2m._overwriteAdd(x, lambda); | 140 | f2m._overwriteAdd(x, lambda); |
144 | f2m._overwriteAdd(x, aX); | 141 | f2m._overwriteAdd(x, aX); |
145 | f2m._overwriteAdd(x, bX); | 142 | f2m._overwriteAdd(x, bX); |
146 | } else { | 143 | } else { |
147 | //console.log(" a.x == b.x"); | 144 | //console.log(" a.x == b.x"); |
148 | lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); | 145 | lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); |
149 | //console.log(" lambda: " + lambda.asString(16)); | 146 | //console.log(" lambda: " + lambda.asString(16)); |
150 | x = f2m._add(this.a()._value, f2m._square(lambda)); | 147 | x = f2m._add(this.a()._value, f2m._square(lambda)); |
151 | //console.log(" x (step 1): " + x.asString(16)); | 148 | //console.log(" x (step 1): " + x.asString(16)); |
152 | f2m._overwriteAdd(x, lambda); | 149 | f2m._overwriteAdd(x, lambda); |
153 | //console.log(" x (step 2): " + x.asString(16)); | 150 | //console.log(" x (step 2): " + x.asString(16)); |
154 | } | 151 | } |
155 | 152 | ||
156 | y = f2m._fastMultiply(f2m._add(bX, x), lambda); | 153 | y = f2m._fastMultiply(f2m._add(bX, x), lambda); |
157 | //console.log(" y (step 1): " + y.asString(16)); | 154 | //console.log(" y (step 1): " + y.asString(16)); |
158 | f2m._overwriteAdd(y, x); | 155 | f2m._overwriteAdd(y, x); |
159 | //console.log(" y (step 2): " + y.asString(16)); | 156 | //console.log(" y (step 2): " + y.asString(16)); |
160 | f2m._overwriteAdd(y, bY); | 157 | f2m._overwriteAdd(y, bY); |
161 | //console.log(" y (step 3): " + y.asString(16)); | 158 | //console.log(" y (step 3): " + y.asString(16)); |
162 | 159 | ||
163 | result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) | 160 | result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) |
164 | } | 161 | } |
165 | //console.log("<<< ECC.BinaryField.Curve.add"); | 162 | //console.log("<<< ECC.BinaryField.Curve.add"); |
166 | 163 | ||
167 | return result; | 164 | return result; |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //----------------------------------------------------------------------------- | 167 | //----------------------------------------------------------------------------- |
171 | 168 | ||
172 | 'addTwice': function(aPointA) { | 169 | 'addTwice': function(aPointA) { |
173 | return this.add(aPointA, aPointA); | 170 | return this.add(aPointA, aPointA); |
174 | }, | 171 | }, |
175 | 172 | ||
176 | //----------------------------------------------------------------------------- | 173 | //----------------------------------------------------------------------------- |
177 | 174 | ||
178 | 'overwriteAdd': function(aPointA, aPointB) { | 175 | 'overwriteAdd': function(aPointA, aPointB) { |
179 | if (aPointA.isZero()) { | 176 | if (aPointA.isZero()) { |
180 | // result = aPointB; | 177 | // result = aPointB; |
181 | aPointA._x._value = aPointB._x._value; | 178 | aPointA._x._value = aPointB._x._value; |
182 | aPointA._y._value = aPointB._y._value; | 179 | aPointA._y._value = aPointB._y._value; |
183 | } else if (aPointB.isZero()) { | 180 | } else if (aPointB.isZero()) { |
184 | // result = aPointA; | 181 | // result = aPointA; |
185 | } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { | 182 | } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { |
186 | // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); | 183 | // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); |
187 | aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O; | 184 | aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O; |
188 | aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O; | 185 | aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O; |
189 | } else { | 186 | } else { |
190 | varf2m; | 187 | varf2m; |
191 | var x, y; | 188 | var x, y; |
192 | var lambda; | 189 | var lambda; |
193 | var aX, aY, bX, bY; | 190 | var aX, aY, bX, bY; |
194 | 191 | ||
195 | aX = aPointA.x()._value; | 192 | aX = aPointA.x()._value; |
196 | aY = aPointA.y()._value; | 193 | aY = aPointA.y()._value; |
197 | bX = aPointB.x()._value; | 194 | bX = aPointB.x()._value; |
198 | bY = aPointB.y()._value; | 195 | bY = aPointB.y()._value; |
199 | 196 | ||
200 | f2m = this.finiteField(); | 197 | f2m = this.finiteField(); |
201 | 198 | ||
202 | if (aPointA.x().compare(aPointB.x()) != 0) { | 199 | if (aPointA.x().compare(aPointB.x()) != 0) { |
203 | //console.log(" a.x != b.x"); | 200 | //console.log(" a.x != b.x"); |
204 | lambda =f2m._fastMultiply( | 201 | lambda =f2m._fastMultiply( |
205 | f2m._add(aY, bY), | 202 | f2m._add(aY, bY), |
206 | f2m._inverse(f2m._add(aX, bX)) | 203 | f2m._inverse(f2m._add(aX, bX)) |
207 | ); | 204 | ); |
208 | x = f2m._add(this.a()._value, f2m._square(lambda)); | 205 | x = f2m._add(this.a()._value, f2m._square(lambda)); |
209 | f2m._overwriteAdd(x, lambda); | 206 | f2m._overwriteAdd(x, lambda); |
210 | f2m._overwriteAdd(x, aX); | 207 | f2m._overwriteAdd(x, aX); |
211 | f2m._overwriteAdd(x, bX); | 208 | f2m._overwriteAdd(x, bX); |
212 | } else { | 209 | } else { |
213 | //console.log(" a.x == b.x"); | 210 | //console.log(" a.x == b.x"); |
214 | lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); | 211 | lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); |
215 | //console.log(" lambda: " + lambda.asString(16)); | 212 | //console.log(" lambda: " + lambda.asString(16)); |
216 | x = f2m._add(this.a()._value, f2m._square(lambda)); | 213 | x = f2m._add(this.a()._value, f2m._square(lambda)); |
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js index a649c9f..56f257a 100644 --- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js +++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; | 27 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; |
31 | //} | 28 | //} |
32 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } | 29 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } |
33 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } | 30 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } |
34 | 31 | ||
35 | Clipperz.Crypto.ECC.BinaryField.FiniteField = function(args) { | 32 | Clipperz.Crypto.ECC.BinaryField.FiniteField = function(args) { |
36 | args = args || {}; | 33 | args = args || {}; |
37 | this._modulus = args.modulus; | 34 | this._modulus = args.modulus; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(null, { | 39 | Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(null, { |
43 | 40 | ||
44 | 'asString': function() { | 41 | 'asString': function() { |
45 | return "Clipperz.Crypto.ECC.BinaryField.FiniteField (" + this.modulus().asString() + ")"; | 42 | return "Clipperz.Crypto.ECC.BinaryField.FiniteField (" + this.modulus().asString() + ")"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //----------------------------------------------------------------------------- | 45 | //----------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'modulus': function() { | 47 | 'modulus': function() { |
51 | return this._modulus; | 48 | return this._modulus; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //----------------------------------------------------------------------------- | 51 | //----------------------------------------------------------------------------- |
55 | 52 | ||
56 | '_module': function(aValue) { | 53 | '_module': function(aValue) { |
57 | varresult; | 54 | varresult; |
58 | var modulusComparison; | 55 | var modulusComparison; |
59 | //console.log(">>> binaryField.finiteField.(standard)module"); | 56 | //console.log(">>> binaryField.finiteField.(standard)module"); |
60 | 57 | ||
61 | modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value); | 58 | modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value); |
62 | 59 | ||
63 | if (modulusComparison < 0) { | 60 | if (modulusComparison < 0) { |
64 | result = aValue; | 61 | result = aValue; |
65 | } else if (modulusComparison == 0) { | 62 | } else if (modulusComparison == 0) { |
66 | result = [0]; | 63 | result = [0]; |
67 | } else { | 64 | } else { |
68 | var modulusBitSize; | 65 | var modulusBitSize; |
69 | var resultBitSize; | 66 | var resultBitSize; |
70 | 67 | ||
71 | result = aValue; | 68 | result = aValue; |
72 | 69 | ||
73 | modulusBitSize = this.modulus().bitSize(); | 70 | modulusBitSize = this.modulus().bitSize(); |
74 | resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); | 71 | resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); |
75 | while (resultBitSize >= modulusBitSize) { | 72 | while (resultBitSize >= modulusBitSize) { |
76 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this.modulus()._value, resultBitSize - modulusBitSize)); | 73 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this.modulus()._value, resultBitSize - modulusBitSize)); |
77 | resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); | 74 | resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); |
78 | } | 75 | } |
79 | } | 76 | } |
80 | //console.log("<<< binaryField.finiteField.(standard)module"); | 77 | //console.log("<<< binaryField.finiteField.(standard)module"); |
81 | 78 | ||
82 | return result; | 79 | return result; |
83 | }, | 80 | }, |
84 | 81 | ||
85 | 'module': function(aValue) { | 82 | 'module': function(aValue) { |
86 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._module(aValue._value.slice(0))); | 83 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._module(aValue._value.slice(0))); |
87 | }, | 84 | }, |
88 | 85 | ||
89 | //----------------------------------------------------------------------------- | 86 | //----------------------------------------------------------------------------- |
90 | 87 | ||
91 | '_add': function(a, b) { | 88 | '_add': function(a, b) { |
92 | return Clipperz.Crypto.ECC.BinaryField.Value._xor(a, b); | 89 | return Clipperz.Crypto.ECC.BinaryField.Value._xor(a, b); |
93 | }, | 90 | }, |
94 | 91 | ||
95 | '_overwriteAdd': function(a, b) { | 92 | '_overwriteAdd': function(a, b) { |
96 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(a, b); | 93 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(a, b); |
97 | }, | 94 | }, |
98 | 95 | ||
99 | 'add': function(a, b) { | 96 | 'add': function(a, b) { |
100 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._add(a._value, b._value)); | 97 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._add(a._value, b._value)); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //----------------------------------------------------------------------------- | 100 | //----------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'negate': function(aValue) { | 102 | 'negate': function(aValue) { |
106 | return aValue.clone(); | 103 | return aValue.clone(); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //----------------------------------------------------------------------------- | 106 | //----------------------------------------------------------------------------- |
110 | 107 | ||
111 | '_multiply': function(a, b) { | 108 | '_multiply': function(a, b) { |
112 | var result; | 109 | var result; |
113 | var valueToXor; | 110 | var valueToXor; |
114 | var i,c; | 111 | var i,c; |
115 | 112 | ||
116 | result = [0]; | 113 | result = [0]; |
117 | valueToXor = b; | 114 | valueToXor = b; |
118 | c = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(a); | 115 | c = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(a); |
119 | for (i=0; i<c; i++) { | 116 | for (i=0; i<c; i++) { |
120 | if (Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(a, i) === true) { | 117 | if (Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(a, i) === true) { |
121 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, valueToXor); | 118 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, valueToXor); |
122 | } | 119 | } |
123 | valueToXor = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(valueToXor, 1); | 120 | valueToXor = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(valueToXor, 1); |
124 | } | 121 | } |
125 | result = this._module(result); | 122 | result = this._module(result); |
126 | 123 | ||
127 | return result; | 124 | return result; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | 'multiply': function(a, b) { | 127 | 'multiply': function(a, b) { |
131 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._multiply(a._value, b._value)); | 128 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._multiply(a._value, b._value)); |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //----------------------------------------------------------------------------- | 131 | //----------------------------------------------------------------------------- |
135 | 132 | ||
136 | '_fastMultiply': function(a, b) { | 133 | '_fastMultiply': function(a, b) { |
137 | var result; | 134 | var result; |
138 | var B; | 135 | var B; |
139 | var i,c; | 136 | var i,c; |
140 | 137 | ||
141 | result = [0]; | 138 | result = [0]; |
142 | B = b.slice(0); //Is this array copy avoidable? | 139 | B = b.slice(0); //Is this array copy avoidable? |
143 | c = 32; | 140 | c = 32; |
144 | for (i=0; i<c; i++) { | 141 | for (i=0; i<c; i++) { |
145 | var ii, cc; | 142 | var ii, cc; |
146 | 143 | ||
147 | cc = a.length; | 144 | cc = a.length; |
148 | for (ii=0; ii<cc; ii++) { | 145 | for (ii=0; ii<cc; ii++) { |
149 | if (((a[ii] >>> i) & 0x01) == 1) { | 146 | if (((a[ii] >>> i) & 0x01) == 1) { |
150 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, B, ii); | 147 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, B, ii); |
151 | } | 148 | } |
152 | } | 149 | } |
153 | 150 | ||
154 | if (i < (c-1)) { | 151 | if (i < (c-1)) { |
155 | B = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(B, 1); | 152 | B = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(B, 1); |
156 | } | 153 | } |
157 | } | 154 | } |
158 | result = this._module(result); | 155 | result = this._module(result); |
159 | 156 | ||
160 | return result; | 157 | return result; |
161 | }, | 158 | }, |
162 | 159 | ||
163 | 'fastMultiply': function(a, b) { | 160 | 'fastMultiply': function(a, b) { |
164 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._fastMultiply(a._value, b._value)); | 161 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._fastMultiply(a._value, b._value)); |
165 | }, | 162 | }, |
166 | 163 | ||
167 | //----------------------------------------------------------------------------- | 164 | //----------------------------------------------------------------------------- |
168 | // | 165 | // |
169 | //Guide to Elliptic Curve Cryptography | 166 | //Guide to Elliptic Curve Cryptography |
170 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone | 167 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone |
171 | //- Pag: 49, Alorithm 2.34 | 168 | //- Pag: 49, Alorithm 2.34 |
172 | // | 169 | // |
173 | //----------------------------------------------------------------------------- | 170 | //----------------------------------------------------------------------------- |
174 | 171 | ||
175 | '_square': function(aValue) { | 172 | '_square': function(aValue) { |
176 | var result; | 173 | var result; |
177 | var value; | 174 | var value; |
178 | var c,i; | 175 | var c,i; |
179 | var precomputedValues; | 176 | var precomputedValues; |
180 | 177 | ||
181 | value = aValue; | 178 | value = aValue; |
182 | result = new Array(value.length * 2); | 179 | result = new Array(value.length * 2); |
183 | precomputedValues = Clipperz.Crypto.ECC.BinaryField.FiniteField.squarePrecomputedBytes; | 180 | precomputedValues = Clipperz.Crypto.ECC.BinaryField.FiniteField.squarePrecomputedBytes; |
184 | 181 | ||
185 | c = value.length; | 182 | c = value.length; |
186 | for (i=0; i<c; i++) { | 183 | for (i=0; i<c; i++) { |
187 | result[i*2] = precomputedValues[(value[i] & 0x000000ff)]; | 184 | result[i*2] = precomputedValues[(value[i] & 0x000000ff)]; |
188 | result[i*2] |= ((precomputedValues[(value[i] & 0x0000ff00) >>> 8]) << 16); | 185 | result[i*2] |= ((precomputedValues[(value[i] & 0x0000ff00) >>> 8]) << 16); |
189 | 186 | ||
190 | result[i*2 + 1] = precomputedValues[(value[i] & 0x00ff0000) >>> 16]; | 187 | result[i*2 + 1] = precomputedValues[(value[i] & 0x00ff0000) >>> 16]; |
191 | result[i*2 + 1] |= ((precomputedValues[(value[i] & 0xff000000) >>> 24]) << 16); | 188 | result[i*2 + 1] |= ((precomputedValues[(value[i] & 0xff000000) >>> 24]) << 16); |
192 | } | 189 | } |
193 | 190 | ||
194 | return this._module(result); | 191 | return this._module(result); |
195 | }, | 192 | }, |
196 | 193 | ||
197 | 'square': function(aValue) { | 194 | 'square': function(aValue) { |
198 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._square(aValue._value)); | 195 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._square(aValue._value)); |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //----------------------------------------------------------------------------- | 198 | //----------------------------------------------------------------------------- |
202 | 199 | ||
203 | '_inverse': function(aValue) { | 200 | '_inverse': function(aValue) { |
204 | varresult; | 201 | varresult; |
205 | var b, c; | 202 | var b, c; |
206 | var u, v; | 203 | var u, v; |
207 | 204 | ||
208 | // b = Clipperz.Crypto.ECC.BinaryField.Value.I._value; | 205 | // b = Clipperz.Crypto.ECC.BinaryField.Value.I._value; |
209 | b = [1]; | 206 | b = [1]; |
210 | // c = Clipperz.Crypto.ECC.BinaryField.Value.O._value; | 207 | // c = Clipperz.Crypto.ECC.BinaryField.Value.O._value; |
211 | c = [0]; | 208 | c = [0]; |
212 | u = this._module(aValue); | 209 | u = this._module(aValue); |
213 | v = this.modulus()._value.slice(0); | 210 | v = this.modulus()._value.slice(0); |
214 | 211 | ||
215 | while (Clipperz.Crypto.ECC.BinaryField.Value._bitSize(u) > 1) { | 212 | while (Clipperz.Crypto.ECC.BinaryField.Value._bitSize(u) > 1) { |
216 | varbitDifferenceSize; | 213 | varbitDifferenceSize; |
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js index b7a5537..ffe287b 100644 --- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js +++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js | |||
@@ -1,67 +1,64 @@ | |||
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 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; | 27 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; |
31 | //} | 28 | //} |
32 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } | 29 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } |
33 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } | 30 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } |
34 | 31 | ||
35 | Clipperz.Crypto.ECC.BinaryField.Point = function(args) { | 32 | Clipperz.Crypto.ECC.BinaryField.Point = function(args) { |
36 | args = args || {}; | 33 | args = args || {}; |
37 | this._x = args.x; | 34 | this._x = args.x; |
38 | this._y = args.y; | 35 | this._y = args.y; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, { | 40 | Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, { |
44 | 41 | ||
45 | 'asString': function() { | 42 | 'asString': function() { |
46 | return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")"; | 43 | return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //----------------------------------------------------------------------------- | 46 | //----------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'x': function() { | 48 | 'x': function() { |
52 | return this._x; | 49 | return this._x; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | 'y': function() { | 52 | 'y': function() { |
56 | return this._y; | 53 | return this._y; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //----------------------------------------------------------------------------- | 56 | //----------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'isZero': function() { | 58 | 'isZero': function() { |
62 | return (this.x().isZero() && this.y().isZero()) | 59 | return (this.x().isZero() && this.y().isZero()) |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //----------------------------------------------------------------------------- | 62 | //----------------------------------------------------------------------------- |
66 | __syntaxFix__: "syntax fix" | 63 | __syntaxFix__: "syntax fix" |
67 | }); | 64 | }); |
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js index 5a430d1..b705a20 100644 --- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js +++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | //try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; | 27 | //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; |
31 | //} | 28 | //} |
32 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
33 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } | 30 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } |
34 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } | 31 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } |
35 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } | 32 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } |
36 | 33 | ||
37 | Clipperz.Crypto.ECC.BinaryField.Value = function(aValue, aBase, aBitSize) { | 34 | Clipperz.Crypto.ECC.BinaryField.Value = function(aValue, aBase, aBitSize) { |
38 | if (aValue.constructor == String) { | 35 | if (aValue.constructor == String) { |
39 | varvalue; | 36 | varvalue; |
40 | varstringLength; | 37 | varstringLength; |
41 | var numberOfWords; | 38 | var numberOfWords; |
42 | vari,c; | 39 | vari,c; |
43 | 40 | ||
44 | if (aBase != 16) { | 41 | if (aBase != 16) { |
45 | throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase; | 42 | throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase; |
46 | } | 43 | } |
47 | 44 | ||
48 | value = aValue.replace(/ /g, ''); | 45 | value = aValue.replace(/ /g, ''); |
49 | stringLength = value.length; | 46 | stringLength = value.length; |
50 | numberOfWords = Math.ceil(stringLength / 8); | 47 | numberOfWords = Math.ceil(stringLength / 8); |
51 | this._value = new Array(numberOfWords); | 48 | this._value = new Array(numberOfWords); |
52 | 49 | ||
53 | c = numberOfWords; | 50 | c = numberOfWords; |
54 | for (i=0; i<c; i++) { | 51 | for (i=0; i<c; i++) { |
55 | varword; | 52 | varword; |
56 | 53 | ||
57 | if (i < (c-1)) { | 54 | if (i < (c-1)) { |
58 | word = parseInt(value.substr(stringLength-((i+1)*8), 8), 16); | 55 | word = parseInt(value.substr(stringLength-((i+1)*8), 8), 16); |
59 | } else { | 56 | } else { |
60 | word = parseInt(value.substr(0, stringLength-(i*8)), 16); | 57 | word = parseInt(value.substr(0, stringLength-(i*8)), 16); |
61 | } | 58 | } |
62 | 59 | ||
63 | this._value[i] = word; | 60 | this._value[i] = word; |
64 | } | 61 | } |
65 | } else if (aValue.constructor == Array) { | 62 | } else if (aValue.constructor == Array) { |
66 | var itemsToCopy; | 63 | var itemsToCopy; |
67 | 64 | ||
68 | itemsToCopy = aValue.length; | 65 | itemsToCopy = aValue.length; |
69 | while (aValue[itemsToCopy - 1] == 0) { | 66 | while (aValue[itemsToCopy - 1] == 0) { |
70 | itemsToCopy --; | 67 | itemsToCopy --; |
71 | } | 68 | } |
72 | 69 | ||
73 | this._value = aValue.slice(0, itemsToCopy); | 70 | this._value = aValue.slice(0, itemsToCopy); |
74 | } else if (aValue.constructor == Number) { | 71 | } else if (aValue.constructor == Number) { |
75 | this._value = [aValue]; | 72 | this._value = [aValue]; |
76 | } else { | 73 | } else { |
77 | // throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType; | 74 | // throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType; |
78 | } | 75 | } |
79 | 76 | ||
80 | this._bitSize == aBitSize || null; | 77 | this._bitSize == aBitSize || null; |
81 | 78 | ||
82 | return this; | 79 | return this; |
83 | } | 80 | } |
84 | 81 | ||
85 | Clipperz.Crypto.ECC.BinaryField.Value.prototype = MochiKit.Base.update(null, { | 82 | Clipperz.Crypto.ECC.BinaryField.Value.prototype = MochiKit.Base.update(null, { |
86 | 83 | ||
87 | 'value': function() { | 84 | 'value': function() { |
88 | return this._value; | 85 | return this._value; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //----------------------------------------------------------------------------- | 88 | //----------------------------------------------------------------------------- |
92 | 89 | ||
93 | 'wordSize': function() { | 90 | 'wordSize': function() { |
94 | return this._value.length | 91 | return this._value.length |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //----------------------------------------------------------------------------- | 94 | //----------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'clone': function() { | 96 | 'clone': function() { |
100 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._value.slice(0), null, this._bitSize); | 97 | return new Clipperz.Crypto.ECC.BinaryField.Value(this._value.slice(0), null, this._bitSize); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //----------------------------------------------------------------------------- | 100 | //----------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'isZero': function() { | 102 | 'isZero': function() { |
106 | return (this.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) == 0); | 103 | return (this.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) == 0); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //----------------------------------------------------------------------------- | 106 | //----------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'asString': function(aBase) { | 108 | 'asString': function(aBase) { |
112 | varresult; | 109 | varresult; |
113 | var i,c; | 110 | var i,c; |
114 | 111 | ||
115 | if (aBase != 16) { | 112 | if (aBase != 16) { |
116 | throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase; | 113 | throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase; |
117 | } | 114 | } |
118 | 115 | ||
119 | result = ""; | 116 | result = ""; |
120 | c = this.wordSize(); | 117 | c = this.wordSize(); |
121 | for (i=0; i<c; i++) { | 118 | for (i=0; i<c; i++) { |
122 | varwordAsString; | 119 | varwordAsString; |
123 | 120 | ||
124 | // wordAsString = ("00000000" + this.value()[i].toString(16)); | 121 | // wordAsString = ("00000000" + this.value()[i].toString(16)); |
125 | wordAsString = ("00000000" + this._value[i].toString(16)); | 122 | wordAsString = ("00000000" + this._value[i].toString(16)); |
126 | wordAsString = wordAsString.substring(wordAsString.length - 8); | 123 | wordAsString = wordAsString.substring(wordAsString.length - 8); |
127 | result = wordAsString + result; | 124 | result = wordAsString + result; |
128 | } | 125 | } |
129 | 126 | ||
130 | result = result.replace(/^(00)*/, ""); | 127 | result = result.replace(/^(00)*/, ""); |
131 | 128 | ||
132 | if (result == "") { | 129 | if (result == "") { |
133 | result = "0"; | 130 | result = "0"; |
134 | } | 131 | } |
135 | 132 | ||
136 | return result; | 133 | return result; |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //----------------------------------------------------------------------------- | 136 | //----------------------------------------------------------------------------- |
140 | 137 | ||
141 | 'shiftLeft': function(aNumberOfBitsToShift) { | 138 | 'shiftLeft': function(aNumberOfBitsToShift) { |
142 | //this method seems like it is never called. :-( | 139 | //this method seems like it is never called. :-( |
143 | return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this._value, aNumberOfBitsToShift)); | 140 | return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this._value, aNumberOfBitsToShift)); |
144 | }, | 141 | }, |
145 | 142 | ||
146 | //----------------------------------------------------------------------------- | 143 | //----------------------------------------------------------------------------- |
147 | 144 | ||
148 | 'bitSize': function() { | 145 | 'bitSize': function() { |
149 | if (this._bitSize == null) { | 146 | if (this._bitSize == null) { |
150 | this._bitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(this._value); | 147 | this._bitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(this._value); |
151 | } | 148 | } |
152 | 149 | ||
153 | return this._bitSize; | 150 | return this._bitSize; |
154 | }, | 151 | }, |
155 | 152 | ||
156 | //----------------------------------------------------------------------------- | 153 | //----------------------------------------------------------------------------- |
157 | 154 | ||
158 | 'isBitSet': function(aBitPosition) { | 155 | 'isBitSet': function(aBitPosition) { |
159 | return Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(this._value, aBitPosition); | 156 | return Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(this._value, aBitPosition); |
160 | }, | 157 | }, |
161 | 158 | ||
162 | //----------------------------------------------------------------------------- | 159 | //----------------------------------------------------------------------------- |
163 | 160 | ||
164 | 'xor': function(aValue) { | 161 | 'xor': function(aValue) { |
165 | return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._xor(this._value, aValue._value)); | 162 | return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._xor(this._value, aValue._value)); |
166 | }, | 163 | }, |
167 | 164 | ||
168 | //----------------------------------------------------------------------------- | 165 | //----------------------------------------------------------------------------- |
169 | 166 | ||
170 | 'compare': function(aValue) { | 167 | 'compare': function(aValue) { |
171 | return Clipperz.Crypto.ECC.BinaryField.Value._compare(this._value, aValue._value); | 168 | return Clipperz.Crypto.ECC.BinaryField.Value._compare(this._value, aValue._value); |
172 | }, | 169 | }, |
173 | 170 | ||
174 | //----------------------------------------------------------------------------- | 171 | //----------------------------------------------------------------------------- |
175 | __syntaxFix__: "syntax fix" | 172 | __syntaxFix__: "syntax fix" |
176 | }); | 173 | }); |
177 | 174 | ||
178 | Clipperz.Crypto.ECC.BinaryField.Value.O = new Clipperz.Crypto.ECC.BinaryField.Value('0', 16); | 175 | Clipperz.Crypto.ECC.BinaryField.Value.O = new Clipperz.Crypto.ECC.BinaryField.Value('0', 16); |
179 | Clipperz.Crypto.ECC.BinaryField.Value.I = new Clipperz.Crypto.ECC.BinaryField.Value('1', 16); | 176 | Clipperz.Crypto.ECC.BinaryField.Value.I = new Clipperz.Crypto.ECC.BinaryField.Value('1', 16); |
180 | 177 | ||
181 | Clipperz.Crypto.ECC.BinaryField.Value._xor = function(a, b, aFirstItemOffset) { | 178 | Clipperz.Crypto.ECC.BinaryField.Value._xor = function(a, b, aFirstItemOffset) { |
182 | var result; | 179 | var result; |
183 | var resultSize; | 180 | var resultSize; |
184 | var i,c; | 181 | var i,c; |
185 | var firstItemOffset; | 182 | var firstItemOffset; |
186 | 183 | ||
187 | firstItemOffset = aFirstItemOffset || 0; | 184 | firstItemOffset = aFirstItemOffset || 0; |
188 | resultSize = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset; | 185 | resultSize = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset; |
189 | 186 | ||
190 | result = new Array(resultSize); | 187 | result = new Array(resultSize); |
191 | 188 | ||
192 | c = firstItemOffset; | 189 | c = firstItemOffset; |
193 | for (i=0; i<c; i++) { | 190 | for (i=0; i<c; i++) { |
194 | result[i] = a[i]; | 191 | result[i] = a[i]; |
195 | } | 192 | } |
196 | 193 | ||
197 | c = resultSize; | 194 | c = resultSize; |
198 | for (i=firstItemOffset; i<c; i++) { | 195 | for (i=firstItemOffset; i<c; i++) { |
199 | result[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0); | 196 | result[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0); |
200 | } | 197 | } |
201 | 198 | ||
202 | return result; | 199 | return result; |
203 | }; | 200 | }; |
204 | 201 | ||
205 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor = function(a, b, aFirstItemOffset) { | 202 | Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor = function(a, b, aFirstItemOffset) { |
206 | var i,c; | 203 | var i,c; |
207 | var firstItemOffset; | 204 | var firstItemOffset; |
208 | 205 | ||
209 | firstItemOffset = aFirstItemOffset || 0; | 206 | firstItemOffset = aFirstItemOffset || 0; |
210 | 207 | ||
211 | c = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset; | 208 | c = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset; |
212 | for (i=firstItemOffset; i<c; i++) { | 209 | for (i=firstItemOffset; i<c; i++) { |
213 | a[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0); | 210 | a[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0); |
214 | } | 211 | } |
215 | }; | 212 | }; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js index ae2b8fb..be197e3 100644 --- a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js +++ b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //try { if (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) == 'undefined') { throw ""; }} catch (e) { | 26 | //try { if (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) == 'undefined') { throw ""; }} catch (e) { |
30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.BinaryField.Curve!"; | 27 | //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.BinaryField.Curve!"; |
31 | //} | 28 | //} |
32 | //try { if (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) == 'undefined') { throw ""; }} catch (e) { | 29 | //try { if (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) == 'undefined') { throw ""; }} catch (e) { |
33 | //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.Koblitz.Curve!"; | 30 | //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.Koblitz.Curve!"; |
34 | //} | 31 | //} |
35 | 32 | ||
36 | Clipperz.Crypto.ECC.StandardCurves = {}; | 33 | Clipperz.Crypto.ECC.StandardCurves = {}; |
37 | 34 | ||
38 | MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, { | 35 | MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, { |
39 | 36 | ||
40 | //============================================================================== | 37 | //============================================================================== |
41 | 38 | ||
42 | '_K571': null, | 39 | '_K571': null, |
43 | 'K571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1 | 40 | 'K571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1 |
44 | if ((Clipperz.Crypto.ECC.StandardCurves._K571 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) { | 41 | if ((Clipperz.Crypto.ECC.StandardCurves._K571 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) { |
45 | Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.Koblitz.Curve({ | 42 | Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.Koblitz.Curve({ |
46 | modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16), | 43 | modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16), |
47 | a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16), | 44 | a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16), |
48 | b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16), | 45 | b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16), |
49 | G: new Clipperz.Crypto.ECC.Koblitz.Point({ | 46 | G: new Clipperz.Crypto.ECC.Koblitz.Point({ |
50 | x: new Clipperz.Crypto.ECC.Koblitz.Value('026eb7a8 59923fbc 82189631 f8103fe4 ac9ca297 0012d5d4 60248048 01841ca4 43709584 93b205e6 47da304d b4ceb08c bbd1ba39 494776fb 988b4717 4dca88c7 e2945283 a01c8972', 16), | 47 | x: new Clipperz.Crypto.ECC.Koblitz.Value('026eb7a8 59923fbc 82189631 f8103fe4 ac9ca297 0012d5d4 60248048 01841ca4 43709584 93b205e6 47da304d b4ceb08c bbd1ba39 494776fb 988b4717 4dca88c7 e2945283 a01c8972', 16), |
51 | y: new Clipperz.Crypto.ECC.Koblitz.Value('0349dc80 7f4fbf37 4f4aeade 3bca9531 4dd58cec 9f307a54 ffc61efc 006d8a2c 9d4979c0 ac44aea7 4fbebbb9 f772aedc b620b01a 7ba7af1b 320430c8 591984f6 01cd4c14 3ef1c7a3', 16) | 48 | y: new Clipperz.Crypto.ECC.Koblitz.Value('0349dc80 7f4fbf37 4f4aeade 3bca9531 4dd58cec 9f307a54 ffc61efc 006d8a2c 9d4979c0 ac44aea7 4fbebbb9 f772aedc b620b01a 7ba7af1b 320430c8 591984f6 01cd4c14 3ef1c7a3', 16) |
52 | }), | 49 | }), |
53 | r: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16), | 50 | r: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16), |
54 | h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16), | 51 | h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16), |
55 | primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16) | 52 | primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16) |
56 | }); | 53 | }); |
57 | } | 54 | } |
58 | 55 | ||
59 | return Clipperz.Crypto.ECC.StandardCurves._K571; | 56 | return Clipperz.Crypto.ECC.StandardCurves._K571; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //----------------------------------------------------------------------------- | 59 | //----------------------------------------------------------------------------- |
63 | 60 | ||
64 | '_K283': null, | 61 | '_K283': null, |
65 | 'K283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 | 62 | 'K283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 |
66 | if ((Clipperz.Crypto.ECC.StandardCurves._K283 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) { | 63 | if ((Clipperz.Crypto.ECC.StandardCurves._K283 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) { |
67 | Clipperz.Crypto.ECC.StandardCurves._K283 = new Clipperz.Crypto.ECC.Koblitz.Curve({ | 64 | Clipperz.Crypto.ECC.StandardCurves._K283 = new Clipperz.Crypto.ECC.Koblitz.Curve({ |
68 | modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), | 65 | modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), |
69 | a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16), | 66 | a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16), |
70 | b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16), | 67 | b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16), |
71 | G: new Clipperz.Crypto.ECC.Koblitz.Point({ | 68 | G: new Clipperz.Crypto.ECC.Koblitz.Point({ |
72 | x: new Clipperz.Crypto.ECC.Koblitz.Value('0503213f 78ca4488 3f1a3b81 62f188e5 53cd265f 23c1567a 16876913 b0c2ac24 58492836', 16), | 69 | x: new Clipperz.Crypto.ECC.Koblitz.Value('0503213f 78ca4488 3f1a3b81 62f188e5 53cd265f 23c1567a 16876913 b0c2ac24 58492836', 16), |
73 | y: new Clipperz.Crypto.ECC.Koblitz.Value('01ccda38 0f1c9e31 8d90f95d 07e5426f e87e45c0 e8184698 e4596236 4e341161 77dd2259', 16) | 70 | y: new Clipperz.Crypto.ECC.Koblitz.Value('01ccda38 0f1c9e31 8d90f95d 07e5426f e87e45c0 e8184698 e4596236 4e341161 77dd2259', 16) |
74 | }), | 71 | }), |
75 | r: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16), | 72 | r: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16), |
76 | h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16), | 73 | h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16), |
77 | primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16) | 74 | primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16) |
78 | }); | 75 | }); |
79 | } | 76 | } |
80 | 77 | ||
81 | return Clipperz.Crypto.ECC.StandardCurves._K283; | 78 | return Clipperz.Crypto.ECC.StandardCurves._K283; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | //============================================================================== | 81 | //============================================================================== |
85 | 82 | ||
86 | '_B571': null, | 83 | '_B571': null, |
87 | 'B571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1 | 84 | 'B571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1 |
88 | if ((Clipperz.Crypto.ECC.StandardCurves._B571 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) { | 85 | if ((Clipperz.Crypto.ECC.StandardCurves._B571 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) { |
89 | Clipperz.Crypto.ECC.StandardCurves._B571 = new Clipperz.Crypto.ECC.BinaryField.Curve({ | 86 | Clipperz.Crypto.ECC.StandardCurves._B571 = new Clipperz.Crypto.ECC.BinaryField.Curve({ |
90 | modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16), | 87 | modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16), |
91 | a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), | 88 | a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), |
92 | b: new Clipperz.Crypto.ECC.BinaryField.Value('02f40e7e 2221f295 de297117 b7f3d62f 5c6a97ff cb8ceff1 cd6ba8ce 4a9a18ad 84ffabbd 8efa5933 2be7ad67 56a66e29 4afd185a 78ff12aa 520e4de7 39baca0c 7ffeff7f 2955727a', 16), | 89 | b: new Clipperz.Crypto.ECC.BinaryField.Value('02f40e7e 2221f295 de297117 b7f3d62f 5c6a97ff cb8ceff1 cd6ba8ce 4a9a18ad 84ffabbd 8efa5933 2be7ad67 56a66e29 4afd185a 78ff12aa 520e4de7 39baca0c 7ffeff7f 2955727a', 16), |
93 | G: new Clipperz.Crypto.ECC.BinaryField.Point({ | 90 | G: new Clipperz.Crypto.ECC.BinaryField.Point({ |
94 | x: new Clipperz.Crypto.ECC.BinaryField.Value('0303001d 34b85629 6c16c0d4 0d3cd775 0a93d1d2 955fa80a a5f40fc8 db7b2abd bde53950 f4c0d293 cdd711a3 5b67fb14 99ae6003 8614f139 4abfa3b4 c850d927 e1e7769c 8eec2d19', 16), | 91 | x: new Clipperz.Crypto.ECC.BinaryField.Value('0303001d 34b85629 6c16c0d4 0d3cd775 0a93d1d2 955fa80a a5f40fc8 db7b2abd bde53950 f4c0d293 cdd711a3 5b67fb14 99ae6003 8614f139 4abfa3b4 c850d927 e1e7769c 8eec2d19', 16), |
95 | y: new Clipperz.Crypto.ECC.BinaryField.Value('037bf273 42da639b 6dccfffe b73d69d7 8c6c27a6 009cbbca 1980f853 3921e8a6 84423e43 bab08a57 6291af8f 461bb2a8 b3531d2f 0485c19b 16e2f151 6e23dd3c 1a4827af 1b8ac15b', 16) | 92 | y: new Clipperz.Crypto.ECC.BinaryField.Value('037bf273 42da639b 6dccfffe b73d69d7 8c6c27a6 009cbbca 1980f853 3921e8a6 84423e43 bab08a57 6291af8f 461bb2a8 b3531d2f 0485c19b 16e2f151 6e23dd3c 1a4827af 1b8ac15b', 16) |
96 | }), | 93 | }), |
97 | r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff e661ce18 ff559873 08059b18 6823851e c7dd9ca1 161de93d 5174d66e 8382e9bb 2fe84e47', 16), | 94 | r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff e661ce18 ff559873 08059b18 6823851e c7dd9ca1 161de93d 5174d66e 8382e9bb 2fe84e47', 16), |
98 | h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) | 95 | h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) |
99 | 96 | ||
100 | // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10), | 97 | // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10), |
101 | // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16) | 98 | // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16) |
102 | }); | 99 | }); |
103 | 100 | ||
104 | //----------------------------------------------------------------------------- | 101 | //----------------------------------------------------------------------------- |
105 | // | 102 | // |
106 | //Guide to Elliptic Curve Cryptography | 103 | //Guide to Elliptic Curve Cryptography |
107 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone | 104 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone |
108 | //- Pag: 56, Alorithm 2.45 (with a typo!!!) | 105 | //- Pag: 56, Alorithm 2.45 (with a typo!!!) |
109 | // | 106 | // |
110 | //----------------------------------------------------------------------------- | 107 | //----------------------------------------------------------------------------- |
111 | // | 108 | // |
112 | // http://www.milw0rm.com/papers/136 | 109 | // http://www.milw0rm.com/papers/136 |
113 | // | 110 | // |
114 | // ------------------------------------------------------------------------- | 111 | // ------------------------------------------------------------------------- |
115 | // Polynomial Reduction Algorithm Modulo f571 | 112 | // Polynomial Reduction Algorithm Modulo f571 |
116 | // ------------------------------------------------------------------------- | 113 | // ------------------------------------------------------------------------- |
117 | // | 114 | // |
118 | // Input: Polynomial p(x) of degree 1140 or less, stored as | 115 | // Input: Polynomial p(x) of degree 1140 or less, stored as |
119 | // an array of 2T machinewords. | 116 | // an array of 2T machinewords. |
120 | // Output: p(x) mod f571(x) | 117 | // Output: p(x) mod f571(x) |
121 | // | 118 | // |
122 | // FOR i = T-1, ..., 0 DO | 119 | // FOR i = T-1, ..., 0 DO |
123 | // SET X := P[i+T] | 120 | // SET X := P[i+T] |
124 | // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15) | 121 | // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15) |
125 | // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27) | 122 | // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27) |
126 | // | 123 | // |
127 | // SET X := P[T-1] >> 27 | 124 | // SET X := P[T-1] >> 27 |
128 | // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10) | 125 | // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10) |
129 | // P[T-1] := P[T-1] & 0x07ffffff | 126 | // P[T-1] := P[T-1] & 0x07ffffff |
130 | // | 127 | // |
131 | // RETURN P[T-1],...,P[0] | 128 | // RETURN P[T-1],...,P[0] |
132 | // | 129 | // |
133 | // ------------------------------------------------------------------------- | 130 | // ------------------------------------------------------------------------- |
134 | // | 131 | // |
135 | Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module; | 132 | Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module; |
136 | Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) { | 133 | Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) { |
137 | varresult; | 134 | varresult; |
138 | 135 | ||
139 | if (aValue.bitSize() > 1140) { | 136 | if (aValue.bitSize() > 1140) { |
140 | MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); | 137 | MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); |
141 | result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); | 138 | result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); |
142 | } else { | 139 | } else { |
143 | varC, T; | 140 | varC, T; |
144 | var i; | 141 | var i; |
145 | 142 | ||
146 | //console.log(">>> binaryField.finiteField.(improved)module"); | 143 | //console.log(">>> binaryField.finiteField.(improved)module"); |
147 | // C = aValue.value().slice(0); | 144 | // C = aValue.value().slice(0); |
148 | C = aValue._value.slice(0); | 145 | C = aValue._value.slice(0); |
149 | for (i=35; i>=18; i--) { | 146 | for (i=35; i>=18; i--) { |
150 | T = C[i]; | 147 | T = C[i]; |
151 | C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0); | 148 | C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0); |
152 | C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0); | 149 | C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0); |
153 | } | 150 | } |
154 | T = (C[17] >>> 27); | 151 | T = (C[17] >>> 27); |
155 | C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0); | 152 | C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0); |
156 | C[17] = (C[17] & 0x07ffffff); | 153 | C[17] = (C[17] & 0x07ffffff); |
157 | 154 | ||
158 | for(i=18; i<=35; i++) { | 155 | for(i=18; i<=35; i++) { |
159 | C[i] = 0; | 156 | C[i] = 0; |
160 | } | 157 | } |
161 | 158 | ||
162 | result = new Clipperz.Crypto.ECC.BinaryField.Value(C); | 159 | result = new Clipperz.Crypto.ECC.BinaryField.Value(C); |
163 | //console.log("<<< binaryField.finiteField.(improved)module"); | 160 | //console.log("<<< binaryField.finiteField.(improved)module"); |
164 | } | 161 | } |
165 | 162 | ||
166 | return result; | 163 | return result; |
167 | }; | 164 | }; |
168 | } | 165 | } |
169 | 166 | ||
170 | return Clipperz.Crypto.ECC.StandardCurves._B571; | 167 | return Clipperz.Crypto.ECC.StandardCurves._B571; |
171 | }, | 168 | }, |
172 | 169 | ||
173 | //----------------------------------------------------------------------------- | 170 | //----------------------------------------------------------------------------- |
174 | 171 | ||
175 | '_B283': null, | 172 | '_B283': null, |
176 | 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 | 173 | 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 |
177 | if ((Clipperz.Crypto.ECC.StandardCurves._B283 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) { | 174 | if ((Clipperz.Crypto.ECC.StandardCurves._B283 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) { |
178 | Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({ | 175 | Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({ |
179 | modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), | 176 | modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), |
180 | a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), | 177 | a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), |
181 | b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16), | 178 | b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16), |
182 | G: new Clipperz.Crypto.ECC.BinaryField.Point({ | 179 | G: new Clipperz.Crypto.ECC.BinaryField.Point({ |
183 | x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16), | 180 | x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16), |
184 | y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16) | 181 | y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16) |
185 | }), | 182 | }), |
186 | r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16), | 183 | r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16), |
187 | h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) | 184 | h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) |
188 | }); | 185 | }); |
189 | 186 | ||
190 | //----------------------------------------------------------------------------- | 187 | //----------------------------------------------------------------------------- |
191 | // | 188 | // |
192 | //Guide to Elliptic Curve Cryptography | 189 | //Guide to Elliptic Curve Cryptography |
193 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone | 190 | //Darrel Hankerson, Alfred Menezes, Scott Vanstone |
194 | //- Pag: 56, Alorithm 2.43 | 191 | //- Pag: 56, Alorithm 2.43 |
195 | // | 192 | // |
196 | //----------------------------------------------------------------------------- | 193 | //----------------------------------------------------------------------------- |
197 | Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module; | 194 | Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module; |
198 | Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) { | 195 | Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) { |
199 | varresult; | 196 | varresult; |
200 | 197 | ||
201 | if (aValue.bitSize() > 564) { | 198 | if (aValue.bitSize() > 564) { |
202 | MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); | 199 | MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); |
203 | result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); | 200 | result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); |
204 | } else { | 201 | } else { |
205 | varC, T; | 202 | varC, T; |
206 | var i; | 203 | var i; |
207 | 204 | ||
208 | //console.log(">>> binaryField.finiteField.(improved)module"); | 205 | //console.log(">>> binaryField.finiteField.(improved)module"); |
209 | C = aValue._value.slice(0); | 206 | C = aValue._value.slice(0); |
210 | for (i=17; i>=9; i--) { | 207 | for (i=17; i>=9; i--) { |
211 | T = C[i]; | 208 | T = C[i]; |
212 | C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0); | 209 | C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0); |
213 | C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0); | 210 | C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0); |
214 | } | 211 | } |
215 | T = (C[8] >>> 27); | 212 | T = (C[8] >>> 27); |
216 | C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0); | 213 | C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0); |
diff --git a/frontend/gamma/js/Clipperz/Crypto/PRNG.js b/frontend/gamma/js/Clipperz/Crypto/PRNG.js index 266b909..adfdb16 100644 --- a/frontend/gamma/js/Clipperz/Crypto/PRNG.js +++ b/frontend/gamma/js/Clipperz/Crypto/PRNG.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; | 27 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | try { if (typeof(Clipperz.Crypto.SHA) == 'undefined') { throw ""; }} catch (e) { | 30 | try { if (typeof(Clipperz.Crypto.SHA) == 'undefined') { throw ""; }} catch (e) { |
34 | throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.SHA!"; | 31 | throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.SHA!"; |
35 | } | 32 | } |
36 | 33 | ||
37 | try { if (typeof(Clipperz.Crypto.AES) == 'undefined') { throw ""; }} catch (e) { | 34 | try { if (typeof(Clipperz.Crypto.AES) == 'undefined') { throw ""; }} catch (e) { |
38 | throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.AES!"; | 35 | throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.AES!"; |
39 | } | 36 | } |
40 | 37 | ||
41 | if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { Clipperz.Crypto.PRNG = {}; } | 38 | if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { Clipperz.Crypto.PRNG = {}; } |
42 | 39 | ||
43 | //############################################################################# | 40 | //############################################################################# |
44 | 41 | ||
45 | Clipperz.Crypto.PRNG.EntropyAccumulator = function(args) { | 42 | Clipperz.Crypto.PRNG.EntropyAccumulator = function(args) { |
46 | args = args || {}; | 43 | args = args || {}; |
47 | //MochiKit.Base.bindMethods(this); | 44 | //MochiKit.Base.bindMethods(this); |
48 | 45 | ||
49 | this._stack = new Clipperz.ByteArray(); | 46 | this._stack = new Clipperz.ByteArray(); |
50 | this._maxStackLengthBeforeHashing = args.maxStackLengthBeforeHashing || 256; | 47 | this._maxStackLengthBeforeHashing = args.maxStackLengthBeforeHashing || 256; |
51 | return this; | 48 | return this; |
52 | } | 49 | } |
53 | 50 | ||
54 | Clipperz.Crypto.PRNG.EntropyAccumulator.prototype = MochiKit.Base.update(null, { | 51 | Clipperz.Crypto.PRNG.EntropyAccumulator.prototype = MochiKit.Base.update(null, { |
55 | 52 | ||
56 | 'toString': function() { | 53 | 'toString': function() { |
57 | return "Clipperz.Crypto.PRNG.EntropyAccumulator"; | 54 | return "Clipperz.Crypto.PRNG.EntropyAccumulator"; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'stack': function() { | 59 | 'stack': function() { |
63 | return this._stack; | 60 | return this._stack; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | 'setStack': function(aValue) { | 63 | 'setStack': function(aValue) { |
67 | this._stack = aValue; | 64 | this._stack = aValue; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | 'resetStack': function() { | 67 | 'resetStack': function() { |
71 | this.stack().reset(); | 68 | this.stack().reset(); |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'maxStackLengthBeforeHashing': function() { | 71 | 'maxStackLengthBeforeHashing': function() { |
75 | return this._maxStackLengthBeforeHashing; | 72 | return this._maxStackLengthBeforeHashing; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'addRandomByte': function(aValue) { | 77 | 'addRandomByte': function(aValue) { |
81 | this.stack().appendByte(aValue); | 78 | this.stack().appendByte(aValue); |
82 | 79 | ||
83 | if (this.stack().length() > this.maxStackLengthBeforeHashing()) { | 80 | if (this.stack().length() > this.maxStackLengthBeforeHashing()) { |
84 | this.setStack(Clipperz.Crypto.SHA.sha_d256(this.stack())); | 81 | this.setStack(Clipperz.Crypto.SHA.sha_d256(this.stack())); |
85 | } | 82 | } |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | __syntaxFix__: "syntax fix" | 86 | __syntaxFix__: "syntax fix" |
90 | }); | 87 | }); |
91 | 88 | ||
92 | //############################################################################# | 89 | //############################################################################# |
93 | 90 | ||
94 | Clipperz.Crypto.PRNG.RandomnessSource = function(args) { | 91 | Clipperz.Crypto.PRNG.RandomnessSource = function(args) { |
95 | args = args || {}; | 92 | args = args || {}; |
96 | MochiKit.Base.bindMethods(this); | 93 | MochiKit.Base.bindMethods(this); |
97 | 94 | ||
98 | this._generator = args.generator || null; | 95 | this._generator = args.generator || null; |
99 | this._sourceId = args.sourceId || null; | 96 | this._sourceId = args.sourceId || null; |
100 | this._boostMode = args.boostMode || false; | 97 | this._boostMode = args.boostMode || false; |
101 | 98 | ||
102 | this._nextPoolIndex = 0; | 99 | this._nextPoolIndex = 0; |
103 | 100 | ||
104 | return this; | 101 | return this; |
105 | } | 102 | } |
106 | 103 | ||
107 | Clipperz.Crypto.PRNG.RandomnessSource.prototype = MochiKit.Base.update(null, { | 104 | Clipperz.Crypto.PRNG.RandomnessSource.prototype = MochiKit.Base.update(null, { |
108 | 105 | ||
109 | 'generator': function() { | 106 | 'generator': function() { |
110 | return this._generator; | 107 | return this._generator; |
111 | }, | 108 | }, |
112 | 109 | ||
113 | 'setGenerator': function(aValue) { | 110 | 'setGenerator': function(aValue) { |
114 | this._generator = aValue; | 111 | this._generator = aValue; |
115 | }, | 112 | }, |
116 | 113 | ||
117 | //------------------------------------------------------------------------- | 114 | //------------------------------------------------------------------------- |
118 | 115 | ||
119 | 'boostMode': function() { | 116 | 'boostMode': function() { |
120 | return this._boostMode; | 117 | return this._boostMode; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | 'setBoostMode': function(aValue) { | 120 | 'setBoostMode': function(aValue) { |
124 | this._boostMode = aValue; | 121 | this._boostMode = aValue; |
125 | }, | 122 | }, |
126 | 123 | ||
127 | //------------------------------------------------------------------------- | 124 | //------------------------------------------------------------------------- |
128 | 125 | ||
129 | 'sourceId': function() { | 126 | 'sourceId': function() { |
130 | return this._sourceId; | 127 | return this._sourceId; |
131 | }, | 128 | }, |
132 | 129 | ||
133 | 'setSourceId': function(aValue) { | 130 | 'setSourceId': function(aValue) { |
134 | this._sourceId = aValue; | 131 | this._sourceId = aValue; |
135 | }, | 132 | }, |
136 | 133 | ||
137 | //------------------------------------------------------------------------- | 134 | //------------------------------------------------------------------------- |
138 | 135 | ||
139 | 'nextPoolIndex': function() { | 136 | 'nextPoolIndex': function() { |
140 | return this._nextPoolIndex; | 137 | return this._nextPoolIndex; |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'incrementNextPoolIndex': function() { | 140 | 'incrementNextPoolIndex': function() { |
144 | this._nextPoolIndex = ((this._nextPoolIndex + 1) % this.generator().numberOfEntropyAccumulators()); | 141 | this._nextPoolIndex = ((this._nextPoolIndex + 1) % this.generator().numberOfEntropyAccumulators()); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | //------------------------------------------------------------------------- | 144 | //------------------------------------------------------------------------- |
148 | 145 | ||
149 | 'updateGeneratorWithValue': function(aRandomValue) { | 146 | 'updateGeneratorWithValue': function(aRandomValue) { |
150 | if (this.generator() != null) { | 147 | if (this.generator() != null) { |
151 | this.generator().addRandomByte(this.sourceId(), this.nextPoolIndex(), aRandomValue); | 148 | this.generator().addRandomByte(this.sourceId(), this.nextPoolIndex(), aRandomValue); |
152 | this.incrementNextPoolIndex(); | 149 | this.incrementNextPoolIndex(); |
153 | } | 150 | } |
154 | }, | 151 | }, |
155 | 152 | ||
156 | //------------------------------------------------------------------------- | 153 | //------------------------------------------------------------------------- |
157 | __syntaxFix__: "syntax fix" | 154 | __syntaxFix__: "syntax fix" |
158 | }); | 155 | }); |
159 | 156 | ||
160 | //############################################################################# | 157 | //############################################################################# |
161 | 158 | ||
162 | Clipperz.Crypto.PRNG.TimeRandomnessSource = function(args) { | 159 | Clipperz.Crypto.PRNG.TimeRandomnessSource = function(args) { |
163 | args = args || {}; | 160 | args = args || {}; |
164 | //MochiKit.Base.bindMethods(this); | 161 | //MochiKit.Base.bindMethods(this); |
165 | 162 | ||
166 | this._intervalTime = args.intervalTime || 1000; | 163 | this._intervalTime = args.intervalTime || 1000; |
167 | 164 | ||
168 | Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); | 165 | Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); |
169 | 166 | ||
170 | this.collectEntropy(); | 167 | this.collectEntropy(); |
171 | return this; | 168 | return this; |
172 | } | 169 | } |
173 | 170 | ||
174 | Clipperz.Crypto.PRNG.TimeRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { | 171 | Clipperz.Crypto.PRNG.TimeRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { |
175 | 172 | ||
176 | 'intervalTime': function() { | 173 | 'intervalTime': function() { |
177 | return this._intervalTime; | 174 | return this._intervalTime; |
178 | }, | 175 | }, |
179 | 176 | ||
180 | //------------------------------------------------------------------------- | 177 | //------------------------------------------------------------------------- |
181 | 178 | ||
182 | 'collectEntropy': function() { | 179 | 'collectEntropy': function() { |
183 | varnow; | 180 | varnow; |
184 | varentropyByte; | 181 | varentropyByte; |
185 | var intervalTime; | 182 | var intervalTime; |
186 | now = new Date(); | 183 | now = new Date(); |
187 | entropyByte = (now.getTime() & 0xff); | 184 | entropyByte = (now.getTime() & 0xff); |
188 | 185 | ||
189 | intervalTime = this.intervalTime(); | 186 | intervalTime = this.intervalTime(); |
190 | if (this.boostMode() == true) { | 187 | if (this.boostMode() == true) { |
191 | intervalTime = intervalTime / 9; | 188 | intervalTime = intervalTime / 9; |
192 | } | 189 | } |
193 | 190 | ||
194 | this.updateGeneratorWithValue(entropyByte); | 191 | this.updateGeneratorWithValue(entropyByte); |
195 | setTimeout(this.collectEntropy, intervalTime); | 192 | setTimeout(this.collectEntropy, intervalTime); |
196 | }, | 193 | }, |
197 | 194 | ||
198 | //------------------------------------------------------------------------- | 195 | //------------------------------------------------------------------------- |
199 | 196 | ||
200 | 'numberOfRandomBits': function() { | 197 | 'numberOfRandomBits': function() { |
201 | return 5; | 198 | return 5; |
202 | }, | 199 | }, |
203 | 200 | ||
204 | //------------------------------------------------------------------------- | 201 | //------------------------------------------------------------------------- |
205 | 202 | ||
206 | 'pollingFrequency': function() { | 203 | 'pollingFrequency': function() { |
207 | return 10; | 204 | return 10; |
208 | }, | 205 | }, |
209 | 206 | ||
210 | //------------------------------------------------------------------------- | 207 | //------------------------------------------------------------------------- |
211 | __syntaxFix__: "syntax fix" | 208 | __syntaxFix__: "syntax fix" |
212 | }); | 209 | }); |
213 | 210 | ||
214 | //***************************************************************************** | 211 | //***************************************************************************** |
215 | 212 | ||
216 | Clipperz.Crypto.PRNG.MouseRandomnessSource = function(args) { | 213 | Clipperz.Crypto.PRNG.MouseRandomnessSource = function(args) { |
diff --git a/frontend/gamma/js/Clipperz/Crypto/RSA.js b/frontend/gamma/js/Clipperz/Crypto/RSA.js index 4dad8f7..6844dba 100644 --- a/frontend/gamma/js/Clipperz/Crypto/RSA.js +++ b/frontend/gamma/js/Clipperz/Crypto/RSA.js | |||
@@ -1,151 +1,148 @@ | |||
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 | try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.RSA depends on Clipperz.Crypto.BigInt!"; | 27 | throw "Clipperz.Crypto.RSA depends on Clipperz.Crypto.BigInt!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.Crypto.RSA) == 'undefined') { Clipperz.Crypto.RSA = {}; } | 30 | if (typeof(Clipperz.Crypto.RSA) == 'undefined') { Clipperz.Crypto.RSA = {}; } |
34 | 31 | ||
35 | Clipperz.Crypto.RSA.VERSION = "0.1"; | 32 | Clipperz.Crypto.RSA.VERSION = "0.1"; |
36 | Clipperz.Crypto.RSA.NAME = "Clipperz.RSA"; | 33 | Clipperz.Crypto.RSA.NAME = "Clipperz.RSA"; |
37 | 34 | ||
38 | //############################################################################# | 35 | //############################################################################# |
39 | 36 | ||
40 | MochiKit.Base.update(Clipperz.Crypto.RSA, { | 37 | MochiKit.Base.update(Clipperz.Crypto.RSA, { |
41 | 38 | ||
42 | //------------------------------------------------------------------------- | 39 | //------------------------------------------------------------------------- |
43 | 40 | ||
44 | 'publicKeyWithValues': function (e, d, n) { | 41 | 'publicKeyWithValues': function (e, d, n) { |
45 | varresult; | 42 | varresult; |
46 | 43 | ||
47 | result = {}; | 44 | result = {}; |
48 | 45 | ||
49 | if (e.isBigInt) { | 46 | if (e.isBigInt) { |
50 | result.e = e; | 47 | result.e = e; |
51 | } else { | 48 | } else { |
52 | result.e = new Clipperz.Crypto.BigInt(e, 16); | 49 | result.e = new Clipperz.Crypto.BigInt(e, 16); |
53 | } | 50 | } |
54 | 51 | ||
55 | if (d.isBigInt) { | 52 | if (d.isBigInt) { |
56 | result.d = d; | 53 | result.d = d; |
57 | } else { | 54 | } else { |
58 | result.d = new Clipperz.Crypto.BigInt(d, 16); | 55 | result.d = new Clipperz.Crypto.BigInt(d, 16); |
59 | } | 56 | } |
60 | 57 | ||
61 | if (n.isBigInt) { | 58 | if (n.isBigInt) { |
62 | result.n = n; | 59 | result.n = n; |
63 | } else { | 60 | } else { |
64 | result.n = new Clipperz.Crypto.BigInt(n, 16); | 61 | result.n = new Clipperz.Crypto.BigInt(n, 16); |
65 | } | 62 | } |
66 | 63 | ||
67 | return result; | 64 | return result; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | 'privateKeyWithValues': function(e, d, n) { | 67 | 'privateKeyWithValues': function(e, d, n) { |
71 | return Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n); | 68 | return Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n); |
72 | }, | 69 | }, |
73 | 70 | ||
74 | //----------------------------------------------------------------------------- | 71 | //----------------------------------------------------------------------------- |
75 | 72 | ||
76 | 'encryptUsingPublicKey': function (aKey, aMessage) { | 73 | 'encryptUsingPublicKey': function (aKey, aMessage) { |
77 | varmessageValue; | 74 | varmessageValue; |
78 | varresult; | 75 | varresult; |
79 | 76 | ||
80 | messageValue = new Clipperz.Crypto.BigInt(aMessage, 16); | 77 | messageValue = new Clipperz.Crypto.BigInt(aMessage, 16); |
81 | result = messageValue.powerModule(aKey.e, aKey.n); | 78 | result = messageValue.powerModule(aKey.e, aKey.n); |
82 | 79 | ||
83 | return result.asString(16); | 80 | return result.asString(16); |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //............................................................................. | 83 | //............................................................................. |
87 | 84 | ||
88 | 'decryptUsingPublicKey': function (aKey, aMessage) { | 85 | 'decryptUsingPublicKey': function (aKey, aMessage) { |
89 | return Clipperz.Crypto.RSA.encryptUsingPublicKey(aKey, aMessage); | 86 | return Clipperz.Crypto.RSA.encryptUsingPublicKey(aKey, aMessage); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //----------------------------------------------------------------------------- | 89 | //----------------------------------------------------------------------------- |
93 | 90 | ||
94 | 'encryptUsingPrivateKey': function (aKey, aMessage) { | 91 | 'encryptUsingPrivateKey': function (aKey, aMessage) { |
95 | varmessageValue; | 92 | varmessageValue; |
96 | varresult; | 93 | varresult; |
97 | 94 | ||
98 | messageValue = new Clipperz.Crypto.BigInt(aMessage, 16); | 95 | messageValue = new Clipperz.Crypto.BigInt(aMessage, 16); |
99 | result = messageValue.powerModule(aKey.d, aKey.n); | 96 | result = messageValue.powerModule(aKey.d, aKey.n); |
100 | 97 | ||
101 | return result.asString(16); | 98 | return result.asString(16); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //............................................................................. | 101 | //............................................................................. |
105 | 102 | ||
106 | 'decryptUsingPrivateKey': function (aKey, aMessage) { | 103 | 'decryptUsingPrivateKey': function (aKey, aMessage) { |
107 | return Clipperz.Crypto.RSA.encryptUsingPrivateKey(aKey, aMessage); | 104 | return Clipperz.Crypto.RSA.encryptUsingPrivateKey(aKey, aMessage); |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //----------------------------------------------------------------------------- | 107 | //----------------------------------------------------------------------------- |
111 | 108 | ||
112 | 'generatePublicKey': function(aNumberOfBits) { | 109 | 'generatePublicKey': function(aNumberOfBits) { |
113 | varresult; | 110 | varresult; |
114 | vare; | 111 | vare; |
115 | vard; | 112 | vard; |
116 | varn; | 113 | varn; |
117 | 114 | ||
118 | e = new Clipperz.Crypto.BigInt("10001", 16); | 115 | e = new Clipperz.Crypto.BigInt("10001", 16); |
119 | 116 | ||
120 | { | 117 | { |
121 | var p, q; | 118 | var p, q; |
122 | varphi; | 119 | varphi; |
123 | 120 | ||
124 | do { | 121 | do { |
125 | p = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits); | 122 | p = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits); |
126 | } while (p.module(e).equals(1)); | 123 | } while (p.module(e).equals(1)); |
127 | 124 | ||
128 | do { | 125 | do { |
129 | q = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits); | 126 | q = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits); |
130 | } while ((q.equals(p)) || (q.module(e).equals(1))); | 127 | } while ((q.equals(p)) || (q.module(e).equals(1))); |
131 | 128 | ||
132 | n = p.multiply(q); | 129 | n = p.multiply(q); |
133 | phi = (p.subtract(1).multiply(q.subtract(1))); | 130 | phi = (p.subtract(1).multiply(q.subtract(1))); |
134 | d = e.powerModule(-1, phi); | 131 | d = e.powerModule(-1, phi); |
135 | } | 132 | } |
136 | 133 | ||
137 | result = Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n); | 134 | result = Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n); |
138 | 135 | ||
139 | return result; | 136 | return result; |
140 | }, | 137 | }, |
141 | 138 | ||
142 | //------------------------------------------------------------------------- | 139 | //------------------------------------------------------------------------- |
143 | 140 | ||
144 | __syntaxFix__: "syntax fix" | 141 | __syntaxFix__: "syntax fix" |
145 | 142 | ||
146 | //------------------------------------------------------------------------- | 143 | //------------------------------------------------------------------------- |
147 | 144 | ||
148 | }); | 145 | }); |
149 | 146 | ||
150 | //############################################################################# | 147 | //############################################################################# |
151 | 148 | ||
diff --git a/frontend/gamma/js/Clipperz/Crypto/SHA.js b/frontend/gamma/js/Clipperz/Crypto/SHA.js index 3cf8559..b07fa85 100644 --- a/frontend/gamma/js/Clipperz/Crypto/SHA.js +++ b/frontend/gamma/js/Clipperz/Crypto/SHA.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; | 27 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } | 30 | if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } |
34 | if (typeof(Clipperz.Crypto.SHA) == 'undefined') { Clipperz.Crypto.SHA = {}; } | 31 | if (typeof(Clipperz.Crypto.SHA) == 'undefined') { Clipperz.Crypto.SHA = {}; } |
35 | 32 | ||
36 | Clipperz.Crypto.SHA.VERSION = "0.3"; | 33 | Clipperz.Crypto.SHA.VERSION = "0.3"; |
37 | Clipperz.Crypto.SHA.NAME = "Clipperz.Crypto.SHA"; | 34 | Clipperz.Crypto.SHA.NAME = "Clipperz.Crypto.SHA"; |
38 | 35 | ||
39 | MochiKit.Base.update(Clipperz.Crypto.SHA, { | 36 | MochiKit.Base.update(Clipperz.Crypto.SHA, { |
40 | 37 | ||
41 | '__repr__': function () { | 38 | '__repr__': function () { |
42 | return "[" + this.NAME + " " + this.VERSION + "]"; | 39 | return "[" + this.NAME + " " + this.VERSION + "]"; |
43 | }, | 40 | }, |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //----------------------------------------------------------------------------- | 46 | //----------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'rotateRight': function(aValue, aNumberOfBits) { | 48 | 'rotateRight': function(aValue, aNumberOfBits) { |
52 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.rotateRight"); | 49 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.rotateRight"); |
53 | var result; | 50 | var result; |
54 | 51 | ||
55 | result = (aValue >>> aNumberOfBits) | (aValue << (32 - aNumberOfBits)); | 52 | result = (aValue >>> aNumberOfBits) | (aValue << (32 - aNumberOfBits)); |
56 | 53 | ||
57 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.rotateRight"); | 54 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.rotateRight"); |
58 | return result; | 55 | return result; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'shiftRight': function(aValue, aNumberOfBits) { | 58 | 'shiftRight': function(aValue, aNumberOfBits) { |
62 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.shiftRight"); | 59 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.shiftRight"); |
63 | var result; | 60 | var result; |
64 | 61 | ||
65 | result = aValue >>> aNumberOfBits; | 62 | result = aValue >>> aNumberOfBits; |
66 | 63 | ||
67 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.shiftRight"); | 64 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.shiftRight"); |
68 | return result; | 65 | return result; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //----------------------------------------------------------------------------- | 68 | //----------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'safeAdd': function() { | 70 | 'safeAdd': function() { |
74 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.safeAdd"); | 71 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.safeAdd"); |
75 | varresult; | 72 | varresult; |
76 | vari, c; | 73 | vari, c; |
77 | 74 | ||
78 | result = arguments[0]; | 75 | result = arguments[0]; |
79 | c = arguments.length; | 76 | c = arguments.length; |
80 | for (i=1; i<c; i++) { | 77 | for (i=1; i<c; i++) { |
81 | varlowerBytesSum; | 78 | varlowerBytesSum; |
82 | 79 | ||
83 | lowerBytesSum = (result & 0xffff) + (arguments[i] & 0xffff); | 80 | lowerBytesSum = (result & 0xffff) + (arguments[i] & 0xffff); |
84 | result = (((result >> 16) + (arguments[i] >> 16) + (lowerBytesSum >> 16)) << 16) | (lowerBytesSum & 0xffff); | 81 | result = (((result >> 16) + (arguments[i] >> 16) + (lowerBytesSum >> 16)) << 16) | (lowerBytesSum & 0xffff); |
85 | } | 82 | } |
86 | 83 | ||
87 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.safeAdd"); | 84 | //Clipperz.Profile.stop("Clipperz.Crypto.SHA.safeAdd"); |
88 | return result; | 85 | return result; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //----------------------------------------------------------------------------- | 88 | //----------------------------------------------------------------------------- |
92 | 89 | ||
93 | 'sha256_array': function(aValue) { | 90 | 'sha256_array': function(aValue) { |
94 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.sha256_array"); | 91 | //Clipperz.Profile.start("Clipperz.Crypto.SHA.sha256_array"); |
95 | varresult; | 92 | varresult; |
96 | varmessage; | 93 | varmessage; |
97 | var h0, h1, h2, h3, h4, h5, h6, h7; | 94 | var h0, h1, h2, h3, h4, h5, h6, h7; |
98 | vark; | 95 | vark; |
99 | varmessageLength; | 96 | varmessageLength; |
100 | varmessageLengthInBits; | 97 | varmessageLengthInBits; |
101 | var_i, _c; | 98 | var_i, _c; |
102 | var charBits; | 99 | var charBits; |
103 | var rotateRight; | 100 | var rotateRight; |
104 | var shiftRight; | 101 | var shiftRight; |
105 | var safeAdd; | 102 | var safeAdd; |
106 | varbytesPerBlock; | 103 | varbytesPerBlock; |
107 | var currentMessageIndex; | 104 | var currentMessageIndex; |
108 | 105 | ||
109 | bytesPerBlock = 512/8; | 106 | bytesPerBlock = 512/8; |
110 | rotateRight = Clipperz.Crypto.SHA.rotateRight; | 107 | rotateRight = Clipperz.Crypto.SHA.rotateRight; |
111 | shiftRight = Clipperz.Crypto.SHA.shiftRight; | 108 | shiftRight = Clipperz.Crypto.SHA.shiftRight; |
112 | safeAdd = Clipperz.Crypto.SHA.safeAdd; | 109 | safeAdd = Clipperz.Crypto.SHA.safeAdd; |
113 | 110 | ||
114 | charBits = 8; | 111 | charBits = 8; |
115 | 112 | ||
116 | h0 = 0x6a09e667; | 113 | h0 = 0x6a09e667; |
117 | h1 = 0xbb67ae85; | 114 | h1 = 0xbb67ae85; |
118 | h2 = 0x3c6ef372; | 115 | h2 = 0x3c6ef372; |
119 | h3 = 0xa54ff53a; | 116 | h3 = 0xa54ff53a; |
120 | h4 = 0x510e527f; | 117 | h4 = 0x510e527f; |
121 | h5 = 0x9b05688c; | 118 | h5 = 0x9b05688c; |
122 | h6 = 0x1f83d9ab; | 119 | h6 = 0x1f83d9ab; |
123 | h7 = 0x5be0cd19; | 120 | h7 = 0x5be0cd19; |
124 | 121 | ||
125 | k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, | 122 | k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, |
126 | 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, | 123 | 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, |
127 | 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, | 124 | 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, |
128 | 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, | 125 | 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, |
129 | 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, | 126 | 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, |
130 | 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, | 127 | 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, |
131 | 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, | 128 | 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, |
132 | 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; | 129 | 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; |
133 | 130 | ||
134 | message = aValue; | 131 | message = aValue; |
135 | messageLength = message.length; | 132 | messageLength = message.length; |
136 | 133 | ||
137 | //Pre-processing: | 134 | //Pre-processing: |
138 | message.push(0x80); //append a single "1" bit to message | 135 | message.push(0x80); //append a single "1" bit to message |
139 | 136 | ||
140 | _c = (512 - (((messageLength + 1) * charBits) % 512) - 64) / charBits; | 137 | _c = (512 - (((messageLength + 1) * charBits) % 512) - 64) / charBits; |
141 | if (_c < 0) { | 138 | if (_c < 0) { |
142 | _c = _c + (512 / charBits); | 139 | _c = _c + (512 / charBits); |
143 | } | 140 | } |
144 | 141 | ||
145 | for (_i=0; _i<_c; _i++) { | 142 | for (_i=0; _i<_c; _i++) { |
146 | message.push(0x00); //append "0" bits until message length ≡ 448 ≡ -64 (mod 512) | 143 | message.push(0x00); //append "0" bits until message length ≡ 448 ≡ -64 (mod 512) |
147 | } | 144 | } |
148 | 145 | ||
149 | messageLengthInBits = messageLength * charBits; | 146 | messageLengthInBits = messageLength * charBits; |
150 | message.push(0x00); //the 4 most high byte are alway 0 as message length is represented with a 32bit value; | 147 | message.push(0x00); //the 4 most high byte are alway 0 as message length is represented with a 32bit value; |
151 | message.push(0x00); | 148 | message.push(0x00); |
152 | message.push(0x00); | 149 | message.push(0x00); |
153 | message.push(0x00); | 150 | message.push(0x00); |
154 | message.push((messageLengthInBits >> 24)& 0xff); | 151 | message.push((messageLengthInBits >> 24)& 0xff); |
155 | message.push((messageLengthInBits >> 16)& 0xff); | 152 | message.push((messageLengthInBits >> 16)& 0xff); |
156 | message.push((messageLengthInBits >> 8) & 0xff); | 153 | message.push((messageLengthInBits >> 8) & 0xff); |
157 | message.push( messageLengthInBits & 0xff); | 154 | message.push( messageLengthInBits & 0xff); |
158 | 155 | ||
159 | currentMessageIndex = 0; | 156 | currentMessageIndex = 0; |
160 | while(currentMessageIndex < message.length) { | 157 | while(currentMessageIndex < message.length) { |
161 | varw; | 158 | varw; |
162 | vara, b, c, d, e, f, g, h; | 159 | vara, b, c, d, e, f, g, h; |
163 | 160 | ||
164 | w = Array(64); | 161 | w = Array(64); |
165 | 162 | ||
166 | _c = 16; | 163 | _c = 16; |
167 | for (_i=0; _i<_c; _i++) { | 164 | for (_i=0; _i<_c; _i++) { |
168 | var _j; | 165 | var _j; |
169 | 166 | ||
170 | _j = currentMessageIndex + _i*4; | 167 | _j = currentMessageIndex + _i*4; |
171 | w[_i] = (message[_j] << 24) | (message[_j + 1] << 16) | (message[_j + 2] << 8) | (message[_j + 3] << 0); | 168 | w[_i] = (message[_j] << 24) | (message[_j + 1] << 16) | (message[_j + 2] << 8) | (message[_j + 3] << 0); |
172 | } | 169 | } |
173 | 170 | ||
174 | _c = 64; | 171 | _c = 64; |
175 | for (_i=16; _i<_c; _i++) { | 172 | for (_i=16; _i<_c; _i++) { |
176 | vars0, s1; | 173 | vars0, s1; |
177 | 174 | ||
178 | s0 = (rotateRight(w[_i-15], 7)) ^ (rotateRight(w[_i-15], 18)) ^ (shiftRight(w[_i-15], 3)); | 175 | s0 = (rotateRight(w[_i-15], 7)) ^ (rotateRight(w[_i-15], 18)) ^ (shiftRight(w[_i-15], 3)); |
179 | s1 = (rotateRight(w[_i-2], 17)) ^ (rotateRight(w[_i-2], 19)) ^ (shiftRight(w[_i-2], 10)); | 176 | s1 = (rotateRight(w[_i-2], 17)) ^ (rotateRight(w[_i-2], 19)) ^ (shiftRight(w[_i-2], 10)); |
180 | w[_i] = safeAdd(w[_i-16], s0, w[_i-7], s1); | 177 | w[_i] = safeAdd(w[_i-16], s0, w[_i-7], s1); |
181 | } | 178 | } |
182 | 179 | ||
183 | a=h0; b=h1; c=h2; d=h3; e=h4; f=h5; g=h6; h=h7; | 180 | a=h0; b=h1; c=h2; d=h3; e=h4; f=h5; g=h6; h=h7; |
184 | 181 | ||
185 | _c = 64; | 182 | _c = 64; |
186 | for (_i=0; _i<_c; _i++) { | 183 | for (_i=0; _i<_c; _i++) { |
187 | var s0, s1, ch, maj, t1, t2; | 184 | var s0, s1, ch, maj, t1, t2; |
188 | 185 | ||
189 | s0 = (rotateRight(a, 2)) ^ (rotateRight(a, 13)) ^ (rotateRight(a, 22)); | 186 | s0 = (rotateRight(a, 2)) ^ (rotateRight(a, 13)) ^ (rotateRight(a, 22)); |
190 | maj = (a & b) ^ (a & c) ^ (b & c); | 187 | maj = (a & b) ^ (a & c) ^ (b & c); |
191 | t2 = safeAdd(s0, maj); | 188 | t2 = safeAdd(s0, maj); |
192 | s1 = (rotateRight(e, 6)) ^ (rotateRight(e, 11)) ^ (rotateRight(e, 25)); | 189 | s1 = (rotateRight(e, 6)) ^ (rotateRight(e, 11)) ^ (rotateRight(e, 25)); |
193 | ch = (e & f) ^ ((~e) & g); | 190 | ch = (e & f) ^ ((~e) & g); |
194 | t1 = safeAdd(h, s1, ch, k[_i], w[_i]); | 191 | t1 = safeAdd(h, s1, ch, k[_i], w[_i]); |
195 | 192 | ||
196 | h = g; | 193 | h = g; |
197 | g = f; | 194 | g = f; |
198 | f = e; | 195 | f = e; |
199 | e = safeAdd(d, t1); | 196 | e = safeAdd(d, t1); |
200 | d = c; | 197 | d = c; |
201 | c = b; | 198 | c = b; |
202 | b = a; | 199 | b = a; |
203 | a = safeAdd(t1, t2); | 200 | a = safeAdd(t1, t2); |
204 | } | 201 | } |
205 | 202 | ||
206 | h0 = safeAdd(h0, a); | 203 | h0 = safeAdd(h0, a); |
207 | h1 = safeAdd(h1, b); | 204 | h1 = safeAdd(h1, b); |
208 | h2 = safeAdd(h2, c); | 205 | h2 = safeAdd(h2, c); |
209 | h3 = safeAdd(h3, d); | 206 | h3 = safeAdd(h3, d); |
210 | h4 = safeAdd(h4, e); | 207 | h4 = safeAdd(h4, e); |
211 | h5 = safeAdd(h5, f); | 208 | h5 = safeAdd(h5, f); |
212 | h6 = safeAdd(h6, g); | 209 | h6 = safeAdd(h6, g); |
213 | h7 = safeAdd(h7, h); | 210 | h7 = safeAdd(h7, h); |
214 | 211 | ||
215 | currentMessageIndex += bytesPerBlock; | 212 | currentMessageIndex += bytesPerBlock; |
216 | } | 213 | } |
diff --git a/frontend/gamma/js/Clipperz/Crypto/SRP.js b/frontend/gamma/js/Clipperz/Crypto/SRP.js index 0eef6ec..3b25275 100644 --- a/frontend/gamma/js/Clipperz/Crypto/SRP.js +++ b/frontend/gamma/js/Clipperz/Crypto/SRP.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; | 27 | throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { | 30 | try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { |
34 | throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.BigInt!"; | 31 | throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.BigInt!"; |
35 | } | 32 | } |
36 | 33 | ||
37 | try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { | 34 | try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { |
38 | throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.PRNG!"; | 35 | throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.PRNG!"; |
39 | } | 36 | } |
40 | 37 | ||
41 | if (typeof(Clipperz.Crypto.SRP) == 'undefined') { Clipperz.Crypto.SRP = {}; } | 38 | if (typeof(Clipperz.Crypto.SRP) == 'undefined') { Clipperz.Crypto.SRP = {}; } |
42 | 39 | ||
43 | Clipperz.Crypto.SRP.VERSION = "0.1"; | 40 | Clipperz.Crypto.SRP.VERSION = "0.1"; |
44 | Clipperz.Crypto.SRP.NAME = "Clipperz.Crypto.SRP"; | 41 | Clipperz.Crypto.SRP.NAME = "Clipperz.Crypto.SRP"; |
45 | 42 | ||
46 | //############################################################################# | 43 | //############################################################################# |
47 | 44 | ||
48 | MochiKit.Base.update(Clipperz.Crypto.SRP, { | 45 | MochiKit.Base.update(Clipperz.Crypto.SRP, { |
49 | 46 | ||
50 | '_n': null, | 47 | '_n': null, |
51 | '_g': null, | 48 | '_g': null, |
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'n': function() { | 51 | 'n': function() { |
55 | if (Clipperz.Crypto.SRP._n == null) { | 52 | if (Clipperz.Crypto.SRP._n == null) { |
56 | Clipperz.Crypto.SRP._n = new Clipperz.Crypto.BigInt("115b8b692e0e045692cf280b436735c77a5a9e8a9e7ed56c965f87db5b2a2ece3", 16); | 53 | Clipperz.Crypto.SRP._n = new Clipperz.Crypto.BigInt("115b8b692e0e045692cf280b436735c77a5a9e8a9e7ed56c965f87db5b2a2ece3", 16); |
57 | } | 54 | } |
58 | 55 | ||
59 | return Clipperz.Crypto.SRP._n; | 56 | return Clipperz.Crypto.SRP._n; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'g': function() { | 61 | 'g': function() { |
65 | if (Clipperz.Crypto.SRP._g == null) { | 62 | if (Clipperz.Crypto.SRP._g == null) { |
66 | Clipperz.Crypto.SRP._g = new Clipperz.Crypto.BigInt(2); //eventually 5 (as suggested on the Diffi-Helmann documentation) | 63 | Clipperz.Crypto.SRP._g = new Clipperz.Crypto.BigInt(2); //eventually 5 (as suggested on the Diffi-Helmann documentation) |
67 | } | 64 | } |
68 | 65 | ||
69 | return Clipperz.Crypto.SRP._g; | 66 | return Clipperz.Crypto.SRP._g; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //----------------------------------------------------------------------------- | 69 | //----------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'exception': { | 71 | 'exception': { |
75 | 'InvalidValue': new MochiKit.Base.NamedError("Clipperz.Crypto.SRP.exception.InvalidValue") | 72 | 'InvalidValue': new MochiKit.Base.NamedError("Clipperz.Crypto.SRP.exception.InvalidValue") |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | __syntaxFix__: "syntax fix" | 76 | __syntaxFix__: "syntax fix" |
80 | 77 | ||
81 | }); | 78 | }); |
82 | 79 | ||
83 | //############################################################################# | 80 | //############################################################################# |
84 | // | 81 | // |
85 | // S R P C o n n e c t i o n version 1.0 | 82 | // S R P C o n n e c t i o n version 1.0 |
86 | // | 83 | // |
87 | //============================================================================= | 84 | //============================================================================= |
88 | Clipperz.Crypto.SRP.Connection = function (args) { | 85 | Clipperz.Crypto.SRP.Connection = function (args) { |
89 | args = args || {}; | 86 | args = args || {}; |
90 | 87 | ||
91 | this._C = args.C; | 88 | this._C = args.C; |
92 | this._P = args.P; | 89 | this._P = args.P; |
93 | this.hash = args.hash; | 90 | this.hash = args.hash; |
94 | 91 | ||
95 | this._a = null; | 92 | this._a = null; |
96 | this._A = null; | 93 | this._A = null; |
97 | 94 | ||
98 | this._s = null; | 95 | this._s = null; |
99 | this._B = null; | 96 | this._B = null; |
100 | 97 | ||
101 | this._x = null; | 98 | this._x = null; |
102 | 99 | ||
103 | this._u = null; | 100 | this._u = null; |
104 | this._K = null; | 101 | this._K = null; |
105 | this._M1 = null; | 102 | this._M1 = null; |
106 | this._M2 = null; | 103 | this._M2 = null; |
107 | 104 | ||
108 | this._sessionKey = null; | 105 | this._sessionKey = null; |
109 | 106 | ||
110 | return this; | 107 | return this; |
111 | } | 108 | } |
112 | 109 | ||
113 | Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, { | 110 | Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, { |
114 | 111 | ||
115 | 'toString': function () { | 112 | 'toString': function () { |
116 | return "Clipperz.Crypto.SRP.Connection (username: " + this.username() + "). Status: " + this.statusDescription(); | 113 | return "Clipperz.Crypto.SRP.Connection (username: " + this.username() + "). Status: " + this.statusDescription(); |
117 | }, | 114 | }, |
118 | 115 | ||
119 | //------------------------------------------------------------------------- | 116 | //------------------------------------------------------------------------- |
120 | 117 | ||
121 | 'C': function () { | 118 | 'C': function () { |
122 | return this._C; | 119 | return this._C; |
123 | }, | 120 | }, |
124 | 121 | ||
125 | //------------------------------------------------------------------------- | 122 | //------------------------------------------------------------------------- |
126 | 123 | ||
127 | 'P': function () { | 124 | 'P': function () { |
128 | return this._P; | 125 | return this._P; |
129 | }, | 126 | }, |
130 | 127 | ||
131 | //------------------------------------------------------------------------- | 128 | //------------------------------------------------------------------------- |
132 | 129 | ||
133 | 'a': function () { | 130 | 'a': function () { |
134 | if (this._a == null) { | 131 | if (this._a == null) { |
135 | this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16); | 132 | this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16); |
136 | // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10); | 133 | // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10); |
137 | //MochiKit.Logging.logDebug("SRP a: " + this._a); | 134 | //MochiKit.Logging.logDebug("SRP a: " + this._a); |
138 | } | 135 | } |
139 | 136 | ||
140 | return this._a; | 137 | return this._a; |
141 | }, | 138 | }, |
142 | 139 | ||
143 | //------------------------------------------------------------------------- | 140 | //------------------------------------------------------------------------- |
144 | 141 | ||
145 | 'A': function () { | 142 | 'A': function () { |
146 | if (this._A == null) { | 143 | if (this._A == null) { |
147 | //Warning: this value should be strictly greater than zero: how should we perform this check? | 144 | //Warning: this value should be strictly greater than zero: how should we perform this check? |
148 | this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n()); | 145 | this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n()); |
149 | 146 | ||
150 | if (this._A.equals(0)) { | 147 | if (this._A.equals(0)) { |
151 | MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0."); | 148 | MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0."); |
152 | throw Clipperz.Crypto.SRP.exception.InvalidValue; | 149 | throw Clipperz.Crypto.SRP.exception.InvalidValue; |
153 | } | 150 | } |
154 | //MochiKit.Logging.logDebug("SRP A: " + this._A); | 151 | //MochiKit.Logging.logDebug("SRP A: " + this._A); |
155 | } | 152 | } |
156 | 153 | ||
157 | return this._A; | 154 | return this._A; |
158 | }, | 155 | }, |
159 | 156 | ||
160 | //------------------------------------------------------------------------- | 157 | //------------------------------------------------------------------------- |
161 | 158 | ||
162 | 's': function () { | 159 | 's': function () { |
163 | return this._s; | 160 | return this._s; |
164 | //MochiKit.Logging.logDebug("SRP s: " + this._S); | 161 | //MochiKit.Logging.logDebug("SRP s: " + this._S); |
165 | }, | 162 | }, |
166 | 163 | ||
167 | 'set_s': function(aValue) { | 164 | 'set_s': function(aValue) { |
168 | this._s = aValue; | 165 | this._s = aValue; |
169 | }, | 166 | }, |
170 | 167 | ||
171 | //------------------------------------------------------------------------- | 168 | //------------------------------------------------------------------------- |
172 | 169 | ||
173 | 'B': function () { | 170 | 'B': function () { |
174 | return this._B; | 171 | return this._B; |
175 | }, | 172 | }, |
176 | 173 | ||
177 | 'set_B': function(aValue) { | 174 | 'set_B': function(aValue) { |
178 | //Warning: this value should be strictly greater than zero: how should we perform this check? | 175 | //Warning: this value should be strictly greater than zero: how should we perform this check? |
179 | if (! aValue.equals(0)) { | 176 | if (! aValue.equals(0)) { |
180 | this._B = aValue; | 177 | this._B = aValue; |
181 | //MochiKit.Logging.logDebug("SRP B: " + this._B); | 178 | //MochiKit.Logging.logDebug("SRP B: " + this._B); |
182 | } else { | 179 | } else { |
183 | MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0."); | 180 | MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0."); |
184 | throw Clipperz.Crypto.SRP.exception.InvalidValue; | 181 | throw Clipperz.Crypto.SRP.exception.InvalidValue; |
185 | } | 182 | } |
186 | }, | 183 | }, |
187 | 184 | ||
188 | //------------------------------------------------------------------------- | 185 | //------------------------------------------------------------------------- |
189 | 186 | ||
190 | 'x': function () { | 187 | 'x': function () { |
191 | if (this._x == null) { | 188 | if (this._x == null) { |
192 | this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16); | 189 | this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16); |
193 | //MochiKit.Logging.logDebug("SRP x: " + this._x); | 190 | //MochiKit.Logging.logDebug("SRP x: " + this._x); |
194 | } | 191 | } |
195 | 192 | ||
196 | return this._x; | 193 | return this._x; |
197 | }, | 194 | }, |
198 | 195 | ||
199 | //------------------------------------------------------------------------- | 196 | //------------------------------------------------------------------------- |
200 | 197 | ||
201 | 'u': function () { | 198 | 'u': function () { |
202 | if (this._u == null) { | 199 | if (this._u == null) { |
203 | this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16); | 200 | this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16); |
204 | //MochiKit.Logging.logDebug("SRP u: " + this._u); | 201 | //MochiKit.Logging.logDebug("SRP u: " + this._u); |
205 | } | 202 | } |
206 | 203 | ||
207 | return this._u; | 204 | return this._u; |
208 | }, | 205 | }, |
209 | 206 | ||
210 | //------------------------------------------------------------------------- | 207 | //------------------------------------------------------------------------- |
211 | 208 | ||
212 | 'S': function () { | 209 | 'S': function () { |
213 | if (this._S == null) { | 210 | if (this._S == null) { |
214 | var bigint; | 211 | var bigint; |
215 | varsrp; | 212 | varsrp; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/DOM.js b/frontend/gamma/js/Clipperz/DOM.js index 40720d8..8f24653 100644 --- a/frontend/gamma/js/Clipperz/DOM.js +++ b/frontend/gamma/js/Clipperz/DOM.js | |||
@@ -1,139 +1,136 @@ | |||
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.DOM) == 'undefined') { Clipperz.DOM = {}; } | 27 | if (typeof(Clipperz.DOM) == 'undefined') { Clipperz.DOM = {}; } |
31 | 28 | ||
32 | Clipperz.DOM.VERSION = "0.1"; | 29 | Clipperz.DOM.VERSION = "0.1"; |
33 | Clipperz.DOM.NAME = "Clipperz.DOM"; | 30 | Clipperz.DOM.NAME = "Clipperz.DOM"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.DOM, { | 32 | MochiKit.Base.update(Clipperz.DOM, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'selectOptionMatchingValue': function (aSelectElement, aValue, shouldUseCaseInsensitiveTest) { | 48 | 'selectOptionMatchingValue': function (aSelectElement, aValue, shouldUseCaseInsensitiveTest) { |
52 | var selectedOptionIndex; | 49 | var selectedOptionIndex; |
53 | var i, c; | 50 | var i, c; |
54 | 51 | ||
55 | selectedOptionIndex = -1; | 52 | selectedOptionIndex = -1; |
56 | 53 | ||
57 | c = aSelectElement.options.length; | 54 | c = aSelectElement.options.length; |
58 | for (i=0; (i<c) && (selectedOptionIndex == -1); i++) { | 55 | for (i=0; (i<c) && (selectedOptionIndex == -1); i++) { |
59 | if (shouldUseCaseInsensitiveTest == true) { | 56 | if (shouldUseCaseInsensitiveTest == true) { |
60 | if (aSelectElement.options[i].value.toLowerCase() == aValue.toLowerCase()) { | 57 | if (aSelectElement.options[i].value.toLowerCase() == aValue.toLowerCase()) { |
61 | selectedOptionIndex = i; | 58 | selectedOptionIndex = i; |
62 | } | 59 | } |
63 | } else { | 60 | } else { |
64 | if (aSelectElement.options[i].value == aValue) { | 61 | if (aSelectElement.options[i].value == aValue) { |
65 | selectedOptionIndex = i; | 62 | selectedOptionIndex = i; |
66 | } | 63 | } |
67 | } | 64 | } |
68 | } | 65 | } |
69 | 66 | ||
70 | if (selectedOptionIndex != -1) { | 67 | if (selectedOptionIndex != -1) { |
71 | aSelectElement.selectedIndex = selectedOptionIndex; | 68 | aSelectElement.selectedIndex = selectedOptionIndex; |
72 | } | 69 | } |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'setFormContents': function(aNode, someValues) { | 74 | 'setFormContents': function(aNode, someValues) { |
78 | var node; | 75 | var node; |
79 | var values; | 76 | var values; |
80 | var i, c; | 77 | var i, c; |
81 | 78 | ||
82 | values = {}; | 79 | values = {}; |
83 | c = someValues[0].length; | 80 | c = someValues[0].length; |
84 | for (i=0; i<c; i++) { | 81 | for (i=0; i<c; i++) { |
85 | values[someValues[0][i]] = someValues[1][i]; | 82 | values[someValues[0][i]] = someValues[1][i]; |
86 | } | 83 | } |
87 | 84 | ||
88 | // var m = MochiKit.Base; | 85 | // var m = MochiKit.Base; |
89 | // var self = MochiKit.DOM; | 86 | // var self = MochiKit.DOM; |
90 | if (typeof(aNode) == "undefined" || aNode === null) { | 87 | if (typeof(aNode) == "undefined" || aNode === null) { |
91 | node = MochiKit.DOM._document.body; | 88 | node = MochiKit.DOM._document.body; |
92 | } else { | 89 | } else { |
93 | node = MochiKit.DOM.getElement(aNode); | 90 | node = MochiKit.DOM.getElement(aNode); |
94 | } | 91 | } |
95 | 92 | ||
96 | MochiKit.Base.nodeWalk(node, function(aNode) { | 93 | MochiKit.Base.nodeWalk(node, function(aNode) { |
97 | var result; | 94 | var result; |
98 | var name; | 95 | var name; |
99 | 96 | ||
100 | result = null; | 97 | result = null; |
101 | name = aNode.name; | 98 | name = aNode.name; |
102 | if (MochiKit.Base.isNotEmpty(name) && (typeof(values[name]) != 'undefined')) { | 99 | if (MochiKit.Base.isNotEmpty(name) && (typeof(values[name]) != 'undefined')) { |
103 | var tagName; | 100 | var tagName; |
104 | 101 | ||
105 | tagName = aNode.tagName.toUpperCase(); | 102 | tagName = aNode.tagName.toUpperCase(); |
106 | if (tagName === "INPUT" && (aNode.type == "radio" || aNode.type == "checkbox")) { | 103 | if (tagName === "INPUT" && (aNode.type == "radio" || aNode.type == "checkbox")) { |
107 | aNode.checked = values[name]; | 104 | aNode.checked = values[name]; |
108 | } else if (tagName === "SELECT") { | 105 | } else if (tagName === "SELECT") { |
109 | if (aNode.type == "select-one") { | 106 | if (aNode.type == "select-one") { |
110 | Clipperz.DOM.selectOptionMatchingValue(aNode, values[name]); | 107 | Clipperz.DOM.selectOptionMatchingValue(aNode, values[name]); |
111 | } else { //aNode.type == "select-multiple" | 108 | } else { //aNode.type == "select-multiple" |
112 | MochiKit.Logging.logWarning("### unhandled Select.type = 'select-multiple' condition"); | 109 | MochiKit.Logging.logWarning("### unhandled Select.type = 'select-multiple' condition"); |
113 | } | 110 | } |
114 | } else if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") { | 111 | } else if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") { |
115 | result = aNode.childNodes; | 112 | result = aNode.childNodes; |
116 | } else { | 113 | } else { |
117 | aNode.value = values[name] | 114 | aNode.value = values[name] |
118 | } | 115 | } |
119 | } else { | 116 | } else { |
120 | result = aNode.childNodes; | 117 | result = aNode.childNodes; |
121 | } | 118 | } |
122 | 119 | ||
123 | return result; | 120 | return result; |
124 | }); | 121 | }); |
125 | }, | 122 | }, |
126 | 123 | ||
127 | //------------------------------------------------------------------------- | 124 | //------------------------------------------------------------------------- |
128 | 125 | ||
129 | 'get': MochiKit.DOM.getElement, | 126 | 'get': MochiKit.DOM.getElement, |
130 | 127 | ||
131 | //------------------------------------------------------------------------- | 128 | //------------------------------------------------------------------------- |
132 | 129 | ||
133 | 'Helper': Clipperz.YUI.DomHelper, | 130 | 'Helper': Clipperz.YUI.DomHelper, |
134 | 131 | ||
135 | //------------------------------------------------------------------------- | 132 | //------------------------------------------------------------------------- |
136 | __syntaxFix__: "syntax fix" | 133 | __syntaxFix__: "syntax fix" |
137 | 134 | ||
138 | }); | 135 | }); |
139 | 136 | ||
diff --git a/frontend/gamma/js/Clipperz/Date.js b/frontend/gamma/js/Clipperz/Date.js index 4103b88..020d77b 100644 --- a/frontend/gamma/js/Clipperz/Date.js +++ b/frontend/gamma/js/Clipperz/Date.js | |||
@@ -1,216 +1,213 @@ | |||
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.Date) == 'undefined') { Clipperz.Date = {}; } | 27 | if (typeof(Clipperz.Date) == 'undefined') { Clipperz.Date = {}; } |
31 | 28 | ||
32 | Clipperz.Date.VERSION = "0.1"; | 29 | Clipperz.Date.VERSION = "0.1"; |
33 | Clipperz.Date.NAME = "Clipperz.Date"; | 30 | Clipperz.Date.NAME = "Clipperz.Date"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Date, { | 32 | MochiKit.Base.update(Clipperz.Date, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'daysInMonth': [31,28,31,30,31,30,31,31,30,31,30,31], | 48 | 'daysInMonth': [31,28,31,30,31,30,31,31,30,31,30,31], |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'englishOrdinalDaySuffixForDate': function(aDate) { | 52 | 'englishOrdinalDaySuffixForDate': function(aDate) { |
56 | var result; | 53 | var result; |
57 | 54 | ||
58 | switch (aDate.getDate()) { | 55 | switch (aDate.getDate()) { |
59 | case 1: | 56 | case 1: |
60 | case 21: | 57 | case 21: |
61 | case 31: | 58 | case 31: |
62 | result = "st"; | 59 | result = "st"; |
63 | break; | 60 | break; |
64 | case 2: | 61 | case 2: |
65 | case 22: | 62 | case 22: |
66 | result = "nd"; | 63 | result = "nd"; |
67 | break; | 64 | break; |
68 | case 3: | 65 | case 3: |
69 | case 23: | 66 | case 23: |
70 | result = "rd"; | 67 | result = "rd"; |
71 | break; | 68 | break; |
72 | default: | 69 | default: |
73 | result = "th"; | 70 | result = "th"; |
74 | break; | 71 | break; |
75 | } | 72 | } |
76 | 73 | ||
77 | return result; | 74 | return result; |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //------------------------------------------------------------------------- | 77 | //------------------------------------------------------------------------- |
81 | 78 | ||
82 | 'isLeapYear': function(aDate) { | 79 | 'isLeapYear': function(aDate) { |
83 | var year; | 80 | var year; |
84 | var result; | 81 | var result; |
85 | 82 | ||
86 | year = aDate.getFullYear(); | 83 | year = aDate.getFullYear(); |
87 | result = ((year & 0x03) == 0 && (year % 100 || (year % 400 == 0 && year))); | 84 | result = ((year & 0x03) == 0 && (year % 100 || (year % 400 == 0 && year))); |
88 | 85 | ||
89 | return result; | 86 | return result; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //------------------------------------------------------------------------- | 89 | //------------------------------------------------------------------------- |
93 | 90 | ||
94 | 'getDaysInMonth': function(aDate) { | 91 | 'getDaysInMonth': function(aDate) { |
95 | var result; | 92 | var result; |
96 | 93 | ||
97 | if (aDate.getMonth() == 1) { | 94 | if (aDate.getMonth() == 1) { |
98 | Clipperz.Date.isLeapYear(aDate) | 95 | Clipperz.Date.isLeapYear(aDate) |
99 | result += Clipperz.Date.isLeapYear(aDate) ? 29 : 28; | 96 | result += Clipperz.Date.isLeapYear(aDate) ? 29 : 28; |
100 | } else { | 97 | } else { |
101 | result = Clipperz.Date.daysInMonth[aDate.getMonth()]; | 98 | result = Clipperz.Date.daysInMonth[aDate.getMonth()]; |
102 | } | 99 | } |
103 | 100 | ||
104 | return result; | 101 | return result; |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------- |
108 | 105 | ||
109 | 'getTimezone': function(aDate) { | 106 | 'getTimezone': function(aDate) { |
110 | var result; | 107 | var result; |
111 | 108 | ||
112 | result = aDate.toString(); | 109 | result = aDate.toString(); |
113 | result = result.replace(/([A-Z]{3}) [0-9]{4}/, '$1'); | 110 | result = result.replace(/([A-Z]{3}) [0-9]{4}/, '$1'); |
114 | result = result.replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3"); | 111 | result = result.replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3"); |
115 | 112 | ||
116 | return result; | 113 | return result; |
117 | }, | 114 | }, |
118 | 115 | ||
119 | 'getGMTOffset': function(aDate) { | 116 | 'getGMTOffset': function(aDate) { |
120 | return (aDate.getTimezoneOffset() > 0 ? "-" : "+")+ MochiKit.Format.numberFormatter('00')(Math.floor(this.getTimezoneOffset() / 60)) | 117 | return (aDate.getTimezoneOffset() > 0 ? "-" : "+")+ MochiKit.Format.numberFormatter('00')(Math.floor(this.getTimezoneOffset() / 60)) |
121 | + MochiKit.Format.numberFormatter('00')(this.getTimezoneOffset() % 60); | 118 | + MochiKit.Format.numberFormatter('00')(this.getTimezoneOffset() % 60); |
122 | }, | 119 | }, |
123 | 120 | ||
124 | //------------------------------------------------------------------------- | 121 | //------------------------------------------------------------------------- |
125 | 122 | ||
126 | 'dayOfYear': function(aDate) { | 123 | 'dayOfYear': function(aDate) { |
127 | var result; | 124 | var result; |
128 | var i,c; | 125 | var i,c; |
129 | 126 | ||
130 | result = 0; | 127 | result = 0; |
131 | c = aDate.getMonth(); | 128 | c = aDate.getMonth(); |
132 | for (i=0; i<c; i++) { | 129 | for (i=0; i<c; i++) { |
133 | if (i == 1) { | 130 | if (i == 1) { |
134 | result += Clipperz.Date.isLeapYear(aDate) ? 29 : 28; | 131 | result += Clipperz.Date.isLeapYear(aDate) ? 29 : 28; |
135 | } else { | 132 | } else { |
136 | result += Clipperz.Date.daysInMonth[i]; | 133 | result += Clipperz.Date.daysInMonth[i]; |
137 | } | 134 | } |
138 | } | 135 | } |
139 | return num + this.getDate() - 1; | 136 | return num + this.getDate() - 1; |
140 | }, | 137 | }, |
141 | 138 | ||
142 | //------------------------------------------------------------------------- | 139 | //------------------------------------------------------------------------- |
143 | 140 | ||
144 | 'getPHPLikeFormatCode': function(aCharacter) { | 141 | 'getPHPLikeFormatCode': function(aCharacter) { |
145 | var result; | 142 | var result; |
146 | 143 | ||
147 | switch (aCharacter) { | 144 | switch (aCharacter) { |
148 | case "d": | 145 | case "d": |
149 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getDate())"; | 146 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getDate())"; |
150 | break; | 147 | break; |
151 | case "D": | 148 | case "D": |
152 | result = " + aLocale['shortDays'][aDate.getDay()]"; | 149 | result = " + aLocale['shortDays'][aDate.getDay()]"; |
153 | break; | 150 | break; |
154 | case "j": | 151 | case "j": |
155 | result = " + aDate.getDate()"; | 152 | result = " + aDate.getDate()"; |
156 | break; | 153 | break; |
157 | case "l": | 154 | case "l": |
158 | result = " + aLocale['days'][aDate.getDay()]"; | 155 | result = " + aLocale['days'][aDate.getDay()]"; |
159 | break; | 156 | break; |
160 | case "S": | 157 | case "S": |
161 | result = " + Clipperz.Date.englishOrdinalDaySuffixForDate(aDate)"; | 158 | result = " + Clipperz.Date.englishOrdinalDaySuffixForDate(aDate)"; |
162 | break; | 159 | break; |
163 | case "w": | 160 | case "w": |
164 | result = " + aDate.getDay()"; | 161 | result = " + aDate.getDay()"; |
165 | break; | 162 | break; |
166 | case "z": | 163 | case "z": |
167 | result = " + aDate.getDayOfYear()"; | 164 | result = " + aDate.getDayOfYear()"; |
168 | break; | 165 | break; |
169 | case "W": | 166 | case "W": |
170 | result = " + aDate.getWeekOfYear()"; | 167 | result = " + aDate.getWeekOfYear()"; |
171 | break; | 168 | break; |
172 | case "F": | 169 | case "F": |
173 | result = " + aLocale['months'][aDate.getMonth()]"; | 170 | result = " + aLocale['months'][aDate.getMonth()]"; |
174 | break; | 171 | break; |
175 | case "m": | 172 | case "m": |
176 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getMonth() + 1)"; | 173 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getMonth() + 1)"; |
177 | break; | 174 | break; |
178 | case "M": | 175 | case "M": |
179 | result = " + aLocale['shortMonths'][aDate.getMonth()]"; | 176 | result = " + aLocale['shortMonths'][aDate.getMonth()]"; |
180 | break; | 177 | break; |
181 | case "n": | 178 | case "n": |
182 | result = " + (aDate.getMonth() + 1)"; | 179 | result = " + (aDate.getMonth() + 1)"; |
183 | break; | 180 | break; |
184 | case "t": | 181 | case "t": |
185 | result = " + Clipperz.Date.getDaysInMonth(aDate)"; | 182 | result = " + Clipperz.Date.getDaysInMonth(aDate)"; |
186 | break; | 183 | break; |
187 | case "L": | 184 | case "L": |
188 | result = " + (Clipperz.Date.isLeapYear(aDate) ? 1 : 0)"; | 185 | result = " + (Clipperz.Date.isLeapYear(aDate) ? 1 : 0)"; |
189 | break; | 186 | break; |
190 | case "Y": | 187 | case "Y": |
191 | result = " + aDate.getFullYear()"; | 188 | result = " + aDate.getFullYear()"; |
192 | break; | 189 | break; |
193 | case "y": | 190 | case "y": |
194 | result = " + ('' + aDate.getFullYear()).substring(2, 4)"; | 191 | result = " + ('' + aDate.getFullYear()).substring(2, 4)"; |
195 | break; | 192 | break; |
196 | case "a": | 193 | case "a": |
197 | result = " + (aDate.getHours() < 12 ? aLocale['amDesignation'] : aLocale['pmDesignation'])"; | 194 | result = " + (aDate.getHours() < 12 ? aLocale['amDesignation'] : aLocale['pmDesignation'])"; |
198 | break; | 195 | break; |
199 | case "A": | 196 | case "A": |
200 | result = " + (aDate.getHours() < 12 ? aLocale['amDesignation'].toUpperCase() : aLocale['pmDesignation'].toUpperCase())"; | 197 | result = " + (aDate.getHours() < 12 ? aLocale['amDesignation'].toUpperCase() : aLocale['pmDesignation'].toUpperCase())"; |
201 | break; | 198 | break; |
202 | case "g": | 199 | case "g": |
203 | result = " + ((aDate.getHours() %12) ? aDate.getHours() % 12 : 12)"; | 200 | result = " + ((aDate.getHours() %12) ? aDate.getHours() % 12 : 12)"; |
204 | break; | 201 | break; |
205 | case "G": | 202 | case "G": |
206 | result = " + aDate.getHours()"; | 203 | result = " + aDate.getHours()"; |
207 | break; | 204 | break; |
208 | case "h": | 205 | case "h": |
209 | result = " + MochiKit.Format.numberFormatter('00')((aDate.getHours() %12) ? aDate.getHours() % 12 : 12)"; | 206 | result = " + MochiKit.Format.numberFormatter('00')((aDate.getHours() %12) ? aDate.getHours() % 12 : 12)"; |
210 | break; | 207 | break; |
211 | case "H": | 208 | case "H": |
212 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getHours())"; | 209 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getHours())"; |
213 | break; | 210 | break; |
214 | case "i": | 211 | case "i": |
215 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getMinutes())"; | 212 | result = " + MochiKit.Format.numberFormatter('00')(aDate.getMinutes())"; |
216 | break; | 213 | break; |
diff --git a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js index 06ab5a8..a3c10c8 100644 --- a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js +++ b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js | |||
@@ -1,196 +1,193 @@ | |||
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 | 27 | ||
31 | 28 | ||
32 | Clipperz.KeePassExportProcessor = function(args) { | 29 | Clipperz.KeePassExportProcessor = function(args) { |
33 | args = args || {}; | 30 | args = args || {}; |
34 | 31 | ||
35 | return this; | 32 | return this; |
36 | } | 33 | } |
37 | 34 | ||
38 | //============================================================================= | 35 | //============================================================================= |
39 | 36 | ||
40 | Clipperz.KeePassExportProcessor.prototype = MochiKit.Base.update(null, { | 37 | Clipperz.KeePassExportProcessor.prototype = MochiKit.Base.update(null, { |
41 | 38 | ||
42 | //------------------------------------------------------------------------- | 39 | //------------------------------------------------------------------------- |
43 | 40 | ||
44 | 'deferredParse_core': function(aContext) { | 41 | 'deferredParse_core': function(aContext) { |
45 | var deferredResult; | 42 | var deferredResult; |
46 | 43 | ||
47 | if (aContext.line == "") { | 44 | if (aContext.line == "") { |
48 | deferredResult = MochiKit.Async.succeed(aContext.result); | 45 | deferredResult = MochiKit.Async.succeed(aContext.result); |
49 | } else { | 46 | } else { |
50 | var record; | 47 | var record; |
51 | 48 | ||
52 | record = this.parseRecord(aContext); | 49 | record = this.parseRecord(aContext); |
53 | if (record != null) { | 50 | if (record != null) { |
54 | aContext.result.push(record); | 51 | aContext.result.push(record); |
55 | } | 52 | } |
56 | 53 | ||
57 | aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); | 54 | aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); |
58 | 55 | ||
59 | deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredParse_core"); | 56 | deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredParse_core"); |
60 | deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); | 57 | deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); |
61 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); | 58 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); |
62 | deferredResult.addMethod(this, 'deferredParse_core'); | 59 | deferredResult.addMethod(this, 'deferredParse_core'); |
63 | deferredResult.callback(aContext); | 60 | deferredResult.callback(aContext); |
64 | } | 61 | } |
65 | 62 | ||
66 | return deferredResult; | 63 | return deferredResult; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //......................................................................... | 66 | //......................................................................... |
70 | 67 | ||
71 | 'deferredParse': function(aValue) { | 68 | 'deferredParse': function(aValue) { |
72 | var deferredResult; | 69 | var deferredResult; |
73 | var lines; | 70 | var lines; |
74 | var context; | 71 | var context; |
75 | 72 | ||
76 | lines = aValue.replace(/\r?\n/g, "\n"); | 73 | lines = aValue.replace(/\r?\n/g, "\n"); |
77 | context = { | 74 | context = { |
78 | line: lines, | 75 | line: lines, |
79 | size: lines.length, | 76 | size: lines.length, |
80 | result: [] | 77 | result: [] |
81 | } | 78 | } |
82 | 79 | ||
83 | deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredResult"); | 80 | deferredResult = new Clipperz.Async.Deferred("KeePassExportProcessor.deferredResult"); |
84 | deferredResult.addMethod(this, 'deferredParse_core'); | 81 | deferredResult.addMethod(this, 'deferredParse_core'); |
85 | deferredResult.callback(context); | 82 | deferredResult.callback(context); |
86 | 83 | ||
87 | return deferredResult; | 84 | return deferredResult; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
91 | 88 | ||
92 | 'parseRecord': function(aContext) { | 89 | 'parseRecord': function(aContext) { |
93 | var result; | 90 | var result; |
94 | var recordLabelRegexp; | 91 | var recordLabelRegexp; |
95 | varfieldLabelRegexp; | 92 | varfieldLabelRegexp; |
96 | var fieldValueRegexp; | 93 | var fieldValueRegexp; |
97 | var fullLineRegexp; | 94 | var fullLineRegexp; |
98 | /* | 95 | /* |
99 | [Record name] | 96 | [Record name] |
100 | Group Tree: | 97 | Group Tree: |
101 | UserName: | 98 | UserName: |
102 | URL: | 99 | URL: |
103 | Password: | 100 | Password: |
104 | Notes: test | 101 | Notes: test |
105 | UUID: 525f62430079bae48b79ed2961924b05 | 102 | UUID: 525f62430079bae48b79ed2961924b05 |
106 | Icon: 0 | 103 | Icon: 0 |
107 | Creation Time: 2007-06-26 17:56:03 | 104 | Creation Time: 2007-06-26 17:56:03 |
108 | Last Access: 2007-10-25 16:23:51 | 105 | Last Access: 2007-10-25 16:23:51 |
109 | Last Modification: 2007-10-25 16:23:51 | 106 | Last Modification: 2007-10-25 16:23:51 |
110 | Expires: 2999-12-28 23:59:59 | 107 | Expires: 2999-12-28 23:59:59 |
111 | 108 | ||
112 | [Record name] ==> Title | 109 | [Record name] ==> Title |
113 | Group: General ==> Group | 110 | Group: General ==> Group |
114 | Group Tree: ==> Group Tree | 111 | Group Tree: ==> Group Tree |
115 | UserName: ==> UserName | 112 | UserName: ==> UserName |
116 | URL: ==>URL | 113 | URL: ==>URL |
117 | Password: ==>Password | 114 | Password: ==>Password |
118 | Notes: test ==>Notes | 115 | Notes: test ==>Notes |
119 | UUID: 525f62430079bae48b79ed2961924b05 ==>UUID | 116 | UUID: 525f62430079bae48b79ed2961924b05 ==>UUID |
120 | Icon: 0 ==>Icon | 117 | Icon: 0 ==>Icon |
121 | Creation Time: 2007-06-26 17:56:03 ==>Creation Time | 118 | Creation Time: 2007-06-26 17:56:03 ==>Creation Time |
122 | Last Access: 2007-10-25 16:23:51 ==>Last Access | 119 | Last Access: 2007-10-25 16:23:51 ==>Last Access |
123 | Last Modification: 2007-10-25 16:23:51 ==>Last Modification | 120 | Last Modification: 2007-10-25 16:23:51 ==>Last Modification |
124 | Expires: 2999-12-28 23:59:59 ==> Expires | 121 | Expires: 2999-12-28 23:59:59 ==> Expires |
125 | Attachment Description: ==> Attachment Description | 122 | Attachment Description: ==> Attachment Description |
126 | Attachment: ==> Attachment | 123 | Attachment: ==> Attachment |
127 | */ | 124 | */ |
128 | // recordLabelRegexp = new RegExp("(^\\[(.*)\\]\\n|^Title:\s*(.*)\\n)"); | 125 | // recordLabelRegexp = new RegExp("(^\\[(.*)\\]\\n|^Title:\s*(.*)\\n)"); |
129 | recordLabelRegexp = new RegExp("^\\[(.*)\\]\\n|^Title:\s*(.*)\\n"); | 126 | recordLabelRegexp = new RegExp("^\\[(.*)\\]\\n|^Title:\s*(.*)\\n"); |
130 | fieldLabelRegexp = new RegExp("^\s?(Group|Group Tree|Username|UserName|User Name|Url|URL|Password|Notes|Comment|UUID|Icon|Creation Time|Last Access|Last Modification|Expires|Attachment Description|Attachment|Valid until): "); | 127 | fieldLabelRegexp = new RegExp("^\s?(Group|Group Tree|Username|UserName|User Name|Url|URL|Password|Notes|Comment|UUID|Icon|Creation Time|Last Access|Last Modification|Expires|Attachment Description|Attachment|Valid until): "); |
131 | fieldValueRegexp = new RegExp("(.*)(\\n|$)"); | 128 | fieldValueRegexp = new RegExp("(.*)(\\n|$)"); |
132 | fullLineRegexp = new RegExp("^(.*\\n)"); | 129 | fullLineRegexp = new RegExp("^(.*\\n)"); |
133 | 130 | ||
134 | if (recordLabelRegexp.test(aContext.line) == true) { | 131 | if (recordLabelRegexp.test(aContext.line) == true) { |
135 | var line; | 132 | var line; |
136 | 133 | ||
137 | line = aContext.line; | 134 | line = aContext.line; |
138 | 135 | ||
139 | result = {}; | 136 | result = {}; |
140 | result['Title'] = line.match(recordLabelRegexp)[1]; | 137 | result['Title'] = line.match(recordLabelRegexp)[1]; |
141 | line = line.replace(/^.*\n/, ""); | 138 | line = line.replace(/^.*\n/, ""); |
142 | while (fieldLabelRegexp.test(line) == true) { | 139 | while (fieldLabelRegexp.test(line) == true) { |
143 | var fieldName; | 140 | var fieldName; |
144 | var fieldValue; | 141 | var fieldValue; |
145 | 142 | ||
146 | fieldName = RegExp.$1; | 143 | fieldName = RegExp.$1; |
147 | line = RegExp.rightContext; | 144 | line = RegExp.rightContext; |
148 | 145 | ||
149 | fieldValue = line.match(fieldValueRegexp)[1]; | 146 | fieldValue = line.match(fieldValueRegexp)[1]; |
150 | line = RegExp.rightContext; | 147 | line = RegExp.rightContext; |
151 | 148 | ||
152 | if (fieldName == 'Notes') { | 149 | if (fieldName == 'Notes') { |
153 | var isMultiline; | 150 | var isMultiline; |
154 | 151 | ||
155 | isMultiline = false; | 152 | isMultiline = false; |
156 | 153 | ||
157 | if ((line != "") && (fieldLabelRegexp.test(line) == false) && (recordLabelRegexp.test(line) == false)) { | 154 | if ((line != "") && (fieldLabelRegexp.test(line) == false) && (recordLabelRegexp.test(line) == false)) { |
158 | fieldValue += '\n'; | 155 | fieldValue += '\n'; |
159 | } | 156 | } |
160 | 157 | ||
161 | while ((line != "") && (fieldLabelRegexp.test(line) == false) && (recordLabelRegexp.test(line) == false)) { | 158 | while ((line != "") && (fieldLabelRegexp.test(line) == false) && (recordLabelRegexp.test(line) == false)) { |
162 | var newLineValue; | 159 | var newLineValue; |
163 | 160 | ||
164 | newLineValue = line.match(fullLineRegexp)[1]; | 161 | newLineValue = line.match(fullLineRegexp)[1]; |
165 | if (newLineValue != "\n") { | 162 | if (newLineValue != "\n") { |
166 | isMultiline = true; | 163 | isMultiline = true; |
167 | } | 164 | } |
168 | fieldValue += newLineValue; | 165 | fieldValue += newLineValue; |
169 | line = RegExp.rightContext; | 166 | line = RegExp.rightContext; |
170 | } | 167 | } |
171 | 168 | ||
172 | if (isMultiline) { | 169 | if (isMultiline) { |
173 | fieldValue = fieldValue.replace(/\n$/g, ""); | 170 | fieldValue = fieldValue.replace(/\n$/g, ""); |
174 | } else { | 171 | } else { |
175 | fieldValue = fieldValue.replace(/\n\n$/g, ""); | 172 | fieldValue = fieldValue.replace(/\n\n$/g, ""); |
176 | } | 173 | } |
177 | 174 | ||
178 | line = line.replace(/^\n/, ''); | 175 | line = line.replace(/^\n/, ''); |
179 | } | 176 | } |
180 | 177 | ||
181 | result[fieldName] = fieldValue; | 178 | result[fieldName] = fieldValue; |
182 | } | 179 | } |
183 | } else { | 180 | } else { |
184 | result = null; | 181 | result = null; |
185 | } | 182 | } |
186 | 183 | ||
187 | aContext.line = line; | 184 | aContext.line = line; |
188 | 185 | ||
189 | return result; | 186 | return result; |
190 | }, | 187 | }, |
191 | 188 | ||
192 | //------------------------------------------------------------------------- | 189 | //------------------------------------------------------------------------- |
193 | __syntaxFix__: "syntax fix" | 190 | __syntaxFix__: "syntax fix" |
194 | }); | 191 | }); |
195 | 192 | ||
196 | 193 | ||
diff --git a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js index 04beb85..36cda88 100644 --- a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js +++ b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js | |||
@@ -1,176 +1,173 @@ | |||
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 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.KeyValueObjectStore = function(args) { | 30 | Clipperz.KeyValueObjectStore = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | 32 | ||
36 | //this._name = args['name'] || "unnamed KeyValueObjectStore"; | 33 | //this._name = args['name'] || "unnamed KeyValueObjectStore"; |
37 | this._values = args['values'] || {}; | 34 | this._values = args['values'] || {}; |
38 | //this._referenceObjectStore = null; | 35 | //this._referenceObjectStore = null; |
39 | //console.log("new KeyValueObjectStore", args, this._values); | 36 | //console.log("new KeyValueObjectStore", args, this._values); |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, { | 41 | Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, { |
45 | 42 | ||
46 | 'values': function() { | 43 | 'values': function() { |
47 | return this._values; | 44 | return this._values; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | 'initWithValues': function (someValues) { | 47 | 'initWithValues': function (someValues) { |
51 | this._values = Clipperz.Base.deepClone(someValues) || {}; | 48 | this._values = Clipperz.Base.deepClone(someValues) || {}; |
52 | return this; | 49 | return this; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | 'setValues': function (someValues) { | 52 | 'setValues': function (someValues) { |
56 | //console.log("KeyValueObjectStore.setValues", someValues); | 53 | //console.log("KeyValueObjectStore.setValues", someValues); |
57 | this._values = someValues; | 54 | this._values = someValues; |
58 | return this; | 55 | return this; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //'initWithObjectStore': function (anObjectStore) { | 58 | //'initWithObjectStore': function (anObjectStore) { |
62 | // this._referenceObjectStore = anObjectStore; | 59 | // this._referenceObjectStore = anObjectStore; |
63 | //}, | 60 | //}, |
64 | 61 | ||
65 | 'removeAllData': function () { | 62 | 'removeAllData': function () { |
66 | this._values = {}; | 63 | this._values = {}; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'getValue': function(aKeyPath) { | 68 | 'getValue': function(aKeyPath) { |
72 | var result; | 69 | var result; |
73 | var keys; | 70 | var keys; |
74 | var i,c; | 71 | var i,c; |
75 | 72 | ||
76 | result = this.values(); | 73 | result = this.values(); |
77 | 74 | ||
78 | keys = (aKeyPath + '').split('.'); | 75 | keys = (aKeyPath + '').split('.'); |
79 | c = keys.length; | 76 | c = keys.length; |
80 | i = 0; | 77 | i = 0; |
81 | 78 | ||
82 | while ((i<c) && (result != null)) { | 79 | while ((i<c) && (result != null)) { |
83 | if (typeof result[keys[i]] != 'undefined') { | 80 | if (typeof result[keys[i]] != 'undefined') { |
84 | result = result[keys[i]]; | 81 | result = result[keys[i]]; |
85 | } else { | 82 | } else { |
86 | result = null; | 83 | result = null; |
87 | } | 84 | } |
88 | 85 | ||
89 | i++; | 86 | i++; |
90 | } | 87 | } |
91 | 88 | ||
92 | return result; | 89 | return result; |
93 | }, | 90 | }, |
94 | 91 | ||
95 | //------------------------------------------------------------------------- | 92 | //------------------------------------------------------------------------- |
96 | 93 | ||
97 | 'setValue': function(aKeyPath, aValue) { | 94 | 'setValue': function(aKeyPath, aValue) { |
98 | var targetObject; | 95 | var targetObject; |
99 | var keys; | 96 | var keys; |
100 | var i,c; | 97 | var i,c; |
101 | 98 | ||
102 | //console.log(">>> KeyValueObjectStore.setValue", this, this.values(), aKeyPath, aValue); | 99 | //console.log(">>> KeyValueObjectStore.setValue", this, this.values(), aKeyPath, aValue); |
103 | targetObject = this.values(); | 100 | targetObject = this.values(); |
104 | keys = (aKeyPath + '').split('.'); | 101 | keys = (aKeyPath + '').split('.'); |
105 | c = keys.length - 1; | 102 | c = keys.length - 1; |
106 | for (i=0; i<c; i++) { | 103 | for (i=0; i<c; i++) { |
107 | //console.log("--- KeyValueObjectStore.setValue", i, targetObject, keys[i]); | 104 | //console.log("--- KeyValueObjectStore.setValue", i, targetObject, keys[i]); |
108 | if (typeof targetObject[keys[i]] == 'undefined') { | 105 | if (typeof targetObject[keys[i]] == 'undefined') { |
109 | targetObject[keys[i]] = {} | 106 | targetObject[keys[i]] = {} |
110 | } | 107 | } |
111 | 108 | ||
112 | targetObject = targetObject[keys[i]]; | 109 | targetObject = targetObject[keys[i]]; |
113 | } | 110 | } |
114 | 111 | ||
115 | targetObject[keys[c]] = aValue; | 112 | targetObject[keys[c]] = aValue; |
116 | //console.log("<<< KeyValueObjectStore.setValue"); | 113 | //console.log("<<< KeyValueObjectStore.setValue"); |
117 | 114 | ||
118 | return aValue; | 115 | return aValue; |
119 | }, | 116 | }, |
120 | 117 | ||
121 | //------------------------------------------------------------------------- | 118 | //------------------------------------------------------------------------- |
122 | 119 | ||
123 | 'removeValue': function (aKeyPath) { | 120 | 'removeValue': function (aKeyPath) { |
124 | // this.setValue(aKeyPath, null); | 121 | // this.setValue(aKeyPath, null); |
125 | 122 | ||
126 | var targetObject; | 123 | var targetObject; |
127 | var keys; | 124 | var keys; |
128 | var i,c; | 125 | var i,c; |
129 | 126 | ||
130 | targetObject = this.values(); | 127 | targetObject = this.values(); |
131 | keys = ('' + aKeyPath).split('.'); | 128 | keys = ('' + aKeyPath).split('.'); |
132 | c = keys.length - 1; | 129 | c = keys.length - 1; |
133 | for (i=0; i<c; i++) { | 130 | for (i=0; i<c; i++) { |
134 | if (typeof targetObject[keys[i]] == 'undefined') { | 131 | if (typeof targetObject[keys[i]] == 'undefined') { |
135 | targetObject[keys[i]] = {} | 132 | targetObject[keys[i]] = {} |
136 | } | 133 | } |
137 | 134 | ||
138 | targetObject = targetObject[keys[i]]; | 135 | targetObject = targetObject[keys[i]]; |
139 | } | 136 | } |
140 | 137 | ||
141 | delete targetObject[keys[c]]; | 138 | delete targetObject[keys[c]]; |
142 | }, | 139 | }, |
143 | 140 | ||
144 | //------------------------------------------------------------------------- | 141 | //------------------------------------------------------------------------- |
145 | 142 | ||
146 | 'deferredGetOrSet': function(aKeyPath, aGetterFunction) { | 143 | 'deferredGetOrSet': function(aKeyPath, aGetterFunction) { |
147 | var deferredResult; | 144 | var deferredResult; |
148 | 145 | ||
149 | if (this.getValue(aKeyPath) != null) { | 146 | if (this.getValue(aKeyPath) != null) { |
150 | deferredResult = MochiKit.Async.succeed(this.getValue(aKeyPath)); | 147 | deferredResult = MochiKit.Async.succeed(this.getValue(aKeyPath)); |
151 | } else { | 148 | } else { |
152 | deferredResult = new Clipperz.Async.Deferred("KeyValueObjectStore.deferredGetOrSet [" + aKeyPath + "]", {trace:false}); | 149 | deferredResult = new Clipperz.Async.Deferred("KeyValueObjectStore.deferredGetOrSet [" + aKeyPath + "]", {trace:false}); |
153 | 150 | ||
154 | deferredResult.addCallback(aGetterFunction); | 151 | deferredResult.addCallback(aGetterFunction); |
155 | deferredResult.addMethod(this, 'setValue', aKeyPath); | 152 | deferredResult.addMethod(this, 'setValue', aKeyPath); |
156 | deferredResult.callback(); | 153 | deferredResult.callback(); |
157 | } | 154 | } |
158 | 155 | ||
159 | return deferredResult; | 156 | return deferredResult; |
160 | }, | 157 | }, |
161 | 158 | ||
162 | //------------------------------------------------------------------------- | 159 | //------------------------------------------------------------------------- |
163 | 160 | ||
164 | 'isEmpty': function () { | 161 | 'isEmpty': function () { |
165 | return (MochiKit.Base.keys(this.values()).length == 0) | 162 | return (MochiKit.Base.keys(this.values()).length == 0) |
166 | }, | 163 | }, |
167 | 164 | ||
168 | //------------------------------------------------------------------------- | 165 | //------------------------------------------------------------------------- |
169 | /* | 166 | /* |
170 | 'dumpData': function () { | 167 | 'dumpData': function () { |
171 | return Clipperz.Base.serializeJSON(this.values()); | 168 | return Clipperz.Base.serializeJSON(this.values()); |
172 | }, | 169 | }, |
173 | */ | 170 | */ |
174 | //------------------------------------------------------------------------- | 171 | //------------------------------------------------------------------------- |
175 | __syntaxFix__: "syntax fix" | 172 | __syntaxFix__: "syntax fix" |
176 | }); | 173 | }); |
diff --git a/frontend/gamma/js/Clipperz/Logging.js b/frontend/gamma/js/Clipperz/Logging.js index d6c107e..77a0896 100644 --- a/frontend/gamma/js/Clipperz/Logging.js +++ b/frontend/gamma/js/Clipperz/Logging.js | |||
@@ -1,42 +1,39 @@ | |||
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 | Clipperz.Base.module('Clipperz'); | 26 | Clipperz.Base.module('Clipperz'); |
30 | 27 | ||
31 | if (typeof console == 'undefined') { | 28 | if (typeof console == 'undefined') { |
32 | Clipperz.log = MochiKit.Logging.logDebug; | 29 | Clipperz.log = MochiKit.Logging.logDebug; |
33 | // Safari/WebKit 4 | 30 | // Safari/WebKit 4 |
34 | } else if (navigator.userAgent.match(/WebKit/)) { | 31 | } else if (navigator.userAgent.match(/WebKit/)) { |
35 | //Clipperz.log = console.log; | 32 | //Clipperz.log = console.log; |
36 | Clipperz.log = MochiKit.Logging.logDebug; | 33 | Clipperz.log = MochiKit.Logging.logDebug; |
37 | } else if (navigator.userAgent.match(/Gecko/)) { | 34 | } else if (navigator.userAgent.match(/Gecko/)) { |
38 | Clipperz.log = function () { | 35 | Clipperz.log = function () { |
39 | // firebug 1.3 bug see http://code.google.com/p/fbug/issues/detail?id=1347 | 36 | // firebug 1.3 bug see http://code.google.com/p/fbug/issues/detail?id=1347 |
40 | console.log.apply(window._firebug, arguments); | 37 | console.log.apply(window._firebug, arguments); |
41 | }; | 38 | }; |
42 | } \ No newline at end of file | 39 | } \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js b/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js index 789d6b8..897beed 100644 --- a/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js +++ b/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js | |||
@@ -1,196 +1,193 @@ | |||
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 | /* | 26 | /* |
30 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 27 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
31 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 28 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
32 | 29 | ||
33 | Clipperz.PM.BookmarkletProcessor = function(aConfiguration) { | 30 | Clipperz.PM.BookmarkletProcessor = function(aConfiguration) { |
34 | this._configuration = aConfiguration; | 31 | this._configuration = aConfiguration; |
35 | 32 | ||
36 | this._editableFields = null; | 33 | this._editableFields = null; |
37 | this._favicon = null; | 34 | this._favicon = null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | Clipperz.PM.BookmarkletProcessor.prototype = MochiKit.Base.update(null, { | 39 | Clipperz.PM.BookmarkletProcessor.prototype = MochiKit.Base.update(null, { |
43 | 40 | ||
44 | 'toString': function() { | 41 | 'toString': function() { |
45 | return "Clipperz.PM.BookmarkletProcessor"; | 42 | return "Clipperz.PM.BookmarkletProcessor"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'configuration': function() { | 47 | 'configuration': function() { |
51 | return this._configuration; | 48 | return this._configuration; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'pageTitle': function() { | 53 | 'pageTitle': function() { |
57 | return this.configuration().page.title; | 54 | return this.configuration().page.title; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'fields': function() { | 59 | 'fields': function() { |
63 | return this.configuration().form.inputs; | 60 | return this.configuration().form.inputs; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'editableFields': function() { | 65 | 'editableFields': function() { |
69 | if (this._editableFields == null) { | 66 | if (this._editableFields == null) { |
70 | this._editableFields = MochiKit.Base.filter(function(aField) { | 67 | this._editableFields = MochiKit.Base.filter(function(aField) { |
71 | var result; | 68 | var result; |
72 | var type; | 69 | var type; |
73 | 70 | ||
74 | type = aField['type'].toLowerCase(); | 71 | type = aField['type'].toLowerCase(); |
75 | result = ((type != 'hidden') && (type != 'submit') && (type != 'checkbox') && (type != 'radio') && (type != 'select')); | 72 | result = ((type != 'hidden') && (type != 'submit') && (type != 'checkbox') && (type != 'radio') && (type != 'select')); |
76 | 73 | ||
77 | return result; | 74 | return result; |
78 | }, this.fields()) | 75 | }, this.fields()) |
79 | } | 76 | } |
80 | 77 | ||
81 | return this._editableFields; | 78 | return this._editableFields; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
85 | 82 | ||
86 | 'hostname': function() { | 83 | 'hostname': function() { |
87 | if (this._hostname == null) { | 84 | if (this._hostname == null) { |
88 | var actionUrl; | 85 | var actionUrl; |
89 | 86 | ||
90 | actionUrl = this.configuration()['form']['attributes']['action']; | 87 | actionUrl = this.configuration()['form']['attributes']['action']; |
91 | this._hostname = actionUrl.replace(/ ^ h t t p s ? : \ / \ / ( [ ^ \ / ] * ) \ / . * /, '$1'); | 88 | this._hostname = actionUrl.replace(/ ^ h t t p s ? : \ / \ / ( [ ^ \ / ] * ) \ / . * /, '$1'); |
92 | } | 89 | } |
93 | 90 | ||
94 | return this._hostname; | 91 | return this._hostname; |
95 | }, | 92 | }, |
96 | 93 | ||
97 | 'favicon': function() { | 94 | 'favicon': function() { |
98 | if (this._favicon == null) { | 95 | if (this._favicon == null) { |
99 | this._favicon = "http://" + this.hostname() + "/favicon.ico"; | 96 | this._favicon = "http://" + this.hostname() + "/favicon.ico"; |
100 | } | 97 | } |
101 | 98 | ||
102 | return this._favicon; | 99 | return this._favicon; |
103 | }, | 100 | }, |
104 | 101 | ||
105 | //------------------------------------------------------------------------- | 102 | //------------------------------------------------------------------------- |
106 | __syntaxFix__: "syntax fix" | 103 | __syntaxFix__: "syntax fix" |
107 | }); | 104 | }); |
108 | 105 | ||
109 | //############################################################################# | 106 | //############################################################################# |
110 | / * | 107 | / * |
111 | Clipperz.PM.BookmarkletProcessor.createRecordFromBookmarkletConfiguration = function(anUser, aConfiguration) { | 108 | Clipperz.PM.BookmarkletProcessor.createRecordFromBookmarkletConfiguration = function(anUser, aConfiguration) { |
112 | var processor; | 109 | var processor; |
113 | var record; | 110 | var record; |
114 | var recordVersion; | 111 | var recordVersion; |
115 | var directLogin; | 112 | var directLogin; |
116 | var bindings; | 113 | var bindings; |
117 | var i,c; | 114 | var i,c; |
118 | 115 | ||
119 | processor = new Clipperz.PM.BookmarkletProcessor(aConfiguration); | 116 | processor = new Clipperz.PM.BookmarkletProcessor(aConfiguration); |
120 | 117 | ||
121 | record = new Clipperz.PM.DataModel.Record({ | 118 | record = new Clipperz.PM.DataModel.Record({ |
122 | 'label':processor.pageTitle(), | 119 | 'label':processor.pageTitle(), |
123 | 'notes':"", | 120 | 'notes':"", |
124 | 'user': anUser | 121 | 'user': anUser |
125 | }); | 122 | }); |
126 | recordVersion = new Clipperz.PM.DataModel.Record.Version(record, {}) | 123 | recordVersion = new Clipperz.PM.DataModel.Record.Version(record, {}) |
127 | record.setCurrentVersion(recordVersion); | 124 | record.setCurrentVersion(recordVersion); |
128 | 125 | ||
129 | bindings = {}; | 126 | bindings = {}; |
130 | 127 | ||
131 | c = processor.editableFields().length; | 128 | c = processor.editableFields().length; |
132 | for (i=0; i<c; i++) { | 129 | for (i=0; i<c; i++) { |
133 | var formField; | 130 | var formField; |
134 | var recordField; | 131 | var recordField; |
135 | 132 | ||
136 | formField = processor.editableFields()[i]; | 133 | formField = processor.editableFields()[i]; |
137 | recordField = new Clipperz.PM.DataModel.RecordField({ | 134 | recordField = new Clipperz.PM.DataModel.RecordField({ |
138 | 'label':formField['name'], | 135 | 'label':formField['name'], |
139 | 'value':formField['value'], | 136 | 'value':formField['value'], |
140 | 'type': Clipperz.PM.Strings.inputTypeToRecordFieldType[formField['type']], | 137 | 'type': Clipperz.PM.Strings.inputTypeToRecordFieldType[formField['type']], |
141 | 'hidden': false, | 138 | 'hidden': false, |
142 | 'recordVersion':recordVersion | 139 | 'recordVersion':recordVersion |
143 | }); | 140 | }); |
144 | recordVersion.addField(recordField); | 141 | recordVersion.addField(recordField); |
145 | 142 | ||
146 | bindings[formField['name']] = recordField.key(); | 143 | bindings[formField['name']] = recordField.key(); |
147 | } | 144 | } |
148 | 145 | ||
149 | directLogin = new Clipperz.PM.DataModel.DirectLogin({ | 146 | directLogin = new Clipperz.PM.DataModel.DirectLogin({ |
150 | 'record': record, | 147 | 'record': record, |
151 | 'label': processor.pageTitle(), | 148 | 'label': processor.pageTitle(), |
152 | 'favicon': processor.favicon(), | 149 | 'favicon': processor.favicon(), |
153 | 'formData': processor.configuration()['form'], | 150 | 'formData': processor.configuration()['form'], |
154 | 'bindingData':bindings, | 151 | 'bindingData':bindings, |
155 | 'bookmarkletVersion':'0.2' | 152 | 'bookmarkletVersion':'0.2' |
156 | }); | 153 | }); |
157 | record.addDirectLogin(directLogin); | 154 | record.addDirectLogin(directLogin); |
158 | 155 | ||
159 | anUser.addRecord(record); | 156 | anUser.addRecord(record); |
160 | 157 | ||
161 | return record; | 158 | return record; |
162 | }; | 159 | }; |
163 | * / | 160 | * / |
164 | //----------------------------------------------------------------------------- | 161 | //----------------------------------------------------------------------------- |
165 | 162 | ||
166 | Clipperz.PM.BookmarkletProcessor.sanitizeBookmarkletConfiguration = function(aConfiguration) { | 163 | Clipperz.PM.BookmarkletProcessor.sanitizeBookmarkletConfiguration = function(aConfiguration) { |
167 | var result; | 164 | var result; |
168 | 165 | ||
169 | //throw "XSS Bookmarklet attempt"; | 166 | //throw "XSS Bookmarklet attempt"; |
170 | 167 | ||
171 | result = aConfiguration; | 168 | result = aConfiguration; |
172 | 169 | ||
173 | return result; | 170 | return result; |
174 | }; | 171 | }; |
175 | 172 | ||
176 | //----------------------------------------------------------------------------- | 173 | //----------------------------------------------------------------------------- |
177 | 174 | ||
178 | Clipperz.PM.BookmarkletProcessor.checkBookmarkletConfiguration = function(aConfiguration) { | 175 | Clipperz.PM.BookmarkletProcessor.checkBookmarkletConfiguration = function(aConfiguration) { |
179 | var result; | 176 | var result; |
180 | 177 | ||
181 | try { | 178 | try { |
182 | result = Clipperz.Base.evalJSON(aConfiguration); | 179 | result = Clipperz.Base.evalJSON(aConfiguration); |
183 | result = Clipperz.PM.BookmarkletProcessor.sanitizeBookmarkletConfiguration(result); | 180 | result = Clipperz.PM.BookmarkletProcessor.sanitizeBookmarkletConfiguration(result); |
184 | 181 | ||
185 | if (result['version'] != '0.2.3') { | 182 | if (result['version'] != '0.2.3') { |
186 | throw "WrongBookmarkletVersion"; | 183 | throw "WrongBookmarkletVersion"; |
187 | } | 184 | } |
188 | } catch (exception) { | 185 | } catch (exception) { |
189 | throw exception; | 186 | throw exception; |
190 | } | 187 | } |
191 | 188 | ||
192 | return result; | 189 | return result; |
193 | }; | 190 | }; |
194 | 191 | ||
195 | //----------------------------------------------------------------------------- | 192 | //----------------------------------------------------------------------------- |
196 | */ \ No newline at end of file | 193 | */ \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/Connection.js b/frontend/gamma/js/Clipperz/PM/Connection.js index 6e58c60..b4e8aaa 100644 --- a/frontend/gamma/js/Clipperz/PM/Connection.js +++ b/frontend/gamma/js/Clipperz/PM/Connection.js | |||
@@ -1,216 +1,213 @@ | |||
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 | 28 | ||
32 | //----------------------------------------------------------------------------- | 29 | //----------------------------------------------------------------------------- |
33 | // | 30 | // |
34 | // Abstract C O N N E C T I O N class | 31 | // Abstract C O N N E C T I O N class |
35 | // | 32 | // |
36 | //----------------------------------------------------------------------------- | 33 | //----------------------------------------------------------------------------- |
37 | 34 | ||
38 | Clipperz.PM.Connection = function (args) { | 35 | Clipperz.PM.Connection = function (args) { |
39 | args = args || {}; | 36 | args = args || {}; |
40 | 37 | ||
41 | this._proxy = args.proxy || Clipperz.PM.Proxy.defaultProxy; | 38 | this._proxy = args.proxy || Clipperz.PM.Proxy.defaultProxy; |
42 | this._getCredentialsFunction = args.getCredentialsFunction; | 39 | this._getCredentialsFunction = args.getCredentialsFunction; |
43 | 40 | ||
44 | this._clipperz_pm_crypto_version = null; | 41 | this._clipperz_pm_crypto_version = null; |
45 | this._connectionId = null; | 42 | this._connectionId = null; |
46 | this._sharedSecret = null; | 43 | this._sharedSecret = null; |
47 | 44 | ||
48 | return this; | 45 | return this; |
49 | } | 46 | } |
50 | 47 | ||
51 | Clipperz.PM.Connection.prototype = MochiKit.Base.update(null, { | 48 | Clipperz.PM.Connection.prototype = MochiKit.Base.update(null, { |
52 | 49 | ||
53 | 'toString': function() { | 50 | 'toString': function() { |
54 | return "Connection [" + this.version() + "]"; | 51 | return "Connection [" + this.version() + "]"; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //========================================================================= | 54 | //========================================================================= |
58 | 55 | ||
59 | 'version': function() { | 56 | 'version': function() { |
60 | throw Clipperz.Base.exception.AbstractMethod; | 57 | throw Clipperz.Base.exception.AbstractMethod; |
61 | }, | 58 | }, |
62 | 59 | ||
63 | 'clipperz_pm_crypto_version': function() { | 60 | 'clipperz_pm_crypto_version': function() { |
64 | if (this._clipperz_pm_crypto_version == null) { | 61 | if (this._clipperz_pm_crypto_version == null) { |
65 | var connectionVersions; | 62 | var connectionVersions; |
66 | varversions; | 63 | varversions; |
67 | varversion; | 64 | varversion; |
68 | var i, c; | 65 | var i, c; |
69 | 66 | ||
70 | version = null; | 67 | version = null; |
71 | connectionVersions = Clipperz.PM.Connection.communicationProtocol.versions; | 68 | connectionVersions = Clipperz.PM.Connection.communicationProtocol.versions; |
72 | versions = MochiKit.Base.keys(connectionVersions); | 69 | versions = MochiKit.Base.keys(connectionVersions); |
73 | c = versions.length; | 70 | c = versions.length; |
74 | for (i=0; i<c; i++) { | 71 | for (i=0; i<c; i++) { |
75 | if (! (versions[i] == 'current')) { | 72 | if (! (versions[i] == 'current')) { |
76 | if (this instanceof connectionVersions[versions[i]]) { | 73 | if (this instanceof connectionVersions[versions[i]]) { |
77 | version = versions[i]; | 74 | version = versions[i]; |
78 | }; | 75 | }; |
79 | } | 76 | } |
80 | } | 77 | } |
81 | 78 | ||
82 | this._clipperz_pm_crypto_version = version; | 79 | this._clipperz_pm_crypto_version = version; |
83 | } | 80 | } |
84 | 81 | ||
85 | return this._clipperz_pm_crypto_version; | 82 | return this._clipperz_pm_crypto_version; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'defaultErrorHandler': function(anErrorString, anException) { | 87 | 'defaultErrorHandler': function(anErrorString, anException) { |
91 | MochiKit.Logging.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")"); | 88 | MochiKit.Logging.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")"); |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
95 | 92 | ||
96 | 'getCredentialsFunction': function () { | 93 | 'getCredentialsFunction': function () { |
97 | return this._getCredentialsFunction; | 94 | return this._getCredentialsFunction; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | 'normalizedCredentials': function(someValues) { | 97 | 'normalizedCredentials': function(someValues) { |
101 | throw Clipperz.Base.exception.AbstractMethod; | 98 | throw Clipperz.Base.exception.AbstractMethod; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //========================================================================= | 101 | //========================================================================= |
105 | 102 | ||
106 | 'proxy': function () { | 103 | 'proxy': function () { |
107 | return this._proxy; | 104 | return this._proxy; |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //========================================================================= | 107 | //========================================================================= |
111 | 108 | ||
112 | 'register': function () { | 109 | 'register': function () { |
113 | throw Clipperz.Base.exception.AbstractMethod; | 110 | throw Clipperz.Base.exception.AbstractMethod; |
114 | }, | 111 | }, |
115 | 112 | ||
116 | 'login': function() { | 113 | 'login': function() { |
117 | throw Clipperz.Base.exception.AbstractMethod; | 114 | throw Clipperz.Base.exception.AbstractMethod; |
118 | }, | 115 | }, |
119 | 116 | ||
120 | //------------------------------------------------------------------------- | 117 | //------------------------------------------------------------------------- |
121 | 118 | ||
122 | 'message': function(someArguments, aCallback) { | 119 | 'message': function(someArguments, aCallback) { |
123 | throw Clipperz.Base.exception.AbstractMethod; | 120 | throw Clipperz.Base.exception.AbstractMethod; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
127 | 124 | ||
128 | 'serverSideUserCredentials': function() { | 125 | 'serverSideUserCredentials': function() { |
129 | throw Clipperz.Base.exception.AbstractMethod; | 126 | throw Clipperz.Base.exception.AbstractMethod; |
130 | }, | 127 | }, |
131 | 128 | ||
132 | //========================================================================= | 129 | //========================================================================= |
133 | 130 | ||
134 | 'sharedSecret': function () { | 131 | 'sharedSecret': function () { |
135 | return this._sharedSecret; | 132 | return this._sharedSecret; |
136 | }, | 133 | }, |
137 | 134 | ||
138 | 'setSharedSecret': function (aValue) { | 135 | 'setSharedSecret': function (aValue) { |
139 | this._sharedSecret = aValue; | 136 | this._sharedSecret = aValue; |
140 | }, | 137 | }, |
141 | 138 | ||
142 | //------------------------------------------------------------------------- | 139 | //------------------------------------------------------------------------- |
143 | 140 | ||
144 | 'connectionId': function() { | 141 | 'connectionId': function() { |
145 | return this._connectionId; | 142 | return this._connectionId; |
146 | }, | 143 | }, |
147 | 144 | ||
148 | 'setConnectionId': function(aValue) { | 145 | 'setConnectionId': function(aValue) { |
149 | this._connectionId = aValue; | 146 | this._connectionId = aValue; |
150 | }, | 147 | }, |
151 | 148 | ||
152 | //========================================================================= | 149 | //========================================================================= |
153 | /* | 150 | /* |
154 | //TODO: ????? | 151 | //TODO: ????? |
155 | 'oneTimePassword': function() { | 152 | 'oneTimePassword': function() { |
156 | return this._oneTimePassword; | 153 | return this._oneTimePassword; |
157 | }, | 154 | }, |
158 | 155 | ||
159 | 'setOneTimePassword': function(aValue) { | 156 | 'setOneTimePassword': function(aValue) { |
160 | this._oneTimePassword = aValue; | 157 | this._oneTimePassword = aValue; |
161 | }, | 158 | }, |
162 | */ | 159 | */ |
163 | //========================================================================= | 160 | //========================================================================= |
164 | 161 | ||
165 | 'reset': function() { | 162 | 'reset': function() { |
166 | this.setSharedSecret(null); | 163 | this.setSharedSecret(null); |
167 | this.setConnectionId(null); | 164 | this.setConnectionId(null); |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //========================================================================= | 167 | //========================================================================= |
171 | __syntaxFix__: "syntax fix" | 168 | __syntaxFix__: "syntax fix" |
172 | 169 | ||
173 | } | 170 | } |
174 | ); | 171 | ); |
175 | 172 | ||
176 | 173 | ||
177 | if (typeof(Clipperz.PM.Connection.SRP) == 'undefined') { Clipperz.PM.Connection.SRP = {}; } | 174 | if (typeof(Clipperz.PM.Connection.SRP) == 'undefined') { Clipperz.PM.Connection.SRP = {}; } |
178 | //----------------------------------------------------------------------------- | 175 | //----------------------------------------------------------------------------- |
179 | // | 176 | // |
180 | // S R P [ 1 . 0 ] C O N N E C T I O N class | 177 | // S R P [ 1 . 0 ] C O N N E C T I O N class |
181 | // | 178 | // |
182 | //----------------------------------------------------------------------------- | 179 | //----------------------------------------------------------------------------- |
183 | 180 | ||
184 | Clipperz.PM.Connection.SRP['1.0'] = function (args) { | 181 | Clipperz.PM.Connection.SRP['1.0'] = function (args) { |
185 | Clipperz.PM.Connection.call(this, args); | 182 | Clipperz.PM.Connection.call(this, args); |
186 | 183 | ||
187 | return this; | 184 | return this; |
188 | } | 185 | } |
189 | 186 | ||
190 | Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.PM.Connection(), { | 187 | Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.PM.Connection(), { |
191 | 188 | ||
192 | 'version': function() { | 189 | 'version': function() { |
193 | return '1.0'; | 190 | return '1.0'; |
194 | }, | 191 | }, |
195 | 192 | ||
196 | //========================================================================= | 193 | //========================================================================= |
197 | 194 | ||
198 | 'register': function (someUserData) { | 195 | 'register': function (someUserData) { |
199 | vardeferredResult; | 196 | vardeferredResult; |
200 | var cryptoVersion; | 197 | var cryptoVersion; |
201 | var srpConnection; | 198 | var srpConnection; |
202 | 199 | ||
203 | cryptoVersion = this.clipperz_pm_crypto_version(); | 200 | cryptoVersion = this.clipperz_pm_crypto_version(); |
204 | 201 | ||
205 | deferredResult = new Clipperz.Async.Deferred("Connection.registerWithVersion", {trace:false}); | 202 | deferredResult = new Clipperz.Async.Deferred("Connection.registerWithVersion", {trace:false}); |
206 | deferredResult.collectResults({ | 203 | deferredResult.collectResults({ |
207 | 'credentials': [ | 204 | 'credentials': [ |
208 | this.getCredentialsFunction(), | 205 | this.getCredentialsFunction(), |
209 | MochiKit.Base.method(this, 'normalizedCredentials'), | 206 | MochiKit.Base.method(this, 'normalizedCredentials'), |
210 | MochiKit.Base.bind(function(someCredentials) { | 207 | MochiKit.Base.bind(function(someCredentials) { |
211 | var srpConnection; | 208 | var srpConnection; |
212 | var result; | 209 | var result; |
213 | 210 | ||
214 | srpConnection = new Clipperz.Crypto.SRP.Connection({ C:someCredentials['username'], P:someCredentials['password'], hash:this.hash() }); | 211 | srpConnection = new Clipperz.Crypto.SRP.Connection({ C:someCredentials['username'], P:someCredentials['password'], hash:this.hash() }); |
215 | result = srpConnection.serverSideCredentials(); | 212 | result = srpConnection.serverSideCredentials(); |
216 | result['version'] = Clipperz.PM.Connection.communicationProtocol.currentVersion; | 213 | result['version'] = Clipperz.PM.Connection.communicationProtocol.currentVersion; |
diff --git a/frontend/gamma/js/Clipperz/PM/Crypto.js b/frontend/gamma/js/Clipperz/PM/Crypto.js index bfafbea..31fe349 100644 --- a/frontend/gamma/js/Clipperz/PM/Crypto.js +++ b/frontend/gamma/js/Clipperz/PM/Crypto.js | |||
@@ -1,216 +1,213 @@ | |||
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.Crypto) == 'undefined') { Clipperz.PM.Crypto = {}; } | 28 | if (typeof(Clipperz.PM.Crypto) == 'undefined') { Clipperz.PM.Crypto = {}; } |
32 | 29 | ||
33 | Clipperz.PM.Crypto.VERSION = "0.2"; | 30 | Clipperz.PM.Crypto.VERSION = "0.2"; |
34 | Clipperz.PM.Crypto.NAME = "Clipperz.PM.Crypto"; | 31 | Clipperz.PM.Crypto.NAME = "Clipperz.PM.Crypto"; |
35 | 32 | ||
36 | Clipperz.PM.Crypto.encryptingFunctions = {}; | 33 | Clipperz.PM.Crypto.encryptingFunctions = {}; |
37 | 34 | ||
38 | MochiKit.Base.update(Clipperz.PM.Crypto, { | 35 | MochiKit.Base.update(Clipperz.PM.Crypto, { |
39 | 36 | ||
40 | '__repr__': function () { | 37 | '__repr__': function () { |
41 | return "[" + this.NAME + " " + this.VERSION + "]"; | 38 | return "[" + this.NAME + " " + this.VERSION + "]"; |
42 | }, | 39 | }, |
43 | 40 | ||
44 | //------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------- |
45 | 42 | ||
46 | 'toString': function () { | 43 | 'toString': function () { |
47 | return this.__repr__(); | 44 | return this.__repr__(); |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | /* | 48 | /* |
52 | 'communicationProtocol': { | 49 | 'communicationProtocol': { |
53 | 'currentVersion': '0.2', | 50 | 'currentVersion': '0.2', |
54 | 'versions': { | 51 | 'versions': { |
55 | '0.1': Clipperz.PM.Connection.SRP['1.0'],//Clipperz.Crypto.SRP.versions['1.0'].Connection, | 52 | '0.1': Clipperz.PM.Connection.SRP['1.0'],//Clipperz.Crypto.SRP.versions['1.0'].Connection, |
56 | '0.2': Clipperz.PM.Connection.SRP['1.1']//Clipperz.Crypto.SRP.versions['1.1'].Connection | 53 | '0.2': Clipperz.PM.Connection.SRP['1.1']//Clipperz.Crypto.SRP.versions['1.1'].Connection |
57 | }, | 54 | }, |
58 | 'fallbackVersions': { | 55 | 'fallbackVersions': { |
59 | 'current':'0.1', | 56 | 'current':'0.1', |
60 | '0.2': '0.1', | 57 | '0.2': '0.1', |
61 | '0.1': null | 58 | '0.1': null |
62 | } | 59 | } |
63 | }, | 60 | }, |
64 | */ | 61 | */ |
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'encryptingFunctions': { | 64 | 'encryptingFunctions': { |
68 | 'currentVersion': '0.3', | 65 | 'currentVersion': '0.3', |
69 | 'versions': { | 66 | 'versions': { |
70 | 67 | ||
71 | //##################################################################### | 68 | //##################################################################### |
72 | 69 | ||
73 | '0.1': { | 70 | '0.1': { |
74 | 'encrypt': function(aKey, aValue) { | 71 | 'encrypt': function(aKey, aValue) { |
75 | return Clipperz.Crypto.Base.encryptUsingSecretKey(aKey, Clipperz.Base.serializeJSON(aValue)); | 72 | return Clipperz.Crypto.Base.encryptUsingSecretKey(aKey, Clipperz.Base.serializeJSON(aValue)); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'deferredEncrypt': function(aKey, aValue) { | 75 | 'deferredEncrypt': function(aKey, aValue) { |
79 | var deferredResult; | 76 | var deferredResult; |
80 | 77 | ||
81 | deferredResult = new Clipperz.Async.Deferred("Crypto[0.1].deferredEncrypt"); | 78 | deferredResult = new Clipperz.Async.Deferred("Crypto[0.1].deferredEncrypt"); |
82 | deferredResult.addCallback(Clipperz.PM.Crypto.encryptingFunctions.versions['0.1'].encrypt, aKey, aValue); | 79 | deferredResult.addCallback(Clipperz.PM.Crypto.encryptingFunctions.versions['0.1'].encrypt, aKey, aValue); |
83 | deferredResult.callback(); | 80 | deferredResult.callback(); |
84 | 81 | ||
85 | return deferredResult; | 82 | return deferredResult; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | 'decrypt': function(aKey, aValue) { | 85 | 'decrypt': function(aKey, aValue) { |
89 | var result; | 86 | var result; |
90 | 87 | ||
91 | if (aValue != null) { | 88 | if (aValue != null) { |
92 | result = Clipperz.Base.evalJSON(Clipperz.Crypto.Base.decryptUsingSecretKey(aKey, aValue)); | 89 | result = Clipperz.Base.evalJSON(Clipperz.Crypto.Base.decryptUsingSecretKey(aKey, aValue)); |
93 | } else { | 90 | } else { |
94 | result = null; | 91 | result = null; |
95 | } | 92 | } |
96 | 93 | ||
97 | return result; | 94 | return result; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | 'deferredDecrypt': function(aKey, aValue) { | 97 | 'deferredDecrypt': function(aKey, aValue) { |
101 | var deferredResult; | 98 | var deferredResult; |
102 | 99 | ||
103 | deferredResult = new Clipperz.Async.Deferred("Crypto.[0.1].deferredDecrypt"); | 100 | deferredResult = new Clipperz.Async.Deferred("Crypto.[0.1].deferredDecrypt"); |
104 | deferredResult.addCallback(Clipperz.PM.Crypto.encryptingFunctions.versions['0.1'].decrypt, aKey, aValue); | 101 | deferredResult.addCallback(Clipperz.PM.Crypto.encryptingFunctions.versions['0.1'].decrypt, aKey, aValue); |
105 | deferredResult.callback(); | 102 | deferredResult.callback(); |
106 | 103 | ||
107 | return deferredResult; | 104 | return deferredResult; |
108 | }, | 105 | }, |
109 | 106 | ||
110 | 'hash': function(aValue) { | 107 | 'hash': function(aValue) { |
111 | var result; | 108 | var result; |
112 | var strngResult; | 109 | var strngResult; |
113 | 110 | ||
114 | stringResult = Clipperz.Crypto.Base.computeHashValue(aValue.asString()); //!!!!!!! | 111 | stringResult = Clipperz.Crypto.Base.computeHashValue(aValue.asString()); //!!!!!!! |
115 | result = new Clipperz.ByteArray("0x" + stringResult); | 112 | result = new Clipperz.ByteArray("0x" + stringResult); |
116 | 113 | ||
117 | return result; | 114 | return result; |
118 | }, | 115 | }, |
119 | 116 | ||
120 | 'deriveKey': function(aStringValue) { | 117 | 'deriveKey': function(aStringValue) { |
121 | return Clipperz.Crypto.Base.computeHashValue(aStringValue); | 118 | return Clipperz.Crypto.Base.computeHashValue(aStringValue); |
122 | } | 119 | } |
123 | }, | 120 | }, |
124 | 121 | ||
125 | //##################################################################### | 122 | //##################################################################### |
126 | 123 | ||
127 | '0.2': { | 124 | '0.2': { |
128 | 'encrypt': function(aKey, aValue, aNonce) { | 125 | 'encrypt': function(aKey, aValue, aNonce) { |
129 | var result; | 126 | var result; |
130 | varkey, value; | 127 | varkey, value; |
131 | var dataToEncrypt; | 128 | var dataToEncrypt; |
132 | var encryptedData; | 129 | var encryptedData; |
133 | 130 | ||
134 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); | 131 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); |
135 | value = new Clipperz.ByteArray(Clipperz.Base.serializeJSON(aValue)); | 132 | value = new Clipperz.ByteArray(Clipperz.Base.serializeJSON(aValue)); |
136 | dataToEncrypt = Clipperz.Crypto.SHA.sha_d256(value).appendBlock(value); | 133 | dataToEncrypt = Clipperz.Crypto.SHA.sha_d256(value).appendBlock(value); |
137 | encryptedData = Clipperz.Crypto.AES.encrypt(key, dataToEncrypt, aNonce); | 134 | encryptedData = Clipperz.Crypto.AES.encrypt(key, dataToEncrypt, aNonce); |
138 | result = encryptedData.toBase64String(); | 135 | result = encryptedData.toBase64String(); |
139 | 136 | ||
140 | return result; | 137 | return result; |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'deferredEncrypt': function(aKey, aValue, aNonce) { | 140 | 'deferredEncrypt': function(aKey, aValue, aNonce) { |
144 | var deferredResult; | 141 | var deferredResult; |
145 | varkey, value; | 142 | varkey, value; |
146 | var dataToEncrypt; | 143 | var dataToEncrypt; |
147 | // var encryptedData; | 144 | // var encryptedData; |
148 | 145 | ||
149 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); | 146 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); |
150 | value = new Clipperz.ByteArray(Clipperz.Base.serializeJSON(aValue)); | 147 | value = new Clipperz.ByteArray(Clipperz.Base.serializeJSON(aValue)); |
151 | dataToEncrypt = Clipperz.Crypto.SHA.sha_d256(value).appendBlock(value); | 148 | dataToEncrypt = Clipperz.Crypto.SHA.sha_d256(value).appendBlock(value); |
152 | 149 | ||
153 | deferredResult = new Clipperz.Async.Deferred("Crypto[0.2].deferredEncrypt") | 150 | deferredResult = new Clipperz.Async.Deferred("Crypto[0.2].deferredEncrypt") |
154 | deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncrypt, key, dataToEncrypt, aNonce); | 151 | deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncrypt, key, dataToEncrypt, aNonce); |
155 | deferredResult.addCallback(function(aResult) { | 152 | deferredResult.addCallback(function(aResult) { |
156 | return aResult.toBase64String(); | 153 | return aResult.toBase64String(); |
157 | }) | 154 | }) |
158 | deferredResult.callback(); | 155 | deferredResult.callback(); |
159 | 156 | ||
160 | return deferredResult; | 157 | return deferredResult; |
161 | }, | 158 | }, |
162 | 159 | ||
163 | 'decrypt': function(aKey, aValue) { | 160 | 'decrypt': function(aKey, aValue) { |
164 | var result; | 161 | var result; |
165 | 162 | ||
166 | if (aValue != null) { | 163 | if (aValue != null) { |
167 | var key, value; | 164 | var key, value; |
168 | var decryptedData; | 165 | var decryptedData; |
169 | var decryptedValue; | 166 | var decryptedValue; |
170 | 167 | ||
171 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); | 168 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); |
172 | value = new Clipperz.ByteArray().appendBase64String(aValue); | 169 | value = new Clipperz.ByteArray().appendBase64String(aValue); |
173 | 170 | ||
174 | decryptedData = Clipperz.Crypto.AES.decrypt(key, value); | 171 | decryptedData = Clipperz.Crypto.AES.decrypt(key, value); |
175 | decryptedValue = decryptedData.split((256/8)); | 172 | decryptedValue = decryptedData.split((256/8)); |
176 | 173 | ||
177 | try { | 174 | try { |
178 | result = Clipperz.Base.evalJSON(decryptedValue.asString()); | 175 | result = Clipperz.Base.evalJSON(decryptedValue.asString()); |
179 | } catch (exception) { | 176 | } catch (exception) { |
180 | MochiKit.Logging.logError("Error while decrypting data [1]"); | 177 | MochiKit.Logging.logError("Error while decrypting data [1]"); |
181 | throw Clipperz.Crypto.Base.exception.CorruptedMessage; | 178 | throw Clipperz.Crypto.Base.exception.CorruptedMessage; |
182 | } | 179 | } |
183 | } else { | 180 | } else { |
184 | result = null; | 181 | result = null; |
185 | } | 182 | } |
186 | 183 | ||
187 | return result; | 184 | return result; |
188 | }, | 185 | }, |
189 | 186 | ||
190 | 'deferredDecrypt': function(aKey, aValue) { | 187 | 'deferredDecrypt': function(aKey, aValue) { |
191 | var result; | 188 | var result; |
192 | 189 | ||
193 | if (aValue != null) { | 190 | if (aValue != null) { |
194 | var deferredResult; | 191 | var deferredResult; |
195 | var key, value; | 192 | var key, value; |
196 | // var decryptedData; | 193 | // var decryptedData; |
197 | 194 | ||
198 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); | 195 | key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); |
199 | value = new Clipperz.ByteArray().appendBase64String(aValue); | 196 | value = new Clipperz.ByteArray().appendBase64String(aValue); |
200 | 197 | ||
201 | deferredResult = new Clipperz.Async.Deferred("Crypto.[0.2].deferredDecrypt"); | 198 | deferredResult = new Clipperz.Async.Deferred("Crypto.[0.2].deferredDecrypt"); |
202 | deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value); | 199 | deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value); |
203 | deferredResult.addCallback(function(aResult) { | 200 | deferredResult.addCallback(function(aResult) { |
204 | var result; | 201 | var result; |
205 | var decryptedData; | 202 | var decryptedData; |
206 | 203 | ||
207 | decryptedData = aResult.split((256/8)); | 204 | decryptedData = aResult.split((256/8)); |
208 | 205 | ||
209 | try { | 206 | try { |
210 | result = Clipperz.Base.evalJSON(decryptedData.asString()); | 207 | result = Clipperz.Base.evalJSON(decryptedData.asString()); |
211 | } catch (exception) { | 208 | } catch (exception) { |
212 | MochiKit.Logging.logError("Error while decrypting data [2]"); | 209 | MochiKit.Logging.logError("Error while decrypting data [2]"); |
213 | throw Clipperz.Crypto.Base.exception.CorruptedMessage; | 210 | throw Clipperz.Crypto.Base.exception.CorruptedMessage; |
214 | } | 211 | } |
215 | 212 | ||
216 | return result; | 213 | return result; |
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js index 1d38509..8f8696d 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.DataModel'); | 26 | Clipperz.Base.module('Clipperz.PM.DataModel'); |
30 | 27 | ||
31 | Clipperz.PM.DataModel.DirectLogin = function(args) { | 28 | Clipperz.PM.DataModel.DirectLogin = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.DataModel.DirectLogin.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.DataModel.DirectLogin.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._reference =args.reference | 33 | this._reference =args.reference |
37 | ||Clipperz.PM.Crypto.randomKey(); | 34 | ||Clipperz.PM.Crypto.randomKey(); |
38 | this._record =args.record | 35 | this._record =args.record |
39 | ||Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | ||Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | 37 | ||
41 | this._retrieveIndexDataFunction = args.retrieveIndexDataFunction | 38 | this._retrieveIndexDataFunction = args.retrieveIndexDataFunction |
42 | ||this.record().retrieveDirectLoginIndexDataFunction() | 39 | ||this.record().retrieveDirectLoginIndexDataFunction() |
43 | ||Clipperz.Base.exception.raise('MandatoryParameter'); | 40 | ||Clipperz.Base.exception.raise('MandatoryParameter'); |
44 | this._setIndexDataFunction = args.setIndexDataFunction | 41 | this._setIndexDataFunction = args.setIndexDataFunction |
45 | ||this.record().setDirectLoginIndexDataFunction() | 42 | ||this.record().setDirectLoginIndexDataFunction() |
46 | ||Clipperz.Base.exception.raise('MandatoryParameter'); | 43 | ||Clipperz.Base.exception.raise('MandatoryParameter'); |
47 | this._removeIndexDataFunction =args.removeIndexDataFunction | 44 | this._removeIndexDataFunction =args.removeIndexDataFunction |
48 | ||this.record().removeDirectLoginIndexDataFunction() | 45 | ||this.record().removeDirectLoginIndexDataFunction() |
49 | ||Clipperz.Base.exception.raise('MandatoryParameter'); | 46 | ||Clipperz.Base.exception.raise('MandatoryParameter'); |
50 | 47 | ||
51 | this._inputs = null; | 48 | this._inputs = null; |
52 | this._bindings = null; | 49 | this._bindings = null; |
53 | this._formValues = null; | 50 | this._formValues = null; |
54 | 51 | ||
55 | // this._inputsDeferredLock = new MochiKit.Async.DeferredLock(); | 52 | // this._inputsDeferredLock = new MochiKit.Async.DeferredLock(); |
56 | // this._bindingsDeferredLock = new MochiKit.Async.DeferredLock(); | 53 | // this._bindingsDeferredLock = new MochiKit.Async.DeferredLock(); |
57 | // this._formValuesDeferredLock = new MochiKit.Async.DeferredLock(); | 54 | // this._formValuesDeferredLock = new MochiKit.Async.DeferredLock(); |
58 | 55 | ||
59 | this._transientState = null; | 56 | this._transientState = null; |
60 | 57 | ||
61 | this._isBrandNew = MochiKit.Base.isUndefinedOrNull(args.reference); | 58 | this._isBrandNew = MochiKit.Base.isUndefinedOrNull(args.reference); |
62 | 59 | ||
63 | this.record().addDirectLogin(this); | 60 | this.record().addDirectLogin(this); |
64 | 61 | ||
65 | return this; | 62 | return this; |
66 | } | 63 | } |
67 | 64 | ||
68 | Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, { | 65 | Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, { |
69 | 66 | ||
70 | 'toString': function() { | 67 | 'toString': function() { |
71 | return "DirectLogin (" + this.reference() + ")"; | 68 | return "DirectLogin (" + this.reference() + ")"; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | //========================================================================= | 71 | //========================================================================= |
75 | 72 | ||
76 | 'reference': function () { | 73 | 'reference': function () { |
77 | return this._reference; | 74 | return this._reference; |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //------------------------------------------------------------------------- | 77 | //------------------------------------------------------------------------- |
81 | 78 | ||
82 | 'record': function () { | 79 | 'record': function () { |
83 | return this._record; | 80 | return this._record; |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //========================================================================= | 83 | //========================================================================= |
87 | 84 | ||
88 | 'isBrandNew': function () { | 85 | 'isBrandNew': function () { |
89 | return this._isBrandNew; | 86 | return this._isBrandNew; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //========================================================================= | 89 | //========================================================================= |
93 | 90 | ||
94 | 'removeIndexDataFunction': function () { | 91 | 'removeIndexDataFunction': function () { |
95 | return this._removeIndexDataFunction; | 92 | return this._removeIndexDataFunction; |
96 | }, | 93 | }, |
97 | 94 | ||
98 | 'remove': function () { | 95 | 'remove': function () { |
99 | return Clipperz.Async.callbacks("DirectLogin.remove", [ | 96 | return Clipperz.Async.callbacks("DirectLogin.remove", [ |
100 | MochiKit.Base.partial(this.removeIndexDataFunction(), this.reference()), | 97 | MochiKit.Base.partial(this.removeIndexDataFunction(), this.reference()), |
101 | MochiKit.Base.method(this.record(), 'removeDirectLogin', this) | 98 | MochiKit.Base.method(this.record(), 'removeDirectLogin', this) |
102 | ], {trace:false}); | 99 | ], {trace:false}); |
103 | }, | 100 | }, |
104 | 101 | ||
105 | //========================================================================= | 102 | //========================================================================= |
106 | /* | 103 | /* |
107 | 'inputsDeferredLock': function () { | 104 | 'inputsDeferredLock': function () { |
108 | return this._inputsDeferredLock; | 105 | return this._inputsDeferredLock; |
109 | }, | 106 | }, |
110 | 107 | ||
111 | 'bindingsDeferredLock': function () { | 108 | 'bindingsDeferredLock': function () { |
112 | return this._bindingsDeferredLock; | 109 | return this._bindingsDeferredLock; |
113 | }, | 110 | }, |
114 | 111 | ||
115 | 'formValuesDeferredLock': function () { | 112 | 'formValuesDeferredLock': function () { |
116 | return this._formValuesDeferredLock; | 113 | return this._formValuesDeferredLock; |
117 | }, | 114 | }, |
118 | */ | 115 | */ |
119 | //========================================================================= | 116 | //========================================================================= |
120 | 117 | ||
121 | 'label': function () { | 118 | 'label': function () { |
122 | return this.getIndexDataForKey('label'); | 119 | return this.getIndexDataForKey('label'); |
123 | }, | 120 | }, |
124 | 121 | ||
125 | 'setLabelKeepingBackwardCompatibilityWithBeta': function (aValue) { | 122 | 'setLabelKeepingBackwardCompatibilityWithBeta': function (aValue) { |
126 | return Clipperz.Async.callbacks("DirectLogin.setLabelKeepingBackwardCompatibilityWithBeta", [ | 123 | return Clipperz.Async.callbacks("DirectLogin.setLabelKeepingBackwardCompatibilityWithBeta", [ |
127 | MochiKit.Base.method(this, 'setIndexDataForKey', 'label', aValue), | 124 | MochiKit.Base.method(this, 'setIndexDataForKey', 'label', aValue), |
128 | MochiKit.Base.method(this, 'setValue', 'label', aValue) | 125 | MochiKit.Base.method(this, 'setValue', 'label', aValue) |
129 | ], {trace:false}); | 126 | ], {trace:false}); |
130 | }, | 127 | }, |
131 | 128 | ||
132 | 'setLabel': function (aValue) { | 129 | 'setLabel': function (aValue) { |
133 | return this.setLabelKeepingBackwardCompatibilityWithBeta(aValue); | 130 | return this.setLabelKeepingBackwardCompatibilityWithBeta(aValue); |
134 | // return this.setIndexDataForKey('label', aValue); | 131 | // return this.setIndexDataForKey('label', aValue); |
135 | }, | 132 | }, |
136 | 133 | ||
137 | //========================================================================= | 134 | //========================================================================= |
138 | 135 | ||
139 | 'favicon': function () { | 136 | 'favicon': function () { |
140 | return this.getIndexDataForKey('favicon'); | 137 | return this.getIndexDataForKey('favicon'); |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'setFavicon': function (aValue) { | 140 | 'setFavicon': function (aValue) { |
144 | return this.setIndexDataForKey('favicon', aValue); | 141 | return this.setIndexDataForKey('favicon', aValue); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | 'faviconUrlWithBookmarkletConfiguration': function (aBookmarkletConfiguration) { | 144 | 'faviconUrlWithBookmarkletConfiguration': function (aBookmarkletConfiguration) { |
148 | varresult; | 145 | varresult; |
149 | 146 | ||
150 | if (! MochiKit.Base.isUndefinedOrNull(aBookmarkletConfiguration['page']['favicon'])) { | 147 | if (! MochiKit.Base.isUndefinedOrNull(aBookmarkletConfiguration['page']['favicon'])) { |
151 | result = aBookmarkletConfiguration['page']['favicon']; | 148 | result = aBookmarkletConfiguration['page']['favicon']; |
152 | } else if (! MochiKit.Base.isUndefinedOrNull(aBookmarkletConfiguration['form']['attributes']['action'])) { | 149 | } else if (! MochiKit.Base.isUndefinedOrNull(aBookmarkletConfiguration['form']['attributes']['action'])) { |
153 | var actionUrl; | 150 | var actionUrl; |
154 | var hostname; | 151 | var hostname; |
155 | 152 | ||
156 | actionUrl = aBookmarkletConfiguration['form']['attributes']['action']; | 153 | actionUrl = aBookmarkletConfiguration['form']['attributes']['action']; |
157 | hostname = actionUrl.replace(/^https?:\/\/([^\/]*)\/.*/, '$1'); | 154 | hostname = actionUrl.replace(/^https?:\/\/([^\/]*)\/.*/, '$1'); |
158 | result = "http://" + hostname + "/favicon.ico"; | 155 | result = "http://" + hostname + "/favicon.ico"; |
159 | } else { | 156 | } else { |
160 | result = null; | 157 | result = null; |
161 | } | 158 | } |
162 | 159 | ||
163 | 160 | ||
164 | return result; | 161 | return result; |
165 | }, | 162 | }, |
166 | 163 | ||
167 | //------------------------------------------------------------------------- | 164 | //------------------------------------------------------------------------- |
168 | /* | 165 | /* |
169 | 'faviconData': function () { | 166 | 'faviconData': function () { |
170 | var regexp = new RegExp('^data\:\/\/.*', 'i'); | 167 | var regexp = new RegExp('^data\:\/\/.*', 'i'); |
171 | 168 | ||
172 | return Clipperz.Async.callbacks("DirectLogin.favicon", [ | 169 | return Clipperz.Async.callbacks("DirectLogin.favicon", [ |
173 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon'), | 170 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon'), |
174 | MochiKit.Base.method(regexp, 'test'), | 171 | MochiKit.Base.method(regexp, 'test'), |
175 | Clipperz.Async.deferredIf("is data URL", [ | 172 | Clipperz.Async.deferredIf("is data URL", [ |
176 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon') | 173 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon') |
177 | ], [ | 174 | ], [ |
178 | MochiKit.Base.method(this, 'transientState'), | 175 | MochiKit.Base.method(this, 'transientState'), |
179 | MochiKit.Base.itemgetter('faviconData'), | 176 | MochiKit.Base.itemgetter('faviconData'), |
180 | Clipperz.Async.deferredIf('has a chaced value for the favicon data', [ | 177 | Clipperz.Async.deferredIf('has a chaced value for the favicon data', [ |
181 | MochiKit.Base.operator.identity | 178 | MochiKit.Base.operator.identity |
182 | ], [ | 179 | ], [ |
183 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon'), | 180 | MochiKit.Base.method(this, 'getIndexDataForKey', 'favicon'), |
184 | MochiKit.Base.method(this, 'loadFaviconDataFromURL') | 181 | MochiKit.Base.method(this, 'loadFaviconDataFromURL') |
185 | ]) | 182 | ]) |
186 | 183 | ||
187 | ]) | 184 | ]) |
188 | ], {trace:false}); | 185 | ], {trace:false}); |
189 | }, | 186 | }, |
190 | 187 | ||
191 | //------------------------------------------------------------------------- | 188 | //------------------------------------------------------------------------- |
192 | 189 | ||
193 | 'loadFaviconDataFromURL': function (anURL) { | 190 | 'loadFaviconDataFromURL': function (anURL) { |
194 | var deferredResult; | 191 | var deferredResult; |
195 | var image; | 192 | var image; |
196 | 193 | ||
197 | deferredResult = new Clipperz.Async.Deferred("DirectLogin.loadFaviconDataFromURL", {trace:false}); | 194 | deferredResult = new Clipperz.Async.Deferred("DirectLogin.loadFaviconDataFromURL", {trace:false}); |
198 | deferredResult.addCallback(function (anEvent) { | 195 | deferredResult.addCallback(function (anEvent) { |
199 | var image = anEvent.src(); | 196 | var image = anEvent.src(); |
200 | var canvas = document.createElement("canvas"); | 197 | var canvas = document.createElement("canvas"); |
201 | var result; | 198 | var result; |
202 | 199 | ||
203 | canvas.width = image.width; | 200 | canvas.width = image.width; |
204 | canvas.height = image.height; | 201 | canvas.height = image.height; |
205 | 202 | ||
206 | var ctx = canvas.getContext("2d"); | 203 | var ctx = canvas.getContext("2d"); |
207 | ctx.drawImage(image, 0, 0); | 204 | ctx.drawImage(image, 0, 0); |
208 | 205 | ||
209 | result = canvas.toDataURL(/*"image/png"* /); | 206 | result = canvas.toDataURL(/*"image/png"* /); |
210 | 207 | ||
211 | return result; | 208 | return result; |
212 | }); | 209 | }); |
213 | deferredResult.addErrback(MochiKit.Async.succeed, Clipperz.PM.Strings.getValue('defaultFaviconUrl')); | 210 | deferredResult.addErrback(MochiKit.Async.succeed, Clipperz.PM.Strings.getValue('defaultFaviconUrl')); |
214 | deferredResult.addBoth(MochiKit.Base.bind(function (aDataUrl) { | 211 | deferredResult.addBoth(MochiKit.Base.bind(function (aDataUrl) { |
215 | this.transientState()['faviconData'] = aDataUrl; | 212 | this.transientState()['faviconData'] = aDataUrl; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js index fd55c63..4377853 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js | |||
@@ -1,125 +1,122 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, args) { | 33 | Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | 37 | ||
41 | this._key = args.key|| Clipperz.Base.exception.raise('MandatoryParameter'); | 38 | this._key = args.key|| Clipperz.Base.exception.raise('MandatoryParameter'); |
42 | this._fieldKey = args.field || /* this.directLogin().fieldWithName(args.fieldName).reference() || */null; | 39 | this._fieldKey = args.field || /* this.directLogin().fieldWithName(args.fieldName).reference() || */null; |
43 | 40 | ||
44 | return this; | 41 | return this; |
45 | } | 42 | } |
46 | 43 | ||
47 | Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { | 44 | Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { |
48 | 45 | ||
49 | 'toString': function() { | 46 | 'toString': function() { |
50 | return "DirectLoginBinding (" + this.key() + ", " + this.fieldKey() + ")"; | 47 | return "DirectLoginBinding (" + this.key() + ", " + this.fieldKey() + ")"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'directLogin': function () { | 52 | 'directLogin': function () { |
56 | return this._directLogin; | 53 | return this._directLogin; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'key': function() { | 58 | 'key': function() { |
62 | return this._key; | 59 | return this._key; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'fieldKey': function() { | 64 | 'fieldKey': function() { |
68 | return this._fieldKey; | 65 | return this._fieldKey; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | 'setFieldKey': function(aValue) { | 68 | 'setFieldKey': function(aValue) { |
72 | this._fieldKey = aValue; | 69 | this._fieldKey = aValue; |
73 | 70 | ||
74 | return this.directLogin().setValue('bindingData' + '.' + this.key(), aValue); | 71 | return this.directLogin().setValue('bindingData' + '.' + this.key(), aValue); |
75 | }, | 72 | }, |
76 | 73 | ||
77 | //'fieldName': function() { | 74 | //'fieldName': function() { |
78 | // return this._fieldName; | 75 | // return this._fieldName; |
79 | //}, | 76 | //}, |
80 | 77 | ||
81 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
82 | 79 | ||
83 | 'field': function() { | 80 | 'field': function() { |
84 | var deferredResult; | 81 | var deferredResult; |
85 | 82 | ||
86 | if (this.fieldKey() != null) { | 83 | if (this.fieldKey() != null) { |
87 | deferredResult = Clipperz.Async.callbacks("DirectLoginBinding.field [1]", [ | 84 | deferredResult = Clipperz.Async.callbacks("DirectLoginBinding.field [1]", [ |
88 | MochiKit.Base.method(this.directLogin().record(), 'fields'), | 85 | MochiKit.Base.method(this.directLogin().record(), 'fields'), |
89 | MochiKit.Base.itemgetter(this.fieldKey()) | 86 | MochiKit.Base.itemgetter(this.fieldKey()) |
90 | ], {trace:false}); | 87 | ], {trace:false}); |
91 | // } else if (this.fieldName() != null) { | 88 | // } else if (this.fieldName() != null) { |
92 | // WTF = TODO; | 89 | // WTF = TODO; |
93 | // result = this.directLogin().record().fieldWithName(this.fieldName()); | 90 | // result = this.directLogin().record().fieldWithName(this.fieldName()); |
94 | // | 91 | // |
95 | // this.setFieldKey(result.key()); | 92 | // this.setFieldKey(result.key()); |
96 | } else { | 93 | } else { |
97 | deferredResult = MochiKit.Async.succeed(null); | 94 | deferredResult = MochiKit.Async.succeed(null); |
98 | } | 95 | } |
99 | 96 | ||
100 | return deferredResult; | 97 | return deferredResult; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | 'setField': function (aField) { | 100 | 'setField': function (aField) { |
104 | this.setFieldKey(aField.reference()); | 101 | this.setFieldKey(aField.reference()); |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------- |
108 | /* | 105 | /* |
109 | 'fieldValue': function () { | 106 | 'fieldValue': function () { |
110 | return Clipperz.Async.callbacks("DirectLoginBinding.fieldValue", [ | 107 | return Clipperz.Async.callbacks("DirectLoginBinding.fieldValue", [ |
111 | MochiKit.Base.method('field'), | 108 | MochiKit.Base.method('field'), |
112 | MochiKit.Base.methodcaller('value') | 109 | MochiKit.Base.methodcaller('value') |
113 | ], {trace:false}); | 110 | ], {trace:false}); |
114 | }, | 111 | }, |
115 | */ | 112 | */ |
116 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
117 | 114 | ||
118 | 'serializedData': function() { | 115 | 'serializedData': function() { |
119 | return this.fieldKey(); | 116 | return this.fieldKey(); |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //------------------------------------------------------------------------- | 119 | //------------------------------------------------------------------------- |
123 | __syntaxFix__: "syntax fix" | 120 | __syntaxFix__: "syntax fix" |
124 | }); | 121 | }); |
125 | 122 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js index 939ab4b..a461197 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js | |||
@@ -1,107 +1,104 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.DataModel.DirectLoginFormValue = function(aDirectLogin, args) { | 33 | Clipperz.PM.DataModel.DirectLoginFormValue = function(aDirectLogin, args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | 37 | ||
41 | this._key = args.key || Clipperz.Base.exception.raise('MandatoryParameter'); | 38 | this._key = args.key || Clipperz.Base.exception.raise('MandatoryParameter'); |
42 | this._fieldOptions = args.fieldOptions|| Clipperz.Base.exception.raise('MandatoryParameter'); | 39 | this._fieldOptions = args.fieldOptions|| Clipperz.Base.exception.raise('MandatoryParameter'); |
43 | this._value = args.value || null; | 40 | this._value = args.value || null; |
44 | 41 | ||
45 | return this; | 42 | return this; |
46 | } | 43 | } |
47 | 44 | ||
48 | Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null, { | 45 | Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null, { |
49 | 46 | ||
50 | 'toString': function() { | 47 | 'toString': function() { |
51 | return "DirectLoginFormValue (" + this.key() + ", " + this.value() + ")"; | 48 | return "DirectLoginFormValue (" + this.key() + ", " + this.value() + ")"; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'directLogin': function () { | 53 | 'directLogin': function () { |
57 | return this._directLogin; | 54 | return this._directLogin; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'key': function() { | 59 | 'key': function() { |
63 | return this._key; | 60 | return this._key; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'fieldOptions': function() { | 65 | 'fieldOptions': function() { |
69 | return this._fieldOptions; | 66 | return this._fieldOptions; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'type': function () { | 71 | 'type': function () { |
75 | return this.fieldOptions()['type']; | 72 | return this.fieldOptions()['type']; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'value': function() { | 77 | 'value': function() { |
81 | varresult; | 78 | varresult; |
82 | 79 | ||
83 | result = this._value; | 80 | result = this._value; |
84 | 81 | ||
85 | // if ((result == null) && (this.type() == 'checkbox')) { | 82 | // if ((result == null) && (this.type() == 'checkbox')) { |
86 | // result = false; | 83 | // result = false; |
87 | // }; | 84 | // }; |
88 | 85 | ||
89 | return result; | 86 | return result; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | 'setValue': function (aValue) { | 89 | 'setValue': function (aValue) { |
93 | //console.log("DirectLoginFormValue.setValue", aValue); | 90 | //console.log("DirectLoginFormValue.setValue", aValue); |
94 | this._value = aValue; | 91 | this._value = aValue; |
95 | return this.directLogin().setValue('formValues' + '.' + this.key(), aValue); | 92 | return this.directLogin().setValue('formValues' + '.' + this.key(), aValue); |
96 | }, | 93 | }, |
97 | 94 | ||
98 | //------------------------------------------------------------------------- | 95 | //------------------------------------------------------------------------- |
99 | /* | 96 | /* |
100 | 'serializedData': function() { | 97 | 'serializedData': function() { |
101 | return this.value(); | 98 | return this.value(); |
102 | }, | 99 | }, |
103 | */ | 100 | */ |
104 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
105 | __syntaxFix__: "syntax fix" | 102 | __syntaxFix__: "syntax fix" |
106 | }); | 103 | }); |
107 | 104 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js index 673d5ee..8188389 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js | |||
@@ -1,203 +1,200 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | //############################################################################# | 30 | //############################################################################# |
34 | 31 | ||
35 | Clipperz.PM.DataModel.DirectLoginInput = function(args) { | 32 | Clipperz.PM.DataModel.DirectLoginInput = function(args) { |
36 | this._args = args; | 33 | this._args = args; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { | 38 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { |
42 | 39 | ||
43 | 'args': function() { | 40 | 'args': function() { |
44 | return this._args; | 41 | return this._args; |
45 | }, | 42 | }, |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'name': function() { | 46 | 'name': function() { |
50 | return this.args()['name']; | 47 | return this.args()['name']; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'type': function() { | 52 | 'type': function() { |
56 | var result; | 53 | var result; |
57 | 54 | ||
58 | result = this.args()['type']; | 55 | result = this.args()['type']; |
59 | 56 | ||
60 | if (result != null) { | 57 | if (result != null) { |
61 | result = result.toLowerCase(); | 58 | result = result.toLowerCase(); |
62 | } | 59 | } |
63 | return result; | 60 | return result; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'options': function() { | 65 | 'options': function() { |
69 | return this.args()['options']; | 66 | return this.args()['options']; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'value': function() { | 71 | 'value': function() { |
75 | return this.args()['value']; | 72 | return this.args()['value']; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | /* | 76 | /* |
80 | 'formConfiguration': function(someFormValues, someBindings, someFields) { | 77 | 'formConfiguration': function(someFormValues, someBindings, someFields) { |
81 | var result; | 78 | var result; |
82 | //console.log("### DirectLoginInput.formConfiguration", someFields); | 79 | //console.log("### DirectLoginInput.formConfiguration", someFields); |
83 | if (this.shouldSetValue()) { | 80 | if (this.shouldSetValue()) { |
84 | switch (this.type()) { | 81 | switch (this.type()) { |
85 | case 'select': | 82 | case 'select': |
86 | var currentValue; | 83 | var currentValue; |
87 | var options; | 84 | var options; |
88 | 85 | ||
89 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; | 86 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; |
90 | currentValue = someFormValues[this.name()]; | 87 | currentValue = someFormValues[this.name()]; |
91 | options = this.args()['options']; | 88 | options = this.args()['options']; |
92 | 89 | ||
93 | result = MochiKit.DOM.SELECT({name:this.name()}, | 90 | result = MochiKit.DOM.SELECT({name:this.name()}, |
94 | MochiKit.Base.map(function(anOption) { | 91 | MochiKit.Base.map(function(anOption) { |
95 | var options; | 92 | var options; |
96 | 93 | ||
97 | options = {value:anOption['value']}; | 94 | options = {value:anOption['value']}; |
98 | if (currentValue == anOption['value']) { | 95 | if (currentValue == anOption['value']) { |
99 | options.selected = true; | 96 | options.selected = true; |
100 | } | 97 | } |
101 | 98 | ||
102 | return MochiKit.DOM.OPTION(options, anOption['label']) | 99 | return MochiKit.DOM.OPTION(options, anOption['label']) |
103 | }, options) | 100 | }, options) |
104 | ) | 101 | ) |
105 | break; | 102 | break; |
106 | case 'checkbox': | 103 | case 'checkbox': |
107 | var options; | 104 | var options; |
108 | 105 | ||
109 | options = {type:'checkbox', name: this.name()}; | 106 | options = {type:'checkbox', name: this.name()}; |
110 | // if (this.directLogin()._configuration['formValues'][this.name()] == true) { | 107 | // if (this.directLogin()._configuration['formValues'][this.name()] == true) { |
111 | if (someFormValues[this.name()] == true) { | 108 | if (someFormValues[this.name()] == true) { |
112 | options['checked'] = true; | 109 | options['checked'] = true; |
113 | }; | 110 | }; |
114 | 111 | ||
115 | result = MochiKit.DOM.INPUT(options, null); | 112 | result = MochiKit.DOM.INPUT(options, null); |
116 | break; | 113 | break; |
117 | case 'radio': | 114 | case 'radio': |
118 | var currentName; | 115 | var currentName; |
119 | var currentValue; | 116 | var currentValue; |
120 | var options; | 117 | var options; |
121 | 118 | ||
122 | currentName = this.name(); | 119 | currentName = this.name(); |
123 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; | 120 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; |
124 | currentValue = someFormValues[this.name()]; | 121 | currentValue = someFormValues[this.name()]; |
125 | options = this.args()['options']; | 122 | options = this.args()['options']; |
126 | 123 | ||
127 | result = MochiKit.DOM.DIV(null, | 124 | result = MochiKit.DOM.DIV(null, |
128 | MochiKit.Base.map(function(anOption) { | 125 | MochiKit.Base.map(function(anOption) { |
129 | var options; | 126 | var options; |
130 | var isChecked; | 127 | var isChecked; |
131 | var inputNode; | 128 | var inputNode; |
132 | var divNode; | 129 | var divNode; |
133 | 130 | ||
134 | options = {type:'radio', name:currentName, value:anOption['value']} | 131 | options = {type:'radio', name:currentName, value:anOption['value']} |
135 | isChecked = (currentValue == anOption['value']); | 132 | isChecked = (currentValue == anOption['value']); |
136 | if (isChecked) { | 133 | if (isChecked) { |
137 | options.checked = true; | 134 | options.checked = true; |
138 | } | 135 | } |
139 | 136 | ||
140 | if (Clipperz_IEisBroken == true) { | 137 | if (Clipperz_IEisBroken == true) { |
141 | var checkedValue; | 138 | var checkedValue; |
142 | 139 | ||
143 | checkedValue = (isChecked ? " CHECKED" : ""); | 140 | checkedValue = (isChecked ? " CHECKED" : ""); |
144 | inputNode = MochiKit.DOM.currentDocument().createElement("<INPUT TYPE='RADIO' NAME='" + currentName + "' VALUE='" + anOption['value'] + "'" + checkedValue + ">"); | 141 | inputNode = MochiKit.DOM.currentDocument().createElement("<INPUT TYPE='RADIO' NAME='" + currentName + "' VALUE='" + anOption['value'] + "'" + checkedValue + ">"); |
145 | } else { | 142 | } else { |
146 | inputNode = MochiKit.DOM.INPUT(options, anOption['value']); | 143 | inputNode = MochiKit.DOM.INPUT(options, anOption['value']); |
147 | } | 144 | } |
148 | divNode = MochiKit.DOM.DIV(null, inputNode); | 145 | divNode = MochiKit.DOM.DIV(null, inputNode); |
149 | 146 | ||
150 | return divNode; | 147 | return divNode; |
151 | }, options) | 148 | }, options) |
152 | ); | 149 | ); |
153 | break; | 150 | break; |
154 | } | 151 | } |
155 | } else { | 152 | } else { |
156 | var binding; | 153 | var binding; |
157 | // binding = this.directLogin().bindings()[this.name()]; | 154 | // binding = this.directLogin().bindings()[this.name()]; |
158 | binding = someBindings[this.name()]; | 155 | binding = someBindings[this.name()]; |
159 | 156 | ||
160 | //console.log("### binding", binding); | 157 | //console.log("### binding", binding); |
161 | //if (binding != null) { | 158 | //if (binding != null) { |
162 | ///console.log(" binding.field()", binding.field()); | 159 | ///console.log(" binding.field()", binding.field()); |
163 | ///console.log(" binding.field().value()", binding.field().value()); | 160 | ///console.log(" binding.field().value()", binding.field().value()); |
164 | //console.log(" someFields[binding.fieldKey()].value()", someFields[binding.fieldKey()].value()); | 161 | //console.log(" someFields[binding.fieldKey()].value()", someFields[binding.fieldKey()].value()); |
165 | //} | 162 | //} |
166 | result = MochiKit.DOM.INPUT({ | 163 | result = MochiKit.DOM.INPUT({ |
167 | type:((this.type() != 'password') ? this.type() : 'text'), | 164 | type:((this.type() != 'password') ? this.type() : 'text'), |
168 | name:this.name(), | 165 | name:this.name(), |
169 | // value:((binding != null)? binding.field().value() : this.value()) | 166 | // value:((binding != null)? binding.field().value() : this.value()) |
170 | value:((binding != null)? someFields[binding.fieldKey()]['value'] : this.value()) | 167 | value:((binding != null)? someFields[binding.fieldKey()]['value'] : this.value()) |
171 | // value:((binding != null)? someFields[binding.fieldKey()].value() : this.value()) | 168 | // value:((binding != null)? someFields[binding.fieldKey()].value() : this.value()) |
172 | }, null); | 169 | }, null); |
173 | } | 170 | } |
174 | 171 | ||
175 | return result; | 172 | return result; |
176 | }, | 173 | }, |
177 | */ | 174 | */ |
178 | //------------------------------------------------------------------------- | 175 | //------------------------------------------------------------------------- |
179 | 176 | ||
180 | 'needsFormValue': function() { | 177 | 'needsFormValue': function() { |
181 | var type; | 178 | var type; |
182 | var result; | 179 | var result; |
183 | 180 | ||
184 | type = this.type(); | 181 | type = this.type(); |
185 | result = ((type == 'checkbox') || (type == 'radio') || (type == 'select')); | 182 | result = ((type == 'checkbox') || (type == 'radio') || (type == 'select')); |
186 | 183 | ||
187 | return result; | 184 | return result; |
188 | }, | 185 | }, |
189 | 186 | ||
190 | 'needsBinding': function() { | 187 | 'needsBinding': function() { |
191 | var type; | 188 | var type; |
192 | var result; | 189 | var result; |
193 | 190 | ||
194 | type = this.type(); | 191 | type = this.type(); |
195 | result = ((type == 'text') || (type == 'password')); | 192 | result = ((type == 'text') || (type == 'password')); |
196 | 193 | ||
197 | return result; | 194 | return result; |
198 | }, | 195 | }, |
199 | 196 | ||
200 | //------------------------------------------------------------------------- | 197 | //------------------------------------------------------------------------- |
201 | __syntaxFix__: "syntax fix" | 198 | __syntaxFix__: "syntax fix" |
202 | }); | 199 | }); |
203 | 200 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js index 3408b08..cdeec8b 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.KeyValueObjectStore) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.KeyValueObjectStore) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.EncryptedRemoteObject depends on Clipperz.KeyValueObjectStore!"; | 27 | throw "Clipperz.PM.DataModel.EncryptedRemoteObject depends on Clipperz.KeyValueObjectStore!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
34 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 31 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
35 | 32 | ||
36 | Clipperz.PM.DataModel.EncryptedRemoteObject = function(args) { | 33 | Clipperz.PM.DataModel.EncryptedRemoteObject = function(args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | this._name = args.name || null; | 36 | this._name = args.name || null; |
40 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); | 37 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); |
41 | this._isBrandNew = ((args.reference == null) && (args.remoteData == null)); | 38 | this._isBrandNew = ((args.reference == null) && (args.remoteData == null)); |
42 | 39 | ||
43 | if ((this._isBrandNew == false) && (args['retrieveKeyFunction'] == null)) { | 40 | if ((this._isBrandNew == false) && (args['retrieveKeyFunction'] == null)) { |
44 | Clipperz.Base.exception.raise('MandatoryParameter'); | 41 | Clipperz.Base.exception.raise('MandatoryParameter'); |
45 | } else { | 42 | } else { |
46 | this._retrieveKeyFunction = args['retrieveKeyFunction']; | 43 | this._retrieveKeyFunction = args['retrieveKeyFunction']; |
47 | } | 44 | } |
48 | 45 | ||
49 | this._retrieveRemoteDataFunction = args.retrieveRemoteDataFunction|| null; | 46 | this._retrieveRemoteDataFunction = args.retrieveRemoteDataFunction|| null; |
50 | this._remoteData = args.remoteData || null; | 47 | this._remoteData = args.remoteData || null; |
51 | // this._remoteData = args.remoteData ? Clipperz.Base.deepClone(args.remoteData) : null; | 48 | // this._remoteData = args.remoteData ? Clipperz.Base.deepClone(args.remoteData) : null; |
52 | if ((!this._isBrandNew) && ((this._retrieveRemoteDataFunction == null) && (this._remoteData == null))) { | 49 | if ((!this._isBrandNew) && ((this._retrieveRemoteDataFunction == null) && (this._remoteData == null))) { |
53 | Clipperz.Base.exception.raise('MandatoryParameter'); | 50 | Clipperz.Base.exception.raise('MandatoryParameter'); |
54 | } | 51 | } |
55 | 52 | ||
56 | 53 | ||
57 | this._encryptedDataKeypath = args.encryptedDataKeypath || 'data'; //Clipperz.Base.exception.raise('MandatoryParameter'); | 54 | this._encryptedDataKeypath = args.encryptedDataKeypath || 'data'; //Clipperz.Base.exception.raise('MandatoryParameter'); |
58 | this._encryptedVersionKeypath = args.encryptedVersionKeypath || 'version';//Clipperz.Base.exception.raise('MandatoryParameter'); | 55 | this._encryptedVersionKeypath = args.encryptedVersionKeypath || 'version';//Clipperz.Base.exception.raise('MandatoryParameter'); |
59 | 56 | ||
60 | 57 | ||
61 | this._transientState = null; | 58 | this._transientState = null; |
62 | this._deferredLocks = {}; | 59 | this._deferredLocks = {}; |
63 | 60 | ||
64 | if (this._isBrandNew == true) { | 61 | if (this._isBrandNew == true) { |
65 | this._objectDataStore = new Clipperz.KeyValueObjectStore(/*{'name':'EncryptedRemoteObject.objectDataStore [1]'}*/); | 62 | this._objectDataStore = new Clipperz.KeyValueObjectStore(/*{'name':'EncryptedRemoteObject.objectDataStore [1]'}*/); |
66 | } else { | 63 | } else { |
67 | this._objectDataStore = null; | 64 | this._objectDataStore = null; |
68 | } | 65 | } |
69 | 66 | ||
70 | return this; | 67 | return this; |
71 | } | 68 | } |
72 | 69 | ||
73 | // | 70 | // |
74 | // Basic data workflow | 71 | // Basic data workflow |
75 | //======================= | 72 | //======================= |
76 | // | 73 | // |
77 | //getRemoteData | 74 | //getRemoteData |
78 | // unpackRemoteData | 75 | // unpackRemoteData |
79 | // getDecryptData [encryptedDataKeypath, encryptedVersionKeypath] | 76 | // getDecryptData [encryptedDataKeypath, encryptedVersionKeypath] |
80 | // unpackData | 77 | // unpackData |
81 | // | 78 | // |
82 | // | 79 | // |
83 | // ?? packData | 80 | // ?? packData |
84 | // ?? encryptDataWithKey | 81 | // ?? encryptDataWithKey |
85 | // ??packRemoteData [encryptedDataKeypath (?), encryptedVersionKeypath (?)] | 82 | // ??packRemoteData [encryptedDataKeypath (?), encryptedVersionKeypath (?)] |
86 | // | 83 | // |
87 | 84 | ||
88 | Clipperz.PM.DataModel.EncryptedRemoteObject.prototype = MochiKit.Base.update(null, { | 85 | Clipperz.PM.DataModel.EncryptedRemoteObject.prototype = MochiKit.Base.update(null, { |
89 | 86 | ||
90 | 'toString': function () { | 87 | 'toString': function () { |
91 | return "Clipperz.PM.DataModel.EncryptedRemoteObject" + (this.name() != null ? " - " + this.name() : ""); | 88 | return "Clipperz.PM.DataModel.EncryptedRemoteObject" + (this.name() != null ? " - " + this.name() : ""); |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
95 | 92 | ||
96 | 'name': function () { | 93 | 'name': function () { |
97 | return this._name; | 94 | return this._name; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //------------------------------------------------------------------------- | 97 | //------------------------------------------------------------------------- |
101 | 98 | ||
102 | 'reference': function () { | 99 | 'reference': function () { |
103 | return this._reference; | 100 | return this._reference; |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'setReference': function (aValue) { | 103 | 'setReference': function (aValue) { |
107 | this._reference = aValue; | 104 | this._reference = aValue; |
108 | 105 | ||
109 | return this._reference; | 106 | return this._reference; |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'transientState': function () { | 111 | 'transientState': function () { |
115 | if (this._transientState == null) { | 112 | if (this._transientState == null) { |
116 | this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'EncryptedRemoteObject.transientState [2]'}*/); | 113 | this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'EncryptedRemoteObject.transientState [2]'}*/); |
117 | } | 114 | } |
118 | 115 | ||
119 | return this._transientState; | 116 | return this._transientState; |
120 | }, | 117 | }, |
121 | 118 | ||
122 | 'resetTransientState': function (isCommitting) { | 119 | 'resetTransientState': function (isCommitting) { |
123 | if (this._transientState != null) { | 120 | if (this._transientState != null) { |
124 | this._transientState.removeAllData(); | 121 | this._transientState.removeAllData(); |
125 | } | 122 | } |
126 | 123 | ||
127 | this._transientState = null; | 124 | this._transientState = null; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //------------------------------------------------------------------------- | 127 | //------------------------------------------------------------------------- |
131 | 128 | ||
132 | 'isBrandNew': function () { | 129 | 'isBrandNew': function () { |
133 | return this._isBrandNew; | 130 | return this._isBrandNew; |
134 | }, | 131 | }, |
135 | 132 | ||
136 | //------------------------------------------------------------------------- | 133 | //------------------------------------------------------------------------- |
137 | 134 | ||
138 | 'getKey': function () { | 135 | 'getKey': function () { |
139 | var deferredResult; | 136 | var deferredResult; |
140 | var deferredLock; | 137 | var deferredLock; |
141 | 138 | ||
142 | deferredLock = this.getDeferredLockForKey('key'); | 139 | deferredLock = this.getDeferredLockForKey('key'); |
143 | 140 | ||
144 | deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObject.getKey", {trace:false}); | 141 | deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObject.getKey", {trace:false}); |
145 | deferredResult.acquireLock(deferredLock); | 142 | deferredResult.acquireLock(deferredLock); |
146 | deferredResult.addMethod( | 143 | deferredResult.addMethod( |
147 | this.decryptedDataStore(), | 144 | this.decryptedDataStore(), |
148 | 'deferredGetOrSet', | 145 | 'deferredGetOrSet', |
149 | 'decryptionKey', | 146 | 'decryptionKey', |
150 | MochiKit.Base.partial(this.retrieveKeyFunction(), this.reference()) | 147 | MochiKit.Base.partial(this.retrieveKeyFunction(), this.reference()) |
151 | ); | 148 | ); |
152 | deferredResult.releaseLock(deferredLock); | 149 | deferredResult.releaseLock(deferredLock); |
153 | deferredResult.callback(); | 150 | deferredResult.callback(); |
154 | 151 | ||
155 | return deferredResult; | 152 | return deferredResult; |
156 | }, | 153 | }, |
157 | 154 | ||
158 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | 155 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
159 | 156 | ||
160 | 'retrieveKeyFunction': function () { | 157 | 'retrieveKeyFunction': function () { |
161 | return this._retrieveKeyFunction; | 158 | return this._retrieveKeyFunction; |
162 | }, | 159 | }, |
163 | 160 | ||
164 | 'setRetrieveKeyFunction': function (aFunction) { | 161 | 'setRetrieveKeyFunction': function (aFunction) { |
165 | this._retrieveKeyFunction = aFunction; | 162 | this._retrieveKeyFunction = aFunction; |
166 | }, | 163 | }, |
167 | 164 | ||
168 | //------------------------------------------------------------------------- | 165 | //------------------------------------------------------------------------- |
169 | 166 | ||
170 | 'hasLoadedRemoteData': function () { | 167 | 'hasLoadedRemoteData': function () { |
171 | return (this._remoteData != null); | 168 | return (this._remoteData != null); |
172 | }, | 169 | }, |
173 | 170 | ||
174 | 'getRemoteData': function () { | 171 | 'getRemoteData': function () { |
175 | var deferredResult; | 172 | var deferredResult; |
176 | vardeferredLock; | 173 | vardeferredLock; |
177 | 174 | ||
178 | deferredLock = this.getDeferredLockForKey('remoteData'); | 175 | deferredLock = this.getDeferredLockForKey('remoteData'); |
179 | 176 | ||
180 | deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObjects.getRemoteData", {trace:false}); | 177 | deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObjects.getRemoteData", {trace:false}); |
181 | deferredResult.acquireLock(deferredLock); | 178 | deferredResult.acquireLock(deferredLock); |
182 | deferredResult.addCallback(MochiKit.Base.bind(function () { | 179 | deferredResult.addCallback(MochiKit.Base.bind(function () { |
183 | var innerDeferredResult; | 180 | var innerDeferredResult; |
184 | 181 | ||
185 | if (this._remoteData != null) { | 182 | if (this._remoteData != null) { |
186 | innerDeferredResult = MochiKit.Async.succeed(this._remoteData); | 183 | innerDeferredResult = MochiKit.Async.succeed(this._remoteData); |
187 | } else { | 184 | } else { |
188 | innerDeferredResult = Clipperz.Async.callbacks("EncryptedRemoteObjects.getRemoteData <inner deferred>", [ | 185 | innerDeferredResult = Clipperz.Async.callbacks("EncryptedRemoteObjects.getRemoteData <inner deferred>", [ |
189 | MochiKit.Base.partial(this.retrieveRemoteDataFunction(), this.reference()), | 186 | MochiKit.Base.partial(this.retrieveRemoteDataFunction(), this.reference()), |
190 | MochiKit.Base.method(this, 'unpackRemoteData'), | 187 | MochiKit.Base.method(this, 'unpackRemoteData'), |
191 | MochiKit.Base.bind(function (someData) { | 188 | MochiKit.Base.bind(function (someData) { |
192 | this._remoteData = someData; | 189 | this._remoteData = someData; |
193 | return this._remoteData; | 190 | return this._remoteData; |
194 | }, this) | 191 | }, this) |
195 | ], {trace:false}); | 192 | ], {trace:false}); |
196 | } | 193 | } |
197 | 194 | ||
198 | return innerDeferredResult; | 195 | return innerDeferredResult; |
199 | }, this)) | 196 | }, this)) |
200 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | 197 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); |
201 | deferredResult.releaseLock(deferredLock); | 198 | deferredResult.releaseLock(deferredLock); |
202 | 199 | ||
203 | deferredResult.callback(); | 200 | deferredResult.callback(); |
204 | 201 | ||
205 | return deferredResult; | 202 | return deferredResult; |
206 | }, | 203 | }, |
207 | 204 | ||
208 | //------------------------------------------------------------------------- | 205 | //------------------------------------------------------------------------- |
209 | 206 | ||
210 | 'unpackRemoteData': function (someData) { | 207 | 'unpackRemoteData': function (someData) { |
211 | return MochiKit.Async.succeed(someData); | 208 | return MochiKit.Async.succeed(someData); |
212 | }, | 209 | }, |
213 | 210 | ||
214 | //......................................................................... | 211 | //......................................................................... |
215 | 212 | ||
216 | 'packRemoteData': function (someData) { | 213 | 'packRemoteData': function (someData) { |
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js index 9f1c197..834e21b 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js | |||
@@ -1,216 +1,213 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.DataModel.OneTimePassword = function(args) { | 33 | Clipperz.PM.DataModel.OneTimePassword = function(args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | //this._user = args['user']; | 36 | //this._user = args['user']; |
40 | this._reference = args['reference']|| Clipperz.PM.Crypto.randomKey(); | 37 | this._reference = args['reference']|| Clipperz.PM.Crypto.randomKey(); |
41 | this._password = args['password']; | 38 | this._password = args['password']; |
42 | this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); | 39 | this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); |
43 | this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); | 40 | this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); |
44 | this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; | 41 | this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; |
45 | 42 | ||
46 | this._status = args['status'] || 'ACTIVE'; //'REQUESTED', 'USED', 'DISABLED' | 43 | this._status = args['status'] || 'ACTIVE'; //'REQUESTED', 'USED', 'DISABLED' |
47 | this._connectionInfo= null; | 44 | this._connectionInfo= null; |
48 | 45 | ||
49 | this._key = null; | 46 | this._key = null; |
50 | this._keyChecksum= null; | 47 | this._keyChecksum= null; |
51 | 48 | ||
52 | return this; | 49 | return this; |
53 | } | 50 | } |
54 | 51 | ||
55 | Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, { | 52 | Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, { |
56 | 53 | ||
57 | 'toString': function() { | 54 | 'toString': function() { |
58 | return "Clipperz.PM.DataModel.OneTimePassword"; | 55 | return "Clipperz.PM.DataModel.OneTimePassword"; |
59 | }, | 56 | }, |
60 | /* | 57 | /* |
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'user': function() { | 60 | 'user': function() { |
64 | return this._user; | 61 | return this._user; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
68 | 65 | ||
69 | 'password': function() { | 66 | 'password': function() { |
70 | return this._password; | 67 | return this._password; |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'passwordValue': function() { | 72 | 'passwordValue': function() { |
76 | return this._passwordValue; | 73 | return this._passwordValue; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
80 | 77 | ||
81 | 'creationDate': function() { | 78 | 'creationDate': function() { |
82 | return this._creationDate; | 79 | return this._creationDate; |
83 | }, | 80 | }, |
84 | 81 | ||
85 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
86 | 83 | ||
87 | 'reference': function() { | 84 | 'reference': function() { |
88 | return this._reference; | 85 | return this._reference; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------- |
92 | 89 | ||
93 | 'key': function() { | 90 | 'key': function() { |
94 | if (this._key == null) { | 91 | if (this._key == null) { |
95 | this._key = Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword(this.user().username(), this.passwordValue()); | 92 | this._key = Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword(this.user().username(), this.passwordValue()); |
96 | } | 93 | } |
97 | 94 | ||
98 | return this._key; | 95 | return this._key; |
99 | }, | 96 | }, |
100 | 97 | ||
101 | //------------------------------------------------------------------------- | 98 | //------------------------------------------------------------------------- |
102 | 99 | ||
103 | 'keyChecksum': function() { | 100 | 'keyChecksum': function() { |
104 | if (this._keyChecksum == null) { | 101 | if (this._keyChecksum == null) { |
105 | this._keyChecksum = Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword(this.user().username(), this.passwordValue()); | 102 | this._keyChecksum = Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword(this.user().username(), this.passwordValue()); |
106 | } | 103 | } |
107 | 104 | ||
108 | return this._keyChecksum; | 105 | return this._keyChecksum; |
109 | }, | 106 | }, |
110 | */ | 107 | */ |
111 | //------------------------------------------------------------------------- | 108 | //------------------------------------------------------------------------- |
112 | 109 | ||
113 | 'status': function() { | 110 | 'status': function() { |
114 | return this._status; | 111 | return this._status; |
115 | }, | 112 | }, |
116 | 113 | ||
117 | 'setStatus': function(aValue) { | 114 | 'setStatus': function(aValue) { |
118 | this._status = aValue; | 115 | this._status = aValue; |
119 | }, | 116 | }, |
120 | 117 | ||
121 | //------------------------------------------------------------------------- | 118 | //------------------------------------------------------------------------- |
122 | /* | 119 | /* |
123 | 'serializedData': function() { | 120 | 'serializedData': function() { |
124 | var result; | 121 | var result; |
125 | 122 | ||
126 | result = { | 123 | result = { |
127 | 'password': this.password(), | 124 | 'password': this.password(), |
128 | 'created': this.creationDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.creationDate()) : null, | 125 | 'created': this.creationDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.creationDate()) : null, |
129 | 'used': this.usageDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.usageDate()) : null, | 126 | 'used': this.usageDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.usageDate()) : null, |
130 | 'status': this.status() | 127 | 'status': this.status() |
131 | }; | 128 | }; |
132 | 129 | ||
133 | return result; | 130 | return result; |
134 | }, | 131 | }, |
135 | 132 | ||
136 | //------------------------------------------------------------------------- | 133 | //------------------------------------------------------------------------- |
137 | 134 | ||
138 | 'packedPassphrase': function() { | 135 | 'packedPassphrase': function() { |
139 | var result; | 136 | var result; |
140 | var packedPassphrase; | 137 | var packedPassphrase; |
141 | var encodedPassphrase; | 138 | var encodedPassphrase; |
142 | varprefixPadding; | 139 | varprefixPadding; |
143 | var suffixPadding; | 140 | var suffixPadding; |
144 | var getRandomBytes; | 141 | var getRandomBytes; |
145 | 142 | ||
146 | getRandomBytes = MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes'); | 143 | getRandomBytes = MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes'); |
147 | 144 | ||
148 | encodedPassphrase = new Clipperz.ByteArray(this.user().passphrase()).toBase64String(); | 145 | encodedPassphrase = new Clipperz.ByteArray(this.user().passphrase()).toBase64String(); |
149 | //MochiKit.Logging.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length); | 146 | //MochiKit.Logging.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length); |
150 | prefixPadding = getRandomBytes(getRandomBytes(1).byteAtIndex(0)).toBase64String(); | 147 | prefixPadding = getRandomBytes(getRandomBytes(1).byteAtIndex(0)).toBase64String(); |
151 | //MochiKit.Logging.logDebug("--- prefixPadding.length: " + prefixPadding.length); | 148 | //MochiKit.Logging.logDebug("--- prefixPadding.length: " + prefixPadding.length); |
152 | suffixPadding = getRandomBytes((500 - prefixPadding.length - encodedPassphrase.length) * 6 / 8).toBase64String(); | 149 | suffixPadding = getRandomBytes((500 - prefixPadding.length - encodedPassphrase.length) * 6 / 8).toBase64String(); |
153 | //MochiKit.Logging.logDebug("--- suffixPadding.length: " + suffixPadding.length); | 150 | //MochiKit.Logging.logDebug("--- suffixPadding.length: " + suffixPadding.length); |
154 | //MochiKit.Logging.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length)); | 151 | //MochiKit.Logging.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length)); |
155 | 152 | ||
156 | packedPassphrase = { | 153 | packedPassphrase = { |
157 | 'prefix': prefixPadding, | 154 | 'prefix': prefixPadding, |
158 | 'passphrase': encodedPassphrase, | 155 | 'passphrase': encodedPassphrase, |
159 | 'suffix': suffixPadding | 156 | 'suffix': suffixPadding |
160 | }; | 157 | }; |
161 | 158 | ||
162 | // result = Clipperz.Base.serializeJSON(packedPassphrase); | 159 | // result = Clipperz.Base.serializeJSON(packedPassphrase); |
163 | result = packedPassphrase; | 160 | result = packedPassphrase; |
164 | //MochiKit.Logging.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result); | 161 | //MochiKit.Logging.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result); |
165 | //MochiKit.Logging.logDebug("<<< OneTimePassword.packedPassphrase"); | 162 | //MochiKit.Logging.logDebug("<<< OneTimePassword.packedPassphrase"); |
166 | 163 | ||
167 | return result; | 164 | return result; |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //------------------------------------------------------------------------- | 167 | //------------------------------------------------------------------------- |
171 | 168 | ||
172 | 'encryptedPackedPassphrase': function() { | 169 | 'encryptedPackedPassphrase': function() { |
173 | return Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion(this.passwordValue(), this.packedPassphrase()) | 170 | return Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion(this.passwordValue(), this.packedPassphrase()) |
174 | }, | 171 | }, |
175 | 172 | ||
176 | //------------------------------------------------------------------------- | 173 | //------------------------------------------------------------------------- |
177 | 174 | ||
178 | 'encryptedData': function() { | 175 | 'encryptedData': function() { |
179 | var deferredResult; | 176 | var deferredResult; |
180 | varresult; | 177 | varresult; |
181 | 178 | ||
182 | //MochiKit.Logging.logDebug(">>> OneTimePassword.encryptedData"); | 179 | //MochiKit.Logging.logDebug(">>> OneTimePassword.encryptedData"); |
183 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference()); | 180 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference()); |
184 | result = { | 181 | result = { |
185 | 'reference': this.reference(), | 182 | 'reference': this.reference(), |
186 | 'key': this.key(), | 183 | 'key': this.key(), |
187 | 'keyChecksum': this.keyChecksum(), | 184 | 'keyChecksum': this.keyChecksum(), |
188 | 'data': "", | 185 | 'data': "", |
189 | 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion | 186 | 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion |
190 | } | 187 | } |
191 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result)); | 188 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result)); |
192 | deferredResult = new MochiKit.Async.Deferred(); | 189 | deferredResult = new MochiKit.Async.Deferred(); |
193 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 3"); | 190 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 3"); |
194 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;}); | 191 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;}); |
195 | //# deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion, this.passwordValue(), this.packedPassphrase()); | 192 | //# deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion, this.passwordValue(), this.packedPassphrase()); |
196 | deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedPackedPassphrase')); | 193 | deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedPackedPassphrase')); |
197 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 4"); | 194 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 4"); |
198 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;}); | 195 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;}); |
199 | deferredResult.addCallback(function(aResult, res) { | 196 | deferredResult.addCallback(function(aResult, res) { |
200 | aResult['data'] = res; | 197 | aResult['data'] = res; |
201 | return aResult; | 198 | return aResult; |
202 | }, result); | 199 | }, result); |
203 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 5"); | 200 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 5"); |
204 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;}); | 201 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;}); |
205 | deferredResult.callback(); | 202 | deferredResult.callback(); |
206 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 6"); | 203 | //MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 6"); |
207 | 204 | ||
208 | return deferredResult; | 205 | return deferredResult; |
209 | }, | 206 | }, |
210 | 207 | ||
211 | //------------------------------------------------------------------------- | 208 | //------------------------------------------------------------------------- |
212 | 209 | ||
213 | 'saveChanges': function() { | 210 | 'saveChanges': function() { |
214 | var deferredResult; | 211 | var deferredResult; |
215 | varresult; | 212 | varresult; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js index 147aa7d..f51bbc2 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js | |||
@@ -1,167 +1,164 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.Record.Version) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.Record.Version) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.Record.Version.Field depends on Clipperz.PM.DataModel.Record.Version!"; | 27 | throw "Clipperz.PM.DataModel.Record.Version.Field depends on Clipperz.PM.DataModel.Record.Version!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | Clipperz.PM.DataModel.Record.Version.Field = function(args) { | 30 | Clipperz.PM.DataModel.Record.Version.Field = function(args) { |
34 | Clipperz.PM.DataModel.Record.Version.Field.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.DataModel.Record.Version.Field.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._recordVersion = args.recordVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._recordVersion = args.recordVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); | 34 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version.Field, Object, { | 40 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version.Field, Object, { |
44 | 41 | ||
45 | 'toString': function() { | 42 | 'toString': function() { |
46 | return "Record.Version.Field (" + this.reference() + ")"; | 43 | return "Record.Version.Field (" + this.reference() + ")"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'recordVersion': function () { | 48 | 'recordVersion': function () { |
52 | return this._recordVersion; | 49 | return this._recordVersion; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'reference': function () { | 54 | 'reference': function () { |
58 | return this._reference; | 55 | return this._reference; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'getItem': function (aKey) { | 60 | 'getItem': function (aKey) { |
64 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.getItem", [ | 61 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.getItem", [ |
65 | MochiKit.Base.method(this, 'recordVersion'), | 62 | MochiKit.Base.method(this, 'recordVersion'), |
66 | MochiKit.Base.methodcaller('getValue', 'fields' + '.' + this.reference() + '.' + aKey) | 63 | MochiKit.Base.methodcaller('getValue', 'fields' + '.' + this.reference() + '.' + aKey) |
67 | ], {trace:false}); | 64 | ], {trace:false}); |
68 | }, | 65 | }, |
69 | 66 | ||
70 | 'setItem': function (aKey, aValue) { | 67 | 'setItem': function (aKey, aValue) { |
71 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.getItem", [ | 68 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.getItem", [ |
72 | MochiKit.Base.method(this, 'recordVersion'), | 69 | MochiKit.Base.method(this, 'recordVersion'), |
73 | MochiKit.Base.methodcaller('setValue', 'fields' + '.' + this.reference() + '.' + aKey, aValue) | 70 | MochiKit.Base.methodcaller('setValue', 'fields' + '.' + this.reference() + '.' + aKey, aValue) |
74 | ], {trace:false}); | 71 | ], {trace:false}); |
75 | }, | 72 | }, |
76 | 73 | ||
77 | //------------------------------------------------------------------------- | 74 | //------------------------------------------------------------------------- |
78 | 75 | ||
79 | 'label': function () { | 76 | 'label': function () { |
80 | return this.getItem('label'); | 77 | return this.getItem('label'); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | 'setLabel': function (aValue) { | 80 | 'setLabel': function (aValue) { |
84 | return this.setItem('label', aValue); | 81 | return this.setItem('label', aValue); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'value': function () { | 86 | 'value': function () { |
90 | return this.getItem('value'); | 87 | return this.getItem('value'); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | 'setValue': function (aValue) { | 90 | 'setValue': function (aValue) { |
94 | return this.setItem('value', aValue); | 91 | return this.setItem('value', aValue); |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'actionType': function () { | 96 | 'actionType': function () { |
100 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.actionType", [ | 97 | return Clipperz.Async.callbacks("Clipperz.PM.DataModel.Record.Version.Field.actionType", [ |
101 | Clipperz.Async.collectResults("Clipperz.PM.DataModel.Record.Version.Field.actionType [collect results]", { | 98 | Clipperz.Async.collectResults("Clipperz.PM.DataModel.Record.Version.Field.actionType [collect results]", { |
102 | 'isHidden':MochiKit.Base.method(this, 'isHidden'), | 99 | 'isHidden':MochiKit.Base.method(this, 'isHidden'), |
103 | 'value':MochiKit.Base.method(this, 'value') | 100 | 'value':MochiKit.Base.method(this, 'value') |
104 | }, {trace:false}), | 101 | }, {trace:false}), |
105 | function (someValues) { | 102 | function (someValues) { |
106 | var result; //'NONE', 'URL', 'EMAIL', 'PASSWORD' | 103 | var result; //'NONE', 'URL', 'EMAIL', 'PASSWORD' |
107 | 104 | ||
108 | result = 'NONE'; | 105 | result = 'NONE'; |
109 | 106 | ||
110 | if (someValues['isHidden']) { | 107 | if (someValues['isHidden']) { |
111 | result = 'PASSWORD'; | 108 | result = 'PASSWORD'; |
112 | } else if (Clipperz.Base.isUrl(someValues['value'])) { | 109 | } else if (Clipperz.Base.isUrl(someValues['value'])) { |
113 | result = 'URL' | 110 | result = 'URL' |
114 | } else if (Clipperz.Base.isEmail(someValues['value'])) { | 111 | } else if (Clipperz.Base.isEmail(someValues['value'])) { |
115 | result = 'EMAIL' | 112 | result = 'EMAIL' |
116 | }; | 113 | }; |
117 | 114 | ||
118 | return result; | 115 | return result; |
119 | } | 116 | } |
120 | ], {trace:false}); | 117 | ], {trace:false}); |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //------------------------------------------------------------------------- | 120 | //------------------------------------------------------------------------- |
124 | 121 | ||
125 | 'isHidden': function () { | 122 | 'isHidden': function () { |
126 | return this.getItem('hidden'); | 123 | return this.getItem('hidden'); |
127 | }, | 124 | }, |
128 | 125 | ||
129 | 'setIsHidden': function (aValue) { | 126 | 'setIsHidden': function (aValue) { |
130 | return this.setItem('hidden', aValue); | 127 | return this.setItem('hidden', aValue); |
131 | }, | 128 | }, |
132 | 129 | ||
133 | //------------------------------------------------------------------------- | 130 | //------------------------------------------------------------------------- |
134 | 131 | ||
135 | 'isEmpty': function () { | 132 | 'isEmpty': function () { |
136 | var deferredResult; | 133 | var deferredResult; |
137 | 134 | ||
138 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.Field.isEmpty", {trace:false}); | 135 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.Field.isEmpty", {trace:false}); |
139 | 136 | ||
140 | deferredResult.collectResults({ | 137 | deferredResult.collectResults({ |
141 | 'label': [ | 138 | 'label': [ |
142 | MochiKit.Base.method(this, 'label'), | 139 | MochiKit.Base.method(this, 'label'), |
143 | MochiKit.Base.partial(MochiKit.Base.operator.eq, '') | 140 | MochiKit.Base.partial(MochiKit.Base.operator.eq, '') |
144 | ], | 141 | ], |
145 | 'value': [ | 142 | 'value': [ |
146 | MochiKit.Base.method(this, 'value'), | 143 | MochiKit.Base.method(this, 'value'), |
147 | MochiKit.Base.partial(MochiKit.Base.operator.eq, '') | 144 | MochiKit.Base.partial(MochiKit.Base.operator.eq, '') |
148 | ], | 145 | ], |
149 | 'isHidden': [ | 146 | 'isHidden': [ |
150 | MochiKit.Base.method(this, 'isHidden'), | 147 | MochiKit.Base.method(this, 'isHidden'), |
151 | MochiKit.Base.partial(MochiKit.Base.operator.eq, false) | 148 | MochiKit.Base.partial(MochiKit.Base.operator.eq, false) |
152 | ] | 149 | ] |
153 | }); | 150 | }); |
154 | deferredResult.addCallback(MochiKit.Base.values); | 151 | deferredResult.addCallback(MochiKit.Base.values); |
155 | deferredResult.addCallback(function(someValues) { | 152 | deferredResult.addCallback(function(someValues) { |
156 | return MochiKit.Iter.every(someValues, MochiKit.Base.operator.identity); | 153 | return MochiKit.Iter.every(someValues, MochiKit.Base.operator.identity); |
157 | }); | 154 | }); |
158 | deferredResult.callback(); | 155 | deferredResult.callback(); |
159 | 156 | ||
160 | return deferredResult; | 157 | return deferredResult; |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //------------------------------------------------------------------------- | 160 | //------------------------------------------------------------------------- |
164 | __syntaxFix__: "syntax fix" | 161 | __syntaxFix__: "syntax fix" |
165 | }); | 162 | }); |
166 | 163 | ||
167 | 164 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js index 6e50f8e..dd35fc9 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.Record) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.Record) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.Record.Version depends on Clipperz.PM.DataModel.Record!"; | 27 | throw "Clipperz.PM.DataModel.Record.Version depends on Clipperz.PM.DataModel.Record!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | Clipperz.PM.DataModel.Record.Version = function(args) { | 30 | Clipperz.PM.DataModel.Record.Version = function(args) { |
34 | //console.log(">>> Record.new"); | 31 | //console.log(">>> Record.new"); |
35 | Clipperz.PM.DataModel.Record.Version.superclass.constructor.apply(this, arguments); | 32 | Clipperz.PM.DataModel.Record.Version.superclass.constructor.apply(this, arguments); |
36 | 33 | ||
37 | this._getVersionFunction = args.getVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._getVersionFunction = args.getVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._fields = null; | 35 | this._fields = null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 41 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
45 | 42 | ||
46 | 'toString': function() { | 43 | 'toString': function() { |
47 | return "Record.Version (" + this.reference() + ")"; | 44 | return "Record.Version (" + this.reference() + ")"; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'reference': function () { | 49 | 'reference': function () { |
53 | return this._reference; | 50 | return this._reference; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | /* | 54 | /* |
58 | 'hasPendingChanges': function () { | 55 | 'hasPendingChanges': function () { |
59 | var deferredResult; | 56 | var deferredResult; |
60 | 57 | ||
61 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.hasPendingChanges", {trace:false}); | 58 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.hasPendingChanges", {trace:false}); |
62 | deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.hasPendingChanges, this)); | 59 | deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.hasPendingChanges, this)); |
63 | deferredResult.callback(); | 60 | deferredResult.callback(); |
64 | 61 | ||
65 | return deferredResult; | 62 | return deferredResult; |
66 | }, | 63 | }, |
67 | */ | 64 | */ |
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 67 | ||
71 | 'hasPendingChangesWhenBrandNew': function () { | 68 | 'hasPendingChangesWhenBrandNew': function () { |
72 | var deferredResult; | 69 | var deferredResult; |
73 | 70 | ||
74 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.hasPendingChangesWhenBrandNew", {trace:false}); | 71 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.hasPendingChangesWhenBrandNew", {trace:false}); |
75 | deferredResult.addMethod(this, 'fields'); | 72 | deferredResult.addMethod(this, 'fields'); |
76 | deferredResult.addCallback(MochiKit.Base.values); | 73 | deferredResult.addCallback(MochiKit.Base.values); |
77 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.methodcaller('isEmpty')) | 74 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.methodcaller('isEmpty')) |
78 | deferredResult.addCallback(Clipperz.Async.collectAll); | 75 | deferredResult.addCallback(Clipperz.Async.collectAll); |
79 | deferredResult.addCallback(function(someValues) { | 76 | deferredResult.addCallback(function(someValues) { |
80 | return MochiKit.Iter.every(someValues, MochiKit.Base.operator.identity); | 77 | return MochiKit.Iter.every(someValues, MochiKit.Base.operator.identity); |
81 | }); | 78 | }); |
82 | deferredResult.addCallback(MochiKit.Base.operator.lognot) | 79 | deferredResult.addCallback(MochiKit.Base.operator.lognot) |
83 | deferredResult.callback(); | 80 | deferredResult.callback(); |
84 | 81 | ||
85 | return deferredResult; | 82 | return deferredResult; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //========================================================================= | 85 | //========================================================================= |
89 | 86 | ||
90 | 'commitTransientState': function () { | 87 | 'commitTransientState': function () { |
91 | var deferredResult; | 88 | var deferredResult; |
92 | 89 | ||
93 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.commitTransientState", {trace:false}); | 90 | deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.commitTransientState", {trace:false}); |
94 | deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.commitTransientState, this)); | 91 | deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.commitTransientState, this)); |
95 | deferredResult.callback(); | 92 | deferredResult.callback(); |
96 | 93 | ||
97 | return deferredResult; | 94 | return deferredResult; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //========================================================================= | 97 | //========================================================================= |
101 | 98 | ||
102 | 'unpackData': function (someData) { //++ | 99 | 'unpackData': function (someData) { //++ |
103 | varresult; | 100 | varresult; |
104 | 101 | ||
105 | //console.log("Record.Version - UNPACK DATA", this, someData); | 102 | //console.log("Record.Version - UNPACK DATA", this, someData); |
106 | result = someData; | 103 | result = someData; |
107 | if ((someData['fields'] != null) && (someData['fields'] instanceof Array)) { | 104 | if ((someData['fields'] != null) && (someData['fields'] instanceof Array)) { |
108 | varfields; | 105 | varfields; |
109 | var i,c; | 106 | var i,c; |
110 | 107 | ||
111 | fields = someData['fields']; | 108 | fields = someData['fields']; |
112 | delete someData['fields']; | 109 | delete someData['fields']; |
113 | 110 | ||
114 | someData['fields'] = {}; | 111 | someData['fields'] = {}; |
115 | c = fields.length; | 112 | c = fields.length; |
116 | for (i=0; i<c; i++) { | 113 | for (i=0; i<c; i++) { |
117 | someData['fields'][i] = fields[i]; | 114 | someData['fields'][i] = fields[i]; |
118 | } | 115 | } |
119 | } | 116 | } |
120 | 117 | ||
121 | 118 | ||
122 | 119 | ||
123 | return result; | 120 | return result; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | //========================================================================= | 123 | //========================================================================= |
127 | 124 | ||
128 | 'fields': function () { | 125 | 'fields': function () { |
129 | vardeferredResult; | 126 | vardeferredResult; |
130 | var deferredLock; | 127 | var deferredLock; |
131 | 128 | ||
132 | deferredLock = this.getDeferredLockForKey('fields'); | 129 | deferredLock = this.getDeferredLockForKey('fields'); |
133 | 130 | ||
134 | deferredResult = new Clipperz.Async.Deferred("Record.Version.fields", {trace:false}); | 131 | deferredResult = new Clipperz.Async.Deferred("Record.Version.fields", {trace:false}); |
135 | deferredResult.acquireLock(deferredLock); | 132 | deferredResult.acquireLock(deferredLock); |
136 | deferredResult.addCallback(MochiKit.Base.bind(function () { | 133 | deferredResult.addCallback(MochiKit.Base.bind(function () { |
137 | var innerDeferredResult; | 134 | var innerDeferredResult; |
138 | 135 | ||
139 | if (this._fields == null) { | 136 | if (this._fields == null) { |
140 | innerDeferredResult = new Clipperz.Async.Deferred("Record.Version.fields <inner deferred>", {trace:false}); | 137 | innerDeferredResult = new Clipperz.Async.Deferred("Record.Version.fields <inner deferred>", {trace:false}); |
141 | innerDeferredResult.addMethod(this, 'getValue', 'fields'); | 138 | innerDeferredResult.addMethod(this, 'getValue', 'fields'); |
142 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someObjectData) { | 139 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someObjectData) { |
143 | var reference; | 140 | var reference; |
144 | 141 | ||
145 | this._fields = {}; | 142 | this._fields = {}; |
146 | 143 | ||
147 | for (reference in someObjectData) { | 144 | for (reference in someObjectData) { |
148 | varrecordVersionField; | 145 | varrecordVersionField; |
149 | 146 | ||
150 | recordVersionField = new Clipperz.PM.DataModel.Record.Version.Field({ | 147 | recordVersionField = new Clipperz.PM.DataModel.Record.Version.Field({ |
151 | 'recordVersion':this, | 148 | 'recordVersion':this, |
152 | 'reference': reference | 149 | 'reference': reference |
153 | }); | 150 | }); |
154 | 151 | ||
155 | this._fields[reference] = recordVersionField; | 152 | this._fields[reference] = recordVersionField; |
156 | } | 153 | } |
157 | 154 | ||
158 | return this._fields; | 155 | return this._fields; |
159 | }, this)); | 156 | }, this)); |
160 | innerDeferredResult.callback(); | 157 | innerDeferredResult.callback(); |
161 | } else { | 158 | } else { |
162 | innerDeferredResult = MochiKit.Async.succeed(this._fields); | 159 | innerDeferredResult = MochiKit.Async.succeed(this._fields); |
163 | } | 160 | } |
164 | 161 | ||
165 | return innerDeferredResult; | 162 | return innerDeferredResult; |
166 | }, this)); | 163 | }, this)); |
167 | deferredResult.releaseLock(deferredLock); | 164 | deferredResult.releaseLock(deferredLock); |
168 | deferredResult.callback(); | 165 | deferredResult.callback(); |
169 | 166 | ||
170 | return deferredResult; | 167 | return deferredResult; |
171 | }, | 168 | }, |
172 | 169 | ||
173 | //------------------------------------------------------------------------- | 170 | //------------------------------------------------------------------------- |
174 | 171 | ||
175 | 'getFieldsValues': function () { | 172 | 'getFieldsValues': function () { |
176 | return this.getValue('fields'); | 173 | return this.getValue('fields'); |
177 | }, | 174 | }, |
178 | 175 | ||
179 | //------------------------------------------------------------------------- | 176 | //------------------------------------------------------------------------- |
180 | 177 | ||
181 | 'addField': function (someParameters) { | 178 | 'addField': function (someParameters) { |
182 | varnewField; | 179 | varnewField; |
183 | 180 | ||
184 | newField = new Clipperz.PM.DataModel.Record.Version.Field({recordVersion:this}); | 181 | newField = new Clipperz.PM.DataModel.Record.Version.Field({recordVersion:this}); |
185 | 182 | ||
186 | return Clipperz.Async.callbacks("Record.Version.addField", [ | 183 | return Clipperz.Async.callbacks("Record.Version.addField", [ |
187 | MochiKit.Base.method(this, 'fields'), | 184 | MochiKit.Base.method(this, 'fields'), |
188 | 185 | ||
189 | MochiKit.Base.method(this, '_getObjectDataStore'), | 186 | MochiKit.Base.method(this, '_getObjectDataStore'), |
190 | MochiKit.Base.methodcaller('values'), | 187 | MochiKit.Base.methodcaller('values'), |
191 | Clipperz.Base.serializeJSON, | 188 | Clipperz.Base.serializeJSON, |
192 | 189 | ||
193 | MochiKit.Base.bind(function () { this._fields[newField.reference()] = newField; }, this), | 190 | MochiKit.Base.bind(function () { this._fields[newField.reference()] = newField; }, this), |
194 | MochiKit.Base.method(newField, 'setLabel', someParameters['label']), | 191 | MochiKit.Base.method(newField, 'setLabel', someParameters['label']), |
195 | MochiKit.Base.method(newField, 'setValue', someParameters['value']), | 192 | MochiKit.Base.method(newField, 'setValue', someParameters['value']), |
196 | MochiKit.Base.method(newField, 'setIsHidden',someParameters['isHidden']), | 193 | MochiKit.Base.method(newField, 'setIsHidden',someParameters['isHidden']), |
197 | 194 | ||
198 | MochiKit.Base.method(this, '_getObjectDataStore'), | 195 | MochiKit.Base.method(this, '_getObjectDataStore'), |
199 | MochiKit.Base.methodcaller('values'), | 196 | MochiKit.Base.methodcaller('values'), |
200 | Clipperz.Base.serializeJSON, | 197 | Clipperz.Base.serializeJSON, |
201 | 198 | ||
202 | MochiKit.Base.partial(MochiKit.Async.succeed, newField) | 199 | MochiKit.Base.partial(MochiKit.Async.succeed, newField) |
203 | ], {trace:false}); | 200 | ], {trace:false}); |
204 | }, | 201 | }, |
205 | 202 | ||
206 | //------------------------------------------------------------------------- | 203 | //------------------------------------------------------------------------- |
207 | 204 | ||
208 | 'removeField': function (aField) { | 205 | 'removeField': function (aField) { |
209 | return Clipperz.Async.callbacks("Record.Version.removeField", [ | 206 | return Clipperz.Async.callbacks("Record.Version.removeField", [ |
210 | MochiKit.Base.method(this, 'fields'), | 207 | MochiKit.Base.method(this, 'fields'), |
211 | MochiKit.Base.bind(function () { delete this._fields[aField.reference()]; }, this), | 208 | MochiKit.Base.bind(function () { delete this._fields[aField.reference()]; }, this), |
212 | MochiKit.Base.method(this, 'removeValue', 'fields' + '.' + aField.reference()) | 209 | MochiKit.Base.method(this, 'removeValue', 'fields' + '.' + aField.reference()) |
213 | ], {trace:false}); | 210 | ], {trace:false}); |
214 | }, | 211 | }, |
215 | 212 | ||
216 | //------------------------------------------------------------------------- | 213 | //------------------------------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js index 85dd06b..b816f80 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js | |||
@@ -1,216 +1,213 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | Clipperz.PM.DataModel.Record = function(args) { | 31 | Clipperz.PM.DataModel.Record = function(args) { |
35 | //console.log(">>> new Clipperz.PM.DataModel.Record", args); | 32 | //console.log(">>> new Clipperz.PM.DataModel.Record", args); |
36 | Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments); | 33 | Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments); |
37 | 34 | ||
38 | this._updateDate = (args.updateDate ? Clipperz.PM.Date.parse(args.updateDate) : Clipperz.Base.exception.raise('MandatoryParameter')); | 35 | this._updateDate = (args.updateDate ? Clipperz.PM.Date.parse(args.updateDate) : Clipperz.Base.exception.raise('MandatoryParameter')); |
39 | 36 | ||
40 | this._retrieveIndexDataFunction = args.retrieveIndexDataFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); | 37 | this._retrieveIndexDataFunction = args.retrieveIndexDataFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); |
41 | this._updateIndexDataFunction = args.updateIndexDataFunction || Clipperz.Base.exception.raise('MandatoryParameter'); | 38 | this._updateIndexDataFunction = args.updateIndexDataFunction || Clipperz.Base.exception.raise('MandatoryParameter'); |
42 | 39 | ||
43 | this._retrieveDirectLoginIndexDataFunction = args.retrieveDirectLoginIndexDataFunction|| null; | 40 | this._retrieveDirectLoginIndexDataFunction = args.retrieveDirectLoginIndexDataFunction|| null; |
44 | this._setDirectLoginIndexDataFunction = args.setDirectLoginIndexDataFunction || null; | 41 | this._setDirectLoginIndexDataFunction = args.setDirectLoginIndexDataFunction || null; |
45 | this._removeDirectLoginIndexDataFunction = args.removeDirectLoginIndexDataFunction|| null; | 42 | this._removeDirectLoginIndexDataFunction = args.removeDirectLoginIndexDataFunction|| null; |
46 | 43 | ||
47 | this._createNewDirectLoginFunction = args.createNewDirectLoginFunction || null; | 44 | this._createNewDirectLoginFunction = args.createNewDirectLoginFunction || null; |
48 | 45 | ||
49 | this._directLogins = {}; | 46 | this._directLogins = {}; |
50 | 47 | ||
51 | this._versions = {}; | 48 | this._versions = {}; |
52 | 49 | ||
53 | this._currentRecordVersion = null; | 50 | this._currentRecordVersion = null; |
54 | if (this.isBrandNew()) { | 51 | if (this.isBrandNew()) { |
55 | var newVersion; | 52 | var newVersion; |
56 | 53 | ||
57 | this.setNotes(''); | 54 | this.setNotes(''); |
58 | newVersion = new Clipperz.PM.DataModel.Record.Version({ | 55 | newVersion = new Clipperz.PM.DataModel.Record.Version({ |
59 | 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'), | 56 | 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'), |
60 | 'getVersion': MochiKit.Base.method(this, 'getVersion') | 57 | 'getVersion': MochiKit.Base.method(this, 'getVersion') |
61 | 58 | ||
62 | }); | 59 | }); |
63 | this._versions[newVersion.reference()] = newVersion; | 60 | this._versions[newVersion.reference()] = newVersion; |
64 | this._currentVersionReference = newVersion.reference(); | 61 | this._currentVersionReference = newVersion.reference(); |
65 | // this.setLabel(''); | 62 | // this.setLabel(''); |
66 | } | 63 | } |
67 | 64 | ||
68 | //console.log("<<< new Clipperz.PM.DataModel.Record", args); | 65 | //console.log("<<< new Clipperz.PM.DataModel.Record", args); |
69 | 66 | ||
70 | return this; | 67 | return this; |
71 | } | 68 | } |
72 | 69 | ||
73 | 70 | ||
74 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 71 | Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
75 | 72 | ||
76 | 'toString': function() { | 73 | 'toString': function() { |
77 | return "Record (" + this.reference() + ")"; | 74 | return "Record (" + this.reference() + ")"; |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //------------------------------------------------------------------------- | 77 | //------------------------------------------------------------------------- |
81 | 78 | ||
82 | 'reference': function () { | 79 | 'reference': function () { |
83 | return this._reference; | 80 | return this._reference; |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //========================================================================= | 83 | //========================================================================= |
87 | 84 | ||
88 | 'getIndexData': function () { | 85 | 'getIndexData': function () { |
89 | return this._retrieveIndexDataFunction(this.reference()); | 86 | return this._retrieveIndexDataFunction(this.reference()); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //......................................................................... | 89 | //......................................................................... |
93 | 90 | ||
94 | 'getIndexDataForKey': function (aKey) { | 91 | 'getIndexDataForKey': function (aKey) { |
95 | return Clipperz.Async.callbacks("Record.getIndexDataForKey", [ | 92 | return Clipperz.Async.callbacks("Record.getIndexDataForKey", [ |
96 | MochiKit.Base.method(this, 'getIndexData'), | 93 | MochiKit.Base.method(this, 'getIndexData'), |
97 | MochiKit.Base.itemgetter(aKey) | 94 | MochiKit.Base.itemgetter(aKey) |
98 | ], {trace:false}); | 95 | ], {trace:false}); |
99 | }, | 96 | }, |
100 | 97 | ||
101 | //------------------------------------------------------------------------- | 98 | //------------------------------------------------------------------------- |
102 | 99 | ||
103 | 'setIndexDataForKey': function (aKey, aValue) { | 100 | 'setIndexDataForKey': function (aKey, aValue) { |
104 | // return this._updateIndexDataFunction(this.reference(), aKey, aValue); | 101 | // return this._updateIndexDataFunction(this.reference(), aKey, aValue); |
105 | 102 | ||
106 | var deferredResult; | 103 | var deferredResult; |
107 | 104 | ||
108 | deferredResult = new Clipperz.Async.Deferred("Record.setIndexDataForKey", {trace:false}); | 105 | deferredResult = new Clipperz.Async.Deferred("Record.setIndexDataForKey", {trace:false}); |
109 | deferredResult.addMethod(this, 'getIndexDataForKey', aKey); | 106 | deferredResult.addMethod(this, 'getIndexDataForKey', aKey); |
110 | deferredResult.addCallback(MochiKit.Base.bind(function (aCurrentValue) { | 107 | deferredResult.addCallback(MochiKit.Base.bind(function (aCurrentValue) { |
111 | var result; | 108 | var result; |
112 | var originalValue; | 109 | var originalValue; |
113 | 110 | ||
114 | originalValue = this.transientState().getValue('originalValues.indexData.' + aKey); | 111 | originalValue = this.transientState().getValue('originalValues.indexData.' + aKey); |
115 | if (originalValue == null) { | 112 | if (originalValue == null) { |
116 | originalValue = this.transientState().setValue('originalValues.indexData.' + aKey, aCurrentValue); | 113 | originalValue = this.transientState().setValue('originalValues.indexData.' + aKey, aCurrentValue); |
117 | } | 114 | } |
118 | 115 | ||
119 | if (aCurrentValue != aValue) { | 116 | if (aCurrentValue != aValue) { |
120 | if (originalValue != aValue) { | 117 | if (originalValue != aValue) { |
121 | this.transientState().setValue('hasPendingChanges.indexData.' + aKey, true); | 118 | this.transientState().setValue('hasPendingChanges.indexData.' + aKey, true); |
122 | } else { | 119 | } else { |
123 | this.transientState().setValue('hasPendingChanges.indexData.' + aKey, false); | 120 | this.transientState().setValue('hasPendingChanges.indexData.' + aKey, false); |
124 | } | 121 | } |
125 | 122 | ||
126 | result = this._updateIndexDataFunction(this.reference(), aKey, aValue); | 123 | result = this._updateIndexDataFunction(this.reference(), aKey, aValue); |
127 | } else { | 124 | } else { |
128 | result = MochiKit.Async.succeed(aValue); | 125 | result = MochiKit.Async.succeed(aValue); |
129 | } | 126 | } |
130 | 127 | ||
131 | return result; | 128 | return result; |
132 | }, this)); | 129 | }, this)); |
133 | 130 | ||
134 | deferredResult.callback(); | 131 | deferredResult.callback(); |
135 | 132 | ||
136 | return deferredResult; | 133 | return deferredResult; |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //========================================================================= | 136 | //========================================================================= |
140 | /* | 137 | /* |
141 | 'key': function () { | 138 | 'key': function () { |
142 | return this.getIndexDataForKey('key'); | 139 | return this.getIndexDataForKey('key'); |
143 | }, | 140 | }, |
144 | */ | 141 | */ |
145 | //========================================================================= | 142 | //========================================================================= |
146 | 143 | ||
147 | 'label': function () { | 144 | 'label': function () { |
148 | return this.getIndexDataForKey('label'); | 145 | return this.getIndexDataForKey('label'); |
149 | }, | 146 | }, |
150 | 147 | ||
151 | //......................................................................... | 148 | //......................................................................... |
152 | 149 | ||
153 | 'setLabel': function (aValue) { | 150 | 'setLabel': function (aValue) { |
154 | return this.setIndexDataForKey('label', aValue); | 151 | return this.setIndexDataForKey('label', aValue); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //========================================================================= | 154 | //========================================================================= |
158 | 155 | ||
159 | 'headerNotes': function () { | 156 | 'headerNotes': function () { |
160 | return this.getIndexDataForKey('notes'); | 157 | return this.getIndexDataForKey('notes'); |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //------------------------------------------------------------------------- | 160 | //------------------------------------------------------------------------- |
164 | 161 | ||
165 | 'notes': function () { | 162 | 'notes': function () { |
166 | return Clipperz.Async.callbacks("Record.notes", [ | 163 | return Clipperz.Async.callbacks("Record.notes", [ |
167 | MochiKit.Base.method(this, 'headerNotes'), | 164 | MochiKit.Base.method(this, 'headerNotes'), |
168 | MochiKit.Base.bind(function (someHeaderNotes) { | 165 | MochiKit.Base.bind(function (someHeaderNotes) { |
169 | var result; | 166 | var result; |
170 | 167 | ||
171 | if ((someHeaderNotes == null) || (typeof(someHeaderNotes) == 'undefined')) { | 168 | if ((someHeaderNotes == null) || (typeof(someHeaderNotes) == 'undefined')) { |
172 | result = this.getValue('notes'); | 169 | result = this.getValue('notes'); |
173 | } else { | 170 | } else { |
174 | result = MochiKit.Async.succeed(someHeaderNotes); | 171 | result = MochiKit.Async.succeed(someHeaderNotes); |
175 | } | 172 | } |
176 | 173 | ||
177 | return result; | 174 | return result; |
178 | }, this) | 175 | }, this) |
179 | ], {trace:false}); | 176 | ], {trace:false}); |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //......................................................................... | 179 | //......................................................................... |
183 | 180 | ||
184 | 'setNotes': function (aValue) { | 181 | 'setNotes': function (aValue) { |
185 | return this.setValue('notes', aValue); | 182 | return this.setValue('notes', aValue); |
186 | }, | 183 | }, |
187 | 184 | ||
188 | //========================================================================= | 185 | //========================================================================= |
189 | 186 | ||
190 | 'updateDate': function () { | 187 | 'updateDate': function () { |
191 | return MochiKit.Async.succeed(this._updateDate); | 188 | return MochiKit.Async.succeed(this._updateDate); |
192 | }, | 189 | }, |
193 | 190 | ||
194 | //========================================================================= | 191 | //========================================================================= |
195 | 192 | ||
196 | 'favicon': function () { | 193 | 'favicon': function () { |
197 | var result; | 194 | var result; |
198 | var directLogins; | 195 | var directLogins; |
199 | 196 | ||
200 | directLogins = MochiKit.Base.values(this.directLogins()); | 197 | directLogins = MochiKit.Base.values(this.directLogins()); |
201 | if (directLogins.length > 0) { | 198 | if (directLogins.length > 0) { |
202 | result = directLogins[0].favicon(); | 199 | result = directLogins[0].favicon(); |
203 | // } else if (/* is there an URL to use for searching a favicon */){ | 200 | // } else if (/* is there an URL to use for searching a favicon */){ |
204 | } else { | 201 | } else { |
205 | result = null; //MochiKit.Async.succeed(Clipperz.PM.Strings['defaultFaviconUrl']); | 202 | result = null; //MochiKit.Async.succeed(Clipperz.PM.Strings['defaultFaviconUrl']); |
206 | } | 203 | } |
207 | 204 | ||
208 | return result; | 205 | return result; |
209 | }, | 206 | }, |
210 | 207 | ||
211 | //------------------------------------------------------------------------- | 208 | //------------------------------------------------------------------------- |
212 | 209 | ||
213 | 'searchableContent': function () { | 210 | 'searchableContent': function () { |
214 | var deferredResult; | 211 | var deferredResult; |
215 | 212 | ||
216 | //console.log(">>> searchableContent"); | 213 | //console.log(">>> searchableContent"); |
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js index e675525..d6202ff 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js | |||
@@ -1,187 +1,184 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 30 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
34 | 31 | ||
35 | Clipperz.PM.DataModel.User.Header.Legacy = function(args) { | 32 | Clipperz.PM.DataModel.User.Header.Legacy = function(args) { |
36 | //args = args || {}; | 33 | //args = args || {}; |
37 | Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments); | 34 | Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments); |
38 | 35 | ||
39 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | this._records = null; | 37 | this._records = null; |
41 | //this._directLogins = null; | 38 | //this._directLogins = null; |
42 | 39 | ||
43 | return this; | 40 | return this; |
44 | } | 41 | } |
45 | 42 | ||
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 44 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
48 | 45 | ||
49 | 'toString': function() { | 46 | 'toString': function() { |
50 | return "Clipperz.PM.DataModel.User.Header.Legacy"; | 47 | return "Clipperz.PM.DataModel.User.Header.Legacy"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'retrieveRecordDetailFunction': function () { | 52 | 'retrieveRecordDetailFunction': function () { |
56 | return this._retrieveRecordDetailFunction; | 53 | return this._retrieveRecordDetailFunction; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'getRecordKey': function (aRecordReference) { | 58 | 'getRecordKey': function (aRecordReference) { |
62 | var deferredResult; | 59 | var deferredResult; |
63 | 60 | ||
64 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.getRecordKey", {trace:false}); | 61 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.getRecordKey", {trace:false}); |
65 | deferredResult.addMethod(this, 'getRecordIndexData'); | 62 | deferredResult.addMethod(this, 'getRecordIndexData'); |
66 | deferredResult.addCallback(MochiKit.Base.itemgetter('key')) | 63 | deferredResult.addCallback(MochiKit.Base.itemgetter('key')) |
67 | deferredResult.callback(); | 64 | deferredResult.callback(); |
68 | 65 | ||
69 | return deferredResult; | 66 | return deferredResult; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //========================================================================= | 69 | //========================================================================= |
73 | 70 | ||
74 | 'getRecordIndexData': function (aRecordReference) { | 71 | 'getRecordIndexData': function (aRecordReference) { |
75 | return this.getValue('records.' + aRecordReference); | 72 | return this.getValue('records.' + aRecordReference); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { | 75 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { |
79 | return this.setValue('records.' + aRecordReference + "." + aKey, aValue); | 76 | return this.setValue('records.' + aRecordReference + "." + aKey, aValue); |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'getDirectLoginIndexData': function (aDirectLoginReference) { | 81 | 'getDirectLoginIndexData': function (aDirectLoginReference) { |
85 | return this.getValue('directLogins.' + aDirectLoginReference); | 82 | return this.getValue('directLogins.' + aDirectLoginReference); |
86 | }, | 83 | }, |
87 | 84 | ||
88 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { | 85 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { |
89 | return this.setValue('directLogins.' + aDirectLoginReference + '.' + aKey, aValue); | 86 | return this.setValue('directLogins.' + aDirectLoginReference + '.' + aKey, aValue); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { | 89 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { |
93 | return this.removeValue('directLogins.' + aDirectLoginReference); | 90 | return this.removeValue('directLogins.' + aDirectLoginReference); |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //========================================================================= | 93 | //========================================================================= |
97 | 94 | ||
98 | 'records': function () { | 95 | 'records': function () { |
99 | vardeferredResult; | 96 | vardeferredResult; |
100 | var deferredLock; | 97 | var deferredLock; |
101 | 98 | ||
102 | deferredLock = this.getDeferredLockForKey('records'); | 99 | deferredLock = this.getDeferredLockForKey('records'); |
103 | 100 | ||
104 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records", {trace:false}); | 101 | deferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records", {trace:false}); |
105 | deferredResult.acquireLock(deferredLock); | 102 | deferredResult.acquireLock(deferredLock); |
106 | deferredResult.addCallback(MochiKit.Base.bind(function () { | 103 | deferredResult.addCallback(MochiKit.Base.bind(function () { |
107 | var innerDeferredResult; | 104 | var innerDeferredResult; |
108 | 105 | ||
109 | if (this._records == null) { | 106 | if (this._records == null) { |
110 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records <inner deferred>", {trace:false}); | 107 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.Legacy.records <inner deferred>", {trace:false}); |
111 | innerDeferredResult.collectResults({ | 108 | innerDeferredResult.collectResults({ |
112 | 'header': [ | 109 | 'header': [ |
113 | // MochiKit.Base.method(this, 'getObjectDataStore'), | 110 | // MochiKit.Base.method(this, 'getObjectDataStore'), |
114 | // MochiKit.Base.methodcaller('values') | 111 | // MochiKit.Base.methodcaller('values') |
115 | MochiKit.Base.method(this, 'values') | 112 | MochiKit.Base.method(this, 'values') |
116 | ], | 113 | ], |
117 | 'recordsStats': [ | 114 | 'recordsStats': [ |
118 | MochiKit.Base.method(this, 'getRemoteData'), | 115 | MochiKit.Base.method(this, 'getRemoteData'), |
119 | MochiKit.Base.itemgetter('recordsStats') | 116 | MochiKit.Base.itemgetter('recordsStats') |
120 | ] | 117 | ] |
121 | }); | 118 | }); |
122 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someObjectData) { | 119 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someObjectData) { |
123 | var reference; | 120 | var reference; |
124 | 121 | ||
125 | this._records = {}; | 122 | this._records = {}; |
126 | // this._directLogins = {}; | 123 | // this._directLogins = {}; |
127 | 124 | ||
128 | for (reference in someObjectData['header']['records']) { | 125 | for (reference in someObjectData['header']['records']) { |
129 | varrecord; | 126 | varrecord; |
130 | 127 | ||
131 | record = new Clipperz.PM.DataModel.Record({ | 128 | record = new Clipperz.PM.DataModel.Record({ |
132 | 'reference': reference, | 129 | 'reference': reference, |
133 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'), | 130 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'), |
134 | 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(), | 131 | 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(), |
135 | // 'encryptedDataKeypath': 'data', | 132 | // 'encryptedDataKeypath': 'data', |
136 | // 'encryptedVersionKeypath': 'version', | 133 | // 'encryptedVersionKeypath': 'version', |
137 | 134 | ||
138 | 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getRecordIndexData'), | 135 | 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getRecordIndexData'), |
139 | 'updateIndexDataFunction': MochiKit.Base.method(this, 'updateRecordIndexData'), | 136 | 'updateIndexDataFunction': MochiKit.Base.method(this, 'updateRecordIndexData'), |
140 | 'updateDate': someObjectData['recordsStats'][reference]['updateDate'], | 137 | 'updateDate': someObjectData['recordsStats'][reference]['updateDate'], |
141 | 138 | ||
142 | 'retrieveDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'), | 139 | 'retrieveDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'), |
143 | 'setDirectLoginIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'), | 140 | 'setDirectLoginIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'), |
144 | 'removeDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'removeDirectLoginIndexData') | 141 | 'removeDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'removeDirectLoginIndexData') |
145 | }); | 142 | }); |
146 | 143 | ||
147 | this._records[reference] = record; | 144 | this._records[reference] = record; |
148 | } | 145 | } |
149 | 146 | ||
150 | for (reference in someObjectData['header']['directLogins']) { | 147 | for (reference in someObjectData['header']['directLogins']) { |
151 | vardirectLogin; | 148 | vardirectLogin; |
152 | var record; | 149 | var record; |
153 | 150 | ||
154 | record = this._records[someObjectData['header']['directLogins'][reference]['record']]; | 151 | record = this._records[someObjectData['header']['directLogins'][reference]['record']]; |
155 | if (record != null) { | 152 | if (record != null) { |
156 | directLogin = new Clipperz.PM.DataModel.DirectLogin({ | 153 | directLogin = new Clipperz.PM.DataModel.DirectLogin({ |
157 | 'reference': reference, | 154 | 'reference': reference, |
158 | 'record': record//, | 155 | 'record': record//, |
159 | // 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'), | 156 | // 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'), |
160 | // 'setIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'), | 157 | // 'setIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'), |
161 | // 'removeIndexDataFunction': MochiKit.Base.method(this, 'removeDirectLoginIndexData') | 158 | // 'removeIndexDataFunction': MochiKit.Base.method(this, 'removeDirectLoginIndexData') |
162 | }); | 159 | }); |
163 | } else { | 160 | } else { |
164 | Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!"); | 161 | Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!"); |
165 | } | 162 | } |
166 | } | 163 | } |
167 | 164 | ||
168 | return this._records; | 165 | return this._records; |
169 | }, this)); | 166 | }, this)); |
170 | innerDeferredResult.callback(); | 167 | innerDeferredResult.callback(); |
171 | } else { | 168 | } else { |
172 | innerDeferredResult = MochiKit.Async.succeed(this._records); | 169 | innerDeferredResult = MochiKit.Async.succeed(this._records); |
173 | } | 170 | } |
174 | 171 | ||
175 | return innerDeferredResult; | 172 | return innerDeferredResult; |
176 | }, this)); | 173 | }, this)); |
177 | deferredResult.releaseLock(deferredLock); | 174 | deferredResult.releaseLock(deferredLock); |
178 | deferredResult.callback(); | 175 | deferredResult.callback(); |
179 | 176 | ||
180 | return deferredResult; | 177 | return deferredResult; |
181 | }, | 178 | }, |
182 | 179 | ||
183 | //========================================================================= | 180 | //========================================================================= |
184 | __syntaxFix__: "syntax fix" | 181 | __syntaxFix__: "syntax fix" |
185 | }); | 182 | }); |
186 | 183 | ||
187 | 184 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js index 0ee8599..3528db6 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js | |||
@@ -1,128 +1,125 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 29 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
33 | 30 | ||
34 | //----------------------------------------------------------------------------- | 31 | //----------------------------------------------------------------------------- |
35 | 32 | ||
36 | Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) { | 33 | Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) { |
37 | Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments); | 34 | Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments); |
38 | 35 | ||
39 | this._oneTimePasswords = null; | 36 | this._oneTimePasswords = null; |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | //----------------------------------------------------------------------------- | 41 | //----------------------------------------------------------------------------- |
45 | 42 | ||
46 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 43 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
47 | 44 | ||
48 | 'toString': function() { | 45 | 'toString': function() { |
49 | return "Clipperz.PM.DataModel.User.Header.OneTimePasswords"; | 46 | return "Clipperz.PM.DataModel.User.Header.OneTimePasswords"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | /* | 50 | /* |
54 | 'packData': function (someData) { //++ | 51 | 'packData': function (someData) { //++ |
55 | var result; | 52 | var result; |
56 | 53 | ||
57 | console.log(">>> OneTimePasswords.packData", someData); | 54 | console.log(">>> OneTimePasswords.packData", someData); |
58 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments); | 55 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments); |
59 | console.log("<<< OneTimePasswords.packData"); | 56 | console.log("<<< OneTimePasswords.packData"); |
60 | 57 | ||
61 | return result; | 58 | return result; |
62 | }, | 59 | }, |
63 | */ | 60 | */ |
64 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
65 | /* | 62 | /* |
66 | 'packRemoteData': function (someData) { | 63 | 'packRemoteData': function (someData) { |
67 | var result; | 64 | var result; |
68 | 65 | ||
69 | console.log(">>> OneTimePasswords.packRemoteData", someData); | 66 | console.log(">>> OneTimePasswords.packRemoteData", someData); |
70 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments); | 67 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments); |
71 | console.log("<<< OneTimePasswords.packRemoteData"); | 68 | console.log("<<< OneTimePasswords.packRemoteData"); |
72 | 69 | ||
73 | return result; | 70 | return result; |
74 | }, | 71 | }, |
75 | */ | 72 | */ |
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | /* | 74 | /* |
78 | 'prepareRemoteDataWithKey': function (aKey) { | 75 | 'prepareRemoteDataWithKey': function (aKey) { |
79 | var result; | 76 | var result; |
80 | 77 | ||
81 | console.log(">>> OneTimePasswords.prepareRemoteDataWithKey"); | 78 | console.log(">>> OneTimePasswords.prepareRemoteDataWithKey"); |
82 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments); | 79 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments); |
83 | console.log("<<< OneTimePasswords.prepareRemoteDataWithKey"); | 80 | console.log("<<< OneTimePasswords.prepareRemoteDataWithKey"); |
84 | 81 | ||
85 | return result; | 82 | return result; |
86 | }, | 83 | }, |
87 | */ | 84 | */ |
88 | //========================================================================= | 85 | //========================================================================= |
89 | 86 | ||
90 | 'oneTimePasswords': function () { | 87 | 'oneTimePasswords': function () { |
91 | vardeferredResult; | 88 | vardeferredResult; |
92 | 89 | ||
93 | deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false}); | 90 | deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false}); |
94 | if (this._oneTimePasswords == null) { | 91 | if (this._oneTimePasswords == null) { |
95 | deferredResult.addMethod(this, 'values') | 92 | deferredResult.addMethod(this, 'values') |
96 | deferredResult.addCallback(MochiKit.Base.bind(function (someData) { | 93 | deferredResult.addCallback(MochiKit.Base.bind(function (someData) { |
97 | varotpKey; | 94 | varotpKey; |
98 | 95 | ||
99 | this._oneTimePasswords = {}; | 96 | this._oneTimePasswords = {}; |
100 | 97 | ||
101 | for (otpKey in someData) { | 98 | for (otpKey in someData) { |
102 | var otp; | 99 | var otp; |
103 | var otpParameters; | 100 | var otpParameters; |
104 | 101 | ||
105 | otpParameters = Clipperz.Base.deepClone(someData[otpKey]); | 102 | otpParameters = Clipperz.Base.deepClone(someData[otpKey]); |
106 | otpParameters['reference'] = otpKey; | 103 | otpParameters['reference'] = otpKey; |
107 | 104 | ||
108 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpParameters); | 105 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpParameters); |
109 | this._oneTimePasswords[otpKey] = otp; | 106 | this._oneTimePasswords[otpKey] = otp; |
110 | } | 107 | } |
111 | 108 | ||
112 | return this._oneTimePasswords; | 109 | return this._oneTimePasswords; |
113 | 110 | ||
114 | }, this)); | 111 | }, this)); |
115 | deferredResult.callback(); | 112 | deferredResult.callback(); |
116 | } else { | 113 | } else { |
117 | deferredResult = MochiKit.Async.succeed(this._oneTimePasswords); | 114 | deferredResult = MochiKit.Async.succeed(this._oneTimePasswords); |
118 | } | 115 | } |
119 | 116 | ||
120 | return deferredResult; | 117 | return deferredResult; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //========================================================================= | 120 | //========================================================================= |
124 | __syntaxFix__: "syntax fix" | 121 | __syntaxFix__: "syntax fix" |
125 | }); | 122 | }); |
126 | 123 | ||
127 | //----------------------------------------------------------------------------- | 124 | //----------------------------------------------------------------------------- |
128 | 125 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js index 91b981e..b164889 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js | |||
@@ -1,53 +1,50 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.Preferences depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.Preferences depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 30 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
34 | 31 | ||
35 | Clipperz.PM.DataModel.User.Header.Preferences = function(args) { | 32 | Clipperz.PM.DataModel.User.Header.Preferences = function(args) { |
36 | Clipperz.PM.DataModel.User.Header.Preferences.superclass.constructor.apply(this, arguments); | 33 | Clipperz.PM.DataModel.User.Header.Preferences.superclass.constructor.apply(this, arguments); |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Preferences, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 39 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Preferences, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
43 | 40 | ||
44 | 'toString': function() { | 41 | 'toString': function() { |
45 | return "Clipperz.PM.DataModel.User.Header.Preferences"; | 42 | return "Clipperz.PM.DataModel.User.Header.Preferences"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | //========================================================================= | 46 | //========================================================================= |
50 | __syntaxFix__: "syntax fix" | 47 | __syntaxFix__: "syntax fix" |
51 | }); | 48 | }); |
52 | 49 | ||
53 | 50 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js index 6ba58a8..f77ea80 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.RecordIndex depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.RecordIndex depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 30 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
34 | 31 | ||
35 | Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) { | 32 | Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) { |
36 | Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments); | 33 | Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments); |
37 | 34 | ||
38 | //console.log("NEW Clipperz.PM.DataModel.User.Header.RecordIndex", args); | 35 | //console.log("NEW Clipperz.PM.DataModel.User.Header.RecordIndex", args); |
39 | this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ | 36 | this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ |
40 | 'name':'recordsData', | 37 | 'name':'recordsData', |
41 | 'retrieveKeyFunction': args.retrieveKeyFunction, | 38 | 'retrieveKeyFunction': args.retrieveKeyFunction, |
42 | 'remoteData': { | 39 | 'remoteData': { |
43 | 'data': args.recordsData['data'], | 40 | 'data': args.recordsData['data'], |
44 | 'version': args.encryptedDataVersion, | 41 | 'version': args.encryptedDataVersion, |
45 | 'recordsStats': args.recordsStats | 42 | 'recordsStats': args.recordsStats |
46 | }//, | 43 | }//, |
47 | // 'encryptedDataKeypath': 'data', | 44 | // 'encryptedDataKeypath': 'data', |
48 | // 'encryptedVersionKeypath': 'version' | 45 | // 'encryptedVersionKeypath': 'version' |
49 | }); | 46 | }); |
50 | 47 | ||
51 | this._directLoginsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ | 48 | this._directLoginsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ |
52 | 'name':'directLoginsData', | 49 | 'name':'directLoginsData', |
53 | 'retrieveKeyFunction': args.retrieveKeyFunction, | 50 | 'retrieveKeyFunction': args.retrieveKeyFunction, |
54 | 'remoteData': { | 51 | 'remoteData': { |
55 | 'data': args.directLoginsData['data'], | 52 | 'data': args.directLoginsData['data'], |
56 | 'version': args.encryptedDataVersion | 53 | 'version': args.encryptedDataVersion |
57 | }//, | 54 | }//, |
58 | // 'encryptedDataKeypath': 'data', | 55 | // 'encryptedDataKeypath': 'data', |
59 | // 'encryptedVersionKeypath': 'version' | 56 | // 'encryptedVersionKeypath': 'version' |
60 | }); | 57 | }); |
61 | 58 | ||
62 | this._lock = new MochiKit.Async.DeferredLock(); | 59 | this._lock = new MochiKit.Async.DeferredLock(); |
63 | this._transientState = null; | 60 | this._transientState = null; |
64 | 61 | ||
65 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); | 62 | this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); |
66 | this._recordsIndex = args.recordsData['index'] || Clipperz.Base.exception.raise('MandatoryParameter'); | 63 | this._recordsIndex = args.recordsData['index'] || Clipperz.Base.exception.raise('MandatoryParameter'); |
67 | this._directLoginsIndex = args.directLoginsData['index']|| Clipperz.Base.exception.raise('MandatoryParameter'); | 64 | this._directLoginsIndex = args.directLoginsData['index']|| Clipperz.Base.exception.raise('MandatoryParameter'); |
68 | 65 | ||
69 | this._records = null; | 66 | this._records = null; |
70 | 67 | ||
71 | return this; | 68 | return this; |
72 | } | 69 | } |
73 | 70 | ||
74 | 71 | ||
75 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, { | 72 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, { |
76 | 73 | ||
77 | 'toString': function() { | 74 | 'toString': function() { |
78 | return "Clipperz.PM.DataModel.User.Header.RecordIndex"; | 75 | return "Clipperz.PM.DataModel.User.Header.RecordIndex"; |
79 | }, | 76 | }, |
80 | 77 | ||
81 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
82 | 79 | ||
83 | 'retrieveRecordDetailFunction': function () { | 80 | 'retrieveRecordDetailFunction': function () { |
84 | return this._retrieveRecordDetailFunction; | 81 | return this._retrieveRecordDetailFunction; |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'recordsIndex': function () { | 86 | 'recordsIndex': function () { |
90 | return this._recordsIndex; | 87 | return this._recordsIndex; |
91 | }, | 88 | }, |
92 | 89 | ||
93 | 'recordsData': function () { | 90 | 'recordsData': function () { |
94 | return this._recordsData; | 91 | return this._recordsData; |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'directLoginsIndex': function () { | 96 | 'directLoginsIndex': function () { |
100 | return this._directLoginsIndex; | 97 | return this._directLoginsIndex; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | 'directLoginsData': function () { | 100 | 'directLoginsData': function () { |
104 | return this._directLoginsData; | 101 | return this._directLoginsData; |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------- |
108 | 105 | ||
109 | 'lock': function () { | 106 | 'lock': function () { |
110 | return this._lock; | 107 | return this._lock; |
111 | }, | 108 | }, |
112 | 109 | ||
113 | //------------------------------------------------------------------------- | 110 | //------------------------------------------------------------------------- |
114 | 111 | ||
115 | 'transientState': function () { | 112 | 'transientState': function () { |
116 | if (this._transientState == null) { | 113 | if (this._transientState == null) { |
117 | this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'User.Header.RecordIndex.transientState [1]'}*/); | 114 | this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'User.Header.RecordIndex.transientState [1]'}*/); |
118 | } | 115 | } |
119 | 116 | ||
120 | return this._transientState; | 117 | return this._transientState; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | 'resetTransientState': function (isCommitting) { | 120 | 'resetTransientState': function (isCommitting) { |
124 | //console.log("######## UserHeaderRecordIndex - resetTransientState", Clipperz.Base.deepClone(this._transientState)); | 121 | //console.log("######## UserHeaderRecordIndex - resetTransientState", Clipperz.Base.deepClone(this._transientState)); |
125 | if (this._transientState != null) { | 122 | if (this._transientState != null) { |
126 | this._transientState.removeAllData(); | 123 | this._transientState.removeAllData(); |
127 | } | 124 | } |
128 | 125 | ||
129 | this._transientState = null; | 126 | this._transientState = null; |
130 | }, | 127 | }, |
131 | 128 | ||
132 | //------------------------------------------------------------------------- | 129 | //------------------------------------------------------------------------- |
133 | 130 | ||
134 | 'getRecordKey': function (aRecordReference) { | 131 | 'getRecordKey': function (aRecordReference) { |
135 | return Clipperz.Async.callbacks("User.Header.RecordIndex.getRecordKey", [ | 132 | return Clipperz.Async.callbacks("User.Header.RecordIndex.getRecordKey", [ |
136 | MochiKit.Base.method(this, 'getRecordIndexData', aRecordReference), | 133 | MochiKit.Base.method(this, 'getRecordIndexData', aRecordReference), |
137 | MochiKit.Base.itemgetter('key') | 134 | MochiKit.Base.itemgetter('key') |
138 | ], {trace:false}); | 135 | ], {trace:false}); |
139 | }, | 136 | }, |
140 | 137 | ||
141 | 'setRecordKey': function (aRecordReference, aValue) { | 138 | 'setRecordKey': function (aRecordReference, aValue) { |
142 | return this.updateRecordIndexData(aRecordReference, 'key', aValue); | 139 | return this.updateRecordIndexData(aRecordReference, 'key', aValue); |
143 | }, | 140 | }, |
144 | 141 | ||
145 | //------------------------------------------------------------------------- | 142 | //------------------------------------------------------------------------- |
146 | 143 | ||
147 | 'getRecordIndexData': function (aRecordReference) { | 144 | 'getRecordIndexData': function (aRecordReference) { |
148 | return this.recordsData().getValue(this.recordsIndex()[aRecordReference]); | 145 | return this.recordsData().getValue(this.recordsIndex()[aRecordReference]); |
149 | }, | 146 | }, |
150 | 147 | ||
151 | //......................................................................... | 148 | //......................................................................... |
152 | 149 | ||
153 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { | 150 | 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { |
154 | return this.recordsData().setValue(this.recordsIndex()[aRecordReference]+'.'+aKey, aValue); | 151 | return this.recordsData().setValue(this.recordsIndex()[aRecordReference]+'.'+aKey, aValue); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //------------------------------------------------------------------------- | 154 | //------------------------------------------------------------------------- |
158 | 155 | ||
159 | 'getDirectLoginIndexData': function (aDirectLoginReference) { | 156 | 'getDirectLoginIndexData': function (aDirectLoginReference) { |
160 | return this.directLoginsData().getValue(this.directLoginsIndex()[aDirectLoginReference]); | 157 | return this.directLoginsData().getValue(this.directLoginsIndex()[aDirectLoginReference]); |
161 | }, | 158 | }, |
162 | 159 | ||
163 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { | 160 | 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { |
164 | //console.log("UserHeaderRecordIndex.setDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference], aKey); | 161 | //console.log("UserHeaderRecordIndex.setDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference], aKey); |
165 | //if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) { | 162 | //if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) { |
166 | //throw "PIPPO"; | 163 | //throw "PIPPO"; |
167 | //} | 164 | //} |
168 | return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference] + '.' + aKey, aValue); | 165 | return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference] + '.' + aKey, aValue); |
169 | }, | 166 | }, |
170 | 167 | ||
171 | 'addDirectLoginIndexData': function (aDirectLoginReference) { | 168 | 'addDirectLoginIndexData': function (aDirectLoginReference) { |
172 | //console.log("UserHeaderRecordIndex.addDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference]); | 169 | //console.log("UserHeaderRecordIndex.addDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference]); |
173 | return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {}); | 170 | return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {}); |
174 | }, | 171 | }, |
175 | 172 | ||
176 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { | 173 | 'removeDirectLoginIndexData': function (aDirectLoginReference) { |
177 | return this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLoginReference]) | 174 | return this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLoginReference]) |
178 | }, | 175 | }, |
179 | 176 | ||
180 | //------------------------------------------------------------------------- | 177 | //------------------------------------------------------------------------- |
181 | 178 | ||
182 | 'records': function () { | 179 | 'records': function () { |
183 | vardeferredResult; | 180 | vardeferredResult; |
184 | 181 | ||
185 | deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records", {trace:false}); | 182 | deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records", {trace:false}); |
186 | deferredResult.acquireLock(this.lock()); | 183 | deferredResult.acquireLock(this.lock()); |
187 | deferredResult.addCallback(MochiKit.Base.bind(function () { | 184 | deferredResult.addCallback(MochiKit.Base.bind(function () { |
188 | var innerDeferredResult; | 185 | var innerDeferredResult; |
189 | 186 | ||
190 | if (this._records == null) { | 187 | if (this._records == null) { |
191 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records <inner deferred>", {trace:false}); | 188 | innerDeferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records <inner deferred>", {trace:false}); |
192 | innerDeferredResult.collectResults({ | 189 | innerDeferredResult.collectResults({ |
193 | 'records': [ | 190 | 'records': [ |
194 | // MochiKit.Base.method(this.recordsData(), 'getObjectDataStore'), | 191 | // MochiKit.Base.method(this.recordsData(), 'getObjectDataStore'), |
195 | // MochiKit.Base.methodcaller('values') | 192 | // MochiKit.Base.methodcaller('values') |
196 | MochiKit.Base.method(this.recordsData(), 'values') | 193 | MochiKit.Base.method(this.recordsData(), 'values') |
197 | ], | 194 | ], |
198 | 'recordsStats': [ | 195 | 'recordsStats': [ |
199 | MochiKit.Base.method(this.recordsData(), 'getRemoteData'), | 196 | MochiKit.Base.method(this.recordsData(), 'getRemoteData'), |
200 | MochiKit.Base.itemgetter('recordsStats') | 197 | MochiKit.Base.itemgetter('recordsStats') |
201 | ], | 198 | ], |
202 | 'directLogins': [ | 199 | 'directLogins': [ |
203 | // MochiKit.Base.method(this.directLoginsData(), 'getObjectDataStore'), | 200 | // MochiKit.Base.method(this.directLoginsData(), 'getObjectDataStore'), |
204 | // MochiKit.Base.methodcaller('values') | 201 | // MochiKit.Base.methodcaller('values') |
205 | MochiKit.Base.method(this.directLoginsData(), 'values') | 202 | MochiKit.Base.method(this.directLoginsData(), 'values') |
206 | ] | 203 | ] |
207 | }) | 204 | }) |
208 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someData) { | 205 | innerDeferredResult.addCallback(MochiKit.Base.bind(function (someData) { |
209 | var indexReference; | 206 | var indexReference; |
210 | var recordsInvertedIndex; | 207 | var recordsInvertedIndex; |
211 | var directLoginsInvertedIndex; | 208 | var directLoginsInvertedIndex; |
212 | 209 | ||
213 | recordsInvertedIndex = Clipperz.PM.DataModel.User.Header.RecordIndex.invertIndex(this.recordsIndex()); | 210 | recordsInvertedIndex = Clipperz.PM.DataModel.User.Header.RecordIndex.invertIndex(this.recordsIndex()); |
214 | directLoginsInvertedIndex= Clipperz.PM.DataModel.User.Header.RecordIndex.invertIndex(this.directLoginsIndex()); | 211 | directLoginsInvertedIndex= Clipperz.PM.DataModel.User.Header.RecordIndex.invertIndex(this.directLoginsIndex()); |
215 | 212 | ||
216 | this._records = {}; | 213 | this._records = {}; |
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.js index e8afa97..72d4006 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.js | |||
@@ -1,216 +1,213 @@ | |||
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.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.DataModel.User = function (args) { | 33 | Clipperz.PM.DataModel.User = function (args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | Clipperz.PM.DataModel.User.superclass.constructor.apply(this, arguments); | 36 | Clipperz.PM.DataModel.User.superclass.constructor.apply(this, arguments); |
40 | 37 | ||
41 | this._username = args.username || null; | 38 | this._username = args.username || null; |
42 | this._getPassphraseFunction = args.getPassphraseFunction || null; | 39 | this._getPassphraseFunction = args.getPassphraseFunction || null; |
43 | 40 | ||
44 | this._data = null; | 41 | this._data = null; |
45 | 42 | ||
46 | this._connection = null; | 43 | this._connection = null; |
47 | this._connectionVersion = 'current'; | 44 | this._connectionVersion = 'current'; |
48 | 45 | ||
49 | this._serverData = null; | 46 | this._serverData = null; |
50 | this._serverLockValue = null; | 47 | this._serverLockValue = null; |
51 | this._transientState = null; | 48 | this._transientState = null; |
52 | 49 | ||
53 | this._deferredLocks = { | 50 | this._deferredLocks = { |
54 | 'passphrase': new MochiKit.Async.DeferredLock(), | 51 | 'passphrase': new MochiKit.Async.DeferredLock(), |
55 | 'serverData': new MochiKit.Async.DeferredLock(), | 52 | 'serverData': new MochiKit.Async.DeferredLock(), |
56 | // 'recordsIndex': new MochiKit.Async.DeferredLock(), | 53 | // 'recordsIndex': new MochiKit.Async.DeferredLock(), |
57 | // 'directLoginsIndex':new MochiKit.Async.DeferredLock() | 54 | // 'directLoginsIndex':new MochiKit.Async.DeferredLock() |
58 | // 'preferences': new MochiKit.Async.DeferredLock() | 55 | // 'preferences': new MochiKit.Async.DeferredLock() |
59 | // 'oneTimePasswords': new MochiKit.Async.DeferredLock() | 56 | // 'oneTimePasswords': new MochiKit.Async.DeferredLock() |
60 | '__syntaxFix__': 'syntax fix' | 57 | '__syntaxFix__': 'syntax fix' |
61 | }; | 58 | }; |
62 | 59 | ||
63 | return this; | 60 | return this; |
64 | } | 61 | } |
65 | 62 | ||
66 | Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, { | 63 | Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, { |
67 | 64 | ||
68 | 'toString': function () { | 65 | 'toString': function () { |
69 | return "Clipperz.PM.DataModel.User - " + this.username(); | 66 | return "Clipperz.PM.DataModel.User - " + this.username(); |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'username': function () { | 71 | 'username': function () { |
75 | return this._username; | 72 | return this._username; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'setUsername': function (aValue) { | 75 | 'setUsername': function (aValue) { |
79 | this._username = aValue; | 76 | this._username = aValue; |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'displayName': function() { | 81 | 'displayName': function() { |
85 | return "" + this.username() + ""; | 82 | return "" + this.username() + ""; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'data': function () { | 87 | 'data': function () { |
91 | if (this._data == null) { | 88 | if (this._data == null) { |
92 | this._data = new Clipperz.KeyValueObjectStore(/*{'name':'User.data [1]'}*/); | 89 | this._data = new Clipperz.KeyValueObjectStore(/*{'name':'User.data [1]'}*/); |
93 | }; | 90 | }; |
94 | 91 | ||
95 | return this._data; | 92 | return this._data; |
96 | }, | 93 | }, |
97 | 94 | ||
98 | //------------------------------------------------------------------------- | 95 | //------------------------------------------------------------------------- |
99 | 96 | ||
100 | 'serverLockValue': function () { | 97 | 'serverLockValue': function () { |
101 | return this._serverLockValue; | 98 | return this._serverLockValue; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | 'setServerLockValue': function (aValue) { | 101 | 'setServerLockValue': function (aValue) { |
105 | this._serverLockValue = aValue; | 102 | this._serverLockValue = aValue; |
106 | }, | 103 | }, |
107 | 104 | ||
108 | //------------------------------------------------------------------------- | 105 | //------------------------------------------------------------------------- |
109 | 106 | ||
110 | 'transientState': function () { | 107 | 'transientState': function () { |
111 | if (this._transientState == null) { | 108 | if (this._transientState == null) { |
112 | this._transientState = {} | 109 | this._transientState = {} |
113 | } | 110 | } |
114 | 111 | ||
115 | return this._transientState; | 112 | return this._transientState; |
116 | }, | 113 | }, |
117 | 114 | ||
118 | 'resetTransientState': function (isCommitting) { | 115 | 'resetTransientState': function (isCommitting) { |
119 | this._transientState = null; | 116 | this._transientState = null; |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //------------------------------------------------------------------------- | 119 | //------------------------------------------------------------------------- |
123 | 120 | ||
124 | 'deferredLockForSection': function(aSectionName) { | 121 | 'deferredLockForSection': function(aSectionName) { |
125 | return this._deferredLocks[aSectionName]; | 122 | return this._deferredLocks[aSectionName]; |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //------------------------------------------------------------------------- | 125 | //------------------------------------------------------------------------- |
129 | 126 | ||
130 | 'getPassphrase': function() { | 127 | 'getPassphrase': function() { |
131 | var deferredResult; | 128 | var deferredResult; |
132 | 129 | ||
133 | deferredResult = new Clipperz.Async.Deferred("User.getPassphrase", {trace:false}); | 130 | deferredResult = new Clipperz.Async.Deferred("User.getPassphrase", {trace:false}); |
134 | deferredResult.acquireLock(this.deferredLockForSection('passphrase')); | 131 | deferredResult.acquireLock(this.deferredLockForSection('passphrase')); |
135 | deferredResult.addMethod(this.data(), 'deferredGetOrSet', 'passphrase', this.getPassphraseFunction()); | 132 | deferredResult.addMethod(this.data(), 'deferredGetOrSet', 'passphrase', this.getPassphraseFunction()); |
136 | deferredResult.releaseLock(this.deferredLockForSection('passphrase')); | 133 | deferredResult.releaseLock(this.deferredLockForSection('passphrase')); |
137 | deferredResult.callback(); | 134 | deferredResult.callback(); |
138 | 135 | ||
139 | return deferredResult; | 136 | return deferredResult; |
140 | }, | 137 | }, |
141 | 138 | ||
142 | 'getPassphraseFunction': function () { | 139 | 'getPassphraseFunction': function () { |
143 | return this._getPassphraseFunction; | 140 | return this._getPassphraseFunction; |
144 | }, | 141 | }, |
145 | 142 | ||
146 | //------------------------------------------------------------------------- | 143 | //------------------------------------------------------------------------- |
147 | 144 | ||
148 | 'getCredentials': function () { | 145 | 'getCredentials': function () { |
149 | return Clipperz.Async.collectResults("User; get username and passphrase", { | 146 | return Clipperz.Async.collectResults("User; get username and passphrase", { |
150 | 'username': MochiKit.Base.method(this, 'username'), | 147 | 'username': MochiKit.Base.method(this, 'username'), |
151 | 'password': MochiKit.Base.method(this, 'getPassphrase') | 148 | 'password': MochiKit.Base.method(this, 'getPassphrase') |
152 | }, {trace:false})(); | 149 | }, {trace:false})(); |
153 | }, | 150 | }, |
154 | 151 | ||
155 | //------------------------------------------------------------------------- | 152 | //------------------------------------------------------------------------- |
156 | 153 | ||
157 | 'changePassphrase': function (aNewValue) { | 154 | 'changePassphrase': function (aNewValue) { |
158 | return this.updateCredentials(this.username(), aNewValue); | 155 | return this.updateCredentials(this.username(), aNewValue); |
159 | }, | 156 | }, |
160 | 157 | ||
161 | //......................................................................... | 158 | //......................................................................... |
162 | 159 | ||
163 | 'updateCredentials': function (aUsername, aPassphrase) { | 160 | 'updateCredentials': function (aUsername, aPassphrase) { |
164 | vardeferredResult; | 161 | vardeferredResult; |
165 | 162 | ||
166 | deferredResult = new Clipperz.Async.Deferred("User.updateCredentials", {trace:false}); | 163 | deferredResult = new Clipperz.Async.Deferred("User.updateCredentials", {trace:false}); |
167 | // deferredResult.addMethod(this, 'getPassphrase'); | 164 | // deferredResult.addMethod(this, 'getPassphrase'); |
168 | // deferredResult.setValue('currentPassphrase'); | 165 | // deferredResult.setValue('currentPassphrase'); |
169 | deferredResult.addMethod(this.connection(), 'ping'); | 166 | deferredResult.addMethod(this.connection(), 'ping'); |
170 | deferredResult.addMethod(this, 'setUsername', aUsername) | 167 | deferredResult.addMethod(this, 'setUsername', aUsername) |
171 | deferredResult.acquireLock(this.deferredLockForSection('passphrase')); | 168 | deferredResult.acquireLock(this.deferredLockForSection('passphrase')); |
172 | deferredResult.addMethod(this.data(), 'deferredGetOrSet', 'passphrase', aPassphrase); | 169 | deferredResult.addMethod(this.data(), 'deferredGetOrSet', 'passphrase', aPassphrase); |
173 | deferredResult.releaseLock(this.deferredLockForSection('passphrase')); | 170 | deferredResult.releaseLock(this.deferredLockForSection('passphrase')); |
174 | // deferredResult.getValue('currentPassphrase'); | 171 | // deferredResult.getValue('currentPassphrase'); |
175 | deferredResult.addMethod(this, 'prepareRemoteDataWithKey', aPassphrase); | 172 | deferredResult.addMethod(this, 'prepareRemoteDataWithKey', aPassphrase); |
176 | deferredResult.addMethod(this.connection(), 'updateCredentials', aUsername, aPassphrase); | 173 | deferredResult.addMethod(this.connection(), 'updateCredentials', aUsername, aPassphrase); |
177 | deferredResult.callback(); | 174 | deferredResult.callback(); |
178 | 175 | ||
179 | return deferredResult; | 176 | return deferredResult; |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //------------------------------------------------------------------------- | 179 | //------------------------------------------------------------------------- |
183 | 180 | ||
184 | 'initialSetupWithNoData': function () { | 181 | 'initialSetupWithNoData': function () { |
185 | this._serverData = { | 182 | this._serverData = { |
186 | 'version': '0.1', | 183 | 'version': '0.1', |
187 | 'statistics': "", | 184 | 'statistics': "", |
188 | 'header': { | 185 | 'header': { |
189 | 'data': null, | 186 | 'data': null, |
190 | 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion, | 187 | 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion, |
191 | 188 | ||
192 | 'recordsIndex': new Clipperz.PM.DataModel.User.Header.RecordIndex({ | 189 | 'recordsIndex': new Clipperz.PM.DataModel.User.Header.RecordIndex({ |
193 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase'), | 190 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase'), |
194 | 'recordsData': {'data':null, 'index':{}}, | 191 | 'recordsData': {'data':null, 'index':{}}, |
195 | 'recordsStats': null, | 192 | 'recordsStats': null, |
196 | 'directLoginsData': {'data':null, 'index':{}}, | 193 | 'directLoginsData': {'data':null, 'index':{}}, |
197 | 'encryptedDataVersion': Clipperz.PM.Crypto.encryptingFunctions.currentVersion, | 194 | 'encryptedDataVersion': Clipperz.PM.Crypto.encryptingFunctions.currentVersion, |
198 | 'retrieveRecordDetailFunction':MochiKit.Base.method(this, 'getRecordDetail') | 195 | 'retrieveRecordDetailFunction':MochiKit.Base.method(this, 'getRecordDetail') |
199 | }), | 196 | }), |
200 | 'preferences': new Clipperz.PM.DataModel.User.Header.Preferences({ | 197 | 'preferences': new Clipperz.PM.DataModel.User.Header.Preferences({ |
201 | 'name':'preferences', | 198 | 'name':'preferences', |
202 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase') | 199 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase') |
203 | }), | 200 | }), |
204 | 'oneTimePasswords': new Clipperz.PM.DataModel.User.Header.OneTimePasswords({ | 201 | 'oneTimePasswords': new Clipperz.PM.DataModel.User.Header.OneTimePasswords({ |
205 | 'name':'preferences', | 202 | 'name':'preferences', |
206 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase') | 203 | 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase') |
207 | }) | 204 | }) |
208 | } | 205 | } |
209 | }; | 206 | }; |
210 | 207 | ||
211 | // this._serverLockValue = Clipperz.PM.Crypto.randomKey(); | 208 | // this._serverLockValue = Clipperz.PM.Crypto.randomKey(); |
212 | }, | 209 | }, |
213 | 210 | ||
214 | //......................................................................... | 211 | //......................................................................... |
215 | 212 | ||
216 | 'registerAsNewAccount': function () { | 213 | 'registerAsNewAccount': function () { |
diff --git a/frontend/gamma/js/Clipperz/PM/Date.js b/frontend/gamma/js/Clipperz/PM/Date.js index a131357..96a2700 100644 --- a/frontend/gamma/js/Clipperz/PM/Date.js +++ b/frontend/gamma/js/Clipperz/PM/Date.js | |||
@@ -1,201 +1,198 @@ | |||
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.Date) == 'undefined') { Clipperz.PM.Date = {}; } | 28 | if (typeof(Clipperz.PM.Date) == 'undefined') { Clipperz.PM.Date = {}; } |
32 | 29 | ||
33 | Clipperz.PM.Date.VERSION = "0.1"; | 30 | Clipperz.PM.Date.VERSION = "0.1"; |
34 | Clipperz.PM.Date.NAME = "Clipperz.PM.Date"; | 31 | Clipperz.PM.Date.NAME = "Clipperz.PM.Date"; |
35 | 32 | ||
36 | MochiKit.Base.update(Clipperz.PM.Date, { | 33 | MochiKit.Base.update(Clipperz.PM.Date, { |
37 | 34 | ||
38 | '__repr__': function () { | 35 | '__repr__': function () { |
39 | return "[" + this.NAME + " " + this.VERSION + "]"; | 36 | return "[" + this.NAME + " " + this.VERSION + "]"; |
40 | }, | 37 | }, |
41 | 38 | ||
42 | //------------------------------------------------------------------------- | 39 | //------------------------------------------------------------------------- |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return this.__repr__(); | 42 | return this.__repr__(); |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'locale': function() { | 47 | 'locale': function() { |
51 | return { | 48 | return { |
52 | 'amDesignation':Clipperz.PM.Strings.getValue('calendarStrings.amDesignation'), | 49 | 'amDesignation':Clipperz.PM.Strings.getValue('calendarStrings.amDesignation'), |
53 | 'pmDesignation':Clipperz.PM.Strings.getValue('calendarStrings.pmDesignation'), | 50 | 'pmDesignation':Clipperz.PM.Strings.getValue('calendarStrings.pmDesignation'), |
54 | 'days': Clipperz.PM.Strings.getValue('calendarStrings.days'), | 51 | 'days': Clipperz.PM.Strings.getValue('calendarStrings.days'), |
55 | 'shortDays': Clipperz.PM.Strings.getValue('calendarStrings.shortDays'), | 52 | 'shortDays': Clipperz.PM.Strings.getValue('calendarStrings.shortDays'), |
56 | 'shortMonths': Clipperz.PM.Strings.getValue('calendarStrings.shortMonths'), | 53 | 'shortMonths': Clipperz.PM.Strings.getValue('calendarStrings.shortMonths'), |
57 | 'months': Clipperz.PM.Strings.getValue('calendarStrings.months') | 54 | 'months': Clipperz.PM.Strings.getValue('calendarStrings.months') |
58 | } | 55 | } |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //========================================================================= | 58 | //========================================================================= |
62 | /* | 59 | /* |
63 | 'formatDateWithPHPLikeTemplate': function(aDate, aTemplate) { | 60 | 'formatDateWithPHPLikeTemplate': function(aDate, aTemplate) { |
64 | return Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); | 61 | return Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'parseDateWithPHPLikeTemplate': function(aDate, aTemplate) { | 64 | 'parseDateWithPHPLikeTemplate': function(aDate, aTemplate) { |
68 | return Clipperz.Date.parseDateWithPHPTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); | 65 | return Clipperz.Date.parseDateWithPHPTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //========================================================================= | 68 | //========================================================================= |
72 | 69 | ||
73 | 'formatDateWithJavaLikeTemplate': function(aDate, aTemplate) { | 70 | 'formatDateWithJavaLikeTemplate': function(aDate, aTemplate) { |
74 | return Clipperz.Date.formatDateWithJavaLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); | 71 | return Clipperz.Date.formatDateWithJavaLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); |
75 | }, | 72 | }, |
76 | 73 | ||
77 | 'parseDateWithJavaLikeTemplate': function(aDate, aTemplate) { | 74 | 'parseDateWithJavaLikeTemplate': function(aDate, aTemplate) { |
78 | return Clipperz.Date.parseDateWithJavaLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); | 75 | return Clipperz.Date.parseDateWithJavaLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); |
79 | }, | 76 | }, |
80 | */ | 77 | */ |
81 | //========================================================================= | 78 | //========================================================================= |
82 | 79 | ||
83 | 'formatWithTemplate': function (aTemplate, aDate) { | 80 | 'formatWithTemplate': function (aTemplate, aDate) { |
84 | return Clipperz.PM.Date.formatDateWithTemplate(aDate, aTemplate); | 81 | return Clipperz.PM.Date.formatDateWithTemplate(aDate, aTemplate); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | 'formatDateWithTemplate': function(aDate, aTemplate) { | 84 | 'formatDateWithTemplate': function(aDate, aTemplate) { |
88 | var result; | 85 | var result; |
89 | 86 | ||
90 | if (aDate == null) { | 87 | if (aDate == null) { |
91 | result = "" | 88 | result = "" |
92 | } else { | 89 | } else { |
93 | result = Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); | 90 | result = Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale(aDate, aTemplate, Clipperz.PM.Date.locale()); |
94 | }; | 91 | }; |
95 | 92 | ||
96 | return result; | 93 | return result; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | 'parseDateWithTemplate': function(aValue, aTemplate) { | 96 | 'parseDateWithTemplate': function(aValue, aTemplate) { |
100 | return Clipperz.Date.parseDateWithPHPTemplateAndLocale(aValue, aTemplate, Clipperz.PM.Date.locale()); | 97 | return Clipperz.Date.parseDateWithPHPTemplateAndLocale(aValue, aTemplate, Clipperz.PM.Date.locale()); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //========================================================================= | 100 | //========================================================================= |
104 | 101 | ||
105 | 'formatDateWithUTCFormat': function(aDate) { | 102 | 'formatDateWithUTCFormat': function(aDate) { |
106 | return Clipperz.Date.formatDateWithUTCFormatAndLocale(aDate, Clipperz.PM.Date.locale()); | 103 | return Clipperz.Date.formatDateWithUTCFormatAndLocale(aDate, Clipperz.PM.Date.locale()); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | 'parseDateWithUTCFormat': function(aValue) { | 106 | 'parseDateWithUTCFormat': function(aValue) { |
110 | var result; | 107 | var result; |
111 | 108 | ||
112 | if (aValue == null) { | 109 | if (aValue == null) { |
113 | result = null; | 110 | result = null; |
114 | } else { | 111 | } else { |
115 | result = Clipperz.Date.parseDateWithUTCFormatAndLocale(aValue, Clipperz.PM.Date.locale()); | 112 | result = Clipperz.Date.parseDateWithUTCFormatAndLocale(aValue, Clipperz.PM.Date.locale()); |
116 | } | 113 | } |
117 | 114 | ||
118 | return result; | 115 | return result; |
119 | }, | 116 | }, |
120 | 117 | ||
121 | //========================================================================= | 118 | //========================================================================= |
122 | 119 | ||
123 | 'getElapsedTimeDescription': function(aDate) { | 120 | 'getElapsedTimeDescription': function(aDate) { |
124 | var result; | 121 | var result; |
125 | 122 | ||
126 | result = "" | 123 | result = "" |
127 | 124 | ||
128 | if (aDate != null) { | 125 | if (aDate != null) { |
129 | var now; | 126 | var now; |
130 | var elapsedTime; | 127 | var elapsedTime; |
131 | 128 | ||
132 | var millisencondsInAMinute; | 129 | var millisencondsInAMinute; |
133 | var millisencondsInAnHour; | 130 | var millisencondsInAnHour; |
134 | var millisencondsInADay; | 131 | var millisencondsInADay; |
135 | var millisencondsInAWeek; | 132 | var millisencondsInAWeek; |
136 | var millisencondsInAMonth; | 133 | var millisencondsInAMonth; |
137 | 134 | ||
138 | now = new Date(); | 135 | now = new Date(); |
139 | elapsedTime = now.getTime() - aDate.getTime(); | 136 | elapsedTime = now.getTime() - aDate.getTime(); |
140 | 137 | ||
141 | millisencondsInAMinute = 60 * 1000; | 138 | millisencondsInAMinute = 60 * 1000; |
142 | millisencondsInAnHour = millisencondsInAMinute * 60; | 139 | millisencondsInAnHour = millisencondsInAMinute * 60; |
143 | millisencondsInADay = millisencondsInAnHour * 24; | 140 | millisencondsInADay = millisencondsInAnHour * 24; |
144 | millisencondsInAWeek = millisencondsInADay * 7; | 141 | millisencondsInAWeek = millisencondsInADay * 7; |
145 | millisencondsInAMonth = millisencondsInAWeek * 5; | 142 | millisencondsInAMonth = millisencondsInAWeek * 5; |
146 | 143 | ||
147 | if ((elapsedTime / millisencondsInAMonth) > 1) { | 144 | if ((elapsedTime / millisencondsInAMonth) > 1) { |
148 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_A_MONTH_AGO'); | 145 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_A_MONTH_AGO'); |
149 | } else if ((elapsedTime / millisencondsInAWeek) > 1) { | 146 | } else if ((elapsedTime / millisencondsInAWeek) > 1) { |
150 | var elapsedWeeks; | 147 | var elapsedWeeks; |
151 | 148 | ||
152 | elapsedWeeks = Math.floor((elapsedTime / millisencondsInAWeek)); | 149 | elapsedWeeks = Math.floor((elapsedTime / millisencondsInAWeek)); |
153 | if (elapsedWeeks == 1) { | 150 | if (elapsedWeeks == 1) { |
154 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_A_WEEK_AGO'); | 151 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_A_WEEK_AGO'); |
155 | } else { | 152 | } else { |
156 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_*_WEEKS_AGO').replace(/__elapsed__/, elapsedWeeks); | 153 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.MORE_THAN_*_WEEKS_AGO').replace(/__elapsed__/, elapsedWeeks); |
157 | } | 154 | } |
158 | } else if ((elapsedTime / millisencondsInADay) > 1) { | 155 | } else if ((elapsedTime / millisencondsInADay) > 1) { |
159 | var elapsedDays; | 156 | var elapsedDays; |
160 | 157 | ||
161 | elapsedDays = Math.floor((elapsedTime / millisencondsInADay)); | 158 | elapsedDays = Math.floor((elapsedTime / millisencondsInADay)); |
162 | if (elapsedDays == 1) { | 159 | if (elapsedDays == 1) { |
163 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.YESTERDAY'); | 160 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.YESTERDAY'); |
164 | } else { | 161 | } else { |
165 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.*_DAYS_AGO').replace(/__elapsed__/, elapsedDays); | 162 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.*_DAYS_AGO').replace(/__elapsed__/, elapsedDays); |
166 | } | 163 | } |
167 | } else if ((elapsedTime / millisencondsInAnHour) > 1) { | 164 | } else if ((elapsedTime / millisencondsInAnHour) > 1) { |
168 | var elapsedHours; | 165 | var elapsedHours; |
169 | 166 | ||
170 | elapsedHours = Math.floor((elapsedTime / millisencondsInAnHour)); | 167 | elapsedHours = Math.floor((elapsedTime / millisencondsInAnHour)); |
171 | if (elapsedHours == 1) { | 168 | if (elapsedHours == 1) { |
172 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.ABOUT_AN_HOUR_AGO'); | 169 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.ABOUT_AN_HOUR_AGO'); |
173 | } else { | 170 | } else { |
174 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.*_HOURS_AGO').replace(/__elapsed__/, elapsedHours); | 171 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.*_HOURS_AGO').replace(/__elapsed__/, elapsedHours); |
175 | } | 172 | } |
176 | } else { | 173 | } else { |
177 | var elapsed10Minutes; | 174 | var elapsed10Minutes; |
178 | 175 | ||
179 | elapsed10Minutes = (Math.floor((elapsedTime / millisencondsInAMinute) / 10)) * 10; | 176 | elapsed10Minutes = (Math.floor((elapsedTime / millisencondsInAMinute) / 10)) * 10; |
180 | if (elapsed10Minutes == 0) { | 177 | if (elapsed10Minutes == 0) { |
181 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.JUST_A_FEW_MINUTES_AGO'); | 178 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.JUST_A_FEW_MINUTES_AGO'); |
182 | } else { | 179 | } else { |
183 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.ABOUT_*_MINUTES_AGO').replace(/__elapsed__/, elapsed10Minutes+""); | 180 | result = Clipperz.PM.Strings.getValue('elapsedTimeDescriptions.ABOUT_*_MINUTES_AGO').replace(/__elapsed__/, elapsed10Minutes+""); |
184 | } | 181 | } |
185 | } | 182 | } |
186 | } | 183 | } |
187 | 184 | ||
188 | return result; | 185 | return result; |
189 | }, | 186 | }, |
190 | 187 | ||
191 | //------------------------------------------------------------------------- | 188 | //------------------------------------------------------------------------- |
192 | 189 | ||
193 | 'parse': function (aValue) { | 190 | 'parse': function (aValue) { |
194 | return Clipperz.PM.Date.parseDateWithUTCFormat(aValue); | 191 | return Clipperz.PM.Date.parseDateWithUTCFormat(aValue); |
195 | }, | 192 | }, |
196 | 193 | ||
197 | //------------------------------------------------------------------------- | 194 | //------------------------------------------------------------------------- |
198 | __syntaxFix__: "syntax fix" | 195 | __syntaxFix__: "syntax fix" |
199 | 196 | ||
200 | }); | 197 | }); |
201 | 198 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy.js b/frontend/gamma/js/Clipperz/PM/Proxy.js index d90bcb7..190bffd 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy.js | |||
@@ -1,172 +1,169 @@ | |||
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 | 28 | ||
32 | //============================================================================= | 29 | //============================================================================= |
33 | 30 | ||
34 | Clipperz.PM.Proxy = function(args) { | 31 | Clipperz.PM.Proxy = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | 33 | ||
37 | this._shouldPayTolls = args.shouldPayTolls || false; | 34 | this._shouldPayTolls = args.shouldPayTolls || false; |
38 | 35 | ||
39 | this._tolls = { | 36 | this._tolls = { |
40 | 'CONNECT':[], | 37 | 'CONNECT':[], |
41 | 'REGISTER':[], | 38 | 'REGISTER':[], |
42 | 'MESSAGE':[] | 39 | 'MESSAGE':[] |
43 | }; | 40 | }; |
44 | 41 | ||
45 | if (args.isDefault === true) { | 42 | if (args.isDefault === true) { |
46 | Clipperz.PM.Proxy.defaultProxy = this; | 43 | Clipperz.PM.Proxy.defaultProxy = this; |
47 | } | 44 | } |
48 | 45 | ||
49 | return this; | 46 | return this; |
50 | } | 47 | } |
51 | 48 | ||
52 | Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { | 49 | Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { |
53 | 50 | ||
54 | 'toString': function() { | 51 | 'toString': function() { |
55 | return "Clipperz.PM.Proxy"; | 52 | return "Clipperz.PM.Proxy"; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //========================================================================= | 55 | //========================================================================= |
59 | 56 | ||
60 | 'shouldPayTolls': function() { | 57 | 'shouldPayTolls': function() { |
61 | return this._shouldPayTolls; | 58 | return this._shouldPayTolls; |
62 | }, | 59 | }, |
63 | 60 | ||
64 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
65 | 62 | ||
66 | 'tolls': function() { | 63 | 'tolls': function() { |
67 | return this._tolls; | 64 | return this._tolls; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
71 | 68 | ||
72 | 'payToll': function(aRequestType, someParameters) { | 69 | 'payToll': function(aRequestType, someParameters) { |
73 | vardeferredResult; | 70 | vardeferredResult; |
74 | 71 | ||
75 | //console.log(">>> Proxy.payToll", aRequestType, someParameters); | 72 | //console.log(">>> Proxy.payToll", aRequestType, someParameters); |
76 | if (this.shouldPayTolls()) { | 73 | if (this.shouldPayTolls()) { |
77 | deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false}); | 74 | deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false}); |
78 | 75 | ||
79 | if (this.tolls()[aRequestType].length == 0) { | 76 | if (this.tolls()[aRequestType].length == 0) { |
80 | deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType}); | 77 | deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType}); |
81 | deferredResult.addMethod(this, 'setTollCallback'); | 78 | deferredResult.addMethod(this, 'setTollCallback'); |
82 | } | 79 | } |
83 | deferredResult.addMethod(this.tolls()[aRequestType], 'pop'); | 80 | deferredResult.addMethod(this.tolls()[aRequestType], 'pop'); |
84 | deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay')); | 81 | deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay')); |
85 | deferredResult.addCallback(function(aToll) { | 82 | deferredResult.addCallback(function(aToll) { |
86 | var result; | 83 | var result; |
87 | 84 | ||
88 | result = { | 85 | result = { |
89 | parameters: someParameters, | 86 | parameters: someParameters, |
90 | toll: aToll | 87 | toll: aToll |
91 | } | 88 | } |
92 | 89 | ||
93 | return result; | 90 | return result; |
94 | }); | 91 | }); |
95 | 92 | ||
96 | deferredResult.callback(); | 93 | deferredResult.callback(); |
97 | } else { | 94 | } else { |
98 | deferredResult = MochiKit.Async.succeed({parameters:someParameters}); | 95 | deferredResult = MochiKit.Async.succeed({parameters:someParameters}); |
99 | } | 96 | } |
100 | //console.log("<<< Proxy.payToll"); | 97 | //console.log("<<< Proxy.payToll"); |
101 | 98 | ||
102 | return deferredResult; | 99 | return deferredResult; |
103 | }, | 100 | }, |
104 | 101 | ||
105 | //------------------------------------------------------------------------- | 102 | //------------------------------------------------------------------------- |
106 | 103 | ||
107 | 'addToll': function(aToll) { | 104 | 'addToll': function(aToll) { |
108 | //console.log(">>> Proxy.addToll", aToll); | 105 | //console.log(">>> Proxy.addToll", aToll); |
109 | this.tolls()[aToll.requestType()].push(aToll); | 106 | this.tolls()[aToll.requestType()].push(aToll); |
110 | //console.log("<<< Proxy.addToll"); | 107 | //console.log("<<< Proxy.addToll"); |
111 | }, | 108 | }, |
112 | 109 | ||
113 | //========================================================================= | 110 | //========================================================================= |
114 | 111 | ||
115 | 'setTollCallback': function(someParameters) { | 112 | 'setTollCallback': function(someParameters) { |
116 | //console.log(">>> Proxy.setTollCallback", someParameters); | 113 | //console.log(">>> Proxy.setTollCallback", someParameters); |
117 | if (typeof(someParameters['toll']) != 'undefined') { | 114 | if (typeof(someParameters['toll']) != 'undefined') { |
118 | //console.log("added a new toll", someParameters['toll']); | 115 | //console.log("added a new toll", someParameters['toll']); |
119 | this.addToll(new Clipperz.PM.Toll(someParameters['toll'])); | 116 | this.addToll(new Clipperz.PM.Toll(someParameters['toll'])); |
120 | } | 117 | } |
121 | //console.log("<<< Proxy.setTallCallback", someParameters['result']); | 118 | //console.log("<<< Proxy.setTallCallback", someParameters['result']); |
122 | return someParameters['result']; | 119 | return someParameters['result']; |
123 | }, | 120 | }, |
124 | 121 | ||
125 | //========================================================================= | 122 | //========================================================================= |
126 | 123 | ||
127 | 'registration': function (someParameters) { | 124 | 'registration': function (someParameters) { |
128 | return this.processMessage('registration', someParameters, 'REGISTER'); | 125 | return this.processMessage('registration', someParameters, 'REGISTER'); |
129 | }, | 126 | }, |
130 | 127 | ||
131 | 'handshake': function (someParameters) { | 128 | 'handshake': function (someParameters) { |
132 | return this.processMessage('handshake', someParameters, 'CONNECT'); | 129 | return this.processMessage('handshake', someParameters, 'CONNECT'); |
133 | }, | 130 | }, |
134 | 131 | ||
135 | 'message': function (someParameters) { | 132 | 'message': function (someParameters) { |
136 | return this.processMessage('message', someParameters, 'MESSAGE'); | 133 | return this.processMessage('message', someParameters, 'MESSAGE'); |
137 | }, | 134 | }, |
138 | 135 | ||
139 | 'logout': function (someParameters) { | 136 | 'logout': function (someParameters) { |
140 | return this.processMessage('logout', someParameters, 'MESSAGE'); | 137 | return this.processMessage('logout', someParameters, 'MESSAGE'); |
141 | }, | 138 | }, |
142 | 139 | ||
143 | //========================================================================= | 140 | //========================================================================= |
144 | 141 | ||
145 | 'processMessage': function (aFunctionName, someParameters, aRequestType) { | 142 | 'processMessage': function (aFunctionName, someParameters, aRequestType) { |
146 | vardeferredResult; | 143 | vardeferredResult; |
147 | 144 | ||
148 | deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false}); | 145 | deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false}); |
149 | deferredResult.addMethod(this, 'payToll', aRequestType); | 146 | deferredResult.addMethod(this, 'payToll', aRequestType); |
150 | deferredResult.addMethod(this, 'sendMessage', aFunctionName); | 147 | deferredResult.addMethod(this, 'sendMessage', aFunctionName); |
151 | deferredResult.addMethod(this, 'setTollCallback'); | 148 | deferredResult.addMethod(this, 'setTollCallback'); |
152 | deferredResult.callback(someParameters); | 149 | deferredResult.callback(someParameters); |
153 | 150 | ||
154 | return deferredResult; | 151 | return deferredResult; |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //========================================================================= | 154 | //========================================================================= |
158 | 155 | ||
159 | 'sendMessage': function () { | 156 | 'sendMessage': function () { |
160 | throw Clipperz.Base.exception.AbstractMethod; | 157 | throw Clipperz.Base.exception.AbstractMethod; |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //========================================================================= | 160 | //========================================================================= |
164 | 161 | ||
165 | 'isReadOnly': function () { | 162 | 'isReadOnly': function () { |
166 | return false; | 163 | return false; |
167 | }, | 164 | }, |
168 | 165 | ||
169 | //========================================================================= | 166 | //========================================================================= |
170 | __syntaxFix__: "syntax fix" | 167 | __syntaxFix__: "syntax fix" |
171 | 168 | ||
172 | }); | 169 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js index 65b46de..5b39b4a 100755 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js | |||
@@ -1,94 +1,91 @@ | |||
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 | 28 | ||
32 | //============================================================================= | 29 | //============================================================================= |
33 | 30 | ||
34 | Clipperz.PM.Proxy.JSON = function(args) { | 31 | Clipperz.PM.Proxy.JSON = function(args) { |
35 | Clipperz.PM.Proxy.JSON.superclass.constructor.call(this, args); | 32 | Clipperz.PM.Proxy.JSON.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._url = args.url || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._url = args.url || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.Proxy.JSON, Clipperz.PM.Proxy, { | 39 | Clipperz.Base.extend(Clipperz.PM.Proxy.JSON, Clipperz.PM.Proxy, { |
43 | 40 | ||
44 | 'toString': function() { | 41 | 'toString': function() { |
45 | return "Clipperz.PM.Proxy.JSON"; | 42 | return "Clipperz.PM.Proxy.JSON"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //========================================================================= | 45 | //========================================================================= |
49 | 46 | ||
50 | 'url': function () { | 47 | 'url': function () { |
51 | return this._url; | 48 | return this._url; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //========================================================================= | 51 | //========================================================================= |
55 | 52 | ||
56 | 'sendMessage': function(aFunctionName, someParameters) { | 53 | 'sendMessage': function(aFunctionName, someParameters) { |
57 | vardeferredResult; | 54 | vardeferredResult; |
58 | var parameters; | 55 | var parameters; |
59 | 56 | ||
60 | parameters = { | 57 | parameters = { |
61 | method: aFunctionName, | 58 | method: aFunctionName, |
62 | // version: someParameters['version'], | 59 | // version: someParameters['version'], |
63 | // message: someParameters['message'], | 60 | // message: someParameters['message'], |
64 | parameters: Clipperz.Base.serializeJSON(someParameters) | 61 | parameters: Clipperz.Base.serializeJSON(someParameters) |
65 | }; | 62 | }; |
66 | 63 | ||
67 | deferredResult = new Clipperz.Async.Deferred("Proxy.JSON.sendMessage", {trace:false}); | 64 | deferredResult = new Clipperz.Async.Deferred("Proxy.JSON.sendMessage", {trace:false}); |
68 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'remoteRequestSent'); | 65 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'remoteRequestSent'); |
69 | deferredResult.addCallback(MochiKit.Async.doXHR, this.url(), { | 66 | deferredResult.addCallback(MochiKit.Async.doXHR, this.url(), { |
70 | method:'POST', | 67 | method:'POST', |
71 | sendContent:MochiKit.Base.queryString(parameters), | 68 | sendContent:MochiKit.Base.queryString(parameters), |
72 | headers:{"Content-Type":"application/x-www-form-urlencoded"} | 69 | headers:{"Content-Type":"application/x-www-form-urlencoded"} |
73 | }); | 70 | }); |
74 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'remoteRequestReceived'); | 71 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'remoteRequestReceived'); |
75 | // deferredResult.addCallback(MochiKit.Async.evalJSONRequest); | 72 | // deferredResult.addCallback(MochiKit.Async.evalJSONRequest); |
76 | deferredResult.addCallback(MochiKit.Base.itemgetter('responseText')); | 73 | deferredResult.addCallback(MochiKit.Base.itemgetter('responseText')); |
77 | deferredResult.addCallback(Clipperz.Base.evalJSON); | 74 | deferredResult.addCallback(Clipperz.Base.evalJSON); |
78 | deferredResult.addCallback(function (someValues) { | 75 | deferredResult.addCallback(function (someValues) { |
79 | if (someValues['result'] == 'EXCEPTION') { | 76 | if (someValues['result'] == 'EXCEPTION') { |
80 | throw someValues['message']; | 77 | throw someValues['message']; |
81 | } | 78 | } |
82 | 79 | ||
83 | return someValues; | 80 | return someValues; |
84 | }) | 81 | }) |
85 | // return MochiKit.Base.evalJSON(req.responseText); | 82 | // return MochiKit.Base.evalJSON(req.responseText); |
86 | deferredResult.callback(); | 83 | deferredResult.callback(); |
87 | 84 | ||
88 | return deferredResult; | 85 | return deferredResult; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //========================================================================= | 88 | //========================================================================= |
92 | __syntaxFix__: "syntax fix" | 89 | __syntaxFix__: "syntax fix" |
93 | 90 | ||
94 | }); | 91 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js index de8e7f6..01ba122 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js | |||
@@ -1,216 +1,213 @@ | |||
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 | try { if (typeof(Clipperz.PM.Proxy.Offline) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.Proxy.Offline) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.Proxy.Offline.DataStore depends on Clipperz.PM.Proxy.Offline!"; | 27 | throw "Clipperz.PM.Proxy.Offline.DataStore depends on Clipperz.PM.Proxy.Offline!"; |
31 | } | 28 | } |
32 | 29 | ||
33 | //============================================================================= | 30 | //============================================================================= |
34 | 31 | ||
35 | Clipperz.PM.Proxy.Offline.DataStore = function(args) { | 32 | Clipperz.PM.Proxy.Offline.DataStore = function(args) { |
36 | args = args || {}; | 33 | args = args || {}; |
37 | 34 | ||
38 | this._data = args.data || (typeof(_clipperz_dump_data_) != 'undefined' ? _clipperz_dump_data_ : null); | 35 | this._data = args.data || (typeof(_clipperz_dump_data_) != 'undefined' ? _clipperz_dump_data_ : null); |
39 | this._isReadOnly = (typeof(args.readOnly) == 'undefined' ? true : args.readOnly); | 36 | this._isReadOnly = (typeof(args.readOnly) == 'undefined' ? true : args.readOnly); |
40 | this._shouldPayTolls = args.shouldPayTolls || false; | 37 | this._shouldPayTolls = args.shouldPayTolls || false; |
41 | 38 | ||
42 | this._tolls = {}; | 39 | this._tolls = {}; |
43 | this._currentStaticConnection = null; | 40 | this._currentStaticConnection = null; |
44 | 41 | ||
45 | return this; | 42 | return this; |
46 | } | 43 | } |
47 | 44 | ||
48 | Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, { | 45 | Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, { |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'isReadOnly': function () { | 49 | 'isReadOnly': function () { |
53 | return this._isReadOnly; | 50 | return this._isReadOnly; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | 54 | ||
58 | 'shouldPayTolls': function() { | 55 | 'shouldPayTolls': function() { |
59 | return this._shouldPayTolls; | 56 | return this._shouldPayTolls; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'data': function () { | 61 | 'data': function () { |
65 | return this._data; | 62 | return this._data; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'tolls': function () { | 67 | 'tolls': function () { |
71 | return this._tolls; | 68 | return this._tolls; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | //========================================================================= | 71 | //========================================================================= |
75 | 72 | ||
76 | 'resetData': function() { | 73 | 'resetData': function() { |
77 | this._data = { | 74 | this._data = { |
78 | 'users': { | 75 | 'users': { |
79 | 'catchAllUser': { | 76 | 'catchAllUser': { |
80 | __masterkey_test_value__: 'masterkey', | 77 | __masterkey_test_value__: 'masterkey', |
81 | s: '112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00', | 78 | s: '112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00', |
82 | v: '112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00' | 79 | v: '112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00' |
83 | } | 80 | } |
84 | } | 81 | } |
85 | }; | 82 | }; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'setupWithEncryptedData': function(someData) { | 87 | 'setupWithEncryptedData': function(someData) { |
91 | this._data = Clipperz.Base.deepClone(someData); | 88 | this._data = Clipperz.Base.deepClone(someData); |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
95 | 92 | ||
96 | 'setupWithData': function(someData) { | 93 | 'setupWithData': function(someData) { |
97 | var deferredResult; | 94 | var deferredResult; |
98 | var resultData; | 95 | var resultData; |
99 | var i, c; | 96 | var i, c; |
100 | 97 | ||
101 | //Clipperz.log(">>> Proxy.Test.setupWithData"); | 98 | //Clipperz.log(">>> Proxy.Test.setupWithData"); |
102 | resultData = this._data; | 99 | resultData = this._data; |
103 | 100 | ||
104 | deferredResult = new Clipperz.Async.Deferred("Proxy.Test.seupWithData", {trace:false}); | 101 | deferredResult = new Clipperz.Async.Deferred("Proxy.Test.seupWithData", {trace:false}); |
105 | c = someData['users'].length; | 102 | c = someData['users'].length; |
106 | 103 | ||
107 | for (i=0; i<c; i++) { | 104 | for (i=0; i<c; i++) { |
108 | varnewConnection; | 105 | varnewConnection; |
109 | varrecordConfiguration; | 106 | varrecordConfiguration; |
110 | 107 | ||
111 | deferredResult.addMethod(this, 'userSerializedEncryptedData', someData['users'][i]); | 108 | deferredResult.addMethod(this, 'userSerializedEncryptedData', someData['users'][i]); |
112 | deferredResult.addCallback(MochiKit.Base.bind(function(aUserSerializationContext) { | 109 | deferredResult.addCallback(MochiKit.Base.bind(function(aUserSerializationContext) { |
113 | //console.log("SERIALIZED USER", aUserSerializationContext); | 110 | //console.log("SERIALIZED USER", aUserSerializationContext); |
114 | resultData['users'][aUserSerializationContext['credentials']['C']] = { | 111 | resultData['users'][aUserSerializationContext['credentials']['C']] = { |
115 | 's': aUserSerializationContext['credentials']['s'], | 112 | 's': aUserSerializationContext['credentials']['s'], |
116 | 'v': aUserSerializationContext['credentials']['v'], | 113 | 'v': aUserSerializationContext['credentials']['v'], |
117 | 'version': aUserSerializationContext['data']['connectionVersion'], | 114 | 'version': aUserSerializationContext['data']['connectionVersion'], |
118 | 'userDetails': aUserSerializationContext['encryptedData']['user']['header'], | 115 | 'userDetails': aUserSerializationContext['encryptedData']['user']['header'], |
119 | 'userDetailsVersion':aUserSerializationContext['encryptedData']['user']['version'], | 116 | 'userDetailsVersion':aUserSerializationContext['encryptedData']['user']['version'], |
120 | 'statistics': aUserSerializationContext['encryptedData']['user']['statistics'], | 117 | 'statistics': aUserSerializationContext['encryptedData']['user']['statistics'], |
121 | 'lock': aUserSerializationContext['encryptedData']['user']['lock'], | 118 | 'lock': aUserSerializationContext['encryptedData']['user']['lock'], |
122 | 'records': this.rearrangeRecordsData(aUserSerializationContext['encryptedData']['records']) | 119 | 'records': this.rearrangeRecordsData(aUserSerializationContext['encryptedData']['records']) |
123 | } | 120 | } |
124 | }, this)); | 121 | }, this)); |
125 | } | 122 | } |
126 | 123 | ||
127 | deferredResult.addCallback(MochiKit.Base.bind(function() { | 124 | deferredResult.addCallback(MochiKit.Base.bind(function() { |
128 | //console.log("this._data", resultData); | 125 | //console.log("this._data", resultData); |
129 | this._data = resultData; | 126 | this._data = resultData; |
130 | }, this)); | 127 | }, this)); |
131 | 128 | ||
132 | deferredResult.callback(); | 129 | deferredResult.callback(); |
133 | //Clipperz.log("<<< Proxy.Test.setupWithData"); | 130 | //Clipperz.log("<<< Proxy.Test.setupWithData"); |
134 | 131 | ||
135 | return deferredResult; | 132 | return deferredResult; |
136 | }, | 133 | }, |
137 | 134 | ||
138 | //========================================================================= | 135 | //========================================================================= |
139 | 136 | ||
140 | 'getTollForRequestType': function (aRequestType) { | 137 | 'getTollForRequestType': function (aRequestType) { |
141 | varresult; | 138 | varresult; |
142 | vartargetValue; | 139 | vartargetValue; |
143 | var cost; | 140 | var cost; |
144 | 141 | ||
145 | targetValue = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2); | 142 | targetValue = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2); |
146 | switch (aRequestType) { | 143 | switch (aRequestType) { |
147 | case 'REGISTER': | 144 | case 'REGISTER': |
148 | cost = 5; | 145 | cost = 5; |
149 | break; | 146 | break; |
150 | case 'CONNECT': | 147 | case 'CONNECT': |
151 | cost = 5; | 148 | cost = 5; |
152 | break; | 149 | break; |
153 | case 'MESSAGE': | 150 | case 'MESSAGE': |
154 | cost = 2; | 151 | cost = 2; |
155 | break; | 152 | break; |
156 | } | 153 | } |
157 | 154 | ||
158 | result = { | 155 | result = { |
159 | requestType: aRequestType, | 156 | requestType: aRequestType, |
160 | targetValue: targetValue, | 157 | targetValue: targetValue, |
161 | cost: cost | 158 | cost: cost |
162 | } | 159 | } |
163 | 160 | ||
164 | if (this.shouldPayTolls()) { | 161 | if (this.shouldPayTolls()) { |
165 | this.tolls()[targetValue] = result; | 162 | this.tolls()[targetValue] = result; |
166 | } | 163 | } |
167 | 164 | ||
168 | return result; | 165 | return result; |
169 | }, | 166 | }, |
170 | 167 | ||
171 | //------------------------------------------------------------------------- | 168 | //------------------------------------------------------------------------- |
172 | 169 | ||
173 | 'checkToll': function (aFunctionName, someParameters) { | 170 | 'checkToll': function (aFunctionName, someParameters) { |
174 | if (this.shouldPayTolls()) { | 171 | if (this.shouldPayTolls()) { |
175 | var localToll; | 172 | var localToll; |
176 | vartollParameters; | 173 | vartollParameters; |
177 | 174 | ||
178 | tollParameters = someParameters['toll']; | 175 | tollParameters = someParameters['toll']; |
179 | localToll = this.tolls()[tollParameters['targetValue']]; | 176 | localToll = this.tolls()[tollParameters['targetValue']]; |
180 | 177 | ||
181 | if (localToll != null) { | 178 | if (localToll != null) { |
182 | if (! Clipperz.PM.Toll.validate(tollParameters['targetValue'], tollParameters['toll'], localToll['cost'])) { | 179 | if (! Clipperz.PM.Toll.validate(tollParameters['targetValue'], tollParameters['toll'], localToll['cost'])) { |
183 | throw "Toll value too low."; | 180 | throw "Toll value too low."; |
184 | }; | 181 | }; |
185 | } else { | 182 | } else { |
186 | throw "Missing toll"; | 183 | throw "Missing toll"; |
187 | } | 184 | } |
188 | } | 185 | } |
189 | }, | 186 | }, |
190 | 187 | ||
191 | //========================================================================= | 188 | //========================================================================= |
192 | 189 | ||
193 | 'currentStaticConnection': function () { | 190 | 'currentStaticConnection': function () { |
194 | if (this._currentStaticConnection == null) { | 191 | if (this._currentStaticConnection == null) { |
195 | this._currentStaticConnection = {}; | 192 | this._currentStaticConnection = {}; |
196 | } | 193 | } |
197 | 194 | ||
198 | return this._currentStaticConnection; | 195 | return this._currentStaticConnection; |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //------------------------------------------------------------------------- | 198 | //------------------------------------------------------------------------- |
202 | 199 | ||
203 | 'getConnectionForRequest': function (aFunctionName, someParameters) { | 200 | 'getConnectionForRequest': function (aFunctionName, someParameters) { |
204 | varresult; | 201 | varresult; |
205 | 202 | ||
206 | if (this.shouldPayTolls()) { | 203 | if (this.shouldPayTolls()) { |
207 | if ((typeof(someParameters['toll']) != 'undefined') && (typeof(someParameters['toll']['targetValue']) != 'undefined')) { | 204 | if ((typeof(someParameters['toll']) != 'undefined') && (typeof(someParameters['toll']['targetValue']) != 'undefined')) { |
208 | result = this.tolls()[someParameters['toll']['targetValue']]['connection']; | 205 | result = this.tolls()[someParameters['toll']['targetValue']]['connection']; |
209 | if (typeof(result) == 'undefined') { | 206 | if (typeof(result) == 'undefined') { |
210 | result = {}; | 207 | result = {}; |
211 | } | 208 | } |
212 | } else { | 209 | } else { |
213 | result = {}; | 210 | result = {}; |
214 | } | 211 | } |
215 | } else { | 212 | } else { |
216 | result = this.currentStaticConnection(); | 213 | result = this.currentStaticConnection(); |
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js index a15b223..a86ac4f 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js | |||
@@ -1,67 +1,64 @@ | |||
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 | 28 | ||
32 | //============================================================================= | 29 | //============================================================================= |
33 | 30 | ||
34 | Clipperz.PM.Proxy.Offline = function(args) { | 31 | Clipperz.PM.Proxy.Offline = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | 33 | ||
37 | Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args); | 34 | Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args); |
38 | 35 | ||
39 | this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args); | 36 | this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args); |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.Proxy.Offline, Clipperz.PM.Proxy, { | 41 | Clipperz.Base.extend(Clipperz.PM.Proxy.Offline, Clipperz.PM.Proxy, { |
45 | 42 | ||
46 | 'toString': function () { | 43 | 'toString': function () { |
47 | return "Clipperz.PM.Proxy.Offline"; | 44 | return "Clipperz.PM.Proxy.Offline"; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'dataStore': function () { | 49 | 'dataStore': function () { |
53 | return this._dataStore; | 50 | return this._dataStore; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | 54 | ||
58 | 'sendMessage': function(aFunctionName, someParameters) { | 55 | 'sendMessage': function(aFunctionName, someParameters) { |
59 | return this.dataStore().processMessage(aFunctionName, someParameters); | 56 | return this.dataStore().processMessage(aFunctionName, someParameters); |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | __syntaxFix__: "syntax fix" | 61 | __syntaxFix__: "syntax fix" |
65 | 62 | ||
66 | }); | 63 | }); |
67 | 64 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js index be1c337..d554c6a 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js | |||
@@ -1,167 +1,164 @@ | |||
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.Proxy) == 'undefined') { Clipperz.PM.Proxy = {}; } | 28 | if (typeof(Clipperz.PM.Proxy) == 'undefined') { Clipperz.PM.Proxy = {}; } |
32 | 29 | ||
33 | //============================================================================= | 30 | //============================================================================= |
34 | 31 | ||
35 | Clipperz.PM.Proxy.Test = function(args) { | 32 | Clipperz.PM.Proxy.Test = function(args) { |
36 | Clipperz.PM.Proxy.Test.superclass.constructor.call(this, args); | 33 | Clipperz.PM.Proxy.Test.superclass.constructor.call(this, args); |
37 | 34 | ||
38 | args = args || {}; | 35 | args = args || {}; |
39 | 36 | ||
40 | this._expectedRequests = (args.shouldCheckExpectedRequests === true) ? [] : null; | 37 | this._expectedRequests = (args.shouldCheckExpectedRequests === true) ? [] : null; |
41 | this._isExpectingRequests = true; | 38 | this._isExpectingRequests = true; |
42 | this._unexpectedRequests = []; | 39 | this._unexpectedRequests = []; |
43 | 40 | ||
44 | this.dataStore().resetData(); | 41 | this.dataStore().resetData(); |
45 | 42 | ||
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, { | 46 | Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, { |
50 | 47 | ||
51 | 'toString': function() { | 48 | 'toString': function() { |
52 | return "Clipperz.PM.Proxy.Test"; | 49 | return "Clipperz.PM.Proxy.Test"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //========================================================================= | 52 | //========================================================================= |
56 | 53 | ||
57 | 'expectedRequests': function () { | 54 | 'expectedRequests': function () { |
58 | return this._expectedRequests; | 55 | return this._expectedRequests; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'shouldCheckExpectedRequests': function () { | 60 | 'shouldCheckExpectedRequests': function () { |
64 | return (this._expectedRequests != null); | 61 | return (this._expectedRequests != null); |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'setShouldCheckExpectedRequests': function(aValue) { | 64 | 'setShouldCheckExpectedRequests': function(aValue) { |
68 | if (aValue) { | 65 | if (aValue) { |
69 | this._expectedRequests = aValue; | 66 | this._expectedRequests = aValue; |
70 | } else { | 67 | } else { |
71 | this._expectedRequests = null; | 68 | this._expectedRequests = null; |
72 | } | 69 | } |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'shouldNotReceiveAnyFurtherRequest': function () { | 74 | 'shouldNotReceiveAnyFurtherRequest': function () { |
78 | this._isExpectingRequests = false; | 75 | this._isExpectingRequests = false; |
79 | }, | 76 | }, |
80 | 77 | ||
81 | 'mayReceiveMoreRequests': function () { | 78 | 'mayReceiveMoreRequests': function () { |
82 | this._isExpectingRequests = true; | 79 | this._isExpectingRequests = true; |
83 | this.resetUnexpectedRequests(); | 80 | this.resetUnexpectedRequests(); |
84 | }, | 81 | }, |
85 | 82 | ||
86 | 'isExpectingRequests': function () { | 83 | 'isExpectingRequests': function () { |
87 | return this._isExpectingRequests; | 84 | return this._isExpectingRequests; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
91 | 88 | ||
92 | 'unexpectedRequests': function () { | 89 | 'unexpectedRequests': function () { |
93 | return this._unexpectedRequests; | 90 | return this._unexpectedRequests; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | 'resetUnexpectedRequests': function () { | 93 | 'resetUnexpectedRequests': function () { |
97 | this._unexpectedRequests = []; | 94 | this._unexpectedRequests = []; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //------------------------------------------------------------------------- | 97 | //------------------------------------------------------------------------- |
101 | 98 | ||
102 | 'testExpectedRequestParameters': function (aPath, anActualRequest, anExpectedRequest) { | 99 | 'testExpectedRequestParameters': function (aPath, anActualRequest, anExpectedRequest) { |
103 | var aKey; | 100 | var aKey; |
104 | //console.log(">>> Proxy.testExpectedRequestParameters [" + aPath + "]", anActualRequest, anExpectedRequest); | 101 | //console.log(">>> Proxy.testExpectedRequestParameters [" + aPath + "]", anActualRequest, anExpectedRequest); |
105 | for (aKey in anExpectedRequest) { | 102 | for (aKey in anExpectedRequest) { |
106 | if (typeof(anActualRequest[aKey]) == 'undefined') { | 103 | if (typeof(anActualRequest[aKey]) == 'undefined') { |
107 | throw "the expected paramter [" + aKey + "] is missing from the actual request"; | 104 | throw "the expected paramter [" + aKey + "] is missing from the actual request"; |
108 | } | 105 | } |
109 | if (typeof(anExpectedRequest[aKey]) == 'object') { | 106 | if (typeof(anExpectedRequest[aKey]) == 'object') { |
110 | this.testExpectedRequestParameters(aPath + "." + aKey, anActualRequest[aKey], anExpectedRequest[aKey]) | 107 | this.testExpectedRequestParameters(aPath + "." + aKey, anActualRequest[aKey], anExpectedRequest[aKey]) |
111 | } else { | 108 | } else { |
112 | if (! anExpectedRequest[aKey](anActualRequest[aKey])) { | 109 | if (! anExpectedRequest[aKey](anActualRequest[aKey])) { |
113 | throw "wrong value for paramter [" + aKey + "]; got '" + anActualRequest[aKey] + "'"; | 110 | throw "wrong value for paramter [" + aKey + "]; got '" + anActualRequest[aKey] + "'"; |
114 | } | 111 | } |
115 | } | 112 | } |
116 | } | 113 | } |
117 | //console.log("<<< Proxy.testExpectedRequestParameters"); | 114 | //console.log("<<< Proxy.testExpectedRequestParameters"); |
118 | }, | 115 | }, |
119 | 116 | ||
120 | //------------------------------------------------------------------------- | 117 | //------------------------------------------------------------------------- |
121 | 118 | ||
122 | 'checkRequest': function(aFunctionName, someParameters) { | 119 | 'checkRequest': function(aFunctionName, someParameters) { |
123 | if (this.shouldCheckExpectedRequests()) { | 120 | if (this.shouldCheckExpectedRequests()) { |
124 | var expectedRequest; | 121 | var expectedRequest; |
125 | 122 | ||
126 | //console.log(">>> Proxy.Test.checkRequest - " + aFunctionName, someParameters); | 123 | //console.log(">>> Proxy.Test.checkRequest - " + aFunctionName, someParameters); |
127 | expectedRequest = this.expectedRequests().pop(); | 124 | expectedRequest = this.expectedRequests().pop(); |
128 | //console.log("--- Proxy.Test.checkRequest - expectedRequest", expectedRequest); | 125 | //console.log("--- Proxy.Test.checkRequest - expectedRequest", expectedRequest); |
129 | if (expectedRequest == null) { | 126 | if (expectedRequest == null) { |
130 | throw "Proxy.Test.sentMessage: no expected result specified. Got request '" + aFunctionName + "': " + someParameters; | 127 | throw "Proxy.Test.sentMessage: no expected result specified. Got request '" + aFunctionName + "': " + someParameters; |
131 | } | 128 | } |
132 | 129 | ||
133 | try { | 130 | try { |
134 | if (aFunctionName != expectedRequest.functionName) { | 131 | if (aFunctionName != expectedRequest.functionName) { |
135 | throw "wrong function name. Got '" + aFunctionName + "', expected '" + expectedRequest.request.functionName + "'"; | 132 | throw "wrong function name. Got '" + aFunctionName + "', expected '" + expectedRequest.request.functionName + "'"; |
136 | } | 133 | } |
137 | 134 | ||
138 | this.testExpectedRequestParameters("parameters", someParameters, expectedRequest.parameters); | 135 | this.testExpectedRequestParameters("parameters", someParameters, expectedRequest.parameters); |
139 | } catch(exception) { | 136 | } catch(exception) { |
140 | //console.log("EXCEPTION: Proxy.Test.sentMessage[" + expectedRequest.name + "]", exception) | 137 | //console.log("EXCEPTION: Proxy.Test.sentMessage[" + expectedRequest.name + "]", exception) |
141 | throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception; | 138 | throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception; |
142 | } | 139 | } |
143 | } | 140 | } |
144 | //console.log("<<< Proxy.Test.checkRequest"); | 141 | //console.log("<<< Proxy.Test.checkRequest"); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | //========================================================================= | 144 | //========================================================================= |
148 | 145 | ||
149 | 'sendMessage': function(aFunctionName, someParameters) { | 146 | 'sendMessage': function(aFunctionName, someParameters) { |
150 | var result; | 147 | var result; |
151 | 148 | ||
152 | if (this.isExpectingRequests() == false) { | 149 | if (this.isExpectingRequests() == false) { |
153 | // throw Clipperz.PM.Connection.exception.UnexpectedRequest; | 150 | // throw Clipperz.PM.Connection.exception.UnexpectedRequest; |
154 | Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */); | 151 | Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */); |
155 | this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters}); | 152 | this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters}); |
156 | }; | 153 | }; |
157 | this.checkRequest(aFunctionName, someParameters); | 154 | this.checkRequest(aFunctionName, someParameters); |
158 | result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters); | 155 | result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters); |
159 | 156 | ||
160 | return result; | 157 | return result; |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //========================================================================= | 160 | //========================================================================= |
164 | __syntaxFix__: "syntax fix" | 161 | __syntaxFix__: "syntax fix" |
165 | 162 | ||
166 | }); | 163 | }); |
167 | 164 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/Strings.js b/frontend/gamma/js/Clipperz/PM/Strings.js index 43ef21f..a051365 100644 --- a/frontend/gamma/js/Clipperz/PM/Strings.js +++ b/frontend/gamma/js/Clipperz/PM/Strings.js | |||
@@ -1,216 +1,213 @@ | |||
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.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } | 28 | if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } |
32 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } | 29 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } |
33 | 30 | ||
34 | //----------------------------------------------------------------------------- | 31 | //----------------------------------------------------------------------------- |
35 | /* | 32 | /* |
36 | Clipperz.PM.Strings.standardStrings = { | 33 | Clipperz.PM.Strings.standardStrings = { |
37 | 'loginPanelSwitchLanguageSelectOptions':[ | 34 | 'loginPanelSwitchLanguageSelectOptions':[ |
38 | / * | 35 | / * |
39 | {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true}, | 36 | {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true}, |
40 | {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true}, | 37 | {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true}, |
41 | {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true}, | 38 | {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true}, |
42 | {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true}, | 39 | {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true}, |
43 | {tag:'option', html:"Català", value:'ca-ES', disabled:true}, | 40 | {tag:'option', html:"Català", value:'ca-ES', disabled:true}, |
44 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true}, | 41 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true}, |
45 | {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true}, | 42 | {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true}, |
46 | {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true}, | 43 | {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true}, |
47 | {tag:'option', html:"Dansk", value:'da-DK', disabled:true}, | 44 | {tag:'option', html:"Dansk", value:'da-DK', disabled:true}, |
48 | {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /}, | 45 | {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /}, |
49 | {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /}, | 46 | {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /}, |
50 | {tag:'option', html:"English (British)", value:'en-GB'/ *, disabled:true* /}, | 47 | {tag:'option', html:"English (British)", value:'en-GB'/ *, disabled:true* /}, |
51 | {tag:'option', html:"English (Canadian)", value:'en-CA'/ *, disabled:true* /}, | 48 | {tag:'option', html:"English (Canadian)", value:'en-CA'/ *, disabled:true* /}, |
52 | {tag:'option', html:"Español", value:'es-ES', disabled:true}, | 49 | {tag:'option', html:"Español", value:'es-ES', disabled:true}, |
53 | {tag:'option', html:"Eesti", value:'et-EE', disabled:true}, | 50 | {tag:'option', html:"Eesti", value:'et-EE', disabled:true}, |
54 | {tag:'option', html:"Français", value:'fr-FR', disabled:true}, | 51 | {tag:'option', html:"Français", value:'fr-FR', disabled:true}, |
55 | {tag:'option', html:"Galego", value:'gl-ES', disabled:true}, | 52 | {tag:'option', html:"Galego", value:'gl-ES', disabled:true}, |
56 | {tag:'option', html:"Greek (Ελληνικά)", value:'el-GR', disabled:true}, | 53 | {tag:'option', html:"Greek (Ελληνικά)", value:'el-GR', disabled:true}, |
57 | {tag:'option', html:"Íslenska", value:'is-IS', disabled:true}, | 54 | {tag:'option', html:"Íslenska", value:'is-IS', disabled:true}, |
58 | {tag:'option', html:"Italiano", value:'it-IT'/ *, disabled:true* /}, | 55 | {tag:'option', html:"Italiano", value:'it-IT'/ *, disabled:true* /}, |
59 | {tag:'option', html:"Japanese (日本語)", value:'ja-JP', disabled:true}, | 56 | {tag:'option', html:"Japanese (日本語)", value:'ja-JP', disabled:true}, |
60 | {tag:'option', html:"Korean (한국어)", value:'ko-KR', disabled:true}, | 57 | {tag:'option', html:"Korean (한국어)", value:'ko-KR', disabled:true}, |
61 | {tag:'option', html:"Latviešu", value:'lv-LV', disabled:true}, | 58 | {tag:'option', html:"Latviešu", value:'lv-LV', disabled:true}, |
62 | {tag:'option', html:"Lietuvių", value:'lt-LT', disabled:true}, | 59 | {tag:'option', html:"Lietuvių", value:'lt-LT', disabled:true}, |
63 | {tag:'option', html:"Macedonian (Македонски)", value:'mk-MK', disabled:true}, | 60 | {tag:'option', html:"Macedonian (Македонски)", value:'mk-MK', disabled:true}, |
64 | {tag:'option', html:"Magyar", value:'hu-HU', disabled:true}, | 61 | {tag:'option', html:"Magyar", value:'hu-HU', disabled:true}, |
65 | {tag:'option', html:"Nederlands", value:'nl-NL', disabled:true}, | 62 | {tag:'option', html:"Nederlands", value:'nl-NL', disabled:true}, |
66 | {tag:'option', html:"Norsk bokmål", value:'nb-NO', disabled:true}, | 63 | {tag:'option', html:"Norsk bokmål", value:'nb-NO', disabled:true}, |
67 | {tag:'option', html:"Norsk nynorsk", value:'nn-NO', disabled:true}, | 64 | {tag:'option', html:"Norsk nynorsk", value:'nn-NO', disabled:true}, |
68 | {tag:'option', html:"Persian (Western) (فارسى)", value:'fa-IR', disabled:true}, | 65 | {tag:'option', html:"Persian (Western) (فارسى)", value:'fa-IR', disabled:true}, |
69 | {tag:'option', html:"Polski", value:'pl-PL', disabled:true}, | 66 | {tag:'option', html:"Polski", value:'pl-PL', disabled:true}, |
70 | {tag:'option', html:"Português", value:'pt-PT'/ *, disabled:true* /}, | 67 | {tag:'option', html:"Português", value:'pt-PT'/ *, disabled:true* /}, |
71 | {tag:'option', html:"Português Brasileiro", value:'pt-BR'/ *, disabled:true* /}, | 68 | {tag:'option', html:"Português Brasileiro", value:'pt-BR'/ *, disabled:true* /}, |
72 | {tag:'option', html:"Românä", value:'ro-RO', disabled:true}, | 69 | {tag:'option', html:"Românä", value:'ro-RO', disabled:true}, |
73 | {tag:'option', html:"Russian (Русский)", value:'ru-RU', disabled:true}, | 70 | {tag:'option', html:"Russian (Русский)", value:'ru-RU', disabled:true}, |
74 | {tag:'option', html:"Slovak (Slovenčina)", value:'sk-SK', disabled:true}, | 71 | {tag:'option', html:"Slovak (Slovenčina)", value:'sk-SK', disabled:true}, |
75 | {tag:'option', html:"Slovenian (Slovenščina)", value:'sl-SI', disabled:true}, | 72 | {tag:'option', html:"Slovenian (Slovenščina)", value:'sl-SI', disabled:true}, |
76 | {tag:'option', html:"Suomi", value:'fi-FI', disabled:true}, | 73 | {tag:'option', html:"Suomi", value:'fi-FI', disabled:true}, |
77 | {tag:'option', html:"Svenska", value:'sv-SE', disabled:true}, | 74 | {tag:'option', html:"Svenska", value:'sv-SE', disabled:true}, |
78 | {tag:'option', html:"Thai (ไทย)", value:'th-TH', disabled:true}, | 75 | {tag:'option', html:"Thai (ไทย)", value:'th-TH', disabled:true}, |
79 | {tag:'option', html:"Türkçe", value:'tr-TR', disabled:true}, | 76 | {tag:'option', html:"Türkçe", value:'tr-TR', disabled:true}, |
80 | {tag:'option', html:"Ukrainian (Українська)", value:'uk-UA', disabled:true} | 77 | {tag:'option', html:"Ukrainian (Українська)", value:'uk-UA', disabled:true} |
81 | * / | 78 | * / |
82 | {tag:'option', html:"Arabic (العربية)", value:"ar", disabled:true, cls:'disabledOption'}, | 79 | {tag:'option', html:"Arabic (العربية)", value:"ar", disabled:true, cls:'disabledOption'}, |
83 | // {tag:'option', html:"Chinese (中文)", value:"zh", disabled:true}, | 80 | // {tag:'option', html:"Chinese (中文)", value:"zh", disabled:true}, |
84 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN'}, | 81 | {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN'}, |
85 | {tag:'option', html:"Dutch (Nederlands)", value:"nl-NL", disabled:true, cls:'disabledOption'}, | 82 | {tag:'option', html:"Dutch (Nederlands)", value:"nl-NL", disabled:true, cls:'disabledOption'}, |
86 | {tag:'option', html:"English", value:"en-US"}, | 83 | {tag:'option', html:"English", value:"en-US"}, |
87 | {tag:'option', html:"French (Français)", value:"fr-FR"}, | 84 | {tag:'option', html:"French (Français)", value:"fr-FR"}, |
88 | {tag:'option', html:"German (Deutsch)", value:"de-DE", disabled:true, cls:'disabledOption'}, | 85 | {tag:'option', html:"German (Deutsch)", value:"de-DE", disabled:true, cls:'disabledOption'}, |
89 | {tag:'option', html:"Greek (Ελληνικά)", value:"el-GR", disabled:true, cls:'disabledOption'}, | 86 | {tag:'option', html:"Greek (Ελληνικά)", value:"el-GR", disabled:true, cls:'disabledOption'}, |
90 | {tag:'option', html:"Hebrew (עברית)", value:"he-IL", disabled:true, cls:'disabledOption'}, | 87 | {tag:'option', html:"Hebrew (עברית)", value:"he-IL", disabled:true, cls:'disabledOption'}, |
91 | {tag:'option', html:"Italian (Italiano)", value:"it-IT"}, | 88 | {tag:'option', html:"Italian (Italiano)", value:"it-IT"}, |
92 | {tag:'option', html:"Japanese (日本語)", value:"ja-JP"}, | 89 | {tag:'option', html:"Japanese (日本語)", value:"ja-JP"}, |
93 | {tag:'option', html:"Korean (한국어)", value:"ko-KR", disabled:true, cls:'disabledOption'}, | 90 | {tag:'option', html:"Korean (한국어)", value:"ko-KR", disabled:true, cls:'disabledOption'}, |
94 | {tag:'option', html:"Norwegian (Norsk)", value:"no", disabled:true, cls:'disabledOption'}, | 91 | {tag:'option', html:"Norwegian (Norsk)", value:"no", disabled:true, cls:'disabledOption'}, |
95 | {tag:'option', html:"Persian (فارسی)", value:"fa-IR", disabled:true, cls:'disabledOption'}, | 92 | {tag:'option', html:"Persian (فارسی)", value:"fa-IR", disabled:true, cls:'disabledOption'}, |
96 | {tag:'option', html:"Polish (Polski)", value:"pl-PL", disabled:true, cls:'disabledOption'}, | 93 | {tag:'option', html:"Polish (Polski)", value:"pl-PL", disabled:true, cls:'disabledOption'}, |
97 | {tag:'option', html:"Portuguese (Português)", value:"pt-BR"}, | 94 | {tag:'option', html:"Portuguese (Português)", value:"pt-BR"}, |
98 | {tag:'option', html:"Russian (Русский)", value:"ru-RU", disabled:true, cls:'disabledOption'}, | 95 | {tag:'option', html:"Russian (Русский)", value:"ru-RU", disabled:true, cls:'disabledOption'}, |
99 | {tag:'option', html:"Spanish (Español)", value:"es-ES"}, | 96 | {tag:'option', html:"Spanish (Español)", value:"es-ES"}, |
100 | {tag:'option', html:"Swedish (Svenska)", value:"sv-SE", disabled:true, cls:'disabledOption'}, | 97 | {tag:'option', html:"Swedish (Svenska)", value:"sv-SE", disabled:true, cls:'disabledOption'}, |
101 | {tag:'option', html:"Turkish (Türkçe)", value:"tr-TR", disabled:true, cls:'disabledOption'}, | 98 | {tag:'option', html:"Turkish (Türkçe)", value:"tr-TR", disabled:true, cls:'disabledOption'}, |
102 | {tag:'option', html:"Vietnamese (Tiếng Việt)", value:"vi-VN", disabled:true, cls:'disabledOption'} | 99 | {tag:'option', html:"Vietnamese (Tiếng Việt)", value:"vi-VN", disabled:true, cls:'disabledOption'} |
103 | ] | 100 | ] |
104 | } | 101 | } |
105 | */ | 102 | */ |
106 | 103 | ||
107 | Clipperz.PM.Strings.GeneralSettings = { | 104 | Clipperz.PM.Strings.GeneralSettings = { |
108 | 'defaults': { | 105 | 'defaults': { |
109 | // 'loginFormAarghThatsBadUrl':"http://www.clipperz.com/support/faq/account_faq", | 106 | // 'loginFormAarghThatsBadUrl':"http://www.clipperz.com/support/faq/account_faq", |
110 | // 'loginFormVerifyTheCodeUrl':"http://www.clipperz.com/learn_more/reviewing_the_code", | 107 | // 'loginFormVerifyTheCodeUrl':"http://www.clipperz.com/learn_more/reviewing_the_code", |
111 | 108 | ||
112 | // 'donateHeaderLinkUrl': "http://www.clipperz.com/donations", | 109 | // 'donateHeaderLinkUrl': "http://www.clipperz.com/donations", |
113 | // 'creditsHeaderLinkUrl': "http://www.clipperz.com/credits", | 110 | // 'creditsHeaderLinkUrl': "http://www.clipperz.com/credits", |
114 | // 'feedbackHeaderLinkUrl': "http://www.clipperz.com/contact", | 111 | // 'feedbackHeaderLinkUrl': "http://www.clipperz.com/contact", |
115 | // 'helpHeaderLinkUrl': "http://www.clipperz.com/support/user_guide", | 112 | // 'helpHeaderLinkUrl': "http://www.clipperz.com/support/user_guide", |
116 | // 'forumHeaderLinkUrl': "http://www.clipperz.com/forum", | 113 | // 'forumHeaderLinkUrl': "http://www.clipperz.com/forum", |
117 | 114 | ||
118 | // 'httpAuthBookmarkletConfiguration':{tag:'textarea', id:'httpAuthDefaultConfiguration', html:"" + | 115 | // 'httpAuthBookmarkletConfiguration':{tag:'textarea', id:'httpAuthDefaultConfiguration', html:"" + |
119 | // "{ \"page\":{\"title\":\"HTTP authentication\"}," + "\n" + | 116 | // "{ \"page\":{\"title\":\"HTTP authentication\"}," + "\n" + |
120 | // " \"form\":{\"attributes\": {" + "\n" + | 117 | // " \"form\":{\"attributes\": {" + "\n" + |
121 | // " \"action\":\"\"," + "\n" + | 118 | // " \"action\":\"\"," + "\n" + |
122 | // " \"type\":\"http_auth\"" + "\n" + | 119 | // " \"type\":\"http_auth\"" + "\n" + |
123 | // " }, \"inputs\": [" + "\n" + | 120 | // " }, \"inputs\": [" + "\n" + |
124 | // " {\"type\":\"text\",\"name\":\"url\",\"value\":\"\"}," + "\n" + | 121 | // " {\"type\":\"text\",\"name\":\"url\",\"value\":\"\"}," + "\n" + |
125 | // " {\"type\":\"text\",\"name\":\"username\",\"value\":\"\"}," + "\n" + | 122 | // " {\"type\":\"text\",\"name\":\"username\",\"value\":\"\"}," + "\n" + |
126 | // " {\"type\":\"password\",\"name\":\"password\",\"value\":\"\"}" + "\n" + | 123 | // " {\"type\":\"password\",\"name\":\"password\",\"value\":\"\"}" + "\n" + |
127 | // " ]}, \"version\":\"0.2.3\"}" | 124 | // " ]}, \"version\":\"0.2.3\"}" |
128 | // }, | 125 | // }, |
129 | 126 | ||
130 | 'directLoginJumpPageUrl':"", | 127 | 'directLoginJumpPageUrl':"", |
131 | 'defaultFaviconUrl': "data:application/octet-stream;charset=utf-8;base64,AAABAAEAFxcAAAEAGAD8BgAAFgAAACgAAAAXAAAALgAAAAEAGAAAAAAAAAAAABIXAAASFwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////9zAC////////////////////////////////////////////////////////////////////////////////////////////9pAG////////////////////////////////////////////////////////////////////////////////////////////9rAC////////////////////////////////////////////////////////////////////////////////////////////9yAHP////////////////////////IyMizs7O6urrq6ur////////////Ozs6zs7Ozs7Pq6ur///////////////////////8AAAD////////////////////V1dWXl5eXl5eXl5elpaX4+Pj////Ozs6Xl5eXl5eXl5eenp7///////////////////////8AAAD////////////////////Ozs6Xl5eXl5eXl5eXl5fBwcHq6uqenp6Xl5eXl5eXl5eXl5f///////////////////////8AAAD////////////////////j4+OXl5eXl5eXl5eXl5eXl5elpaWXl5eXl5eXl5eXl5ezs7P///////////////////////8AAAD////////////////////////IyMiXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eenp7x8fH////////////////////////////////////////////////////4+PilpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5fOzs7////////////////////////////////////////////////////////q6uq6urqXl5eXl5eXl5eXl5eXl5eXl5eenp7V1dX4+Pj///////////////////////8AAAD////////////4+PjOzs6lpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5e6urrj4+P///////////////8AAAD////////////BwcGXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fx8fH///////////8AAAD///////////+zs7OXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fj4+P///////////8AAAD////////////IyMiXl5eXl5eXl5eXl5e6urqXl5eXl5eXl5eXl5esrKylpaWXl5eXl5eXl5eenp7x8fH///////////8AAAD////////////////Ozs7Ozs7V1dX4+Pj///+Xl5eXl5eXl5eXl5fOzs7////q6urOzs7Ozs7q6ur///////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD////////////////////////////////////IyMiXl5eXl5eenp7x8fH///////////////////////////////////8AAAD////////////////////////////////////////j4+Pj4+Px8fH///////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo=", | 128 | 'defaultFaviconUrl': "data:application/octet-stream;charset=utf-8;base64,AAABAAEAFxcAAAEAGAD8BgAAFgAAACgAAAAXAAAALgAAAAEAGAAAAAAAAAAAABIXAAASFwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////9zAC////////////////////////////////////////////////////////////////////////////////////////////9pAG////////////////////////////////////////////////////////////////////////////////////////////9rAC////////////////////////////////////////////////////////////////////////////////////////////9yAHP////////////////////////IyMizs7O6urrq6ur////////////Ozs6zs7Ozs7Pq6ur///////////////////////8AAAD////////////////////V1dWXl5eXl5eXl5elpaX4+Pj////Ozs6Xl5eXl5eXl5eenp7///////////////////////8AAAD////////////////////Ozs6Xl5eXl5eXl5eXl5fBwcHq6uqenp6Xl5eXl5eXl5eXl5f///////////////////////8AAAD////////////////////j4+OXl5eXl5eXl5eXl5eXl5elpaWXl5eXl5eXl5eXl5ezs7P///////////////////////8AAAD////////////////////////IyMiXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eenp7x8fH////////////////////////////////////////////////////4+PilpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5fOzs7////////////////////////////////////////////////////////q6uq6urqXl5eXl5eXl5eXl5eXl5eXl5eenp7V1dX4+Pj///////////////////////8AAAD////////////4+PjOzs6lpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5e6urrj4+P///////////////8AAAD////////////BwcGXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fx8fH///////////8AAAD///////////+zs7OXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fj4+P///////////8AAAD////////////IyMiXl5eXl5eXl5eXl5e6urqXl5eXl5eXl5eXl5esrKylpaWXl5eXl5eXl5eenp7x8fH///////////8AAAD////////////////Ozs7Ozs7V1dX4+Pj///+Xl5eXl5eXl5eXl5fOzs7////q6urOzs7Ozs7q6ur///////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD////////////////////////////////////IyMiXl5eXl5eenp7x8fH///////////////////////////////////8AAAD////////////////////////////////////////j4+Pj4+Px8fH///////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo=", |
132 | 'defaultFaviconUrl_IE': "https://www.clipperz.com/images/icons/misc/favicon.ico", | 129 | 'defaultFaviconUrl_IE': "https://www.clipperz.com/images/icons/misc/favicon.ico", |
133 | 130 | ||
134 | // 'icons_baseUrl':"https://www.clipperz.com/images/icons", | 131 | // 'icons_baseUrl':"https://www.clipperz.com/images/icons", |
135 | 132 | ||
136 | // 'passwordGeneratorLowercaseCharset':"abcdefghijklmnopqrstuvwxyz", | 133 | // 'passwordGeneratorLowercaseCharset':"abcdefghijklmnopqrstuvwxyz", |
137 | // 'passwordGeneratorUppercaseCharset':"ABCDEFGHIJKLMNOPQRSTUVWXYZ", | 134 | // 'passwordGeneratorUppercaseCharset':"ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
138 | // 'passwordGeneratorNumberCharset': "0123456789", | 135 | // 'passwordGeneratorNumberCharset': "0123456789", |
139 | // 'passwordGeneratorSymbolCharset': "!@#$%^&*+?[]{}/|\\<>,.;:~=-_", | 136 | // 'passwordGeneratorSymbolCharset': "!@#$%^&*+?[]{}/|\\<>,.;:~=-_", |
140 | 137 | ||
141 | // 'passwordGenerator': { | 138 | // 'passwordGenerator': { |
142 | // 'lowercaseCharset':"abcdefghijklmnopqrstuvwxyz", | 139 | // 'lowercaseCharset':"abcdefghijklmnopqrstuvwxyz", |
143 | // 'uppercaseCharset':"ABCDEFGHIJKLMNOPQRSTUVWXYZ", | 140 | // 'uppercaseCharset':"ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
144 | // 'numberCharset':"0123456789", | 141 | // 'numberCharset':"0123456789", |
145 | // 'symbolCharset':"!@#$%^&*+?[]{}/|\\<>,.;:~=-_", | 142 | // 'symbolCharset':"!@#$%^&*+?[]{}/|\\<>,.;:~=-_", |
146 | // }, | 143 | // }, |
147 | 144 | ||
148 | '_': "" | 145 | '_': "" |
149 | } | 146 | } |
150 | } | 147 | } |
151 | 148 | ||
152 | Clipperz.PM.Strings.defaultLanguages = { | 149 | Clipperz.PM.Strings.defaultLanguages = { |
153 | 'default':"en-us", | 150 | 'default':"en-us", |
154 | 151 | ||
155 | // 'de':"de-de", | 152 | // 'de':"de-de", |
156 | // 'el':"el-gr", | 153 | // 'el':"el-gr", |
157 | // 'he':"he-il", | 154 | // 'he':"he-il", |
158 | // 'ru':"ru-ru", | 155 | // 'ru':"ru-ru", |
159 | 156 | ||
160 | 'fr':"fr-fr", | 157 | 'fr':"fr-fr", |
161 | 'es':"es-es", | 158 | 'es':"es-es", |
162 | 'zh':"zh-cn", | 159 | 'zh':"zh-cn", |
163 | 'ja':"ja-jp", | 160 | 'ja':"ja-jp", |
164 | 'pt':"pt-br", | 161 | 'pt':"pt-br", |
165 | 'it':"it-it", | 162 | 'it':"it-it", |
166 | 'en': "en-us" | 163 | 'en': "en-us" |
167 | } | 164 | } |
168 | 165 | ||
169 | Clipperz.PM.Strings.inputTypeToRecordFieldType = { | 166 | Clipperz.PM.Strings.inputTypeToRecordFieldType = { |
170 | 'text': 'TXT', | 167 | 'text': 'TXT', |
171 | 'password': 'PWD', | 168 | 'password': 'PWD', |
172 | 'checkbox': 'CHECK', | 169 | 'checkbox': 'CHECK', |
173 | 'radio': 'RADIO', | 170 | 'radio': 'RADIO', |
174 | 'select': 'SELECT' | 171 | 'select': 'SELECT' |
175 | }; | 172 | }; |
176 | 173 | ||
177 | //----------------------------------------------------------------------------- | 174 | //----------------------------------------------------------------------------- |
178 | 175 | ||
179 | Clipperz.PM.Strings.translateBookmarklet = function (aBookmarkletString) { | 176 | Clipperz.PM.Strings.translateBookmarklet = function (aBookmarkletString) { |
180 | var result; | 177 | var result; |
181 | 178 | ||
182 | result = aBookmarkletString; | 179 | result = aBookmarkletString; |
183 | 180 | ||
184 | result = result.replace(/@BOOKMARKLET_NO_EXCEPTION_MESSAGE@/,Clipperz.PM.Strings.getValue('bookmarkletCopy.noExceptionMessage')); | 181 | result = result.replace(/@BOOKMARKLET_NO_EXCEPTION_MESSAGE@/,Clipperz.PM.Strings.getValue('bookmarkletCopy.noExceptionMessage')); |
185 | result = result.replace(/@BOOKMARKLET_EXCEPTION_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.exceptionMessage')); | 182 | result = result.replace(/@BOOKMARKLET_EXCEPTION_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.exceptionMessage')); |
186 | result = result.replace(/@BOOKMARKLET_COPY@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.copy')); | 183 | result = result.replace(/@BOOKMARKLET_COPY@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.copy')); |
187 | result = result.replace(/@BOOKMARKLET_SUCCESSFUL_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.successfulMessage')); | 184 | result = result.replace(/@BOOKMARKLET_SUCCESSFUL_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.successfulMessage')); |
188 | result = result.replace(/@BOOKMARKLET_FAIL_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.failMessage')); | 185 | result = result.replace(/@BOOKMARKLET_FAIL_MESSAGE@/, Clipperz.PM.Strings.getValue('bookmarkletCopy.failMessage')); |
189 | 186 | ||
190 | return result; | 187 | return result; |
191 | } | 188 | } |
192 | 189 | ||
193 | //----------------------------------------------------------------------------- | 190 | //----------------------------------------------------------------------------- |
194 | 191 | ||
195 | Clipperz.PM.Strings.Languages.setSelectedLanguage = function(aLanguage) { | 192 | Clipperz.PM.Strings.Languages.setSelectedLanguage = function(aLanguage) { |
196 | var language; | 193 | var language; |
197 | varselectedLanguage; | 194 | varselectedLanguage; |
198 | 195 | ||
199 | language = (aLanguage || Clipperz.PM.Strings.preferredLanguage || 'default').toLowerCase(); | 196 | language = (aLanguage || Clipperz.PM.Strings.preferredLanguage || 'default').toLowerCase(); |
200 | if (typeof(Clipperz.PM.Strings.defaultLanguages[language]) != 'undefined') { | 197 | if (typeof(Clipperz.PM.Strings.defaultLanguages[language]) != 'undefined') { |
201 | language = Clipperz.PM.Strings.defaultLanguages[language]; | 198 | language = Clipperz.PM.Strings.defaultLanguages[language]; |
202 | } | 199 | } |
203 | 200 | ||
204 | if (typeof(Clipperz.PM.Strings.Languages[language]) != 'undefined') { | 201 | if (typeof(Clipperz.PM.Strings.Languages[language]) != 'undefined') { |
205 | selectedLanguage = language; | 202 | selectedLanguage = language; |
206 | } else if (typeof(Clipperz.PM.Strings.defaultLanguages[language.substr(0,2)]) != 'undefined') { | 203 | } else if (typeof(Clipperz.PM.Strings.defaultLanguages[language.substr(0,2)]) != 'undefined') { |
207 | selectedLanguage = Clipperz.PM.Strings.defaultLanguages[language.substr(0,2)]; | 204 | selectedLanguage = Clipperz.PM.Strings.defaultLanguages[language.substr(0,2)]; |
208 | } else { | 205 | } else { |
209 | selectedLanguage = Clipperz.PM.Strings.defaultLanguages['default']; | 206 | selectedLanguage = Clipperz.PM.Strings.defaultLanguages['default']; |
210 | } | 207 | } |
211 | 208 | ||
212 | if (selectedLanguage != Clipperz.PM.Strings.selectedLanguage) { | 209 | if (selectedLanguage != Clipperz.PM.Strings.selectedLanguage) { |
213 | vartranslations; | 210 | vartranslations; |
214 | 211 | ||
215 | Clipperz.PM.Strings.selectedLanguage = selectedLanguage; | 212 | Clipperz.PM.Strings.selectedLanguage = selectedLanguage; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js index 446e96c..7f6c52f 100644 --- a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js +++ b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js | |||
@@ -1,216 +1,213 @@ | |||
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.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } | 28 | if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } |
32 | 29 | ||
33 | Clipperz.PM.Strings.messagePanelConfigurations = { | 30 | Clipperz.PM.Strings.messagePanelConfigurations = { |
34 | 31 | ||
35 | 32 | ||
36 | //------------------------------------------------------------------------- | 33 | //------------------------------------------------------------------------- |
37 | // | 34 | // |
38 | // Registration - connection | 35 | // Registration - connection |
39 | // | 36 | // |
40 | 'registration_verify': function() { | 37 | 'registration_verify': function() { |
41 | return { | 38 | return { |
42 | 'title': null, | 39 | 'title': null, |
43 | 'text': Clipperz.PM.Strings['connectionRegistrationSendingRequestMessageText'] | 40 | 'text': Clipperz.PM.Strings['connectionRegistrationSendingRequestMessageText'] |
44 | } | 41 | } |
45 | }, | 42 | }, |
46 | 43 | ||
47 | 'registration_sendingCredentials': function() { | 44 | 'registration_sendingCredentials': function() { |
48 | return { | 45 | return { |
49 | 'title': null, | 46 | 'title': null, |
50 | 'text': Clipperz.PM.Strings['connectionRegistrationSendingCredentialsMessageText'] | 47 | 'text': Clipperz.PM.Strings['connectionRegistrationSendingCredentialsMessageText'] |
51 | } | 48 | } |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | // | 52 | // |
56 | // One Time Password login message panel | 53 | // One Time Password login message panel |
57 | // | 54 | // |
58 | 55 | ||
59 | 'OTP_login_start': function() { | 56 | 'OTP_login_start': function() { |
60 | return { | 57 | return { |
61 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelInitialTitle'], | 58 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelInitialTitle'], |
62 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelInitialText'], | 59 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelInitialText'], |
63 | 'steps': '+3', | 60 | 'steps': '+3', |
64 | 'buttons': {} | 61 | 'buttons': {} |
65 | } | 62 | } |
66 | }, | 63 | }, |
67 | 64 | ||
68 | 'OTP_login_loadingOTP': function() { | 65 | 'OTP_login_loadingOTP': function() { |
69 | return { | 66 | return { |
70 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelLoadingTitle'], | 67 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelLoadingTitle'], |
71 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelLoadingText'] | 68 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelLoadingText'] |
72 | } | 69 | } |
73 | }, | 70 | }, |
74 | 71 | ||
75 | 'OTP_login_extractingPassphrase': function() { | 72 | 'OTP_login_extractingPassphrase': function() { |
76 | return { | 73 | return { |
77 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelProcessingTitle'], | 74 | 'title': Clipperz.PM.Strings['OTPloginMessagePanelProcessingTitle'], |
78 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelProcessingText'] | 75 | 'text': Clipperz.PM.Strings['OTPloginMessagePanelProcessingText'] |
79 | } | 76 | } |
80 | }, | 77 | }, |
81 | 78 | ||
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | // | 81 | // |
85 | // Login message panel | 82 | // Login message panel |
86 | // | 83 | // |
87 | 'login_start': function() { | 84 | 'login_start': function() { |
88 | return { | 85 | return { |
89 | 'title': Clipperz.PM.Strings['loginMessagePanelInitialTitle'], | 86 | 'title': Clipperz.PM.Strings['loginMessagePanelInitialTitle'], |
90 | 'text': Clipperz.PM.Strings['loginMessagePanelInitialText'], | 87 | 'text': Clipperz.PM.Strings['loginMessagePanelInitialText'], |
91 | 'steps': '+7', | 88 | 'steps': '+7', |
92 | 'buttons': { | 89 | 'buttons': { |
93 | 'ok': Clipperz.PM.Strings['loginMessagePanelInitialButtonLabel'] | 90 | 'ok': Clipperz.PM.Strings['loginMessagePanelInitialButtonLabel'] |
94 | } | 91 | } |
95 | } | 92 | } |
96 | }, | 93 | }, |
97 | 94 | ||
98 | 'login_connected': function() { | 95 | 'login_connected': function() { |
99 | return { | 96 | return { |
100 | 'title': Clipperz.PM.Strings['loginMessagePanelConnectedTitle'], | 97 | 'title': Clipperz.PM.Strings['loginMessagePanelConnectedTitle'], |
101 | 'text': Clipperz.PM.Strings['loginMessagePanelConnectedText'], | 98 | 'text': Clipperz.PM.Strings['loginMessagePanelConnectedText'], |
102 | 'buttons': {} | 99 | 'buttons': {} |
103 | } | 100 | } |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'login_failed':function() { | 103 | 'login_failed':function() { |
107 | return { | 104 | return { |
108 | 'title': Clipperz.PM.Strings['loginMessagePanelFailureTitle'], | 105 | 'title': Clipperz.PM.Strings['loginMessagePanelFailureTitle'], |
109 | 'text': Clipperz.PM.Strings['loginMessagePanelFailureText'], | 106 | 'text': Clipperz.PM.Strings['loginMessagePanelFailureText'], |
110 | 'button': Clipperz.PM.Strings['loginMessagePanelFailureButtonLabel'] | 107 | 'button': Clipperz.PM.Strings['loginMessagePanelFailureButtonLabel'] |
111 | } | 108 | } |
112 | }, | 109 | }, |
113 | 110 | ||
114 | //------------------------------------------------------------------------- | 111 | //------------------------------------------------------------------------- |
115 | // | 112 | // |
116 | // Login message panel - connection | 113 | // Login message panel - connection |
117 | // | 114 | // |
118 | 'connection_sendingCredentials': function() { | 115 | 'connection_sendingCredentials': function() { |
119 | return { | 116 | return { |
120 | 'title': Clipperz.PM.Strings['connectionLoginSendingCredentialsMessageTitle'], | 117 | 'title': Clipperz.PM.Strings['connectionLoginSendingCredentialsMessageTitle'], |
121 | 'text': Clipperz.PM.Strings['connectionLoginSendingCredentialsMessageText'] | 118 | 'text': Clipperz.PM.Strings['connectionLoginSendingCredentialsMessageText'] |
122 | } | 119 | } |
123 | }, | 120 | }, |
124 | 121 | ||
125 | 'connection_credentialVerification': function() { | 122 | 'connection_credentialVerification': function() { |
126 | return { | 123 | return { |
127 | 'title': Clipperz.PM.Strings['connectionLoginCredentialsVerificationMessageTitle'], | 124 | 'title': Clipperz.PM.Strings['connectionLoginCredentialsVerificationMessageTitle'], |
128 | 'text': Clipperz.PM.Strings['connectionLoginCredentialsVerificationMessageText'] | 125 | 'text': Clipperz.PM.Strings['connectionLoginCredentialsVerificationMessageText'] |
129 | } | 126 | } |
130 | }, | 127 | }, |
131 | 128 | ||
132 | 'connection_loggedIn': function() { | 129 | 'connection_loggedIn': function() { |
133 | return { | 130 | return { |
134 | 'title': Clipperz.PM.Strings['connectionLoginDoneMessageTitle'], | 131 | 'title': Clipperz.PM.Strings['connectionLoginDoneMessageTitle'], |
135 | 'text': Clipperz.PM.Strings['connectionLoginDoneMessageText'] | 132 | 'text': Clipperz.PM.Strings['connectionLoginDoneMessageText'] |
136 | } | 133 | } |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //------------------------------------------------------------------------- | 136 | //------------------------------------------------------------------------- |
140 | // | 137 | // |
141 | //Login message panel - user | 138 | //Login message panel - user |
142 | // | 139 | // |
143 | 'connection_upgrading': function() { | 140 | 'connection_upgrading': function() { |
144 | return { | 141 | return { |
145 | 'title': Clipperz.PM.Strings['userLoginPanelUpgradingUserCredentialsMessageTitle'], | 142 | 'title': Clipperz.PM.Strings['userLoginPanelUpgradingUserCredentialsMessageTitle'], |
146 | 'text': Clipperz.PM.Strings['userLoginPanelUpgradingUserCredentialsMessageText'], | 143 | 'text': Clipperz.PM.Strings['userLoginPanelUpgradingUserCredentialsMessageText'], |
147 | 'steps': '+1' | 144 | 'steps': '+1' |
148 | } | 145 | } |
149 | }, | 146 | }, |
150 | 147 | ||
151 | 'connection_done': function() { | 148 | 'connection_done': function() { |
152 | return { | 149 | return { |
153 | 'title': Clipperz.PM.Strings['userLoginPanelConnectedMessageTitle'], | 150 | 'title': Clipperz.PM.Strings['userLoginPanelConnectedMessageTitle'], |
154 | 'text': Clipperz.PM.Strings['userLoginPanelConnectedMessageText'] | 151 | 'text': Clipperz.PM.Strings['userLoginPanelConnectedMessageText'] |
155 | } | 152 | } |
156 | }, | 153 | }, |
157 | 154 | ||
158 | 'connection_tryOlderSchema': function() { | 155 | 'connection_tryOlderSchema': function() { |
159 | return { | 156 | return { |
160 | 'title': Clipperz.PM.Strings['userLoginPanelTryingAnOlderConnectionSchemaMessageTitle'], | 157 | 'title': Clipperz.PM.Strings['userLoginPanelTryingAnOlderConnectionSchemaMessageTitle'], |
161 | 'text': Clipperz.PM.Strings['userLoginPanelTryingAnOlderConnectionSchemaMessageText'], | 158 | 'text': Clipperz.PM.Strings['userLoginPanelTryingAnOlderConnectionSchemaMessageText'], |
162 | 'steps': '+4' | 159 | 'steps': '+4' |
163 | } | 160 | } |
164 | }, | 161 | }, |
165 | 162 | ||
166 | 'connection_loadingUserData': function() { | 163 | 'connection_loadingUserData': function() { |
167 | return { | 164 | return { |
168 | 'title': Clipperz.PM.Strings['userLoginPanelLoadingUserDataMessageTitle'], | 165 | 'title': Clipperz.PM.Strings['userLoginPanelLoadingUserDataMessageTitle'], |
169 | 'text': Clipperz.PM.Strings['userLoginPanelLoadingUserDataMessageText'] | 166 | 'text': Clipperz.PM.Strings['userLoginPanelLoadingUserDataMessageText'] |
170 | } | 167 | } |
171 | }, | 168 | }, |
172 | 169 | ||
173 | 'connection_decryptingUserData': function() { | 170 | 'connection_decryptingUserData': function() { |
174 | return { | 171 | return { |
175 | 'title': Clipperz.PM.Strings['userLoginPanelDecryptingUserDataMessageTitle'], | 172 | 'title': Clipperz.PM.Strings['userLoginPanelDecryptingUserDataMessageTitle'], |
176 | 'text': Clipperz.PM.Strings['userLoginPanelDecryptingUserDataMessageText'], | 173 | 'text': Clipperz.PM.Strings['userLoginPanelDecryptingUserDataMessageText'], |
177 | 'steps': '+1' | 174 | 'steps': '+1' |
178 | } | 175 | } |
179 | }, | 176 | }, |
180 | 177 | ||
181 | 'connection_decryptingUserStatistics': function() { | 178 | 'connection_decryptingUserStatistics': function() { |
182 | return { | 179 | return { |
183 | 'title': Clipperz.PM.Strings['userLoginPanelDecryptingUserStatisticsMessageTitle'], | 180 | 'title': Clipperz.PM.Strings['userLoginPanelDecryptingUserStatisticsMessageTitle'], |
184 | 'text': Clipperz.PM.Strings['userLoginPanelDecryptingUserStatisticsMessageText'] | 181 | 'text': Clipperz.PM.Strings['userLoginPanelDecryptingUserStatisticsMessageText'] |
185 | } | 182 | } |
186 | }, | 183 | }, |
187 | 184 | ||
188 | 'collectingEntropy': function() { | 185 | 'collectingEntropy': function() { |
189 | return { | 186 | return { |
190 | 'text': Clipperz.PM.Strings['panelCollectingEntryopyMessageText'], | 187 | 'text': Clipperz.PM.Strings['panelCollectingEntryopyMessageText'], |
191 | 'steps': '+1' | 188 | 'steps': '+1' |
192 | } | 189 | } |
193 | }, | 190 | }, |
194 | 191 | ||
195 | //------------------------------------------------------------------------- | 192 | //------------------------------------------------------------------------- |
196 | // | 193 | // |
197 | // Cards block - delete card panel | 194 | // Cards block - delete card panel |
198 | // | 195 | // |
199 | 'deleteRecord_collectData': function() { | 196 | 'deleteRecord_collectData': function() { |
200 | return { | 197 | return { |
201 | 'title': Clipperz.PM.Strings['deleteRecordPanelCollectRecordDataMessageTitle'], | 198 | 'title': Clipperz.PM.Strings['deleteRecordPanelCollectRecordDataMessageTitle'], |
202 | 'text': Clipperz.PM.Strings['deleteRecordPanelCollectRecordDataMessageText'] | 199 | 'text': Clipperz.PM.Strings['deleteRecordPanelCollectRecordDataMessageText'] |
203 | } | 200 | } |
204 | }, | 201 | }, |
205 | 202 | ||
206 | 'deleteRecord_encryptData': function() { | 203 | 'deleteRecord_encryptData': function() { |
207 | return { | 204 | return { |
208 | 'title': Clipperz.PM.Strings['deleteRecordPanelEncryptUserDataMessageTitle'], | 205 | 'title': Clipperz.PM.Strings['deleteRecordPanelEncryptUserDataMessageTitle'], |
209 | 'text': Clipperz.PM.Strings['deleteRecordPanelEncryptUserDataMessageText'] | 206 | 'text': Clipperz.PM.Strings['deleteRecordPanelEncryptUserDataMessageText'] |
210 | } | 207 | } |
211 | }, | 208 | }, |
212 | 209 | ||
213 | 'deleteRecord_sendingData': function() { | 210 | 'deleteRecord_sendingData': function() { |
214 | return { | 211 | return { |
215 | 'title': Clipperz.PM.Strings['deleteRecordPanelSendingDataToTheServerMessageTitle'], | 212 | 'title': Clipperz.PM.Strings['deleteRecordPanelSendingDataToTheServerMessageTitle'], |
216 | 'text': Clipperz.PM.Strings['deleteRecordPanelSendingDataToTheServerMessageText'] | 213 | 'text': Clipperz.PM.Strings['deleteRecordPanelSendingDataToTheServerMessageText'] |
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js index 1ad2696..101ed3f 100644 --- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js +++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js | |||
@@ -1,216 +1,213 @@ | |||
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.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } | 28 | if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } |
32 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } | 29 | if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } |
33 | 30 | ||
34 | //============================================================================= | 31 | //============================================================================= |
35 | // | 32 | // |
36 | // D E F A U L T S ( defaults ) | 33 | // D E F A U L T S ( defaults ) |
37 | // | 34 | // |
38 | //============================================================================= | 35 | //============================================================================= |
39 | 36 | ||
40 | Clipperz.PM.Strings.Languages['defaults'] = { | 37 | Clipperz.PM.Strings.Languages['defaults'] = { |
41 | 38 | ||
42 | 'elapsedTimeDescriptions': { | 39 | 'elapsedTimeDescriptions': { |
43 | 'MORE_THAN_A_MONTH_AGO': "more than a month ago", | 40 | 'MORE_THAN_A_MONTH_AGO': "more than a month ago", |
44 | 'MORE_THAN_A_WEEK_AGO': "more than a week ago", | 41 | 'MORE_THAN_A_WEEK_AGO': "more than a week ago", |
45 | 'MORE_THAN_*_WEEKS_AGO': "more than __elapsed__ weeks ago", | 42 | 'MORE_THAN_*_WEEKS_AGO': "more than __elapsed__ weeks ago", |
46 | 'YESTERDAY': "yesterday", | 43 | 'YESTERDAY': "yesterday", |
47 | '*_DAYS_AGO': "__elapsed__ days ago", | 44 | '*_DAYS_AGO': "__elapsed__ days ago", |
48 | 'ABOUT_AN_HOUR_AGO': "about an hour ago", | 45 | 'ABOUT_AN_HOUR_AGO': "about an hour ago", |
49 | '*_HOURS_AGO': "__elapsed__ hours ago", | 46 | '*_HOURS_AGO': "__elapsed__ hours ago", |
50 | 'JUST_A_FEW_MINUTES_AGO': "just a few minutes ago", | 47 | 'JUST_A_FEW_MINUTES_AGO': "just a few minutes ago", |
51 | 'ABOUT_*_MINUTES_AGO': "about __elapsed__ minutes ago" | 48 | 'ABOUT_*_MINUTES_AGO': "about __elapsed__ minutes ago" |
52 | }, | 49 | }, |
53 | /* | 50 | /* |
54 | 'unknown_ip': "unknown", | 51 | 'unknown_ip': "unknown", |
55 | 52 | ||
56 | 'countries': { | 53 | 'countries': { |
57 | '--': "unknown", | 54 | '--': "unknown", |
58 | 'AD': "Andorra", | 55 | 'AD': "Andorra", |
59 | 'AE': "United Arab Emirates", | 56 | 'AE': "United Arab Emirates", |
60 | 'AF': "Afghanistan", | 57 | 'AF': "Afghanistan", |
61 | 'AG': "Antigua and Barbuda", | 58 | 'AG': "Antigua and Barbuda", |
62 | 'AI': "Anguilla", | 59 | 'AI': "Anguilla", |
63 | 'AL': "Albania", | 60 | 'AL': "Albania", |
64 | 'AM': "Armenia", | 61 | 'AM': "Armenia", |
65 | 'AN': "Netherlands Antilles", | 62 | 'AN': "Netherlands Antilles", |
66 | 'AO': "Angola", | 63 | 'AO': "Angola", |
67 | 'AP': "Non-Spec Asia Pas Location", | 64 | 'AP': "Non-Spec Asia Pas Location", |
68 | 'AR': "Argentina", | 65 | 'AR': "Argentina", |
69 | 'AS': "American Samoa", | 66 | 'AS': "American Samoa", |
70 | 'AT': "Austria", | 67 | 'AT': "Austria", |
71 | 'AU': "Australia", | 68 | 'AU': "Australia", |
72 | 'AW': "Aruba", | 69 | 'AW': "Aruba", |
73 | 'AX': "Aland Islands", | 70 | 'AX': "Aland Islands", |
74 | 'AZ': "Azerbaijan", | 71 | 'AZ': "Azerbaijan", |
75 | 'BA': "Bosnia and Herzegowina", | 72 | 'BA': "Bosnia and Herzegowina", |
76 | 'BB': "Barbados", | 73 | 'BB': "Barbados", |
77 | 'BD': "Bangladesh", | 74 | 'BD': "Bangladesh", |
78 | 'BE': "Belgium", | 75 | 'BE': "Belgium", |
79 | 'BF': "Burkina Faso", | 76 | 'BF': "Burkina Faso", |
80 | 'BG': "Bulgaria", | 77 | 'BG': "Bulgaria", |
81 | 'BH': "Bahrain", | 78 | 'BH': "Bahrain", |
82 | 'BI': "Burundi", | 79 | 'BI': "Burundi", |
83 | 'BJ': "Benin", | 80 | 'BJ': "Benin", |
84 | 'BM': "Bermuda", | 81 | 'BM': "Bermuda", |
85 | 'BN': "Brunei Darussalam", | 82 | 'BN': "Brunei Darussalam", |
86 | 'BO': "Bolivia", | 83 | 'BO': "Bolivia", |
87 | 'BR': "Brazil", | 84 | 'BR': "Brazil", |
88 | 'BS': "Bahamas", | 85 | 'BS': "Bahamas", |
89 | 'BT': "Bhutan", | 86 | 'BT': "Bhutan", |
90 | 'BW': "Botswana", | 87 | 'BW': "Botswana", |
91 | 'BY': "Belarus", | 88 | 'BY': "Belarus", |
92 | 'BZ': "Belize", | 89 | 'BZ': "Belize", |
93 | 'CA': "Canada", | 90 | 'CA': "Canada", |
94 | 'CD': "Congo the Democratic Republic of the", | 91 | 'CD': "Congo the Democratic Republic of the", |
95 | 'CF': "Central African Republic", | 92 | 'CF': "Central African Republic", |
96 | 'CH': "Switzerland", | 93 | 'CH': "Switzerland", |
97 | 'CI': "Cote D'ivoire", | 94 | 'CI': "Cote D'ivoire", |
98 | 'CK': "Cook Islands", | 95 | 'CK': "Cook Islands", |
99 | 'CL': "Chile", | 96 | 'CL': "Chile", |
100 | 'CM': "Cameroon", | 97 | 'CM': "Cameroon", |
101 | 'CN': "China", | 98 | 'CN': "China", |
102 | 'CO': "Colombia", | 99 | 'CO': "Colombia", |
103 | 'CR': "Costa Rica", | 100 | 'CR': "Costa Rica", |
104 | 'CS': "Serbia and Montenegro", | 101 | 'CS': "Serbia and Montenegro", |
105 | 'CU': "Cuba", | 102 | 'CU': "Cuba", |
106 | 'CY': "Cyprus", | 103 | 'CY': "Cyprus", |
107 | 'CZ': "Czech Republic", | 104 | 'CZ': "Czech Republic", |
108 | 'DE': "Germany", | 105 | 'DE': "Germany", |
109 | 'DJ': "Djibouti", | 106 | 'DJ': "Djibouti", |
110 | 'DK': "Denmark", | 107 | 'DK': "Denmark", |
111 | 'DO': "Dominican Republic", | 108 | 'DO': "Dominican Republic", |
112 | 'DZ': "Algeria", | 109 | 'DZ': "Algeria", |
113 | 'EC': "Ecuador", | 110 | 'EC': "Ecuador", |
114 | 'EE': "Estonia", | 111 | 'EE': "Estonia", |
115 | 'EG': "Egypt", | 112 | 'EG': "Egypt", |
116 | 'ER': "Eritrea", | 113 | 'ER': "Eritrea", |
117 | 'ES': "Spain", | 114 | 'ES': "Spain", |
118 | 'ET': "Ethiopia", | 115 | 'ET': "Ethiopia", |
119 | 'EU': "European Union", | 116 | 'EU': "European Union", |
120 | 'FI': "Finland", | 117 | 'FI': "Finland", |
121 | 'FJ': "Fiji", | 118 | 'FJ': "Fiji", |
122 | 'FM': "Micronesia Federated States of", | 119 | 'FM': "Micronesia Federated States of", |
123 | 'FO': "Faroe Islands", | 120 | 'FO': "Faroe Islands", |
124 | 'FR': "France", | 121 | 'FR': "France", |
125 | 'GA': "Gabon", | 122 | 'GA': "Gabon", |
126 | 'GB': "United Kingdom", | 123 | 'GB': "United Kingdom", |
127 | 'GD': "Grenada", | 124 | 'GD': "Grenada", |
128 | 'GE': "Georgia", | 125 | 'GE': "Georgia", |
129 | 'GF': "French Guiana", | 126 | 'GF': "French Guiana", |
130 | 'GG': "Guernsey", | 127 | 'GG': "Guernsey", |
131 | 'GH': "Ghana", | 128 | 'GH': "Ghana", |
132 | 'GI': "Gibraltar", | 129 | 'GI': "Gibraltar", |
133 | 'GL': "Greenland", | 130 | 'GL': "Greenland", |
134 | 'GM': "Gambia", | 131 | 'GM': "Gambia", |
135 | 'GP': "Guadeloupe", | 132 | 'GP': "Guadeloupe", |
136 | 'GR': "Greece", | 133 | 'GR': "Greece", |
137 | 'GT': "Guatemala", | 134 | 'GT': "Guatemala", |
138 | 'GU': "Guam", | 135 | 'GU': "Guam", |
139 | 'GW': "Guinea-Bissau", | 136 | 'GW': "Guinea-Bissau", |
140 | 'GY': "Guyana", | 137 | 'GY': "Guyana", |
141 | 'HK': "Hong Kong", | 138 | 'HK': "Hong Kong", |
142 | 'HN': "Honduras", | 139 | 'HN': "Honduras", |
143 | 'HR': "Croatia (Local Name: Hrvatska)", | 140 | 'HR': "Croatia (Local Name: Hrvatska)", |
144 | 'HT': "Haiti", | 141 | 'HT': "Haiti", |
145 | 'HU': "Hungary", | 142 | 'HU': "Hungary", |
146 | 'ID': "Indonesia", | 143 | 'ID': "Indonesia", |
147 | 'IE': "Ireland", | 144 | 'IE': "Ireland", |
148 | 'IL': "Israel", | 145 | 'IL': "Israel", |
149 | 'IM': "Isle of Man", | 146 | 'IM': "Isle of Man", |
150 | 'IN': "India", | 147 | 'IN': "India", |
151 | 'IO': "British Indian Ocean Territory", | 148 | 'IO': "British Indian Ocean Territory", |
152 | 'IQ': "Iraq", | 149 | 'IQ': "Iraq", |
153 | 'IR': "Iran (Islamic Republic of)", | 150 | 'IR': "Iran (Islamic Republic of)", |
154 | 'IS': "Iceland", | 151 | 'IS': "Iceland", |
155 | 'IT': "Italy", | 152 | 'IT': "Italy", |
156 | 'JE': "Jersey", | 153 | 'JE': "Jersey", |
157 | 'JM': "Jamaica", | 154 | 'JM': "Jamaica", |
158 | 'JO': "Jordan", | 155 | 'JO': "Jordan", |
159 | 'JP': "Japan", | 156 | 'JP': "Japan", |
160 | 'KE': "Kenya", | 157 | 'KE': "Kenya", |
161 | 'KG': "Kyrgyzstan", | 158 | 'KG': "Kyrgyzstan", |
162 | 'KH': "Cambodia", | 159 | 'KH': "Cambodia", |
163 | 'KI': "Kiribati", | 160 | 'KI': "Kiribati", |
164 | 'KN': "Saint Kitts and Nevis", | 161 | 'KN': "Saint Kitts and Nevis", |
165 | 'KR': "Korea Republic of", | 162 | 'KR': "Korea Republic of", |
166 | 'KW': "Kuwait", | 163 | 'KW': "Kuwait", |
167 | 'KY': "Cayman Islands", | 164 | 'KY': "Cayman Islands", |
168 | 'KZ': "Kazakhstan", | 165 | 'KZ': "Kazakhstan", |
169 | 'LA': "Lao People's Democratic Republic", | 166 | 'LA': "Lao People's Democratic Republic", |
170 | 'LB': "Lebanon", | 167 | 'LB': "Lebanon", |
171 | 'LC': "Saint Lucia", | 168 | 'LC': "Saint Lucia", |
172 | 'LI': "Liechtenstein", | 169 | 'LI': "Liechtenstein", |
173 | 'LK': "Sri Lanka", | 170 | 'LK': "Sri Lanka", |
174 | 'LR': "Liberia", | 171 | 'LR': "Liberia", |
175 | 'LS': "Lesotho", | 172 | 'LS': "Lesotho", |
176 | 'LT': "Lithuania", | 173 | 'LT': "Lithuania", |
177 | 'LU': "Luxembourg", | 174 | 'LU': "Luxembourg", |
178 | 'LV': "Latvia", | 175 | 'LV': "Latvia", |
179 | 'LY': "Libyan Arab Jamahiriya", | 176 | 'LY': "Libyan Arab Jamahiriya", |
180 | 'MA': "Morocco", | 177 | 'MA': "Morocco", |
181 | 'MC': "Monaco", | 178 | 'MC': "Monaco", |
182 | 'MD': "Moldova Republic of", | 179 | 'MD': "Moldova Republic of", |
183 | 'MG': "Madagascar", | 180 | 'MG': "Madagascar", |
184 | 'MH': "Marshall Islands", | 181 | 'MH': "Marshall Islands", |
185 | 'MK': "Macedonia the Former Yugoslav Republic of", | 182 | 'MK': "Macedonia the Former Yugoslav Republic of", |
186 | 'ML': "Mali", | 183 | 'ML': "Mali", |
187 | 'MM': "Myanmar", | 184 | 'MM': "Myanmar", |
188 | 'MN': "Mongolia", | 185 | 'MN': "Mongolia", |
189 | 'MO': "Macau", | 186 | 'MO': "Macau", |
190 | 'MP': "Northern Mariana Islands", | 187 | 'MP': "Northern Mariana Islands", |
191 | 'MR': "Mauritania", | 188 | 'MR': "Mauritania", |
192 | 'MS': "Montserrat", | 189 | 'MS': "Montserrat", |
193 | 'MT': "Malta", | 190 | 'MT': "Malta", |
194 | 'MU': "Mauritius", | 191 | 'MU': "Mauritius", |
195 | 'MV': "Maldives", | 192 | 'MV': "Maldives", |
196 | 'MW': "Malawi", | 193 | 'MW': "Malawi", |
197 | 'MX': "Mexico", | 194 | 'MX': "Mexico", |
198 | 'MY': "Malaysia", | 195 | 'MY': "Malaysia", |
199 | 'MZ': "Mozambique", | 196 | 'MZ': "Mozambique", |
200 | 'NA': "Namibia", | 197 | 'NA': "Namibia", |
201 | 'NC': "New Caledonia", | 198 | 'NC': "New Caledonia", |
202 | 'NF': "Norfolk Island", | 199 | 'NF': "Norfolk Island", |
203 | 'NG': "Nigeria", | 200 | 'NG': "Nigeria", |
204 | 'NI': "Nicaragua", | 201 | 'NI': "Nicaragua", |
205 | 'NL': "Netherlands", | 202 | 'NL': "Netherlands", |
206 | 'NO': "Norway", | 203 | 'NO': "Norway", |
207 | 'NP': "Nepal", | 204 | 'NP': "Nepal", |
208 | 'NR': "Nauru", | 205 | 'NR': "Nauru", |
209 | 'NU': "Niue", | 206 | 'NU': "Niue", |
210 | 'NZ': "New Zealand", | 207 | 'NZ': "New Zealand", |
211 | 'OM': "Oman", | 208 | 'OM': "Oman", |
212 | 'PA': "Panama", | 209 | 'PA': "Panama", |
213 | 'PE': "Peru", | 210 | 'PE': "Peru", |
214 | 'PF': "French Polynesia", | 211 | 'PF': "French Polynesia", |
215 | 'PG': "Papua New Guinea", | 212 | 'PG': "Papua New Guinea", |
216 | 'PH': "Philippines", | 213 | 'PH': "Philippines", |
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js b/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js index eebdb16..b540633 100644 --- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js +++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js | |||
@@ -1,216 +1,213 @@ | |||
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 | //============================================================================= | 26 | //============================================================================= |
30 | // | 27 | // |
31 | // E N G L I S H A M E R I C A N ( en_US ) | 28 | // E N G L I S H A M E R I C A N ( en_US ) |
32 | // | 29 | // |
33 | //============================================================================= | 30 | //============================================================================= |
34 | 31 | ||
35 | Clipperz.PM.Strings.Languages['en-us'] = { | 32 | Clipperz.PM.Strings.Languages['en-us'] = { |
36 | /* | 33 | /* |
37 | //Login page - description | 34 | //Login page - description |
38 | 'clipperzServiceDescription': "\ | 35 | 'clipperzServiceDescription': "\ |
39 | <!-- FIX CSS DONE -->\ | 36 | <!-- FIX CSS DONE -->\ |
40 | <h2>Keep it to yourself!</h2>\ | 37 | <h2>Keep it to yourself!</h2>\ |
41 | <ul>\ | 38 | <ul>\ |
42 | <li>\ | 39 | <li>\ |
43 | <h3>Clipperz is:</h3>\ | 40 | <h3>Clipperz is:</h3>\ |
44 | <ul>\ | 41 | <ul>\ |
45 | <li><p>a secure and simple password manager</p></li>\ | 42 | <li><p>a secure and simple password manager</p></li>\ |
46 | <li><p>an effective single sign-on solution</p></li>\ | 43 | <li><p>an effective single sign-on solution</p></li>\ |
47 | <li><p>a digital vault for your personal data</p></li>\ | 44 | <li><p>a digital vault for your personal data</p></li>\ |
48 | </ul>\ | 45 | </ul>\ |
49 | </li>\ | 46 | </li>\ |
50 | <li>\ | 47 | <li>\ |
51 | <h3>With Clipperz you can:</h3>\ | 48 | <h3>With Clipperz you can:</h3>\ |
52 | <ul>\ | 49 | <ul>\ |
53 | <li><p>store and manage your passwords and online credentials</p></li>\ | 50 | <li><p>store and manage your passwords and online credentials</p></li>\ |
54 | <li><p>login to your web services without entering any username or password</p></li>\ | 51 | <li><p>login to your web services without entering any username or password</p></li>\ |
55 | <li><p>protect all your sensitive data: codes for burglar alarms, PINs, credit card numbers, …</p></li>\ | 52 | <li><p>protect all your sensitive data: codes for burglar alarms, PINs, credit card numbers, …</p></li>\ |
56 | <li><p>share secrets with family members and associates (coming soon)</p></li>\ | 53 | <li><p>share secrets with family members and associates (coming soon)</p></li>\ |
57 | </ul>\ | 54 | </ul>\ |
58 | </li>\ | 55 | </li>\ |
59 | <li>\ | 56 | <li>\ |
60 | <h3>Clipperz benefits:</h3>\ | 57 | <h3>Clipperz benefits:</h3>\ |
61 | <ul>\ | 58 | <ul>\ |
62 | <li><p>free and completely anonymous</p></li>\ | 59 | <li><p>free and completely anonymous</p></li>\ |
63 | <li><p>access it any time from any computer</p></li>\ | 60 | <li><p>access it any time from any computer</p></li>\ |
64 | <li><p>no software to download and nothing to install</p></li>\ | 61 | <li><p>no software to download and nothing to install</p></li>\ |
65 | <li><p>avoid keeping secrets on your PC or on paper</p></li>\ | 62 | <li><p>avoid keeping secrets on your PC or on paper</p></li>\ |
66 | </ul>\ | 63 | </ul>\ |
67 | </li>\ | 64 | </li>\ |
68 | <li>\ | 65 | <li>\ |
69 | <h3>Clipperz security:</h3>\ | 66 | <h3>Clipperz security:</h3>\ |
70 | <ul>\ | 67 | <ul>\ |
71 | <li><p>your secrets are locally encrypted by your browser before being uploaded to Clipperz</p></li>\ | 68 | <li><p>your secrets are locally encrypted by your browser before being uploaded to Clipperz</p></li>\ |
72 | <li><p>the encryption key is a passphrase known only to you</p></li>\ | 69 | <li><p>the encryption key is a passphrase known only to you</p></li>\ |
73 | <li><p>Clipperz hosts your sensitive data in encrypted form and could never actually access the data in its plain form</p></li>\ | 70 | <li><p>Clipperz hosts your sensitive data in encrypted form and could never actually access the data in its plain form</p></li>\ |
74 | <li><p>Clipperz is built upon standard encryption schemes, nothing fancies or homemade</p></li>\ | 71 | <li><p>Clipperz is built upon standard encryption schemes, nothing fancies or homemade</p></li>\ |
75 | <li><p>you can review the source code anytime you like, but you need to know nothing about cryptography to be an happy user!</p></li>\ | 72 | <li><p>you can review the source code anytime you like, but you need to know nothing about cryptography to be an happy user!</p></li>\ |
76 | </ul>\ | 73 | </ul>\ |
77 | </li>\ | 74 | </li>\ |
78 | <li>\ | 75 | <li>\ |
79 | <a href=\"http://www.clipperz.com\" target=\"_blank\">Learn more</a>\ | 76 | <a href=\"http://www.clipperz.com\" target=\"_blank\">Learn more</a>\ |
80 | </li>\ | 77 | </li>\ |
81 | </ul>", | 78 | </ul>", |
82 | 79 | ||
83 | 80 | ||
84 | 'loginFormTitle': "login with your Clipperz account", | 81 | 'loginFormTitle': "login with your Clipperz account", |
85 | 'loginFormUsernameLabel': "username", | 82 | 'loginFormUsernameLabel': "username", |
86 | 'loginFormPassphraseLabel': "passphrase", | 83 | 'loginFormPassphraseLabel': "passphrase", |
87 | 'loginFormDontHaveAnAccountLabel': "don\'t have an account?", | 84 | 'loginFormDontHaveAnAccountLabel': "don\'t have an account?", |
88 | 'loginFormCreateOneLabel': "create one", | 85 | 'loginFormCreateOneLabel': "create one", |
89 | 'loginFormForgotYourCredentialsLabel': "forgot your credentials?", | 86 | 'loginFormForgotYourCredentialsLabel': "forgot your credentials?", |
90 | 'loginFormAarghThatsBadLabel': "aargh! that\'s bad!", | 87 | 'loginFormAarghThatsBadLabel': "aargh! that\'s bad!", |
91 | 'loginFormAfraidOfMaliciousScriptsLabel': "afraid of malicious scripts?", | 88 | 'loginFormAfraidOfMaliciousScriptsLabel': "afraid of malicious scripts?", |
92 | 'loginFormVerifyTheCodeLabel': "verify the code", | 89 | 'loginFormVerifyTheCodeLabel': "verify the code", |
93 | 'loginFormButtonLabel': "Login", | 90 | 'loginFormButtonLabel': "Login", |
94 | 'loginFormOneTimePasswordCheckboxLabel': "use a one-time passphrase", | 91 | 'loginFormOneTimePasswordCheckboxLabel': "use a one-time passphrase", |
95 | 'loginFormOneTimePasswordCheckboxDescription': "", | 92 | 'loginFormOneTimePasswordCheckboxDescription': "", |
96 | 93 | ||
97 | // Login page - language selection | 94 | // Login page - language selection |
98 | 'loginPanelSwithLanguageDescription': "<h5>Switch to your preferred language</h5>", | 95 | 'loginPanelSwithLanguageDescription': "<h5>Switch to your preferred language</h5>", |
99 | 96 | ||
100 | // Login page - browser compatibility | 97 | // Login page - browser compatibility |
101 | 'browserCompatibilityDescription': "<p>Have a better and safer Clipperz experience with Firefox. However Clipperz works just fine also with Opera, Safari and MS Internet Explorer!</p>", | 98 | 'browserCompatibilityDescription': "<p>Have a better and safer Clipperz experience with Firefox. However Clipperz works just fine also with Opera, Safari and MS Internet Explorer!</p>", |
102 | 99 | ||
103 | // Login with OTP - message panel | 100 | // Login with OTP - message panel |
104 | 'OTPloginMessagePanelInitialTitle': "Logging in using a one-time passphrase", | 101 | 'OTPloginMessagePanelInitialTitle': "Logging in using a one-time passphrase", |
105 | 'OTPloginMessagePanelInitialText': "Sending OTP credentials …", | 102 | 'OTPloginMessagePanelInitialText': "Sending OTP credentials …", |
106 | 'OTPloginMessagePanelLoadingTitle': "Logging in using a one-time passphrase", | 103 | 'OTPloginMessagePanelLoadingTitle': "Logging in using a one-time passphrase", |
107 | 'OTPloginMessagePanelLoadingText': "Fetching encrypted authentication data from the server …", | 104 | 'OTPloginMessagePanelLoadingText': "Fetching encrypted authentication data from the server …", |
108 | 'OTPloginMessagePanelProcessingTitle': "Logging in using a one-time passphrase", | 105 | 'OTPloginMessagePanelProcessingTitle': "Logging in using a one-time passphrase", |
109 | 'OTPloginMessagePanelProcessingText': "Local decryption of authentication data", | 106 | 'OTPloginMessagePanelProcessingText': "Local decryption of authentication data", |
110 | 107 | ||
111 | // Regular login - message panel | 108 | // Regular login - message panel |
112 | 'loginMessagePanelInitialTitle': "Logging in …", | 109 | 'loginMessagePanelInitialTitle': "Logging in …", |
113 | 'loginMessagePanelInitialText': "---", | 110 | 'loginMessagePanelInitialText': "---", |
114 | 'loginMessagePanelInitialButtonLabel': "Cancel", | 111 | 'loginMessagePanelInitialButtonLabel': "Cancel", |
115 | 'loginMessagePanelConnectedTitle': "Connected", | 112 | 'loginMessagePanelConnectedTitle': "Connected", |
116 | 'loginMessagePanelConnectedText': "Done", | 113 | 'loginMessagePanelConnectedText': "Done", |
117 | 'loginMessagePanelFailureTitle': "Error", | 114 | 'loginMessagePanelFailureTitle': "Error", |
118 | 'loginMessagePanelFailureText': "Login failed", | 115 | 'loginMessagePanelFailureText': "Login failed", |
119 | 'loginMessagePanelFailureButtonLabel': "Close", | 116 | 'loginMessagePanelFailureButtonLabel': "Close", |
120 | 117 | ||
121 | // Regular login - message panel - connection | 118 | // Regular login - message panel - connection |
122 | 'connectionLoginSendingCredentialsMessageTitle': "Verifying credentials", | 119 | 'connectionLoginSendingCredentialsMessageTitle': "Verifying credentials", |
123 | 'connectionLoginSendingCredentialsMessageText': "Sending credentials", | 120 | 'connectionLoginSendingCredentialsMessageText': "Sending credentials", |
124 | 'connectionLoginCredentialsVerificationMessageTitle':"Verifying credentials", | 121 | 'connectionLoginCredentialsVerificationMessageTitle':"Verifying credentials", |
125 | 'connectionLoginCredentialsVerificationMessageText':"Performing SRP authentication", | 122 | 'connectionLoginCredentialsVerificationMessageText':"Performing SRP authentication", |
126 | 'connectionLoginDoneMessageTitle': "Verifying credentials", | 123 | 'connectionLoginDoneMessageTitle': "Verifying credentials", |
127 | 'connectionLoginDoneMessageText': "Connected", | 124 | 'connectionLoginDoneMessageText': "Connected", |
128 | 125 | ||
129 | //Regular login - message panel - user | 126 | //Regular login - message panel - user |
130 | 'userLoginPanelUpgradingUserCredentialsMessageTitle': "Verifying credentials", | 127 | 'userLoginPanelUpgradingUserCredentialsMessageTitle': "Verifying credentials", |
131 | 'userLoginPanelUpgradingUserCredentialsMessageText': "Upgrading your credentials to a new authentication schema", | 128 | 'userLoginPanelUpgradingUserCredentialsMessageText': "Upgrading your credentials to a new authentication schema", |
132 | 'userLoginPanelConnectedMessageTitle': "User authenticated", | 129 | 'userLoginPanelConnectedMessageTitle': "User authenticated", |
133 | 'userLoginPanelConnectedMessageText': "Successfully logged in", | 130 | 'userLoginPanelConnectedMessageText': "Successfully logged in", |
134 | 'userLoginPanelTryingAnOlderConnectionSchemaMessageTitle': "Verifying credentials", | 131 | 'userLoginPanelTryingAnOlderConnectionSchemaMessageTitle': "Verifying credentials", |
135 | 'userLoginPanelTryingAnOlderConnectionSchemaMessageText': "Trying an older authentication schema", | 132 | 'userLoginPanelTryingAnOlderConnectionSchemaMessageText': "Trying an older authentication schema", |
136 | 'userLoginPanelLoadingUserDataMessageTitle': "User authenticated", | 133 | 'userLoginPanelLoadingUserDataMessageTitle': "User authenticated", |
137 | 'userLoginPanelLoadingUserDataMessageText': "Downloading encrypted card headers from Clipperz", | 134 | 'userLoginPanelLoadingUserDataMessageText': "Downloading encrypted card headers from Clipperz", |
138 | 'userLoginPanelDecryptingUserDataMessageTitle': "User authenticated", | 135 | 'userLoginPanelDecryptingUserDataMessageTitle': "User authenticated", |
139 | 'userLoginPanelDecryptingUserDataMessageText': "Local decryption of card headers", | 136 | 'userLoginPanelDecryptingUserDataMessageText': "Local decryption of card headers", |
140 | 'userLoginPanelDecryptingUserStatisticsMessageTitle': "User authenticated", | 137 | 'userLoginPanelDecryptingUserStatisticsMessageTitle': "User authenticated", |
141 | 'userLoginPanelDecryptingUserStatisticsMessageText': "Local decryption of usage statistics", | 138 | 'userLoginPanelDecryptingUserStatisticsMessageText': "Local decryption of usage statistics", |
142 | 139 | ||
143 | //Registration page - splash alert | 140 | //Registration page - splash alert |
144 | 'splashAlertTitle':"Welcome to Clipperz!", | 141 | 'splashAlertTitle':"Welcome to Clipperz!", |
145 | 'splashAlertText': "\ | 142 | 'splashAlertText': "\ |
146 | <!-- FIX CSS DONE! -->\ | 143 | <!-- FIX CSS DONE! -->\ |
147 | <p>Some security advice</p>\ | 144 | <p>Some security advice</p>\ |
148 | <ul>\ | 145 | <ul>\ |
149 | <li><p>Storing your data at Clipperz is as secure as the passphrase you choose to protect them. Nobody can access them unless they know your passphrase.</p></li>\ | 146 | <li><p>Storing your data at Clipperz is as secure as the passphrase you choose to protect them. Nobody can access them unless they know your passphrase.</p></li>\ |
150 | <li><p>If you are going to use Clipperz for safeguarding sensitive and critical information please make sure to use a strong passphrase. The longer the better!</p></li>\ | 147 | <li><p>If you are going to use Clipperz for safeguarding sensitive and critical information please make sure to use a strong passphrase. The longer the better!</p></li>\ |
151 | <li><p>Clipperz will not be able to recover a lost passphrase!</p></li>\ | 148 | <li><p>Clipperz will not be able to recover a lost passphrase!</p></li>\ |
152 | </ul>\ | 149 | </ul>\ |
153 | <p>For any further information, please refer to <a href=\"http://www.clipperz.com\" target=\"_blank\">Clipperz</a> website.</p>", | 150 | <p>For any further information, please refer to <a href=\"http://www.clipperz.com\" target=\"_blank\">Clipperz</a> website.</p>", |
154 | 'splashAlertCloseButtonLabel':"Ok", | 151 | 'splashAlertCloseButtonLabel':"Ok", |
155 | 152 | ||
156 | // Registration page - form | 153 | // Registration page - form |
157 | 'registrationFormTitle': "create your account", | 154 | 'registrationFormTitle': "create your account", |
158 | 'registrationFormUsernameLabel': "username", | 155 | 'registrationFormUsernameLabel': "username", |
159 | 'registrationFormPassphraseLabel': "passphrase", | 156 | 'registrationFormPassphraseLabel': "passphrase", |
160 | 'registrationFormRetypePassphraseLabel': "re-enter passphrase", | 157 | 'registrationFormRetypePassphraseLabel': "re-enter passphrase", |
161 | 'registrationFormSafetyCheckLabel': "I understand that Clipperz will not be able to recover a lost passphrase.", | 158 | 'registrationFormSafetyCheckLabel': "I understand that Clipperz will not be able to recover a lost passphrase.", |
162 | 'registrationFormTermsOfServiceCheckLabel': "I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>.", | 159 | 'registrationFormTermsOfServiceCheckLabel': "I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>.", |
163 | 'registrationFormDoYouAlreadyHaveAnAccountLabel': "do you already have an account?", | 160 | 'registrationFormDoYouAlreadyHaveAnAccountLabel': "do you already have an account?", |
164 | 'registrationFormSimplyLoginLabel': "simply login", | 161 | 'registrationFormSimplyLoginLabel': "simply login", |
165 | 'registrationFormButtonLabel': "Register", | 162 | 'registrationFormButtonLabel': "Register", |
166 | 163 | ||
167 | // Registration page - warning messages | 164 | // Registration page - warning messages |
168 | 'registrationFormWarningMessageNotMatchingPassphrases':"Your passphrases don't match, please re-type them.", | 165 | 'registrationFormWarningMessageNotMatchingPassphrases':"Your passphrases don't match, please re-type them.", |
169 | 'registrationFormWarningMessageSafetyCheckNotSelected':"Please read and check all the boxes below.", | 166 | 'registrationFormWarningMessageSafetyCheckNotSelected':"Please read and check all the boxes below.", |
170 | 'registrationFormWarningMessageTermsOfServiceCheckNotSelected':"You need to agree to the Terms of Service.", | 167 | 'registrationFormWarningMessageTermsOfServiceCheckNotSelected':"You need to agree to the Terms of Service.", |
171 | 168 | ||
172 | // Registration page - message panel | 169 | // Registration page - message panel |
173 | 'registrationMessagePanelInitialTitle': "Creating account …", | 170 | 'registrationMessagePanelInitialTitle': "Creating account …", |
174 | 'registrationMessagePanelInitialText': "---", | 171 | 'registrationMessagePanelInitialText': "---", |
175 | 'registrationMessagePanelInitialButtonLabel': "Cancel", | 172 | 'registrationMessagePanelInitialButtonLabel': "Cancel", |
176 | 'registrationMessagePanelRegistrationDoneTitle': "Registration", | 173 | 'registrationMessagePanelRegistrationDoneTitle': "Registration", |
177 | 'registrationMessagePanelRegistrationDoneText': "Done", | 174 | 'registrationMessagePanelRegistrationDoneText': "Done", |
178 | 'registrationMessagePanelFailureTitle': "Registration failed", | 175 | 'registrationMessagePanelFailureTitle': "Registration failed", |
179 | 'registrationMessagePanelFailureButtonLabel': "Close", | 176 | 'registrationMessagePanelFailureButtonLabel': "Close", |
180 | 177 | ||
181 | // Registration page - message panel - connection | 178 | // Registration page - message panel - connection |
182 | 'connectionRegistrationSendingRequestMessageText': "Verifying credentials", | 179 | 'connectionRegistrationSendingRequestMessageText': "Verifying credentials", |
183 | 'connectionRegistrationSendingCredentialsMessageText':"Sending credentials", | 180 | 'connectionRegistrationSendingCredentialsMessageText':"Sending credentials", |
184 | 181 | ||
185 | // Registration page - splash panel | 182 | // Registration page - splash panel |
186 | 'registrationSplashPanelTitle': "Security advice", | 183 | 'registrationSplashPanelTitle': "Security advice", |
187 | 'registrationSplashPanelDescription': "<p>These are your Clipperz credentials, take good care of them. Clipperz will never display your username and passphrase a second time!</p>", | 184 | 'registrationSplashPanelDescription': "<p>These are your Clipperz credentials, take good care of them. Clipperz will never display your username and passphrase a second time!</p>", |
188 | 'registrationSplashPanelUsernameLabel': "username", | 185 | 'registrationSplashPanelUsernameLabel': "username", |
189 | 'registrationSplashPanelPassphraseLabel':"passphrase", | 186 | 'registrationSplashPanelPassphraseLabel':"passphrase", |
190 | 187 | ||
191 | 'registrationSplashPanelShowPassphraseButtonLabel':"show passphrase", | 188 | 'registrationSplashPanelShowPassphraseButtonLabel':"show passphrase", |
192 | 189 | ||
193 | //Header links | 190 | //Header links |
194 | 'donateHeaderLinkLabel': "donate", | 191 | 'donateHeaderLinkLabel': "donate", |
195 | 'creditsHeaderLinkLabel': "credits", | 192 | 'creditsHeaderLinkLabel': "credits", |
196 | 'feedbackHeaderLinkLabel': "feedback", | 193 | 'feedbackHeaderLinkLabel': "feedback", |
197 | 'helpHeaderLinkLabel': "help", | 194 | 'helpHeaderLinkLabel': "help", |
198 | 'forumHeaderLinkLabel': "forum", | 195 | 'forumHeaderLinkLabel': "forum", |
199 | 196 | ||
200 | //Menu labels | 197 | //Menu labels |
201 | 'recordMenuLabel': "cards", | 198 | 'recordMenuLabel': "cards", |
202 | 'accountMenuLabel': "account", | 199 | 'accountMenuLabel': "account", |
203 | 'dataMenuLabel': "data", | 200 | 'dataMenuLabel': "data", |
204 | 'contactsMenuLabel': "contacts", | 201 | 'contactsMenuLabel': "contacts", |
205 | 'toolsMenuLabel': "tools", | 202 | 'toolsMenuLabel': "tools", |
206 | 'logoutMenuLabel': "logout", | 203 | 'logoutMenuLabel': "logout", |
207 | 'lockMenuLabel': "lock", | 204 | 'lockMenuLabel': "lock", |
208 | 205 | ||
209 | //Lock dialog | 206 | //Lock dialog |
210 | 'lockTitle': "The account is locked", | 207 | 'lockTitle': "The account is locked", |
211 | 'lockDescription': "<p>To unlock your account, please enter your passphrase.</p>", | 208 | 'lockDescription': "<p>To unlock your account, please enter your passphrase.</p>", |
212 | 'unlockButtonLabel': "Unlock", | 209 | 'unlockButtonLabel': "Unlock", |
213 | 210 | ||
214 | //Account panel - change passphrase | 211 | //Account panel - change passphrase |
215 | 'changePasswordTabLabel': "Change your passphrase", | 212 | 'changePasswordTabLabel': "Change your passphrase", |
216 | 'changePasswordTabTitle': "Change your passphrase", | 213 | 'changePasswordTabTitle': "Change your passphrase", |
diff --git a/frontend/gamma/js/Clipperz/PM/Toll.js b/frontend/gamma/js/Clipperz/PM/Toll.js index a533f51..bb31c43 100644 --- a/frontend/gamma/js/Clipperz/PM/Toll.js +++ b/frontend/gamma/js/Clipperz/PM/Toll.js | |||
@@ -1,194 +1,191 @@ | |||
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 | 28 | ||
32 | //============================================================================= | 29 | //============================================================================= |
33 | 30 | ||
34 | Clipperz.PM.Toll = function(args) { | 31 | Clipperz.PM.Toll = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | 33 | ||
37 | this._requestType = args.requestType; | 34 | this._requestType = args.requestType; |
38 | this._targetValue = args.targetValue; | 35 | this._targetValue = args.targetValue; |
39 | this._cost = args.cost; | 36 | this._cost = args.cost; |
40 | this._toll = null; | 37 | this._toll = null; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | Clipperz.PM.Toll.prototype = MochiKit.Base.update(null, { | 42 | Clipperz.PM.Toll.prototype = MochiKit.Base.update(null, { |
46 | 43 | ||
47 | 'toString': function() { | 44 | 'toString': function() { |
48 | return "Clipperz.PM.Toll (" + this.requestType() + ": " + this.cost() + " - " + ((this.toll() == null)? 'UNPAID' : 'PAID') + ")"; | 45 | return "Clipperz.PM.Toll (" + this.requestType() + ": " + this.cost() + " - " + ((this.toll() == null)? 'UNPAID' : 'PAID') + ")"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'requestType': function() { | 50 | 'requestType': function() { |
54 | return this._requestType; | 51 | return this._requestType; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
58 | 55 | ||
59 | 'targetValue': function() { | 56 | 'targetValue': function() { |
60 | return this._targetValue; | 57 | return this._targetValue; |
61 | }, | 58 | }, |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'cost': function() { | 62 | 'cost': function() { |
66 | return this._cost; | 63 | return this._cost; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'toll': function() { | 68 | 'toll': function() { |
72 | return this._toll; | 69 | return this._toll; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | /* | 73 | /* |
77 | '__pay': function() { | 74 | '__pay': function() { |
78 | varresult; | 75 | varresult; |
79 | vartargetData; | 76 | vartargetData; |
80 | vartargetMatchSize; | 77 | vartargetMatchSize; |
81 | var prefixMatchingBits; | 78 | var prefixMatchingBits; |
82 | varpayment; | 79 | varpayment; |
83 | var i; | 80 | var i; |
84 | 81 | ||
85 | if (this.toll() == null) { | 82 | if (this.toll() == null) { |
86 | i = 0; | 83 | i = 0; |
87 | targetData = new Clipperz.ByteArray("0x" + this.targetValue()); | 84 | targetData = new Clipperz.ByteArray("0x" + this.targetValue()); |
88 | targetMatchSize = this.cost(); | 85 | targetMatchSize = this.cost(); |
89 | 86 | ||
90 | payment = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32); | 87 | payment = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32); |
91 | 88 | ||
92 | do { | 89 | do { |
93 | varpaymentData; | 90 | varpaymentData; |
94 | 91 | ||
95 | //payment = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32); | 92 | //payment = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32); |
96 | payment.increment(); | 93 | payment.increment(); |
97 | paymentData = Clipperz.Crypto.SHA.sha256(payment); | 94 | paymentData = Clipperz.Crypto.SHA.sha256(payment); |
98 | // prefixMatchingBits = this.prefixMatchingBits(targetData, paymentData); | 95 | // prefixMatchingBits = this.prefixMatchingBits(targetData, paymentData); |
99 | prefixMatchingBits = Clipperz.ByteArray.prefixMatchingBits(targetData, paymentData); | 96 | prefixMatchingBits = Clipperz.ByteArray.prefixMatchingBits(targetData, paymentData); |
100 | i++; | 97 | i++; |
101 | } while (prefixMatchingBits < targetMatchSize); | 98 | } while (prefixMatchingBits < targetMatchSize); |
102 | 99 | ||
103 | this._toll = payment.toHexString().substring(2) | 100 | this._toll = payment.toHexString().substring(2) |
104 | } | 101 | } |
105 | 102 | ||
106 | return this; | 103 | return this; |
107 | }, | 104 | }, |
108 | */ | 105 | */ |
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'innerDeferredPay': function (aTargetValue, aCost, aPayment) { | 108 | 'innerDeferredPay': function (aTargetValue, aCost, aPayment) { |
112 | var deferredResult; | 109 | var deferredResult; |
113 | var result; | 110 | var result; |
114 | var payment; | 111 | var payment; |
115 | var i; | 112 | var i; |
116 | 113 | ||
117 | result = null; | 114 | result = null; |
118 | payment = aPayment; | 115 | payment = aPayment; |
119 | i = 0; | 116 | i = 0; |
120 | 117 | ||
121 | while ((result == null) && (i < Clipperz.PM.Toll.numberOfCloseLoopIterations)) { | 118 | while ((result == null) && (i < Clipperz.PM.Toll.numberOfCloseLoopIterations)) { |
122 | if (Clipperz.ByteArray.prefixMatchingBits(aTargetValue, Clipperz.Crypto.SHA.sha256(payment)) > aCost) { | 119 | if (Clipperz.ByteArray.prefixMatchingBits(aTargetValue, Clipperz.Crypto.SHA.sha256(payment)) > aCost) { |
123 | result = payment; | 120 | result = payment; |
124 | } else { | 121 | } else { |
125 | payment.increment(); | 122 | payment.increment(); |
126 | } | 123 | } |
127 | 124 | ||
128 | i ++; | 125 | i ++; |
129 | } | 126 | } |
130 | 127 | ||
131 | if (result == null) { | 128 | if (result == null) { |
132 | deferredResult = MochiKit.Async.callLater(Clipperz.PM.Toll.pauseBetweenEachCloseLoop, MochiKit.Base.method(this, 'innerDeferredPay', aTargetValue, aCost, aPayment)); | 129 | deferredResult = MochiKit.Async.callLater(Clipperz.PM.Toll.pauseBetweenEachCloseLoop, MochiKit.Base.method(this, 'innerDeferredPay', aTargetValue, aCost, aPayment)); |
133 | } else { | 130 | } else { |
134 | deferredResult = MochiKit.Async.succeed(result); | 131 | deferredResult = MochiKit.Async.succeed(result); |
135 | } | 132 | } |
136 | 133 | ||
137 | return deferredResult; | 134 | return deferredResult; |
138 | }, | 135 | }, |
139 | 136 | ||
140 | 'deferredPay': function () { | 137 | 'deferredPay': function () { |
141 | vardeferredResult; | 138 | vardeferredResult; |
142 | vartoll; | 139 | vartoll; |
143 | 140 | ||
144 | toll = this; | 141 | toll = this; |
145 | deferredResult = new Clipperz.Async.Deferred("Toll.deferredPay"); | 142 | deferredResult = new Clipperz.Async.Deferred("Toll.deferredPay"); |
146 | //deferredResult.addLog("--->>> deferredPay - " + this.cost()); | 143 | //deferredResult.addLog("--->>> deferredPay - " + this.cost()); |
147 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes', 32); | 144 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes', 32); |
148 | deferredResult.addMethod(toll, 'innerDeferredPay', new Clipperz.ByteArray("0x" + this.targetValue()), this.cost()); | 145 | deferredResult.addMethod(toll, 'innerDeferredPay', new Clipperz.ByteArray("0x" + this.targetValue()), this.cost()); |
149 | deferredResult.addCallback(MochiKit.Base.bind(function(aPayment) { | 146 | deferredResult.addCallback(MochiKit.Base.bind(function(aPayment) { |
150 | var result; | 147 | var result; |
151 | 148 | ||
152 | result = { | 149 | result = { |
153 | targetValue: this.targetValue(), | 150 | targetValue: this.targetValue(), |
154 | toll: aPayment.toHexString().substr(2) | 151 | toll: aPayment.toHexString().substr(2) |
155 | }; | 152 | }; |
156 | 153 | ||
157 | return result; | 154 | return result; |
158 | }, this)); | 155 | }, this)); |
159 | //deferredResult.addLog("<<<--- deferredPay - " + this.cost()); | 156 | //deferredResult.addLog("<<<--- deferredPay - " + this.cost()); |
160 | deferredResult.callback(); | 157 | deferredResult.callback(); |
161 | 158 | ||
162 | return deferredResult; | 159 | return deferredResult; |
163 | }, | 160 | }, |
164 | 161 | ||
165 | //========================================================================= | 162 | //========================================================================= |
166 | __syntaxFix__: "syntax fix" | 163 | __syntaxFix__: "syntax fix" |
167 | 164 | ||
168 | }); | 165 | }); |
169 | 166 | ||
170 | 167 | ||
171 | Clipperz.PM.Toll.validate = function(aTargetValue, aToll, aCost) { | 168 | Clipperz.PM.Toll.validate = function(aTargetValue, aToll, aCost) { |
172 | var result; | 169 | var result; |
173 | vartollValue; | 170 | vartollValue; |
174 | var targetValue; | 171 | var targetValue; |
175 | var hashedTollValue; | 172 | var hashedTollValue; |
176 | var payedToll; | 173 | var payedToll; |
177 | 174 | ||
178 | tollValue = new Clipperz.ByteArray("0x" + aToll); | 175 | tollValue = new Clipperz.ByteArray("0x" + aToll); |
179 | targetValue = new Clipperz.ByteArray("0x" + aTargetValue); | 176 | targetValue = new Clipperz.ByteArray("0x" + aTargetValue); |
180 | hashedTollValue = Clipperz.Crypto.SHA.sha256(tollValue); | 177 | hashedTollValue = Clipperz.Crypto.SHA.sha256(tollValue); |
181 | 178 | ||
182 | payedToll = Clipperz.ByteArray.prefixMatchingBits(targetValue, hashedTollValue); | 179 | payedToll = Clipperz.ByteArray.prefixMatchingBits(targetValue, hashedTollValue); |
183 | 180 | ||
184 | if (payedToll < aCost) { | 181 | if (payedToll < aCost) { |
185 | result = false; | 182 | result = false; |
186 | } else { | 183 | } else { |
187 | result = true; | 184 | result = true; |
188 | } | 185 | } |
189 | 186 | ||
190 | return result; | 187 | return result; |
191 | }; | 188 | }; |
192 | 189 | ||
193 | Clipperz.PM.Toll.numberOfCloseLoopIterations = 50; | 190 | Clipperz.PM.Toll.numberOfCloseLoopIterations = 50; |
194 | Clipperz.PM.Toll.pauseBetweenEachCloseLoop = 0.5; \ No newline at end of file | 191 | Clipperz.PM.Toll.pauseBetweenEachCloseLoop = 0.5; \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js index 169946a..25e82ca 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.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 | // | 26 | // |
30 | //download.js | 27 | //download.js |
31 | //Download | 28 | //Download |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | 30 | //Created by Giulio Cesare Solaroli on 3/15/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; | 35 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; |
39 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; | 36 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) | 38 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var stroke; | 43 | var stroke; |
47 | var path; | 44 | var path; |
48 | var pointX; | 45 | var pointX; |
49 | var pointY; | 46 | var pointY; |
50 | if (window.devicePixelRatio) | 47 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 48 | resolution = window.devicePixelRatio; |
52 | else | 49 | else |
53 | resolution = 1.0; | 50 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
55 | 52 | ||
56 | context.save(); | 53 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
59 | 56 | ||
60 | // arrow | 57 | // arrow |
61 | 58 | ||
62 | stroke = aThickness; | 59 | stroke = aThickness; |
63 | stroke *= resolution; | 60 | stroke *= resolution; |
64 | if (stroke < 1.0) | 61 | if (stroke < 1.0) |
65 | stroke = Math.ceil(stroke); | 62 | stroke = Math.ceil(stroke); |
66 | else | 63 | else |
67 | stroke = Math.round(stroke); | 64 | stroke = Math.round(stroke); |
68 | stroke /= resolution; | 65 | stroke /= resolution; |
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 66 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
70 | context.beginPath(); | 67 | context.beginPath(); |
71 | pointX = 16.5; | 68 | pointX = 16.5; |
72 | pointY = 22.5; | 69 | pointY = 22.5; |
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
75 | context.moveTo(pointX, pointY); | 72 | context.moveTo(pointX, pointY); |
76 | pointX = 19.5; | 73 | pointX = 19.5; |
77 | pointY = 8.5; | 74 | pointY = 8.5; |
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
80 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
81 | pointX = 30.038; | 78 | pointX = 30.038; |
82 | pointY = 10.605; | 79 | pointY = 10.605; |
83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
85 | context.lineTo(pointX, pointY); | 82 | context.lineTo(pointX, pointY); |
86 | pointX = 27.354; | 83 | pointX = 27.354; |
87 | pointY = 24.354; | 84 | pointY = 24.354; |
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
90 | context.lineTo(pointX, pointY); | 87 | context.lineTo(pointX, pointY); |
91 | pointX = 33.28; | 88 | pointX = 33.28; |
92 | pointY = 25.293; | 89 | pointY = 25.293; |
93 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
94 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
95 | context.lineTo(pointX, pointY); | 92 | context.lineTo(pointX, pointY); |
96 | pointX = 19.81; | 93 | pointX = 19.81; |
97 | pointY = 36.828; | 94 | pointY = 36.828; |
98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 95 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 96 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
100 | context.lineTo(pointX, pointY); | 97 | context.lineTo(pointX, pointY); |
101 | pointX = 10.07; | 98 | pointX = 10.07; |
102 | pointY = 21.617; | 99 | pointY = 21.617; |
103 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
104 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
105 | context.lineTo(pointX, pointY); | 102 | context.lineTo(pointX, pointY); |
106 | pointX = 16.5; | 103 | pointX = 16.5; |
107 | pointY = 22.5; | 104 | pointY = 22.5; |
108 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
109 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
110 | context.lineTo(pointX, pointY); | 107 | context.lineTo(pointX, pointY); |
111 | context.closePath(); | 108 | context.closePath(); |
112 | context.fillStyle = aFillColor; | 109 | context.fillStyle = aFillColor; |
113 | context.fill(); | 110 | context.fill(); |
114 | context.strokeStyle = aColor; | 111 | context.strokeStyle = aColor; |
115 | context.lineWidth = stroke; | 112 | context.lineWidth = stroke; |
116 | context.lineCap = "square"; | 113 | context.lineCap = "square"; |
117 | context.stroke(); | 114 | context.stroke(); |
118 | 115 | ||
119 | context.restore(); | 116 | context.restore(); |
120 | } | 117 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js index b8e535b..ba425ec 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js | |||
@@ -1,208 +1,205 @@ | |||
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 | // | 26 | // |
30 | //look.js | 27 | //look.js |
31 | //Look | 28 | //Look |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | 30 | //Created by Giulio Cesare Solaroli on 3/15/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; | 35 | var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; |
39 | var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; | 36 | var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) | 38 | function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var stroke; | 43 | var stroke; |
47 | var path; | 44 | var path; |
48 | var pointX; | 45 | var pointX; |
49 | var pointY; | 46 | var pointY; |
50 | if (window.devicePixelRatio) | 47 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 48 | resolution = window.devicePixelRatio; |
52 | else | 49 | else |
53 | resolution = 1.0; | 50 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
55 | 52 | ||
56 | context.save(); | 53 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
59 | 56 | ||
60 | // Layer 6 | 57 | // Layer 6 |
61 | 58 | ||
62 | stroke = aThickness; | 59 | stroke = aThickness; |
63 | stroke *= resolution; | 60 | stroke *= resolution; |
64 | if (stroke < 1.0) | 61 | if (stroke < 1.0) |
65 | stroke = Math.ceil(stroke); | 62 | stroke = Math.ceil(stroke); |
66 | else | 63 | else |
67 | stroke = Math.round(stroke); | 64 | stroke = Math.round(stroke); |
68 | stroke /= resolution; | 65 | stroke /= resolution; |
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 66 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
70 | context.save(); | 67 | context.save(); |
71 | context.translate(17.5, 23.0); | 68 | context.translate(17.5, 23.0); |
72 | context.rotate(-0.503); | 69 | context.rotate(-0.503); |
73 | context.translate(-17.5, -23.0); | 70 | context.translate(-17.5, -23.0); |
74 | context.beginPath(); | 71 | context.beginPath(); |
75 | pointX = 28.5; | 72 | pointX = 28.5; |
76 | pointY = 31.5; | 73 | pointY = 31.5; |
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 74 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 75 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
79 | context.moveTo(pointX, pointY); | 76 | context.moveTo(pointX, pointY); |
80 | pointX = 28.5; | 77 | pointX = 28.5; |
81 | pointY = 14.5; | 78 | pointY = 14.5; |
82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 79 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 80 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
84 | context.lineTo(pointX, pointY); | 81 | context.lineTo(pointX, pointY); |
85 | pointX = 6.5; | 82 | pointX = 6.5; |
86 | pointY = 14.5; | 83 | pointY = 14.5; |
87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 84 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 85 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
89 | context.lineTo(pointX, pointY); | 86 | context.lineTo(pointX, pointY); |
90 | pointX = 6.5; | 87 | pointX = 6.5; |
91 | pointY = 31.5; | 88 | pointY = 31.5; |
92 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 89 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
93 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 90 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
94 | context.lineTo(pointX, pointY); | 91 | context.lineTo(pointX, pointY); |
95 | pointX = 28.5; | 92 | pointX = 28.5; |
96 | pointY = 31.5; | 93 | pointY = 31.5; |
97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 94 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 95 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
99 | context.lineTo(pointX, pointY); | 96 | context.lineTo(pointX, pointY); |
100 | context.closePath(); | 97 | context.closePath(); |
101 | context.fillStyle = aFillColor; | 98 | context.fillStyle = aFillColor; |
102 | context.fill(); | 99 | context.fill(); |
103 | context.strokeStyle = aColor; | 100 | context.strokeStyle = aColor; |
104 | context.lineWidth = stroke; | 101 | context.lineWidth = stroke; |
105 | context.lineCap = "square"; | 102 | context.lineCap = "square"; |
106 | context.stroke(); | 103 | context.stroke(); |
107 | context.restore(); | 104 | context.restore(); |
108 | 105 | ||
109 | // Layer 3 | 106 | // Layer 3 |
110 | 107 | ||
111 | stroke = aThickness; | 108 | stroke = aThickness; |
112 | stroke *= resolution; | 109 | stroke *= resolution; |
113 | if (stroke < 1.0) | 110 | if (stroke < 1.0) |
114 | stroke = Math.ceil(stroke); | 111 | stroke = Math.ceil(stroke); |
115 | else | 112 | else |
116 | stroke = Math.round(stroke); | 113 | stroke = Math.round(stroke); |
117 | stroke /= resolution; | 114 | stroke /= resolution; |
118 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 115 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
119 | context.save(); | 116 | context.save(); |
120 | context.translate(22.5, 20.0); | 117 | context.translate(22.5, 20.0); |
121 | context.rotate(-0.071); | 118 | context.rotate(-0.071); |
122 | context.translate(-22.5, -20.0); | 119 | context.translate(-22.5, -20.0); |
123 | context.beginPath(); | 120 | context.beginPath(); |
124 | pointX = 33.5; | 121 | pointX = 33.5; |
125 | pointY = 28.5; | 122 | pointY = 28.5; |
126 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 123 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
127 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 124 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
128 | context.moveTo(pointX, pointY); | 125 | context.moveTo(pointX, pointY); |
129 | pointX = 33.5; | 126 | pointX = 33.5; |
130 | pointY = 11.5; | 127 | pointY = 11.5; |
131 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 128 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
132 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 129 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
133 | context.lineTo(pointX, pointY); | 130 | context.lineTo(pointX, pointY); |
134 | pointX = 11.5; | 131 | pointX = 11.5; |
135 | pointY = 11.5; | 132 | pointY = 11.5; |
136 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 133 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
137 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 134 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
138 | context.lineTo(pointX, pointY); | 135 | context.lineTo(pointX, pointY); |
139 | pointX = 11.5; | 136 | pointX = 11.5; |
140 | pointY = 28.5; | 137 | pointY = 28.5; |
141 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
142 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
143 | context.lineTo(pointX, pointY); | 140 | context.lineTo(pointX, pointY); |
144 | pointX = 33.5; | 141 | pointX = 33.5; |
145 | pointY = 28.5; | 142 | pointY = 28.5; |
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
148 | context.lineTo(pointX, pointY); | 145 | context.lineTo(pointX, pointY); |
149 | context.closePath(); | 146 | context.closePath(); |
150 | context.fillStyle = aFillColor; | 147 | context.fillStyle = aFillColor; |
151 | context.fill(); | 148 | context.fill(); |
152 | context.strokeStyle = aColor; | 149 | context.strokeStyle = aColor; |
153 | context.lineWidth = stroke; | 150 | context.lineWidth = stroke; |
154 | context.lineCap = "square"; | 151 | context.lineCap = "square"; |
155 | context.stroke(); | 152 | context.stroke(); |
156 | context.restore(); | 153 | context.restore(); |
157 | 154 | ||
158 | // Layer 4 | 155 | // Layer 4 |
159 | 156 | ||
160 | stroke = aThickness; | 157 | stroke = aThickness; |
161 | stroke *= resolution; | 158 | stroke *= resolution; |
162 | if (stroke < 1.0) | 159 | if (stroke < 1.0) |
163 | stroke = Math.ceil(stroke); | 160 | stroke = Math.ceil(stroke); |
164 | else | 161 | else |
165 | stroke = Math.round(stroke); | 162 | stroke = Math.round(stroke); |
166 | stroke /= resolution; | 163 | stroke /= resolution; |
167 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 164 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
168 | context.save(); | 165 | context.save(); |
169 | context.translate(27.5, 18.0); | 166 | context.translate(27.5, 18.0); |
170 | context.rotate(0.232); | 167 | context.rotate(0.232); |
171 | context.translate(-27.5, -18.0); | 168 | context.translate(-27.5, -18.0); |
172 | context.beginPath(); | 169 | context.beginPath(); |
173 | pointX = 38.5; | 170 | pointX = 38.5; |
174 | pointY = 26.5; | 171 | pointY = 26.5; |
175 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 172 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
176 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 173 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
177 | context.moveTo(pointX, pointY); | 174 | context.moveTo(pointX, pointY); |
178 | pointX = 38.5; | 175 | pointX = 38.5; |
179 | pointY = 9.5; | 176 | pointY = 9.5; |
180 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
181 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
182 | context.lineTo(pointX, pointY); | 179 | context.lineTo(pointX, pointY); |
183 | pointX = 16.5; | 180 | pointX = 16.5; |
184 | pointY = 9.5; | 181 | pointY = 9.5; |
185 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 182 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
186 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 183 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
187 | context.lineTo(pointX, pointY); | 184 | context.lineTo(pointX, pointY); |
188 | pointX = 16.5; | 185 | pointX = 16.5; |
189 | pointY = 26.5; | 186 | pointY = 26.5; |
190 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 187 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
191 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 188 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
192 | context.lineTo(pointX, pointY); | 189 | context.lineTo(pointX, pointY); |
193 | pointX = 38.5; | 190 | pointX = 38.5; |
194 | pointY = 26.5; | 191 | pointY = 26.5; |
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 192 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 193 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
197 | context.lineTo(pointX, pointY); | 194 | context.lineTo(pointX, pointY); |
198 | context.closePath(); | 195 | context.closePath(); |
199 | context.fillStyle = aFillColor; | 196 | context.fillStyle = aFillColor; |
200 | context.fill(); | 197 | context.fill(); |
201 | context.strokeStyle = aColor; | 198 | context.strokeStyle = aColor; |
202 | context.lineWidth = stroke; | 199 | context.lineWidth = stroke; |
203 | context.lineCap = "square"; | 200 | context.lineCap = "square"; |
204 | context.stroke(); | 201 | context.stroke(); |
205 | context.restore(); | 202 | context.restore(); |
206 | 203 | ||
207 | context.restore(); | 204 | context.restore(); |
208 | } | 205 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js index 9c4e5ba..5c1f860 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js | |||
@@ -1,209 +1,206 @@ | |||
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 | // | 26 | // |
30 | //directLogin.js | 27 | //directLogin.js |
31 | //directLogin | 28 | //directLogin |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; | 35 | var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; |
39 | var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; | 36 | var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var stroke; | 43 | var stroke; |
47 | var path; | 44 | var path; |
48 | var pointX; | 45 | var pointX; |
49 | var pointY; | 46 | var pointY; |
50 | if (window.devicePixelRatio) | 47 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 48 | resolution = window.devicePixelRatio; |
52 | else | 49 | else |
53 | resolution = 1.0; | 50 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
55 | 52 | ||
56 | context.save(); | 53 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_directLoginWidth, kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_directLoginWidth, kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
59 | 56 | ||
60 | // Layer 2 | 57 | // Layer 2 |
61 | 58 | ||
62 | stroke = 6.0; | 59 | stroke = 6.0; |
63 | stroke *= resolution; | 60 | stroke *= resolution; |
64 | if (stroke < 1.0) | 61 | if (stroke < 1.0) |
65 | stroke = Math.ceil(stroke); | 62 | stroke = Math.ceil(stroke); |
66 | else | 63 | else |
67 | stroke = Math.round(stroke); | 64 | stroke = Math.round(stroke); |
68 | stroke /= resolution; | 65 | stroke /= resolution; |
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 66 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
70 | context.beginPath(); | 67 | context.beginPath(); |
71 | pointX = 30.0; | 68 | pointX = 30.0; |
72 | pointY = 41.0; | 69 | pointY = 41.0; |
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
75 | context.moveTo(pointX, pointY); | 72 | context.moveTo(pointX, pointY); |
76 | pointX = 45.579; | 73 | pointX = 45.579; |
77 | pointY = 25.451; | 74 | pointY = 25.451; |
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
80 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
81 | context.strokeStyle = aColor; | 78 | context.strokeStyle = aColor; |
82 | context.lineWidth = stroke; | 79 | context.lineWidth = stroke; |
83 | context.lineCap = "square"; | 80 | context.lineCap = "square"; |
84 | context.stroke(); | 81 | context.stroke(); |
85 | 82 | ||
86 | alignStroke = 0.0; | 83 | alignStroke = 0.0; |
87 | context.beginPath(); | 84 | context.beginPath(); |
88 | pointX = 34.207; | 85 | pointX = 34.207; |
89 | pointY = 45.697; | 86 | pointY = 45.697; |
90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
92 | context.moveTo(pointX, pointY); | 89 | context.moveTo(pointX, pointY); |
93 | pointX = 24.101; | 90 | pointX = 24.101; |
94 | pointY = 37.52; | 91 | pointY = 37.52; |
95 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 92 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
96 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 93 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
97 | context.lineTo(pointX, pointY); | 94 | context.lineTo(pointX, pointY); |
98 | pointX = 24.122; | 95 | pointX = 24.122; |
99 | pointY = 47.828; | 96 | pointY = 47.828; |
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
102 | context.lineTo(pointX, pointY); | 99 | context.lineTo(pointX, pointY); |
103 | pointX = 34.207; | 100 | pointX = 34.207; |
104 | pointY = 45.697; | 101 | pointY = 45.697; |
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 102 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 103 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
107 | context.lineTo(pointX, pointY); | 104 | context.lineTo(pointX, pointY); |
108 | context.closePath(); | 105 | context.closePath(); |
109 | context.fillStyle = aColor; | 106 | context.fillStyle = aColor; |
110 | context.fill(); | 107 | context.fill(); |
111 | 108 | ||
112 | stroke = 6.0; | 109 | stroke = 6.0; |
113 | stroke *= resolution; | 110 | stroke *= resolution; |
114 | if (stroke < 1.0) | 111 | if (stroke < 1.0) |
115 | stroke = Math.ceil(stroke); | 112 | stroke = Math.ceil(stroke); |
116 | else | 113 | else |
117 | stroke = Math.round(stroke); | 114 | stroke = Math.round(stroke); |
118 | stroke /= resolution; | 115 | stroke /= resolution; |
119 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 116 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
120 | context.beginPath(); | 117 | context.beginPath(); |
121 | pointX = 24.631; | 118 | pointX = 24.631; |
122 | pointY = 28.971; | 119 | pointY = 28.971; |
123 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 120 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
124 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 121 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
125 | context.moveTo(pointX, pointY); | 122 | context.moveTo(pointX, pointY); |
126 | pointX = 46.497; | 123 | pointX = 46.497; |
127 | pointY = 26.451; | 124 | pointY = 26.451; |
128 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
129 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
130 | context.lineTo(pointX, pointY); | 127 | context.lineTo(pointX, pointY); |
131 | context.strokeStyle = aColor; | 128 | context.strokeStyle = aColor; |
132 | context.stroke(); | 129 | context.stroke(); |
133 | 130 | ||
134 | alignStroke = 0.0; | 131 | alignStroke = 0.0; |
135 | context.beginPath(); | 132 | context.beginPath(); |
136 | pointX = 25.014; | 133 | pointX = 25.014; |
137 | pointY = 35.265; | 134 | pointY = 35.265; |
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
140 | context.moveTo(pointX, pointY); | 137 | context.moveTo(pointX, pointY); |
141 | pointX = 22.166; | 138 | pointX = 22.166; |
142 | pointY = 22.58; | 139 | pointY = 22.58; |
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
145 | context.lineTo(pointX, pointY); | 142 | context.lineTo(pointX, pointY); |
146 | pointX = 15.784; | 143 | pointX = 15.784; |
147 | pointY = 30.675; | 144 | pointY = 30.675; |
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 145 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 146 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
150 | context.lineTo(pointX, pointY); | 147 | context.lineTo(pointX, pointY); |
151 | pointX = 25.014; | 148 | pointX = 25.014; |
152 | pointY = 35.265; | 149 | pointY = 35.265; |
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 150 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 151 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
155 | context.lineTo(pointX, pointY); | 152 | context.lineTo(pointX, pointY); |
156 | context.closePath(); | 153 | context.closePath(); |
157 | context.fillStyle = aColor; | 154 | context.fillStyle = aColor; |
158 | context.fill(); | 155 | context.fill(); |
159 | 156 | ||
160 | stroke = 6.0; | 157 | stroke = 6.0; |
161 | stroke *= resolution; | 158 | stroke *= resolution; |
162 | if (stroke < 1.0) | 159 | if (stroke < 1.0) |
163 | stroke = Math.ceil(stroke); | 160 | stroke = Math.ceil(stroke); |
164 | else | 161 | else |
165 | stroke = Math.round(stroke); | 162 | stroke = Math.round(stroke); |
166 | stroke /= resolution; | 163 | stroke /= resolution; |
167 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 164 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
168 | context.beginPath(); | 165 | context.beginPath(); |
169 | pointX = 42.282; | 166 | pointX = 42.282; |
170 | pointY = 47.03; | 167 | pointY = 47.03; |
171 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 168 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
172 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 169 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
173 | context.moveTo(pointX, pointY); | 170 | context.moveTo(pointX, pointY); |
174 | pointX = 47.771; | 171 | pointX = 47.771; |
175 | pointY = 25.714; | 172 | pointY = 25.714; |
176 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 173 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
177 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 174 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
178 | context.lineTo(pointX, pointY); | 175 | context.lineTo(pointX, pointY); |
179 | context.strokeStyle = aColor; | 176 | context.strokeStyle = aColor; |
180 | context.stroke(); | 177 | context.stroke(); |
181 | 178 | ||
182 | alignStroke = 0.0; | 179 | alignStroke = 0.0; |
183 | context.beginPath(); | 180 | context.beginPath(); |
184 | pointX = 48.294; | 181 | pointX = 48.294; |
185 | pointY = 48.929; | 182 | pointY = 48.929; |
186 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 183 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
187 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 184 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
188 | context.moveTo(pointX, pointY); | 185 | context.moveTo(pointX, pointY); |
189 | pointX = 35.432; | 186 | pointX = 35.432; |
190 | pointY = 47.039; | 187 | pointY = 47.039; |
191 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 188 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
192 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 189 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
193 | context.lineTo(pointX, pointY); | 190 | context.lineTo(pointX, pointY); |
194 | pointX = 40.7; | 191 | pointX = 40.7; |
195 | pointY = 55.899; | 192 | pointY = 55.899; |
196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 193 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 194 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
198 | context.lineTo(pointX, pointY); | 195 | context.lineTo(pointX, pointY); |
199 | pointX = 48.294; | 196 | pointX = 48.294; |
200 | pointY = 48.929; | 197 | pointY = 48.929; |
201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 198 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 199 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
203 | context.lineTo(pointX, pointY); | 200 | context.lineTo(pointX, pointY); |
204 | context.closePath(); | 201 | context.closePath(); |
205 | context.fillStyle = aColor; | 202 | context.fillStyle = aColor; |
206 | context.fill(); | 203 | context.fill(); |
207 | 204 | ||
208 | context.restore(); | 205 | context.restore(); |
209 | } | 206 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js index 501b69b..b829ed6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //protect.js | 27 | //protect.js |
31 | //protect | 28 | //protect |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; | 35 | var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; |
39 | var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; | 36 | var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | var stroke; | 50 | var stroke; |
54 | if (window.devicePixelRatio) | 51 | if (window.devicePixelRatio) |
55 | resolution = window.devicePixelRatio; | 52 | resolution = window.devicePixelRatio; |
56 | else | 53 | else |
57 | resolution = 1.0; | 54 | resolution = 1.0; |
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | 55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); |
59 | 56 | ||
60 | context.save(); | 57 | context.save(); |
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | 58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); |
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_protectWidth, kClipperz_PM_UI_Canvas_Features_protectHeight); | 59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_protectWidth, kClipperz_PM_UI_Canvas_Features_protectHeight); |
63 | 60 | ||
64 | // Layer 1 | 61 | // Layer 1 |
65 | 62 | ||
66 | alignStroke = 0.0; | 63 | alignStroke = 0.0; |
67 | context.beginPath(); | 64 | context.beginPath(); |
68 | pointX = 38.5; | 65 | pointX = 38.5; |
69 | pointY = 36.0; | 66 | pointY = 36.0; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 69 | context.moveTo(pointX, pointY); |
73 | pointX = 37.068; | 70 | pointX = 37.068; |
74 | pointY = 38.816; | 71 | pointY = 38.816; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1X = 37.41; | 74 | controlPoint1X = 37.41; |
78 | controlPoint1Y = 36.234; | 75 | controlPoint1Y = 36.234; |
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2X = 37.175; | 78 | controlPoint2X = 37.175; |
82 | controlPoint2Y = 37.907; | 79 | controlPoint2Y = 37.907; |
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
86 | pointX = 37.031; | 83 | pointX = 37.031; |
87 | pointY = 40.802; | 84 | pointY = 40.802; |
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
90 | controlPoint1X = 36.991; | 87 | controlPoint1X = 36.991; |
91 | controlPoint1Y = 39.474; | 88 | controlPoint1Y = 39.474; |
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 89 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 90 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
94 | controlPoint2X = 36.98; | 91 | controlPoint2X = 36.98; |
95 | controlPoint2Y = 40.141; | 92 | controlPoint2Y = 40.141; |
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 93 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 94 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 95 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
99 | pointX = 37.258; | 96 | pointX = 37.258; |
100 | pointY = 42.23; | 97 | pointY = 42.23; |
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
103 | controlPoint1X = 37.068; | 100 | controlPoint1X = 37.068; |
104 | controlPoint1Y = 41.283; | 101 | controlPoint1Y = 41.283; |
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 102 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 103 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
107 | controlPoint2X = 37.139; | 104 | controlPoint2X = 37.139; |
108 | controlPoint2Y = 41.762; | 105 | controlPoint2Y = 41.762; |
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 106 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 107 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 108 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
112 | pointX = 38.348; | 109 | pointX = 38.348; |
113 | pointY = 43.979; | 110 | pointY = 43.979; |
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
116 | controlPoint1X = 37.402; | 113 | controlPoint1X = 37.402; |
117 | controlPoint1Y = 42.799; | 114 | controlPoint1Y = 42.799; |
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 115 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 116 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
120 | controlPoint2X = 37.682; | 117 | controlPoint2X = 37.682; |
121 | controlPoint2Y = 43.798; | 118 | controlPoint2Y = 43.798; |
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 119 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 120 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 121 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
125 | pointX = 38.5; | 122 | pointX = 38.5; |
126 | pointY = 36.0; | 123 | pointY = 36.0; |
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 124 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 125 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
129 | controlPoint1X = 40.249; | 126 | controlPoint1X = 40.249; |
130 | controlPoint1Y = 44.497; | 127 | controlPoint1Y = 44.497; |
131 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 128 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
132 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 129 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
133 | controlPoint2X = 40.723; | 130 | controlPoint2X = 40.723; |
134 | controlPoint2Y = 36.303; | 131 | controlPoint2Y = 36.303; |
135 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 132 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
136 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 133 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
137 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 134 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
138 | pointX = 38.5; | 135 | pointX = 38.5; |
139 | pointY = 36.0; | 136 | pointY = 36.0; |
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 137 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 138 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
142 | context.lineTo(pointX, pointY); | 139 | context.lineTo(pointX, pointY); |
143 | context.closePath(); | 140 | context.closePath(); |
144 | pointX = 50.0; | 141 | pointX = 50.0; |
145 | pointY = 52.0; | 142 | pointY = 52.0; |
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
148 | context.moveTo(pointX, pointY); | 145 | context.moveTo(pointX, pointY); |
149 | pointX = 26.0; | 146 | pointX = 26.0; |
150 | pointY = 52.0; | 147 | pointY = 52.0; |
151 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
152 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
153 | context.lineTo(pointX, pointY); | 150 | context.lineTo(pointX, pointY); |
154 | pointX = 26.0; | 151 | pointX = 26.0; |
155 | pointY = 33.0; | 152 | pointY = 33.0; |
156 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
157 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
158 | context.lineTo(pointX, pointY); | 155 | context.lineTo(pointX, pointY); |
159 | pointX = 50.0; | 156 | pointX = 50.0; |
160 | pointY = 33.0; | 157 | pointY = 33.0; |
161 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
162 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
163 | context.lineTo(pointX, pointY); | 160 | context.lineTo(pointX, pointY); |
164 | pointX = 50.0; | 161 | pointX = 50.0; |
165 | pointY = 52.0; | 162 | pointY = 52.0; |
166 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
167 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
168 | context.lineTo(pointX, pointY); | 165 | context.lineTo(pointX, pointY); |
169 | context.closePath(); | 166 | context.closePath(); |
170 | context.fillStyle = aColor; | 167 | context.fillStyle = aColor; |
171 | context.fill(); | 168 | context.fill(); |
172 | 169 | ||
173 | alignStroke = 0.0; | 170 | alignStroke = 0.0; |
174 | context.beginPath(); | 171 | context.beginPath(); |
175 | pointX = 47.0; | 172 | pointX = 47.0; |
176 | pointY = 32.463; | 173 | pointY = 32.463; |
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 174 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 175 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
179 | context.moveTo(pointX, pointY); | 176 | context.moveTo(pointX, pointY); |
180 | pointX = 38.0; | 177 | pointX = 38.0; |
181 | pointY = 52.0; | 178 | pointY = 52.0; |
182 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 179 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
183 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 180 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
184 | controlPoint1X = 47.0; | 181 | controlPoint1X = 47.0; |
185 | controlPoint1Y = 52.925; | 182 | controlPoint1Y = 52.925; |
186 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 183 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
187 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 184 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
188 | controlPoint2X = 38.0; | 185 | controlPoint2X = 38.0; |
189 | controlPoint2Y = 52.0; | 186 | controlPoint2Y = 52.0; |
190 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 187 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
191 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 188 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
192 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 189 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
193 | pointX = 29.0; | 190 | pointX = 29.0; |
194 | pointY = 32.463; | 191 | pointY = 32.463; |
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 192 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 193 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
197 | controlPoint1X = 38.0; | 194 | controlPoint1X = 38.0; |
198 | controlPoint1Y = 52.0; | 195 | controlPoint1Y = 52.0; |
199 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 196 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
200 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 197 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
201 | controlPoint2X = 29.0; | 198 | controlPoint2X = 29.0; |
202 | controlPoint2Y = 52.925; | 199 | controlPoint2Y = 52.925; |
203 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 200 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
204 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 201 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
205 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 202 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
206 | pointX = 47.0; | 203 | pointX = 47.0; |
207 | pointY = 32.463; | 204 | pointY = 32.463; |
208 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 205 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
209 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 206 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
210 | controlPoint1X = 29.0; | 207 | controlPoint1X = 29.0; |
211 | controlPoint1Y = 12.0; | 208 | controlPoint1Y = 12.0; |
212 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 209 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
213 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 210 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
214 | controlPoint2X = 47.0; | 211 | controlPoint2X = 47.0; |
215 | controlPoint2Y = 12.0; | 212 | controlPoint2Y = 12.0; |
216 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 213 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js index 825a17e..8d73cc7 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //share.js | 27 | //share.js |
31 | //share | 28 | //share |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; | 35 | var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; |
39 | var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; | 36 | var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | var stroke; | 50 | var stroke; |
54 | if (window.devicePixelRatio) | 51 | if (window.devicePixelRatio) |
55 | resolution = window.devicePixelRatio; | 52 | resolution = window.devicePixelRatio; |
56 | else | 53 | else |
57 | resolution = 1.0; | 54 | resolution = 1.0; |
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | 55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); |
59 | 56 | ||
60 | context.save(); | 57 | context.save(); |
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | 58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); |
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_shareWidth, kClipperz_PM_UI_Canvas_Features_shareHeight); | 59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_shareWidth, kClipperz_PM_UI_Canvas_Features_shareHeight); |
63 | 60 | ||
64 | // Layer 1 | 61 | // Layer 1 |
65 | 62 | ||
66 | alignStroke = 0.0; | 63 | alignStroke = 0.0; |
67 | context.beginPath(); | 64 | context.beginPath(); |
68 | pointX = 43.179; | 65 | pointX = 43.179; |
69 | pointY = 18.621; | 66 | pointY = 18.621; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 69 | context.moveTo(pointX, pointY); |
73 | pointX = 37.163; | 70 | pointX = 37.163; |
74 | pointY = 12.605; | 71 | pointY = 12.605; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1X = 43.179; | 74 | controlPoint1X = 43.179; |
78 | controlPoint1Y = 15.32; | 75 | controlPoint1Y = 15.32; |
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2X = 40.463; | 78 | controlPoint2X = 40.463; |
82 | controlPoint2Y = 12.605; | 79 | controlPoint2Y = 12.605; |
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
86 | pointX = 31.147; | 83 | pointX = 31.147; |
87 | pointY = 18.621; | 84 | pointY = 18.621; |
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
90 | controlPoint1X = 33.863; | 87 | controlPoint1X = 33.863; |
91 | controlPoint1Y = 12.605; | 88 | controlPoint1Y = 12.605; |
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 89 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 90 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
94 | controlPoint2X = 31.147; | 91 | controlPoint2X = 31.147; |
95 | controlPoint2Y = 15.32; | 92 | controlPoint2Y = 15.32; |
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 93 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 94 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 95 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
99 | pointX = 37.163; | 96 | pointX = 37.163; |
100 | pointY = 24.637; | 97 | pointY = 24.637; |
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
103 | controlPoint1X = 31.147; | 100 | controlPoint1X = 31.147; |
104 | controlPoint1Y = 21.921; | 101 | controlPoint1Y = 21.921; |
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 102 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 103 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
107 | controlPoint2X = 33.863; | 104 | controlPoint2X = 33.863; |
108 | controlPoint2Y = 24.637; | 105 | controlPoint2Y = 24.637; |
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 106 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 107 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 108 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
112 | pointX = 43.179; | 109 | pointX = 43.179; |
113 | pointY = 18.621; | 110 | pointY = 18.621; |
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
116 | controlPoint1X = 40.463; | 113 | controlPoint1X = 40.463; |
117 | controlPoint1Y = 24.637; | 114 | controlPoint1Y = 24.637; |
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 115 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 116 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
120 | controlPoint2X = 43.179; | 117 | controlPoint2X = 43.179; |
121 | controlPoint2Y = 21.921; | 118 | controlPoint2Y = 21.921; |
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 119 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 120 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 121 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
125 | context.closePath(); | 122 | context.closePath(); |
126 | context.fillStyle = aColor; | 123 | context.fillStyle = aColor; |
127 | context.fill(); | 124 | context.fill(); |
128 | 125 | ||
129 | alignStroke = 0.0; | 126 | alignStroke = 0.0; |
130 | context.beginPath(); | 127 | context.beginPath(); |
131 | pointX = 56.548; | 128 | pointX = 56.548; |
132 | pointY = 53.379; | 129 | pointY = 53.379; |
133 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
134 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
135 | context.moveTo(pointX, pointY); | 132 | context.moveTo(pointX, pointY); |
136 | pointX = 51.2; | 133 | pointX = 51.2; |
137 | pointY = 48.032; | 134 | pointY = 48.032; |
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
140 | controlPoint1X = 56.548; | 137 | controlPoint1X = 56.548; |
141 | controlPoint1Y = 50.446; | 138 | controlPoint1Y = 50.446; |
142 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 139 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
143 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 140 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
144 | controlPoint2X = 54.134; | 141 | controlPoint2X = 54.134; |
145 | controlPoint2Y = 48.032; | 142 | controlPoint2Y = 48.032; |
146 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 143 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
147 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 144 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
148 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 145 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
149 | pointX = 45.853; | 146 | pointX = 45.853; |
150 | pointY = 53.379; | 147 | pointY = 53.379; |
151 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
152 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
153 | controlPoint1X = 48.267; | 150 | controlPoint1X = 48.267; |
154 | controlPoint1Y = 48.032; | 151 | controlPoint1Y = 48.032; |
155 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 152 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
156 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 153 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
157 | controlPoint2X = 45.853; | 154 | controlPoint2X = 45.853; |
158 | controlPoint2Y = 50.446; | 155 | controlPoint2Y = 50.446; |
159 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 156 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
160 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 157 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
161 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 158 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
162 | pointX = 51.2; | 159 | pointX = 51.2; |
163 | pointY = 58.727; | 160 | pointY = 58.727; |
164 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 161 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
165 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 162 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
166 | controlPoint1X = 45.853; | 163 | controlPoint1X = 45.853; |
167 | controlPoint1Y = 56.313; | 164 | controlPoint1Y = 56.313; |
168 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 165 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
169 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 166 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
170 | controlPoint2X = 48.267; | 167 | controlPoint2X = 48.267; |
171 | controlPoint2Y = 58.727; | 168 | controlPoint2Y = 58.727; |
172 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 169 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
173 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 170 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
174 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 171 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
175 | pointX = 56.548; | 172 | pointX = 56.548; |
176 | pointY = 53.379; | 173 | pointY = 53.379; |
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 174 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 175 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
179 | controlPoint1X = 54.134; | 176 | controlPoint1X = 54.134; |
180 | controlPoint1Y = 58.727; | 177 | controlPoint1Y = 58.727; |
181 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 178 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
182 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 179 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
183 | controlPoint2X = 56.548; | 180 | controlPoint2X = 56.548; |
184 | controlPoint2Y = 56.313; | 181 | controlPoint2Y = 56.313; |
185 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 182 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
186 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 183 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
187 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 184 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
188 | context.closePath(); | 185 | context.closePath(); |
189 | context.fillStyle = aColor; | 186 | context.fillStyle = aColor; |
190 | context.fill(); | 187 | context.fill(); |
191 | 188 | ||
192 | alignStroke = 0.0; | 189 | alignStroke = 0.0; |
193 | context.beginPath(); | 190 | context.beginPath(); |
194 | pointX = 31.147; | 191 | pointX = 31.147; |
195 | pointY = 38.674; | 192 | pointY = 38.674; |
196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 193 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 194 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
198 | context.moveTo(pointX, pointY); | 195 | context.moveTo(pointX, pointY); |
199 | pointX = 25.8; | 196 | pointX = 25.8; |
200 | pointY = 33.326; | 197 | pointY = 33.326; |
201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 198 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 199 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
203 | controlPoint1X = 31.147; | 200 | controlPoint1X = 31.147; |
204 | controlPoint1Y = 35.74; | 201 | controlPoint1Y = 35.74; |
205 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 202 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
206 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 203 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
207 | controlPoint2X = 28.733; | 204 | controlPoint2X = 28.733; |
208 | controlPoint2Y = 33.326; | 205 | controlPoint2Y = 33.326; |
209 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 206 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
210 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 207 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
211 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 208 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
212 | pointX = 20.452; | 209 | pointX = 20.452; |
213 | pointY = 38.674; | 210 | pointY = 38.674; |
214 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 211 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
215 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 212 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
216 | controlPoint1X = 22.866; | 213 | controlPoint1X = 22.866; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js index eaeb7f1..572d9be 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //store.js | 27 | //store.js |
31 | //store | 28 | //store |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; | 35 | var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; |
39 | var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; | 36 | var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | if (window.devicePixelRatio) | 46 | if (window.devicePixelRatio) |
50 | resolution = window.devicePixelRatio; | 47 | resolution = window.devicePixelRatio; |
51 | else | 48 | else |
52 | resolution = 1.0; | 49 | resolution = 1.0; |
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | 50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); |
54 | 51 | ||
55 | context.save(); | 52 | context.save(); |
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | 53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); |
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_storeWidth, kClipperz_PM_UI_Canvas_Features_storeHeight); | 54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_storeWidth, kClipperz_PM_UI_Canvas_Features_storeHeight); |
58 | 55 | ||
59 | // Layer 1 | 56 | // Layer 1 |
60 | 57 | ||
61 | alignStroke = 0.0; | 58 | alignStroke = 0.0; |
62 | context.beginPath(); | 59 | context.beginPath(); |
63 | pointX = 27.0; | 60 | pointX = 27.0; |
64 | pointY = 29.5; | 61 | pointY = 29.5; |
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
67 | context.moveTo(pointX, pointY); | 64 | context.moveTo(pointX, pointY); |
68 | pointX = 27.0; | 65 | pointX = 27.0; |
69 | pointY = 24.5; | 66 | pointY = 24.5; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.lineTo(pointX, pointY); | 69 | context.lineTo(pointX, pointY); |
73 | pointX = 22.0; | 70 | pointX = 22.0; |
74 | pointY = 24.5; | 71 | pointY = 24.5; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 74 | context.lineTo(pointX, pointY); |
78 | pointX = 22.0; | 75 | pointX = 22.0; |
79 | pointY = 29.5; | 76 | pointY = 29.5; |
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
82 | context.lineTo(pointX, pointY); | 79 | context.lineTo(pointX, pointY); |
83 | pointX = 27.0; | 80 | pointX = 27.0; |
84 | pointY = 29.5; | 81 | pointY = 29.5; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
87 | context.lineTo(pointX, pointY); | 84 | context.lineTo(pointX, pointY); |
88 | context.closePath(); | 85 | context.closePath(); |
89 | context.fillStyle = aColor; | 86 | context.fillStyle = aColor; |
90 | context.fill(); | 87 | context.fill(); |
91 | 88 | ||
92 | alignStroke = 0.0; | 89 | alignStroke = 0.0; |
93 | context.beginPath(); | 90 | context.beginPath(); |
94 | pointX = 54.0; | 91 | pointX = 54.0; |
95 | pointY = 29.5; | 92 | pointY = 29.5; |
96 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 93 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
97 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 94 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
98 | context.moveTo(pointX, pointY); | 95 | context.moveTo(pointX, pointY); |
99 | pointX = 54.0; | 96 | pointX = 54.0; |
100 | pointY = 24.5; | 97 | pointY = 24.5; |
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
103 | context.lineTo(pointX, pointY); | 100 | context.lineTo(pointX, pointY); |
104 | pointX = 29.0; | 101 | pointX = 29.0; |
105 | pointY = 24.5; | 102 | pointY = 24.5; |
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 103 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 104 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
108 | context.lineTo(pointX, pointY); | 105 | context.lineTo(pointX, pointY); |
109 | pointX = 29.0; | 106 | pointX = 29.0; |
110 | pointY = 29.5; | 107 | pointY = 29.5; |
111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 108 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 109 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
113 | context.lineTo(pointX, pointY); | 110 | context.lineTo(pointX, pointY); |
114 | pointX = 54.0; | 111 | pointX = 54.0; |
115 | pointY = 29.5; | 112 | pointY = 29.5; |
116 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 113 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
117 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 114 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
118 | context.lineTo(pointX, pointY); | 115 | context.lineTo(pointX, pointY); |
119 | context.closePath(); | 116 | context.closePath(); |
120 | context.fillStyle = aColor; | 117 | context.fillStyle = aColor; |
121 | context.fill(); | 118 | context.fill(); |
122 | 119 | ||
123 | alignStroke = 0.0; | 120 | alignStroke = 0.0; |
124 | context.beginPath(); | 121 | context.beginPath(); |
125 | pointX = 43.0; | 122 | pointX = 43.0; |
126 | pointY = 37.0; | 123 | pointY = 37.0; |
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 124 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 125 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
129 | context.moveTo(pointX, pointY); | 126 | context.moveTo(pointX, pointY); |
130 | pointX = 43.0; | 127 | pointX = 43.0; |
131 | pointY = 32.0; | 128 | pointY = 32.0; |
132 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 129 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
133 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 130 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
134 | context.lineTo(pointX, pointY); | 131 | context.lineTo(pointX, pointY); |
135 | pointX = 29.0; | 132 | pointX = 29.0; |
136 | pointY = 32.0; | 133 | pointY = 32.0; |
137 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 134 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
138 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 135 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
139 | context.lineTo(pointX, pointY); | 136 | context.lineTo(pointX, pointY); |
140 | pointX = 29.0; | 137 | pointX = 29.0; |
141 | pointY = 37.0; | 138 | pointY = 37.0; |
142 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 139 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
143 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 140 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
144 | context.lineTo(pointX, pointY); | 141 | context.lineTo(pointX, pointY); |
145 | pointX = 43.0; | 142 | pointX = 43.0; |
146 | pointY = 37.0; | 143 | pointY = 37.0; |
147 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 144 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
148 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 145 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
149 | context.lineTo(pointX, pointY); | 146 | context.lineTo(pointX, pointY); |
150 | context.closePath(); | 147 | context.closePath(); |
151 | context.fillStyle = aColor; | 148 | context.fillStyle = aColor; |
152 | context.fill(); | 149 | context.fill(); |
153 | 150 | ||
154 | alignStroke = 0.0; | 151 | alignStroke = 0.0; |
155 | context.beginPath(); | 152 | context.beginPath(); |
156 | pointX = 27.0; | 153 | pointX = 27.0; |
157 | pointY = 37.0; | 154 | pointY = 37.0; |
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 155 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 156 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
160 | context.moveTo(pointX, pointY); | 157 | context.moveTo(pointX, pointY); |
161 | pointX = 27.0; | 158 | pointX = 27.0; |
162 | pointY = 32.0; | 159 | pointY = 32.0; |
163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 160 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 161 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
165 | context.lineTo(pointX, pointY); | 162 | context.lineTo(pointX, pointY); |
166 | pointX = 22.0; | 163 | pointX = 22.0; |
167 | pointY = 32.0; | 164 | pointY = 32.0; |
168 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 165 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
169 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 166 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
170 | context.lineTo(pointX, pointY); | 167 | context.lineTo(pointX, pointY); |
171 | pointX = 22.0; | 168 | pointX = 22.0; |
172 | pointY = 37.0; | 169 | pointY = 37.0; |
173 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 170 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
174 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 171 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
175 | context.lineTo(pointX, pointY); | 172 | context.lineTo(pointX, pointY); |
176 | pointX = 27.0; | 173 | pointX = 27.0; |
177 | pointY = 37.0; | 174 | pointY = 37.0; |
178 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 175 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
179 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 176 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
180 | context.lineTo(pointX, pointY); | 177 | context.lineTo(pointX, pointY); |
181 | context.closePath(); | 178 | context.closePath(); |
182 | context.fillStyle = aColor; | 179 | context.fillStyle = aColor; |
183 | context.fill(); | 180 | context.fill(); |
184 | 181 | ||
185 | alignStroke = 0.0; | 182 | alignStroke = 0.0; |
186 | context.beginPath(); | 183 | context.beginPath(); |
187 | pointX = 27.0; | 184 | pointX = 27.0; |
188 | pointY = 44.0; | 185 | pointY = 44.0; |
189 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 186 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
190 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 187 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
191 | context.moveTo(pointX, pointY); | 188 | context.moveTo(pointX, pointY); |
192 | pointX = 27.0; | 189 | pointX = 27.0; |
193 | pointY = 39.0; | 190 | pointY = 39.0; |
194 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 191 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
195 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 192 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
196 | context.lineTo(pointX, pointY); | 193 | context.lineTo(pointX, pointY); |
197 | pointX = 22.0; | 194 | pointX = 22.0; |
198 | pointY = 39.0; | 195 | pointY = 39.0; |
199 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
200 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
201 | context.lineTo(pointX, pointY); | 198 | context.lineTo(pointX, pointY); |
202 | pointX = 22.0; | 199 | pointX = 22.0; |
203 | pointY = 44.0; | 200 | pointY = 44.0; |
204 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
205 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
206 | context.lineTo(pointX, pointY); | 203 | context.lineTo(pointX, pointY); |
207 | pointX = 27.0; | 204 | pointX = 27.0; |
208 | pointY = 44.0; | 205 | pointY = 44.0; |
209 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 206 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
210 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 207 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
211 | context.lineTo(pointX, pointY); | 208 | context.lineTo(pointX, pointY); |
212 | context.closePath(); | 209 | context.closePath(); |
213 | context.fillStyle = aColor; | 210 | context.fillStyle = aColor; |
214 | context.fill(); | 211 | context.fill(); |
215 | 212 | ||
216 | alignStroke = 0.0; | 213 | alignStroke = 0.0; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js index 5de2e96..b9443bd 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js | |||
@@ -1,68 +1,65 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Canvas'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Canvas'); |
30 | 27 | ||
31 | MochiKit.Base.update(Clipperz.PM.UI.Canvas , { | 28 | MochiKit.Base.update(Clipperz.PM.UI.Canvas , { |
32 | 'marks': { | 29 | 'marks': { |
33 | '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, | 30 | '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, |
34 | '?':Clipperz_PM_UI_Canvas_Marks_questionMark, | 31 | '?':Clipperz_PM_UI_Canvas_Marks_questionMark, |
35 | 'i':Clipperz_PM_UI_Canvas_Marks_info | 32 | 'i':Clipperz_PM_UI_Canvas_Marks_info |
36 | }, | 33 | }, |
37 | 34 | ||
38 | 'features': { | 35 | 'features': { |
39 | 'store': Clipperz_PM_UI_Canvas_Features_store, | 36 | 'store': Clipperz_PM_UI_Canvas_Features_store, |
40 | 'protect': Clipperz_PM_UI_Canvas_Features_protect, | 37 | 'protect': Clipperz_PM_UI_Canvas_Features_protect, |
41 | 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, | 38 | 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, |
42 | 'share': Clipperz_PM_UI_Canvas_Features_share | 39 | 'share': Clipperz_PM_UI_Canvas_Features_share |
43 | }, | 40 | }, |
44 | 41 | ||
45 | 'tips': { | 42 | 'tips': { |
46 | 'open': Clipperz_PM_UI_Canvas_Tips_open, | 43 | 'open': Clipperz_PM_UI_Canvas_Tips_open, |
47 | 'close': Clipperz_PM_UI_Canvas_Tips_close | 44 | 'close': Clipperz_PM_UI_Canvas_Tips_close |
48 | }, | 45 | }, |
49 | 46 | ||
50 | 'star': { | 47 | 'star': { |
51 | 'normal': Clipperz_PM_UI_Canvas_Star_normal | 48 | 'normal': Clipperz_PM_UI_Canvas_Star_normal |
52 | }, | 49 | }, |
53 | 50 | ||
54 | 'coverActions': { | 51 | 'coverActions': { |
55 | 'look': Clipperz_PM_UI_Canvas_CoverActions_look, | 52 | 'look': Clipperz_PM_UI_Canvas_CoverActions_look, |
56 | 'download': Clipperz_PM_UI_Canvas_CoverActions_download | 53 | 'download': Clipperz_PM_UI_Canvas_CoverActions_download |
57 | }, | 54 | }, |
58 | 55 | ||
59 | 'registerButton': { | 56 | 'registerButton': { |
60 | 'normal': Clipperz_PM_UI_Canvas_RegisterButton_normal | 57 | 'normal': Clipperz_PM_UI_Canvas_RegisterButton_normal |
61 | }, | 58 | }, |
62 | 59 | ||
63 | 'logo': { | 60 | 'logo': { |
64 | 'normal': Clipperz_PM_UI_Canvas_Logo_normal | 61 | 'normal': Clipperz_PM_UI_Canvas_Logo_normal |
65 | }, | 62 | }, |
66 | 63 | ||
67 | __syntaxFix__: "syntax fix" | 64 | __syntaxFix__: "syntax fix" |
68 | }); | 65 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js index e0bea36..de9d3aa 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js | |||
@@ -1,65 +1,62 @@ | |||
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 | // | 26 | // |
30 | //normal.js | 27 | //normal.js |
31 | //normal | 28 | //normal |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/25/10 | 30 | //Created by Giulio Cesare Solaroli on 3/25/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; | 35 | var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; |
39 | var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; | 36 | var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Logo_normal(canvas, aMainColor, aSecondaryColor) | 38 | function Clipperz_PM_UI_Canvas_Logo_normal(canvas, aMainColor, aSecondaryColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var string; | 41 | var string; |
45 | 42 | ||
46 | context.save(); | 43 | context.save(); |
47 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Logo_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Logo_normalHeight); | 44 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Logo_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Logo_normalHeight); |
48 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Logo_normalWidth, kClipperz_PM_UI_Canvas_Logo_normalHeight); | 45 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Logo_normalWidth, kClipperz_PM_UI_Canvas_Logo_normalHeight); |
49 | 46 | ||
50 | // clipper… | 47 | // clipper… |
51 | 48 | ||
52 | string = "clipper"; | 49 | string = "clipper"; |
53 | context.font = "38.0pt Helvetica-Bold"; | 50 | context.font = "38.0pt Helvetica-Bold"; |
54 | context.fillStyle = aMainColor; | 51 | context.fillStyle = aMainColor; |
55 | context.fillText(string, -9.0, -9.0); | 52 | context.fillText(string, -9.0, -9.0); |
56 | 53 | ||
57 | // …z | 54 | // …z |
58 | 55 | ||
59 | string = "z"; | 56 | string = "z"; |
60 | context.font = "38.0pt Helvetica-Bold"; | 57 | context.font = "38.0pt Helvetica-Bold"; |
61 | context.fillStyle = aSecondaryColor; | 58 | context.fillStyle = aSecondaryColor; |
62 | context.fillText(string, 125.0, -9.0); | 59 | context.fillText(string, 125.0, -9.0); |
63 | 60 | ||
64 | context.restore(); | 61 | context.restore(); |
65 | } | 62 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js index f3ae04d..02f2f80 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //exclamationMark.js | 27 | //exclamationMark.js |
31 | //! | 28 | //! |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; | 35 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; |
39 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; | 36 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) | 38 | function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | if (window.devicePixelRatio) | 50 | if (window.devicePixelRatio) |
54 | resolution = window.devicePixelRatio; | 51 | resolution = window.devicePixelRatio; |
55 | else | 52 | else |
56 | resolution = 1.0; | 53 | resolution = 1.0; |
57 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
58 | 55 | ||
59 | context.save(); | 56 | context.save(); |
60 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
61 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
62 | 59 | ||
63 | // Layer 1 | 60 | // Layer 1 |
64 | 61 | ||
65 | alignStroke = 0.0; | 62 | alignStroke = 0.0; |
66 | context.beginPath(); | 63 | context.beginPath(); |
67 | pointX = 26.499; | 64 | pointX = 26.499; |
68 | pointY = 10.848; | 65 | pointY = 10.848; |
69 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
70 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
71 | context.moveTo(pointX, pointY); | 68 | context.moveTo(pointX, pointY); |
72 | pointX = 20.887; | 69 | pointX = 20.887; |
73 | pointY = 11.584; | 70 | pointY = 11.584; |
74 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
75 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
76 | controlPoint1X = 25.395; | 73 | controlPoint1X = 25.395; |
77 | controlPoint1Y = 10.802; | 74 | controlPoint1Y = 10.802; |
78 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 75 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
79 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 76 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
80 | controlPoint2X = 22.175; | 77 | controlPoint2X = 22.175; |
81 | controlPoint2Y = 11.078; | 78 | controlPoint2Y = 11.078; |
82 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 79 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
83 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 80 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
84 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 81 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
85 | pointX = 20.013; | 82 | pointX = 20.013; |
86 | pointY = 13.194; | 83 | pointY = 13.194; |
87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 84 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 85 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
89 | controlPoint1X = 20.335; | 86 | controlPoint1X = 20.335; |
90 | controlPoint1Y = 11.814; | 87 | controlPoint1Y = 11.814; |
91 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 88 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
92 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 89 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
93 | controlPoint2X = 19.921; | 90 | controlPoint2X = 19.921; |
94 | controlPoint2Y = 12.826; | 91 | controlPoint2Y = 12.826; |
95 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 92 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
96 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 93 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
97 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 94 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
98 | pointX = 23.049; | 95 | pointX = 23.049; |
99 | pointY = 28.788; | 96 | pointY = 28.788; |
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
102 | controlPoint1X = 20.243; | 99 | controlPoint1X = 20.243; |
103 | controlPoint1Y = 15.448; | 100 | controlPoint1Y = 15.448; |
104 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 101 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
105 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 102 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
106 | controlPoint2X = 22.589; | 103 | controlPoint2X = 22.589; |
107 | controlPoint2Y = 26.35; | 104 | controlPoint2Y = 26.35; |
108 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 105 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
109 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 106 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
110 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 107 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
111 | pointX = 25.027; | 108 | pointX = 25.027; |
112 | pointY = 29.156; | 109 | pointY = 29.156; |
113 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 110 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
114 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 111 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
115 | controlPoint1X = 23.279; | 112 | controlPoint1X = 23.279; |
116 | controlPoint1Y = 29.018; | 113 | controlPoint1Y = 29.018; |
117 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 114 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
118 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 115 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
119 | controlPoint2X = 24.705; | 116 | controlPoint2X = 24.705; |
120 | controlPoint2Y = 29.202; | 117 | controlPoint2Y = 29.202; |
121 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 118 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
122 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 119 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
123 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 120 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
124 | pointX = 27.971; | 121 | pointX = 27.971; |
125 | pointY = 11.354; | 122 | pointY = 11.354; |
126 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 123 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
127 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 124 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
128 | controlPoint1X = 25.809; | 125 | controlPoint1X = 25.809; |
129 | controlPoint1Y = 25.384; | 126 | controlPoint1Y = 25.384; |
130 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 127 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
131 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 128 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
132 | controlPoint2X = 27.971; | 129 | controlPoint2X = 27.971; |
133 | controlPoint2Y = 12.826; | 130 | controlPoint2Y = 12.826; |
134 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 131 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
135 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 132 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
136 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 133 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
137 | pointX = 26.499; | 134 | pointX = 26.499; |
138 | pointY = 10.848; | 135 | pointY = 10.848; |
139 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 136 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
140 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 137 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
141 | controlPoint1X = 27.557; | 138 | controlPoint1X = 27.557; |
142 | controlPoint1Y = 11.032; | 139 | controlPoint1Y = 11.032; |
143 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 140 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
144 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 141 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
145 | controlPoint2X = 26.913; | 142 | controlPoint2X = 26.913; |
146 | controlPoint2Y = 10.848; | 143 | controlPoint2Y = 10.848; |
147 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 144 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
148 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 145 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
149 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 146 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
150 | pointX = 26.499; | 147 | pointX = 26.499; |
151 | pointY = 10.848; | 148 | pointY = 10.848; |
152 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 149 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
153 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 150 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
154 | context.lineTo(pointX, pointY); | 151 | context.lineTo(pointX, pointY); |
155 | context.closePath(); | 152 | context.closePath(); |
156 | pointX = 24.337; | 153 | pointX = 24.337; |
157 | pointY = 31.962; | 154 | pointY = 31.962; |
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 155 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 156 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
160 | context.moveTo(pointX, pointY); | 157 | context.moveTo(pointX, pointY); |
161 | pointX = 21.899; | 158 | pointX = 21.899; |
162 | pointY = 32.882; | 159 | pointY = 32.882; |
163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 160 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 161 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
165 | controlPoint1X = 23.463; | 162 | controlPoint1X = 23.463; |
166 | controlPoint1Y = 31.962; | 163 | controlPoint1Y = 31.962; |
167 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 164 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
168 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 165 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
169 | controlPoint2X = 22.589; | 166 | controlPoint2X = 22.589; |
170 | controlPoint2Y = 32.284; | 167 | controlPoint2Y = 32.284; |
171 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 168 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
172 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 169 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
173 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 170 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
174 | pointX = 20.703; | 171 | pointX = 20.703; |
175 | pointY = 35.458; | 172 | pointY = 35.458; |
176 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 173 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
177 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 174 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
178 | controlPoint1X = 21.163; | 175 | controlPoint1X = 21.163; |
179 | controlPoint1Y = 33.572; | 176 | controlPoint1Y = 33.572; |
180 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 177 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
181 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 178 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
182 | controlPoint2X = 20.703; | 179 | controlPoint2X = 20.703; |
183 | controlPoint2Y = 34.538; | 180 | controlPoint2Y = 34.538; |
184 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 181 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
185 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 182 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
186 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 183 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
187 | pointX = 21.669; | 184 | pointX = 21.669; |
188 | pointY = 38.08; | 185 | pointY = 38.08; |
189 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 186 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
190 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 187 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
191 | controlPoint1X = 20.703; | 188 | controlPoint1X = 20.703; |
192 | controlPoint1Y = 36.47; | 189 | controlPoint1Y = 36.47; |
193 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 190 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
194 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 191 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
195 | controlPoint2X = 20.979; | 192 | controlPoint2X = 20.979; |
196 | controlPoint2Y = 37.344; | 193 | controlPoint2Y = 37.344; |
197 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 194 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
198 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 195 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
199 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 196 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
200 | pointX = 24.015; | 197 | pointX = 24.015; |
201 | pointY = 39.0; | 198 | pointY = 39.0; |
202 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 199 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
203 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 200 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
204 | controlPoint1X = 22.405; | 201 | controlPoint1X = 22.405; |
205 | controlPoint1Y = 38.77; | 202 | controlPoint1Y = 38.77; |
206 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 203 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
207 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 204 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
208 | controlPoint2X = 23.325; | 205 | controlPoint2X = 23.325; |
209 | controlPoint2Y = 39.0; | 206 | controlPoint2Y = 39.0; |
210 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 207 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
211 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 208 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
212 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 209 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
213 | pointX = 26.821; | 210 | pointX = 26.821; |
214 | pointY = 38.034; | 211 | pointY = 38.034; |
215 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 212 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
216 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 213 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js index adab74f..fad5c10 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //info.js | 27 | //info.js |
31 | //i | 28 | //i |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; | 35 | var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; |
39 | var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; | 36 | var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) | 38 | function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | var color; | 50 | var color; |
54 | if (window.devicePixelRatio) | 51 | if (window.devicePixelRatio) |
55 | resolution = window.devicePixelRatio; | 52 | resolution = window.devicePixelRatio; |
56 | else | 53 | else |
57 | resolution = 1.0; | 54 | resolution = 1.0; |
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | 55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); |
59 | 56 | ||
60 | context.save(); | 57 | context.save(); |
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | 58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); |
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_infoWidth, kClipperz_PM_UI_Canvas_Marks_infoHeight); | 59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_infoWidth, kClipperz_PM_UI_Canvas_Marks_infoHeight); |
63 | 60 | ||
64 | // Layer 1 | 61 | // Layer 1 |
65 | 62 | ||
66 | alignStroke = 0.0; | 63 | alignStroke = 0.0; |
67 | context.beginPath(); | 64 | context.beginPath(); |
68 | pointX = 30.253; | 65 | pointX = 30.253; |
69 | pointY = 37.436; | 66 | pointY = 37.436; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 69 | context.moveTo(pointX, pointY); |
73 | pointX = 28.505; | 70 | pointX = 28.505; |
74 | pointY = 37.022; | 71 | pointY = 37.022; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 74 | context.lineTo(pointX, pointY); |
78 | pointX = 27.677; | 75 | pointX = 27.677; |
79 | pointY = 35.09; | 76 | pointY = 35.09; |
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
82 | controlPoint1X = 27.953; | 79 | controlPoint1X = 27.953; |
83 | controlPoint1Y = 36.792; | 80 | controlPoint1Y = 36.792; |
84 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 81 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
85 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 82 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
86 | controlPoint2X = 27.677; | 83 | controlPoint2X = 27.677; |
87 | controlPoint2Y = 36.47; | 84 | controlPoint2Y = 36.47; |
88 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 85 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
89 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 86 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
90 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 87 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
91 | pointX = 27.631; | 88 | pointX = 27.631; |
92 | pointY = 27.546; | 89 | pointY = 27.546; |
93 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
94 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
95 | controlPoint1X = 27.631; | 92 | controlPoint1X = 27.631; |
96 | controlPoint1Y = 32.974; | 93 | controlPoint1Y = 32.974; |
97 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 94 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
98 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 95 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
99 | controlPoint2X = 27.631; | 96 | controlPoint2X = 27.631; |
100 | controlPoint2Y = 29.892; | 97 | controlPoint2Y = 29.892; |
101 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 98 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
102 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 99 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
103 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 100 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
104 | pointX = 27.677; | 101 | pointX = 27.677; |
105 | pointY = 19.726; | 102 | pointY = 19.726; |
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 103 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 104 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
108 | controlPoint1X = 27.631; | 105 | controlPoint1X = 27.631; |
109 | controlPoint1Y = 24.97; | 106 | controlPoint1Y = 24.97; |
110 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 107 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
111 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 108 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
112 | controlPoint2X = 27.677; | 109 | controlPoint2X = 27.677; |
113 | controlPoint2Y = 21.612; | 110 | controlPoint2Y = 21.612; |
114 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 111 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
115 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 112 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
116 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 113 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
117 | pointX = 19.535; | 114 | pointX = 19.535; |
118 | pointY = 21.336; | 115 | pointY = 21.336; |
119 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 116 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
120 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 117 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
121 | controlPoint1X = 25.331; | 118 | controlPoint1X = 25.331; |
122 | controlPoint1Y = 20.692; | 119 | controlPoint1Y = 20.692; |
123 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 120 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
124 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 121 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
125 | controlPoint2X = 20.593; | 122 | controlPoint2X = 20.593; |
126 | controlPoint2Y = 21.336; | 123 | controlPoint2Y = 21.336; |
127 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 124 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
128 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 125 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
129 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 126 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
130 | pointX = 19.443; | 127 | pointX = 19.443; |
131 | pointY = 22.762; | 128 | pointY = 22.762; |
132 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 129 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
133 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 130 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
134 | controlPoint1X = 19.397; | 131 | controlPoint1X = 19.397; |
135 | controlPoint1Y = 21.52; | 132 | controlPoint1Y = 21.52; |
136 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 133 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
137 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 134 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
138 | controlPoint2X = 19.305; | 135 | controlPoint2X = 19.305; |
139 | controlPoint2Y = 22.532; | 136 | controlPoint2Y = 22.532; |
140 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 137 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
141 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 138 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
142 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 139 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
143 | pointX = 21.283; | 140 | pointX = 21.283; |
144 | pointY = 23.82; | 141 | pointY = 23.82; |
145 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 142 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
146 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 143 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
147 | controlPoint1X = 20.639; | 144 | controlPoint1X = 20.639; |
148 | controlPoint1Y = 23.222; | 145 | controlPoint1Y = 23.222; |
149 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 146 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
150 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 147 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
151 | controlPoint2X = 20.961; | 148 | controlPoint2X = 20.961; |
152 | controlPoint2Y = 23.452; | 149 | controlPoint2Y = 23.452; |
153 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 150 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
154 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 151 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
155 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 152 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
156 | pointX = 21.605; | 153 | pointX = 21.605; |
157 | pointY = 24.97; | 154 | pointY = 24.97; |
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 155 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 156 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
160 | controlPoint1X = 21.513; | 157 | controlPoint1X = 21.513; |
161 | controlPoint1Y = 24.05; | 158 | controlPoint1Y = 24.05; |
162 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 159 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
163 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 160 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
164 | controlPoint2X = 21.605; | 161 | controlPoint2X = 21.605; |
165 | controlPoint2Y = 24.602; | 162 | controlPoint2Y = 24.602; |
166 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 163 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
167 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 164 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
168 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 165 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
169 | pointX = 21.651; | 166 | pointX = 21.651; |
170 | pointY = 29.156; | 167 | pointY = 29.156; |
171 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 168 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
172 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 169 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
173 | controlPoint1X = 21.651; | 170 | controlPoint1X = 21.651; |
174 | controlPoint1Y = 25.752; | 171 | controlPoint1Y = 25.752; |
175 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 172 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
176 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 173 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
177 | controlPoint2X = 21.651; | 174 | controlPoint2X = 21.651; |
178 | controlPoint2Y = 27.592; | 175 | controlPoint2Y = 27.592; |
179 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 176 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
180 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 177 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
181 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 178 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
182 | pointX = 21.605; | 179 | pointX = 21.605; |
183 | pointY = 35.228; | 180 | pointY = 35.228; |
184 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 181 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
185 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 182 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
186 | controlPoint1X = 21.651; | 183 | controlPoint1X = 21.651; |
187 | controlPoint1Y = 31.364; | 184 | controlPoint1Y = 31.364; |
188 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 185 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
189 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 186 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
190 | controlPoint2X = 21.651; | 187 | controlPoint2X = 21.651; |
191 | controlPoint2Y = 34.216; | 188 | controlPoint2Y = 34.216; |
192 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 189 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
193 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 190 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
194 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 191 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
195 | pointX = 20.823; | 192 | pointX = 20.823; |
196 | pointY = 37.022; | 193 | pointY = 37.022; |
197 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 194 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
198 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 195 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
199 | controlPoint1X = 21.559; | 196 | controlPoint1X = 21.559; |
200 | controlPoint1Y = 36.332; | 197 | controlPoint1Y = 36.332; |
201 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 198 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
202 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 199 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
203 | controlPoint2X = 21.467; | 200 | controlPoint2X = 21.467; |
204 | controlPoint2Y = 36.838; | 201 | controlPoint2Y = 36.838; |
205 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 202 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
206 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 203 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
207 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 204 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
208 | pointX = 19.121; | 205 | pointX = 19.121; |
209 | pointY = 37.436; | 206 | pointY = 37.436; |
210 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 207 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
211 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 208 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
212 | controlPoint1X = 20.363; | 209 | controlPoint1X = 20.363; |
213 | controlPoint1Y = 37.206; | 210 | controlPoint1Y = 37.206; |
214 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 211 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
215 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 212 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
216 | controlPoint2X = 19.857; | 213 | controlPoint2X = 19.857; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js index 003c4c2..5842828 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //questionMark.js | 27 | //questionMark.js |
31 | //? | 28 | //? |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | 30 | //Created by Giulio Cesare Solaroli on 3/7/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; | 35 | var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; |
39 | var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; | 36 | var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) | 38 | function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | var color; | 50 | var color; |
54 | if (window.devicePixelRatio) | 51 | if (window.devicePixelRatio) |
55 | resolution = window.devicePixelRatio; | 52 | resolution = window.devicePixelRatio; |
56 | else | 53 | else |
57 | resolution = 1.0; | 54 | resolution = 1.0; |
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
59 | 56 | ||
60 | context.save(); | 57 | context.save(); |
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
63 | 60 | ||
64 | // Layer 1 | 61 | // Layer 1 |
65 | 62 | ||
66 | alignStroke = 0.0; | 63 | alignStroke = 0.0; |
67 | context.beginPath(); | 64 | context.beginPath(); |
68 | pointX = 24.118; | 65 | pointX = 24.118; |
69 | pointY = 24.464; | 66 | pointY = 24.464; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 69 | context.moveTo(pointX, pointY); |
73 | pointX = 24.854; | 70 | pointX = 24.854; |
74 | pointY = 23.406; | 71 | pointY = 23.406; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1X = 24.118; | 74 | controlPoint1X = 24.118; |
78 | controlPoint1Y = 24.05; | 75 | controlPoint1Y = 24.05; |
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2X = 24.44; | 78 | controlPoint2X = 24.44; |
82 | controlPoint2Y = 23.636; | 79 | controlPoint2Y = 23.636; |
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
86 | pointX = 29.454; | 83 | pointX = 29.454; |
87 | pointY = 20.6; | 84 | pointY = 20.6; |
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
90 | controlPoint1X = 26.418; | 87 | controlPoint1X = 26.418; |
91 | controlPoint1Y = 22.532; | 88 | controlPoint1Y = 22.532; |
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 89 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 90 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
94 | controlPoint2X = 28.534; | 91 | controlPoint2X = 28.534; |
95 | controlPoint2Y = 21.566; | 92 | controlPoint2Y = 21.566; |
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 93 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 94 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 95 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
99 | pointX = 30.282; | 96 | pointX = 30.282; |
100 | pointY = 17.794; | 97 | pointY = 17.794; |
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
103 | controlPoint1X = 29.868; | 100 | controlPoint1X = 29.868; |
104 | controlPoint1Y = 20.232; | 101 | controlPoint1Y = 20.232; |
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 102 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 103 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
107 | controlPoint2X = 30.282; | 104 | controlPoint2X = 30.282; |
108 | controlPoint2Y = 19.082; | 105 | controlPoint2Y = 19.082; |
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 106 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 107 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 108 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
112 | pointX = 27.2; | 109 | pointX = 27.2; |
113 | pointY = 12.688; | 110 | pointY = 12.688; |
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
116 | controlPoint1X = 30.282; | 113 | controlPoint1X = 30.282; |
117 | controlPoint1Y = 16.322; | 114 | controlPoint1Y = 16.322; |
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 115 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 116 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
120 | controlPoint2X = 29.454; | 117 | controlPoint2X = 29.454; |
121 | controlPoint2Y = 14.344; | 118 | controlPoint2Y = 14.344; |
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 119 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 120 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 121 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
125 | pointX = 21.312; | 122 | pointX = 21.312; |
126 | pointY = 10.664; | 123 | pointY = 10.664; |
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 124 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 125 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
129 | controlPoint1X = 25.636; | 126 | controlPoint1X = 25.636; |
130 | controlPoint1Y = 11.492; | 127 | controlPoint1Y = 11.492; |
131 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 128 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
132 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 129 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
133 | controlPoint2X = 23.382; | 130 | controlPoint2X = 23.382; |
134 | controlPoint2Y = 10.664; | 131 | controlPoint2Y = 10.664; |
135 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 132 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
136 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 133 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
137 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 134 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
138 | pointX = 19.886; | 135 | pointX = 19.886; |
139 | pointY = 11.124; | 136 | pointY = 11.124; |
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 137 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 138 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
142 | controlPoint1X = 20.898; | 139 | controlPoint1X = 20.898; |
143 | controlPoint1Y = 10.664; | 140 | controlPoint1Y = 10.664; |
144 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 141 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
145 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 142 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
146 | controlPoint2X = 20.162; | 143 | controlPoint2X = 20.162; |
147 | controlPoint2Y = 10.894; | 144 | controlPoint2Y = 10.894; |
148 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 145 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
149 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 146 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
150 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 147 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
151 | pointX = 18.0; | 148 | pointX = 18.0; |
152 | pointY = 14.666; | 149 | pointY = 14.666; |
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 150 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 151 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
155 | controlPoint1X = 19.104; | 152 | controlPoint1X = 19.104; |
156 | controlPoint1Y = 11.676; | 153 | controlPoint1Y = 11.676; |
157 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 154 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
158 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 155 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
159 | controlPoint2X = 18.0; | 156 | controlPoint2X = 18.0; |
160 | controlPoint2Y = 14.068; | 157 | controlPoint2Y = 14.068; |
161 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 158 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
162 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 159 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
163 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 160 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
164 | pointX = 18.598; | 161 | pointX = 18.598; |
165 | pointY = 15.586; | 162 | pointY = 15.586; |
166 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
167 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
168 | controlPoint1X = 18.0; | 165 | controlPoint1X = 18.0; |
169 | controlPoint1Y = 14.896; | 166 | controlPoint1Y = 14.896; |
170 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 167 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
171 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 168 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
172 | controlPoint2X = 18.138; | 169 | controlPoint2X = 18.138; |
173 | controlPoint2Y = 15.494; | 170 | controlPoint2Y = 15.494; |
174 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 171 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
175 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 172 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
176 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 173 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
177 | pointX = 19.794; | 174 | pointX = 19.794; |
178 | pointY = 15.908; | 175 | pointY = 15.908; |
179 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 176 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
180 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 177 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
181 | controlPoint1X = 19.012; | 178 | controlPoint1X = 19.012; |
182 | controlPoint1Y = 15.678; | 179 | controlPoint1Y = 15.678; |
183 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 180 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
184 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 181 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
185 | controlPoint2X = 19.426; | 182 | controlPoint2X = 19.426; |
186 | controlPoint2Y = 15.77; | 183 | controlPoint2Y = 15.77; |
187 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 184 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
188 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 185 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
189 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 186 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
190 | pointX = 25.36; | 187 | pointX = 25.36; |
191 | pointY = 20.002; | 188 | pointY = 20.002; |
192 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 189 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
193 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 190 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
194 | controlPoint1X = 22.508; | 191 | controlPoint1X = 22.508; |
195 | controlPoint1Y = 16.644; | 192 | controlPoint1Y = 16.644; |
196 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 193 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
197 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 194 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
198 | controlPoint2X = 25.36; | 195 | controlPoint2X = 25.36; |
199 | controlPoint2Y = 17.886; | 196 | controlPoint2Y = 17.886; |
200 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 197 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
201 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 198 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
202 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 199 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
203 | pointX = 24.21; | 200 | pointX = 24.21; |
204 | pointY = 21.704; | 201 | pointY = 21.704; |
205 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 202 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
206 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 203 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
207 | controlPoint1X = 25.36; | 204 | controlPoint1X = 25.36; |
208 | controlPoint1Y = 20.738; | 205 | controlPoint1Y = 20.738; |
209 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 206 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
210 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 207 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
211 | controlPoint2X = 25.084; | 208 | controlPoint2X = 25.084; |
212 | controlPoint2Y = 21.198; | 209 | controlPoint2Y = 21.198; |
213 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 210 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
214 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 211 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
215 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 212 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
216 | pointX = 19.058; | 213 | pointX = 19.058; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js index 288e0be..2462d0e 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js | |||
@@ -1,216 +1,213 @@ | |||
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 | // | 26 | // |
30 | //normal.js | 27 | //normal.js |
31 | //normal | 28 | //normal |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/24/10 | 30 | //Created by Giulio Cesare Solaroli on 3/24/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; | 35 | var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; |
39 | var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; | 36 | var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) | 38 | function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var controlPoint1X; | 46 | var controlPoint1X; |
50 | var controlPoint1Y; | 47 | var controlPoint1Y; |
51 | var controlPoint2X; | 48 | var controlPoint2X; |
52 | var controlPoint2Y; | 49 | var controlPoint2Y; |
53 | var gradient; | 50 | var gradient; |
54 | var color; | 51 | var color; |
55 | if (window.devicePixelRatio) | 52 | if (window.devicePixelRatio) |
56 | resolution = window.devicePixelRatio; | 53 | resolution = window.devicePixelRatio; |
57 | else | 54 | else |
58 | resolution = 1.0; | 55 | resolution = 1.0; |
59 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 56 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
60 | 57 | ||
61 | context.save(); | 58 | context.save(); |
62 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 59 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
63 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 60 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
64 | 61 | ||
65 | // background | 62 | // background |
66 | 63 | ||
67 | alignStroke = 0.0; | 64 | alignStroke = 0.0; |
68 | context.beginPath(); | 65 | context.beginPath(); |
69 | pointX = 241.0; | 66 | pointX = 241.0; |
70 | pointY = 80.0; | 67 | pointY = 80.0; |
71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
73 | context.moveTo(pointX, pointY); | 70 | context.moveTo(pointX, pointY); |
74 | pointX = 274.0; | 71 | pointX = 274.0; |
75 | pointY = 47.0; | 72 | pointY = 47.0; |
76 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
77 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
78 | controlPoint1X = 259.103; | 75 | controlPoint1X = 259.103; |
79 | controlPoint1Y = 80.0; | 76 | controlPoint1Y = 80.0; |
80 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 77 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
81 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 78 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
82 | controlPoint2X = 274.0; | 79 | controlPoint2X = 274.0; |
83 | controlPoint2Y = 65.103; | 80 | controlPoint2Y = 65.103; |
84 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 81 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
85 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 82 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
86 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 83 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
87 | pointX = 274.0; | 84 | pointX = 274.0; |
88 | pointY = 45.0; | 85 | pointY = 45.0; |
89 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 86 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
90 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 87 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
91 | context.lineTo(pointX, pointY); | 88 | context.lineTo(pointX, pointY); |
92 | pointX = 241.0; | 89 | pointX = 241.0; |
93 | pointY = 12.0; | 90 | pointY = 12.0; |
94 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 91 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
95 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 92 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
96 | controlPoint1X = 274.0; | 93 | controlPoint1X = 274.0; |
97 | controlPoint1Y = 26.897; | 94 | controlPoint1Y = 26.897; |
98 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 95 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
99 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 96 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
100 | controlPoint2X = 259.103; | 97 | controlPoint2X = 259.103; |
101 | controlPoint2Y = 12.0; | 98 | controlPoint2Y = 12.0; |
102 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 99 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
103 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 100 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
104 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 101 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
105 | pointX = 60.0; | 102 | pointX = 60.0; |
106 | pointY = 12.0; | 103 | pointY = 12.0; |
107 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 104 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
108 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 105 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
109 | context.lineTo(pointX, pointY); | 106 | context.lineTo(pointX, pointY); |
110 | pointX = 27.0; | 107 | pointX = 27.0; |
111 | pointY = 45.0; | 108 | pointY = 45.0; |
112 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 109 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
113 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 110 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
114 | controlPoint1X = 41.897; | 111 | controlPoint1X = 41.897; |
115 | controlPoint1Y = 12.0; | 112 | controlPoint1Y = 12.0; |
116 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 113 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
117 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 114 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
118 | controlPoint2X = 27.0; | 115 | controlPoint2X = 27.0; |
119 | controlPoint2Y = 26.897; | 116 | controlPoint2Y = 26.897; |
120 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 117 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
121 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 118 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
122 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 119 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
123 | pointX = 27.0; | 120 | pointX = 27.0; |
124 | pointY = 47.0; | 121 | pointY = 47.0; |
125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 122 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 123 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
127 | context.lineTo(pointX, pointY); | 124 | context.lineTo(pointX, pointY); |
128 | pointX = 60.0; | 125 | pointX = 60.0; |
129 | pointY = 80.0; | 126 | pointY = 80.0; |
130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
132 | controlPoint1X = 27.0; | 129 | controlPoint1X = 27.0; |
133 | controlPoint1Y = 65.103; | 130 | controlPoint1Y = 65.103; |
134 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 131 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
135 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 132 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
136 | controlPoint2X = 41.897; | 133 | controlPoint2X = 41.897; |
137 | controlPoint2Y = 80.0; | 134 | controlPoint2Y = 80.0; |
138 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 135 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
139 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 136 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
140 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 137 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
141 | pointX = 241.0; | 138 | pointX = 241.0; |
142 | pointY = 80.0; | 139 | pointY = 80.0; |
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
145 | context.lineTo(pointX, pointY); | 142 | context.lineTo(pointX, pointY); |
146 | context.closePath(); | 143 | context.closePath(); |
147 | gradient = context.createLinearGradient(150.5, 12.0, 150.5, 80.0); | 144 | gradient = context.createLinearGradient(150.5, 12.0, 150.5, 80.0); |
148 | gradient.addColorStop(0.0, aBackgroundColor); | 145 | gradient.addColorStop(0.0, aBackgroundColor); |
149 | gradient.addColorStop(1.0, aDarkBackgroundColor); | 146 | gradient.addColorStop(1.0, aDarkBackgroundColor); |
150 | context.fillStyle = gradient; | 147 | context.fillStyle = gradient; |
151 | context.fill(); | 148 | context.fill(); |
152 | 149 | ||
153 | // round | 150 | // round |
154 | 151 | ||
155 | alignStroke = 0.0; | 152 | alignStroke = 0.0; |
156 | context.beginPath(); | 153 | context.beginPath(); |
157 | pointX = 44.103; | 154 | pointX = 44.103; |
158 | pointY = 4.014; | 155 | pointY = 4.014; |
159 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 156 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
160 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 157 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
161 | context.moveTo(pointX, pointY); | 158 | context.moveTo(pointX, pointY); |
162 | pointX = 65.629; | 159 | pointX = 65.629; |
163 | pointY = 10.515; | 160 | pointY = 10.515; |
164 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 161 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
165 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 162 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
166 | controlPoint1X = 51.706; | 163 | controlPoint1X = 51.706; |
167 | controlPoint1Y = 4.217; | 164 | controlPoint1Y = 4.217; |
168 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 165 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
169 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 166 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
170 | controlPoint2X = 59.185; | 167 | controlPoint2X = 59.185; |
171 | controlPoint2Y = 6.475; | 168 | controlPoint2Y = 6.475; |
172 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 169 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
173 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 170 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
174 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 171 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
175 | pointX = 78.65; | 172 | pointX = 78.65; |
176 | pointY = 70.918; | 173 | pointY = 70.918; |
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 174 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 175 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
179 | context.lineTo(pointX, pointY); | 176 | context.lineTo(pointX, pointY); |
180 | pointX = 43.0; | 177 | pointX = 43.0; |
181 | pointY = 90.0; | 178 | pointY = 90.0; |
182 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 179 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
183 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 180 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
184 | controlPoint1X = 70.676; | 181 | controlPoint1X = 70.676; |
185 | controlPoint1Y = 82.788; | 182 | controlPoint1Y = 82.788; |
186 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 183 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
187 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 184 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
188 | controlPoint2X = 57.23; | 185 | controlPoint2X = 57.23; |
189 | controlPoint2Y = 89.817; | 186 | controlPoint2Y = 89.817; |
190 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 187 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
191 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 188 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
192 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 189 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
193 | pointX = 0.056; | 190 | pointX = 0.056; |
194 | pointY = 44.801; | 191 | pointY = 44.801; |
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 192 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 193 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
197 | controlPoint1X = 18.834; | 194 | controlPoint1X = 18.834; |
198 | controlPoint1Y = 90.07; | 195 | controlPoint1Y = 90.07; |
199 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 196 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
200 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 197 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
201 | controlPoint2X = -1.18; | 198 | controlPoint2X = -1.18; |
202 | controlPoint2Y = 68.879; | 199 | controlPoint2Y = 68.879; |
203 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 200 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
204 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 201 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
205 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 202 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
206 | pointX = 44.103; | 203 | pointX = 44.103; |
207 | pointY = 4.014; | 204 | pointY = 4.014; |
208 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 205 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
209 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 206 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
210 | controlPoint1X = 1.242; | 207 | controlPoint1X = 1.242; |
211 | controlPoint1Y = 21.708; | 208 | controlPoint1Y = 21.708; |
212 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 209 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
213 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 210 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
214 | controlPoint2X = 21.202; | 211 | controlPoint2X = 21.202; |
215 | controlPoint2Y = 3.72; | 212 | controlPoint2Y = 3.72; |
216 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 213 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js index e70e3b5..cf475c6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js | |||
@@ -1,153 +1,150 @@ | |||
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 | // | 26 | // |
30 | //normal.js | 27 | //normal.js |
31 | //normal | 28 | //normal |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | 30 | //Created by Giulio Cesare Solaroli on 3/15/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; | 35 | var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; |
39 | var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; | 36 | var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) | 38 | function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | if (window.devicePixelRatio) | 46 | if (window.devicePixelRatio) |
50 | resolution = window.devicePixelRatio; | 47 | resolution = window.devicePixelRatio; |
51 | else | 48 | else |
52 | resolution = 1.0; | 49 | resolution = 1.0; |
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | 50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); |
54 | 51 | ||
55 | context.save(); | 52 | context.save(); |
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | 53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); |
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Star_normalWidth, kClipperz_PM_UI_Canvas_Star_normalHeight); | 54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Star_normalWidth, kClipperz_PM_UI_Canvas_Star_normalHeight); |
58 | 55 | ||
59 | // * | 56 | // * |
60 | 57 | ||
61 | alignStroke = 0.0; | 58 | alignStroke = 0.0; |
62 | context.beginPath(); | 59 | context.beginPath(); |
63 | pointX = 8.613; | 60 | pointX = 8.613; |
64 | pointY = 15.583; | 61 | pointY = 15.583; |
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
67 | context.moveTo(pointX, pointY); | 64 | context.moveTo(pointX, pointY); |
68 | pointX = 18.563; | 65 | pointX = 18.563; |
69 | pointY = 18.821; | 66 | pointY = 18.821; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.lineTo(pointX, pointY); | 69 | context.lineTo(pointX, pointY); |
73 | pointX = 18.563; | 70 | pointX = 18.563; |
74 | pointY = 7.347; | 71 | pointY = 7.347; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 74 | context.lineTo(pointX, pointY); |
78 | pointX = 26.799; | 75 | pointX = 26.799; |
79 | pointY = 7.347; | 76 | pointY = 7.347; |
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
82 | context.lineTo(pointX, pointY); | 79 | context.lineTo(pointX, pointY); |
83 | pointX = 26.799; | 80 | pointX = 26.799; |
84 | pointY = 18.821; | 81 | pointY = 18.821; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
87 | context.lineTo(pointX, pointY); | 84 | context.lineTo(pointX, pointY); |
88 | pointX = 36.749; | 85 | pointX = 36.749; |
89 | pointY = 15.583; | 86 | pointY = 15.583; |
90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
92 | context.lineTo(pointX, pointY); | 89 | context.lineTo(pointX, pointY); |
93 | pointX = 38.986; | 90 | pointX = 38.986; |
94 | pointY = 22.677; | 91 | pointY = 22.677; |
95 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 92 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
96 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 93 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
97 | context.lineTo(pointX, pointY); | 94 | context.lineTo(pointX, pointY); |
98 | pointX = 28.846; | 95 | pointX = 28.846; |
99 | pointY = 25.819; | 96 | pointY = 25.819; |
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
102 | context.lineTo(pointX, pointY); | 99 | context.lineTo(pointX, pointY); |
103 | pointX = 35.463; | 100 | pointX = 35.463; |
104 | pointY = 35.293; | 101 | pointY = 35.293; |
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 102 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 103 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
107 | context.lineTo(pointX, pointY); | 104 | context.lineTo(pointX, pointY); |
108 | pointX = 29.369; | 105 | pointX = 29.369; |
109 | pointY = 39.625; | 106 | pointY = 39.625; |
110 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 107 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
111 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 108 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
112 | context.lineTo(pointX, pointY); | 109 | context.lineTo(pointX, pointY); |
113 | pointX = 22.752; | 110 | pointX = 22.752; |
114 | pointY = 30.675; | 111 | pointY = 30.675; |
115 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 112 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
116 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 113 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
117 | context.lineTo(pointX, pointY); | 114 | context.lineTo(pointX, pointY); |
118 | pointX = 15.944; | 115 | pointX = 15.944; |
119 | pointY = 39.625; | 116 | pointY = 39.625; |
120 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 117 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
121 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 118 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
122 | context.lineTo(pointX, pointY); | 119 | context.lineTo(pointX, pointY); |
123 | pointX = 9.85; | 120 | pointX = 9.85; |
124 | pointY = 35.293; | 121 | pointY = 35.293; |
125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 122 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 123 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
127 | context.lineTo(pointX, pointY); | 124 | context.lineTo(pointX, pointY); |
128 | pointX = 16.515; | 125 | pointX = 16.515; |
129 | pointY = 25.819; | 126 | pointY = 25.819; |
130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
132 | context.lineTo(pointX, pointY); | 129 | context.lineTo(pointX, pointY); |
133 | pointX = 6.375; | 130 | pointX = 6.375; |
134 | pointY = 22.677; | 131 | pointY = 22.677; |
135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 132 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 133 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
137 | context.lineTo(pointX, pointY); | 134 | context.lineTo(pointX, pointY); |
138 | pointX = 8.613; | 135 | pointX = 8.613; |
139 | pointY = 15.583; | 136 | pointY = 15.583; |
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 137 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 138 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
142 | context.lineTo(pointX, pointY); | 139 | context.lineTo(pointX, pointY); |
143 | context.closePath(); | 140 | context.closePath(); |
144 | pointX = 42.081; | 141 | pointX = 42.081; |
145 | pointY = 77.949; | 142 | pointY = 77.949; |
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
148 | context.moveTo(pointX, pointY); | 145 | context.moveTo(pointX, pointY); |
149 | context.fillStyle = aColor; | 146 | context.fillStyle = aColor; |
150 | context.fill(); | 147 | context.fill(); |
151 | 148 | ||
152 | context.restore(); | 149 | context.restore(); |
153 | } | 150 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js index 216fd24..cd7ed90 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js | |||
@@ -1,156 +1,153 @@ | |||
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 | // | 26 | // |
30 | //close.js | 27 | //close.js |
31 | //close | 28 | //close |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/14/10 | 30 | //Created by Giulio Cesare Solaroli on 3/14/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; | 35 | var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; |
39 | var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; | 36 | var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | if (window.devicePixelRatio) | 46 | if (window.devicePixelRatio) |
50 | resolution = window.devicePixelRatio; | 47 | resolution = window.devicePixelRatio; |
51 | else | 48 | else |
52 | resolution = 1.0; | 49 | resolution = 1.0; |
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | 50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); |
54 | 51 | ||
55 | context.save(); | 52 | context.save(); |
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | 53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); |
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_closeWidth, kClipperz_PM_UI_Canvas_Tips_closeHeight); | 54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_closeWidth, kClipperz_PM_UI_Canvas_Tips_closeHeight); |
58 | 55 | ||
59 | // background | 56 | // background |
60 | 57 | ||
61 | alignStroke = 0.0; | 58 | alignStroke = 0.0; |
62 | context.beginPath(); | 59 | context.beginPath(); |
63 | pointX = 310.0; | 60 | pointX = 310.0; |
64 | pointY = 6.0; | 61 | pointY = 6.0; |
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
67 | context.moveTo(pointX, pointY); | 64 | context.moveTo(pointX, pointY); |
68 | pointX = 310.0; | 65 | pointX = 310.0; |
69 | pointY = 0.0; | 66 | pointY = 0.0; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.lineTo(pointX, pointY); | 69 | context.lineTo(pointX, pointY); |
73 | pointX = 0.0; | 70 | pointX = 0.0; |
74 | pointY = 0.0; | 71 | pointY = 0.0; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 74 | context.lineTo(pointX, pointY); |
78 | pointX = 0.0; | 75 | pointX = 0.0; |
79 | pointY = 6.0; | 76 | pointY = 6.0; |
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
82 | context.lineTo(pointX, pointY); | 79 | context.lineTo(pointX, pointY); |
83 | pointX = 310.0; | 80 | pointX = 310.0; |
84 | pointY = 6.0; | 81 | pointY = 6.0; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
87 | context.lineTo(pointX, pointY); | 84 | context.lineTo(pointX, pointY); |
88 | context.closePath(); | 85 | context.closePath(); |
89 | context.fillStyle = aBackgroundColor; | 86 | context.fillStyle = aBackgroundColor; |
90 | context.fill(); | 87 | context.fill(); |
91 | 88 | ||
92 | // grid | 89 | // grid |
93 | 90 | ||
94 | // background | 91 | // background |
95 | 92 | ||
96 | alignStroke = 0.0; | 93 | alignStroke = 0.0; |
97 | context.beginPath(); | 94 | context.beginPath(); |
98 | pointX = 310.0; | 95 | pointX = 310.0; |
99 | pointY = 6.0; | 96 | pointY = 6.0; |
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
102 | context.moveTo(pointX, pointY); | 99 | context.moveTo(pointX, pointY); |
103 | pointX = 310.0; | 100 | pointX = 310.0; |
104 | pointY = 0.0; | 101 | pointY = 0.0; |
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 102 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 103 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
107 | context.lineTo(pointX, pointY); | 104 | context.lineTo(pointX, pointY); |
108 | pointX = 0.0; | 105 | pointX = 0.0; |
109 | pointY = 0.0; | 106 | pointY = 0.0; |
110 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 107 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
111 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 108 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
112 | context.lineTo(pointX, pointY); | 109 | context.lineTo(pointX, pointY); |
113 | pointX = 0.0; | 110 | pointX = 0.0; |
114 | pointY = 6.0; | 111 | pointY = 6.0; |
115 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 112 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
116 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 113 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
117 | context.lineTo(pointX, pointY); | 114 | context.lineTo(pointX, pointY); |
118 | pointX = 310.0; | 115 | pointX = 310.0; |
119 | pointY = 6.0; | 116 | pointY = 6.0; |
120 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 117 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
121 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 118 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
122 | context.lineTo(pointX, pointY); | 119 | context.lineTo(pointX, pointY); |
123 | context.closePath(); | 120 | context.closePath(); |
124 | context.fillStyle = aBackgroundColor; | 121 | context.fillStyle = aBackgroundColor; |
125 | context.fill(); | 122 | context.fill(); |
126 | 123 | ||
127 | // toggle | 124 | // toggle |
128 | 125 | ||
129 | alignStroke = 0.0; | 126 | alignStroke = 0.0; |
130 | context.beginPath(); | 127 | context.beginPath(); |
131 | pointX = 149.0; | 128 | pointX = 149.0; |
132 | pointY = 6.0; | 129 | pointY = 6.0; |
133 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
134 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
135 | context.moveTo(pointX, pointY); | 132 | context.moveTo(pointX, pointY); |
136 | pointX = 161.0; | 133 | pointX = 161.0; |
137 | pointY = 6.0; | 134 | pointY = 6.0; |
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
140 | context.lineTo(pointX, pointY); | 137 | context.lineTo(pointX, pointY); |
141 | pointX = 155.0; | 138 | pointX = 155.0; |
142 | pointY = 0.0; | 139 | pointY = 0.0; |
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
145 | context.lineTo(pointX, pointY); | 142 | context.lineTo(pointX, pointY); |
146 | pointX = 149.0; | 143 | pointX = 149.0; |
147 | pointY = 6.0; | 144 | pointY = 6.0; |
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 145 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 146 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
150 | context.lineTo(pointX, pointY); | 147 | context.lineTo(pointX, pointY); |
151 | context.closePath(); | 148 | context.closePath(); |
152 | context.fillStyle = aColor; | 149 | context.fillStyle = aColor; |
153 | context.fill(); | 150 | context.fill(); |
154 | 151 | ||
155 | context.restore(); | 152 | context.restore(); |
156 | } | 153 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js index f1bdaa9..30c1c69 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js | |||
@@ -1,163 +1,160 @@ | |||
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 | // | 26 | // |
30 | //open.js | 27 | //open.js |
31 | //open | 28 | //open |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/14/10 | 30 | //Created by Giulio Cesare Solaroli on 3/14/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; | 35 | var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; |
39 | var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; | 36 | var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) | 38 | function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var path; | 43 | var path; |
47 | var pointX; | 44 | var pointX; |
48 | var pointY; | 45 | var pointY; |
49 | var color; | 46 | var color; |
50 | if (window.devicePixelRatio) | 47 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 48 | resolution = window.devicePixelRatio; |
52 | else | 49 | else |
53 | resolution = 1.0; | 50 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | 51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); |
55 | 52 | ||
56 | context.save(); | 53 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | 54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_openWidth, kClipperz_PM_UI_Canvas_Tips_openHeight); | 55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_openWidth, kClipperz_PM_UI_Canvas_Tips_openHeight); |
59 | 56 | ||
60 | // background | 57 | // background |
61 | 58 | ||
62 | alignStroke = 0.0; | 59 | alignStroke = 0.0; |
63 | context.beginPath(); | 60 | context.beginPath(); |
64 | pointX = 310.0; | 61 | pointX = 310.0; |
65 | pointY = 6.0; | 62 | pointY = 6.0; |
66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 63 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 64 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
68 | context.moveTo(pointX, pointY); | 65 | context.moveTo(pointX, pointY); |
69 | pointX = 310.0; | 66 | pointX = 310.0; |
70 | pointY = 0.0; | 67 | pointY = 0.0; |
71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
73 | context.lineTo(pointX, pointY); | 70 | context.lineTo(pointX, pointY); |
74 | pointX = 0.0; | 71 | pointX = 0.0; |
75 | pointY = 0.0; | 72 | pointY = 0.0; |
76 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
77 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
78 | context.lineTo(pointX, pointY); | 75 | context.lineTo(pointX, pointY); |
79 | pointX = 0.0; | 76 | pointX = 0.0; |
80 | pointY = 6.0; | 77 | pointY = 6.0; |
81 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
82 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
83 | context.lineTo(pointX, pointY); | 80 | context.lineTo(pointX, pointY); |
84 | pointX = 310.0; | 81 | pointX = 310.0; |
85 | pointY = 6.0; | 82 | pointY = 6.0; |
86 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
87 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
88 | context.lineTo(pointX, pointY); | 85 | context.lineTo(pointX, pointY); |
89 | context.closePath(); | 86 | context.closePath(); |
90 | context.fillStyle = aBackgroundColor; | 87 | context.fillStyle = aBackgroundColor; |
91 | context.fill(); | 88 | context.fill(); |
92 | 89 | ||
93 | // grid | 90 | // grid |
94 | 91 | ||
95 | // background | 92 | // background |
96 | 93 | ||
97 | alignStroke = 0.0; | 94 | alignStroke = 0.0; |
98 | context.beginPath(); | 95 | context.beginPath(); |
99 | pointX = 310.0; | 96 | pointX = 310.0; |
100 | pointY = 6.0; | 97 | pointY = 6.0; |
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
103 | context.moveTo(pointX, pointY); | 100 | context.moveTo(pointX, pointY); |
104 | pointX = 310.0; | 101 | pointX = 310.0; |
105 | pointY = 0.0; | 102 | pointY = 0.0; |
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 103 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 104 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
108 | context.lineTo(pointX, pointY); | 105 | context.lineTo(pointX, pointY); |
109 | pointX = 0.0; | 106 | pointX = 0.0; |
110 | pointY = 0.0; | 107 | pointY = 0.0; |
111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 108 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 109 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
113 | context.lineTo(pointX, pointY); | 110 | context.lineTo(pointX, pointY); |
114 | pointX = 0.0; | 111 | pointX = 0.0; |
115 | pointY = 6.0; | 112 | pointY = 6.0; |
116 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 113 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
117 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 114 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
118 | context.lineTo(pointX, pointY); | 115 | context.lineTo(pointX, pointY); |
119 | pointX = 310.0; | 116 | pointX = 310.0; |
120 | pointY = 6.0; | 117 | pointY = 6.0; |
121 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 118 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
122 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 119 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
123 | context.lineTo(pointX, pointY); | 120 | context.lineTo(pointX, pointY); |
124 | context.closePath(); | 121 | context.closePath(); |
125 | context.fillStyle = aBackgroundColor; | 122 | context.fillStyle = aBackgroundColor; |
126 | context.fill(); | 123 | context.fill(); |
127 | 124 | ||
128 | // Layer 1 | 125 | // Layer 1 |
129 | 126 | ||
130 | alignStroke = 0.0; | 127 | alignStroke = 0.0; |
131 | context.save(); | 128 | context.save(); |
132 | context.translate(155.0, 3.0); | 129 | context.translate(155.0, 3.0); |
133 | context.rotate(-3.142); | 130 | context.rotate(-3.142); |
134 | context.translate(-155.0, -3.0); | 131 | context.translate(-155.0, -3.0); |
135 | context.beginPath(); | 132 | context.beginPath(); |
136 | pointX = 149.0; | 133 | pointX = 149.0; |
137 | pointY = 6.0; | 134 | pointY = 6.0; |
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
140 | context.moveTo(pointX, pointY); | 137 | context.moveTo(pointX, pointY); |
141 | pointX = 161.0; | 138 | pointX = 161.0; |
142 | pointY = 6.0; | 139 | pointY = 6.0; |
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
145 | context.lineTo(pointX, pointY); | 142 | context.lineTo(pointX, pointY); |
146 | pointX = 155.0; | 143 | pointX = 155.0; |
147 | pointY = 0.0; | 144 | pointY = 0.0; |
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 145 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 146 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
150 | context.lineTo(pointX, pointY); | 147 | context.lineTo(pointX, pointY); |
151 | pointX = 149.0; | 148 | pointX = 149.0; |
152 | pointY = 6.0; | 149 | pointY = 6.0; |
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 150 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 151 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
155 | context.lineTo(pointX, pointY); | 152 | context.lineTo(pointX, pointY); |
156 | context.closePath(); | 153 | context.closePath(); |
157 | color = "#FFFFFF"; | 154 | color = "#FFFFFF"; |
158 | context.fillStyle = color; | 155 | context.fillStyle = color; |
159 | context.fill(); | 156 | context.fill(); |
160 | context.restore(); | 157 | context.restore(); |
161 | 158 | ||
162 | context.restore(); | 159 | context.restore(); |
163 | } | 160 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js index 26f2fc4..2a03fdf 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | var _Clipperz_PM_Components_base_id_ = 0; | 30 | var _Clipperz_PM_Components_base_id_ = 0; |
34 | 31 | ||
35 | //############################################################################# | 32 | //############################################################################# |
36 | 33 | ||
37 | Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { | 34 | Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { |
38 | args = args || {}; | 35 | args = args || {}; |
39 | Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); | 36 | Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); |
40 | 37 | ||
41 | this._element = args.element || null; | 38 | this._element = args.element || null; |
42 | this._ids = {}; | 39 | this._ids = {}; |
43 | 40 | ||
44 | this._slots = {}; | 41 | this._slots = {}; |
45 | this._slotComponents = {}; | 42 | this._slotComponents = {}; |
46 | 43 | ||
47 | this._components = {}; | 44 | this._components = {}; |
48 | 45 | ||
49 | this._cachedSlots = {}; | 46 | this._cachedSlots = {}; |
50 | 47 | ||
51 | this._isModal = false; | 48 | this._isModal = false; |
52 | 49 | ||
53 | this._isActive = false; | 50 | this._isActive = false; |
54 | this._elementUsedToEnterModalState; | 51 | this._elementUsedToEnterModalState; |
55 | 52 | ||
56 | this._isFullyRendered = false; | 53 | this._isFullyRendered = false; |
57 | this._renderingWaitingQueue = []; | 54 | this._renderingWaitingQueue = []; |
58 | 55 | ||
59 | //this._slots = { | 56 | //this._slots = { |
60 | // 'header':'header', | 57 | // 'header':'header', |
61 | // 'body': 'body', | 58 | // 'body': 'body', |
62 | // 'footer':'footer' | 59 | // 'footer':'footer' |
63 | //}; | 60 | //}; |
64 | 61 | ||
65 | return this; | 62 | return this; |
66 | } | 63 | } |
67 | 64 | ||
68 | //============================================================================= | 65 | //============================================================================= |
69 | 66 | ||
70 | //TODO get back to MochiKit.Base.update as we are not extending anything | 67 | //TODO get back to MochiKit.Base.update as we are not extending anything |
71 | //MochiKit.Base.update(Clipperz.PM.UI.Common.Components.BaseComponent.prototype, { | 68 | //MochiKit.Base.update(Clipperz.PM.UI.Common.Components.BaseComponent.prototype, { |
72 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Component*/ Object, { | 69 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Component*/ Object, { |
73 | 70 | ||
74 | 'isClipperzPMComponent': true, | 71 | 'isClipperzPMComponent': true, |
75 | 72 | ||
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | 74 | ||
78 | 'toString': function () { | 75 | 'toString': function () { |
79 | return "Clipperz.PM.UI.Common.Components.BaseComponent component"; | 76 | return "Clipperz.PM.UI.Common.Components.BaseComponent component"; |
80 | }, | 77 | }, |
81 | 78 | ||
82 | 'componentId': function () { | 79 | 'componentId': function () { |
83 | return this.getId('_id_'); | 80 | return this.getId('_id_'); |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
87 | /* | 84 | /* |
88 | 'slots': function() { | 85 | 'slots': function() { |
89 | return this._slots; | 86 | return this._slots; |
90 | }, | 87 | }, |
91 | */ | 88 | */ |
92 | 'slotComponents': function() { | 89 | 'slotComponents': function() { |
93 | return this._slotComponents; | 90 | return this._slotComponents; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //------------------------------------------------------------------------- | 93 | //------------------------------------------------------------------------- |
97 | 94 | ||
98 | 'components': function () { | 95 | 'components': function () { |
99 | return this._components; | 96 | return this._components; |
100 | }, | 97 | }, |
101 | 98 | ||
102 | 'addComponent': function (aComponent) { | 99 | 'addComponent': function (aComponent) { |
103 | this.components()[aComponent.componentId()] = aComponent; | 100 | this.components()[aComponent.componentId()] = aComponent; |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'removeComponent': function (aComponent) { | 103 | 'removeComponent': function (aComponent) { |
107 | var componentId; | 104 | var componentId; |
108 | 105 | ||
109 | componentId = aComponent.componentId(); | 106 | componentId = aComponent.componentId(); |
110 | this.components()[componentId].remove(); | 107 | this.components()[componentId].remove(); |
111 | delete this.components()[componentId]; | 108 | delete this.components()[componentId]; |
112 | }, | 109 | }, |
113 | 110 | ||
114 | //------------------------------------------------------------------------- | 111 | //------------------------------------------------------------------------- |
115 | /* | 112 | /* |
116 | 'domHelper': function() { | 113 | 'domHelper': function() { |
117 | return Clipperz.YUI.DomHelper; | 114 | return Clipperz.YUI.DomHelper; |
118 | }, | 115 | }, |
119 | */ | 116 | */ |
120 | //------------------------------------------------------------------------- | 117 | //------------------------------------------------------------------------- |
121 | /* | 118 | /* |
122 | 'domHelperAppend': function(aValue) { | 119 | 'domHelperAppend': function(aValue) { |
123 | Clipperz.YUI.DomHelper.append(this.element().dom, aValue); | 120 | Clipperz.YUI.DomHelper.append(this.element().dom, aValue); |
124 | }, | 121 | }, |
125 | */ | 122 | */ |
126 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
127 | 124 | ||
128 | 'element': function() { | 125 | 'element': function() { |
129 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); | 126 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); |
130 | return MochiKit.DOM.getElement(this._element); | 127 | return MochiKit.DOM.getElement(this._element); |
131 | }, | 128 | }, |
132 | 129 | ||
133 | 'setElement': function(aNode) { | 130 | 'setElement': function(aNode) { |
134 | this._element = aNode; | 131 | this._element = aNode; |
135 | }, | 132 | }, |
136 | 133 | ||
137 | //----------------------------------------------------- | 134 | //----------------------------------------------------- |
138 | 135 | ||
139 | 'displayElement': function() { | 136 | 'displayElement': function() { |
140 | return this.element(); | 137 | return this.element(); |
141 | }, | 138 | }, |
142 | 139 | ||
143 | //------------------------------------------------------------------------- | 140 | //------------------------------------------------------------------------- |
144 | 141 | ||
145 | 'renderInNode': function(aDomNode) { | 142 | 'renderInNode': function(aDomNode) { |
146 | this.setElement(aDomNode); | 143 | this.setElement(aDomNode); |
147 | this.render(); | 144 | this.render(); |
148 | }, | 145 | }, |
149 | 146 | ||
150 | 'render': function() { | 147 | 'render': function() { |
151 | this.clear(); | 148 | this.clear(); |
152 | this.renderSelf(); | 149 | this.renderSelf(); |
153 | this.renderComponents(); | 150 | this.renderComponents(); |
154 | if (this.shouldShowTranslationHints()) { | 151 | if (this.shouldShowTranslationHints()) { |
155 | this.renderTranslationHints(); | 152 | this.renderTranslationHints(); |
156 | } | 153 | } |
157 | if (this.shouldShowElementWhileRendering()) { | 154 | if (this.shouldShowElementWhileRendering()) { |
158 | MochiKit.Style.showElement(this.displayElement()); | 155 | MochiKit.Style.showElement(this.displayElement()); |
159 | }; | 156 | }; |
160 | 157 | ||
161 | this._isFullyRendered = true; | 158 | this._isFullyRendered = true; |
162 | 159 | ||
163 | MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); | 160 | MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); |
164 | this.resetRenderingWaitingQueue(); | 161 | this.resetRenderingWaitingQueue(); |
165 | }, | 162 | }, |
166 | 163 | ||
167 | 'renderSelf': function() { | 164 | 'renderSelf': function() { |
168 | throw Clipperz.Base.exception.AbstractMethod; | 165 | throw Clipperz.Base.exception.AbstractMethod; |
169 | }, | 166 | }, |
170 | 167 | ||
171 | 'renderComponents': function() { | 168 | 'renderComponents': function() { |
172 | varslotName; | 169 | varslotName; |
173 | 170 | ||
174 | for (slotName in this.slotComponents()) { | 171 | for (slotName in this.slotComponents()) { |
175 | this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); | 172 | this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); |
176 | } | 173 | } |
177 | }, | 174 | }, |
178 | 175 | ||
179 | //......................................................................... | 176 | //......................................................................... |
180 | 177 | ||
181 | 'isFullyRendered': function () { | 178 | 'isFullyRendered': function () { |
182 | return this._isFullyRendered; | 179 | return this._isFullyRendered; |
183 | }, | 180 | }, |
184 | 181 | ||
185 | //......................................................................... | 182 | //......................................................................... |
186 | 183 | ||
187 | 'renderingWaitingQueue': function () { | 184 | 'renderingWaitingQueue': function () { |
188 | return this._renderingWaitingQueue; | 185 | return this._renderingWaitingQueue; |
189 | }, | 186 | }, |
190 | 187 | ||
191 | 'resetRenderingWaitingQueue': function () { | 188 | 'resetRenderingWaitingQueue': function () { |
192 | this._renderingWaitingQueue = []; | 189 | this._renderingWaitingQueue = []; |
193 | }, | 190 | }, |
194 | 191 | ||
195 | //......................................................................... | 192 | //......................................................................... |
196 | 193 | ||
197 | 'waitUntilFullyRendered': function () { | 194 | 'waitUntilFullyRendered': function () { |
198 | var deferredResult; | 195 | var deferredResult; |
199 | 196 | ||
200 | if (this.isFullyRendered() == true) { | 197 | if (this.isFullyRendered() == true) { |
201 | deferredResult = MochiKit.Async.succeed | 198 | deferredResult = MochiKit.Async.succeed |
202 | } else { | 199 | } else { |
203 | deferredResult = new Clipperz.Async.Deferred("BaseComponent.waitUntilFullyRendered", {trace:false}); | 200 | deferredResult = new Clipperz.Async.Deferred("BaseComponent.waitUntilFullyRendered", {trace:false}); |
204 | this.renderingWaitingQueue().push(deferredResult); | 201 | this.renderingWaitingQueue().push(deferredResult); |
205 | } | 202 | } |
206 | 203 | ||
207 | return deferredResult; | 204 | return deferredResult; |
208 | }, | 205 | }, |
209 | 206 | ||
210 | //----------------------------------------------------- | 207 | //----------------------------------------------------- |
211 | 208 | ||
212 | 'renderTranslationHints': function () { | 209 | 'renderTranslationHints': function () { |
213 | vartranslatableItems; | 210 | vartranslatableItems; |
214 | 211 | ||
215 | translatableItems = MochiKit.Selector.findChildElements(this.displayElement(), ['[stringID]']); | 212 | translatableItems = MochiKit.Selector.findChildElements(this.displayElement(), ['[stringID]']); |
216 | MochiKit.Iter.forEach(translatableItems, MochiKit.Base.method(this, 'enhanceTranslatableElement')) | 213 | MochiKit.Iter.forEach(translatableItems, MochiKit.Base.method(this, 'enhanceTranslatableElement')) |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js index b2761ea..716d851 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js | |||
@@ -1,108 +1,105 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.Button = function(args) { | 28 | Clipperz.PM.UI.Common.Components.Button = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._isDefault = args.isDefault|| false; | 35 | this._isDefault = args.isDefault|| false; |
39 | 36 | ||
40 | this.render(); | 37 | this.render(); |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Common.Components.Button component"; | 49 | return "Clipperz.PM.UI.Common.Components.Button component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'text': function () { | 54 | 'text': function () { |
58 | return this._text; | 55 | return this._text; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'isDefault': function () { | 58 | 'isDefault': function () { |
62 | return this._isDefault; | 59 | return this._isDefault; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'renderSelf': function () { | 64 | 'renderSelf': function () { |
68 | this.append(this.element(), {tag:'div', id:this.getId('wrapper'), cls:'button_wrapper', children:[ | 65 | this.append(this.element(), {tag:'div', id:this.getId('wrapper'), cls:'button_wrapper', children:[ |
69 | {tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[ | 66 | {tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[ |
70 | {tag:'div', id:this.getId('body'), cls:'button_body', children:[ | 67 | {tag:'div', id:this.getId('body'), cls:'button_body', children:[ |
71 | {tag:'span', html:this.text()} | 68 | {tag:'span', html:this.text()} |
72 | ]}, | 69 | ]}, |
73 | {tag:'div', id:this.getId('footer'), cls:'button_footer'} | 70 | {tag:'div', id:this.getId('footer'), cls:'button_footer'} |
74 | ]} | 71 | ]} |
75 | ]}); | 72 | ]}); |
76 | 73 | ||
77 | if (this.isDefault()) { | 74 | if (this.isDefault()) { |
78 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'default'); | 75 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'default'); |
79 | } | 76 | } |
80 | 77 | ||
81 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseenter',this, 'handleOnMouseEnter'); | 78 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseenter',this, 'handleOnMouseEnter'); |
82 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseleave',this, 'handleOnMouseLeave'); | 79 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseleave',this, 'handleOnMouseLeave'); |
83 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmousedown',this, 'handleOnMouseDown'); | 80 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmousedown',this, 'handleOnMouseDown'); |
84 | MochiKit.Signal.connect(this.getId('wrapper'), 'onclick', this, 'handleOnClick'); | 81 | MochiKit.Signal.connect(this.getId('wrapper'), 'onclick', this, 'handleOnClick'); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'handleOnMouseEnter': function (anEvent) { | 86 | 'handleOnMouseEnter': function (anEvent) { |
90 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'hover'); | 87 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'hover'); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | 'handleOnMouseLeave': function (anEvent) { | 90 | 'handleOnMouseLeave': function (anEvent) { |
94 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'hover'); | 91 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'hover'); |
95 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'clicked'); | 92 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'clicked'); |
96 | }, | 93 | }, |
97 | 94 | ||
98 | 'handleOnMouseDown': function (anEvent) { | 95 | 'handleOnMouseDown': function (anEvent) { |
99 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'clicked'); | 96 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'clicked'); |
100 | }, | 97 | }, |
101 | 98 | ||
102 | 'handleOnClick': function (anEvent) { | 99 | 'handleOnClick': function (anEvent) { |
103 | MochiKit.Signal.signal(this, 'onclick', anEvent); | 100 | MochiKit.Signal.signal(this, 'onclick', anEvent); |
104 | }, | 101 | }, |
105 | 102 | ||
106 | //------------------------------------------------------------------------- | 103 | //------------------------------------------------------------------------- |
107 | __syntaxFix__: "syntax fix" | 104 | __syntaxFix__: "syntax fix" |
108 | }); | 105 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js index 0c6e221..7f56c1e 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js | |||
@@ -1,64 +1,61 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { | 31 | Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { |
35 | this._component = aComponent; | 32 | this._component = aComponent; |
36 | this._slotName = aSlotName; | 33 | this._slotName = aSlotName; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | //============================================================================= | 38 | //============================================================================= |
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'slotName': function() { | 44 | 'slotName': function() { |
48 | return this._slotName; | 45 | return this._slotName; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | 'component': function() { | 48 | 'component': function() { |
52 | return this._component; | 49 | return this._component; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'setContent': function(aComponent) { | 54 | 'setContent': function(aComponent) { |
58 | this.component().setComponentForSlotNamed(aComponent, this.slotName()); | 55 | this.component().setComponentForSlotNamed(aComponent, this.slotName()); |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | __syntaxFix__: "syntax fix" | 59 | __syntaxFix__: "syntax fix" |
63 | 60 | ||
64 | }); | 61 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js index 4735f5c..2db2489 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js | |||
@@ -1,91 +1,88 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { | 28 | Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this.render(); | 33 | this.render(); |
37 | this.setSrc(args.src); | 34 | this.setSrc(args.src); |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 42 | ||
46 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
47 | 44 | ||
48 | 'toString': function () { | 45 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; | 46 | return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'src': function () { | 51 | 'src': function () { |
55 | return this.element().src; | 52 | return this.element().src; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | 'setSrc': function (aValue) { | 55 | 'setSrc': function (aValue) { |
59 | this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); | 56 | this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'clear': function () {}, | 61 | 'clear': function () {}, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'renderSelf': function () { | 65 | 'renderSelf': function () { |
69 | MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); | 66 | MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); |
70 | MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); | 67 | MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); |
71 | MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); | 68 | MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); |
72 | }, | 69 | }, |
73 | 70 | ||
74 | //------------------------------------------------------------------------- | 71 | //------------------------------------------------------------------------- |
75 | 72 | ||
76 | 'setDefaultFavicon': function (anEvent) { | 73 | 'setDefaultFavicon': function (anEvent) { |
77 | MochiKit.Signal.disconnectAll(anEvent.src()); | 74 | MochiKit.Signal.disconnectAll(anEvent.src()); |
78 | this.setSrc(null); | 75 | this.setSrc(null); |
79 | }, | 76 | }, |
80 | 77 | ||
81 | 'handleOnLoad': function (anEvent) { | 78 | 'handleOnLoad': function (anEvent) { |
82 | MochiKit.Signal.disconnectAll(anEvent.src()); | 79 | MochiKit.Signal.disconnectAll(anEvent.src()); |
83 | //console.log("HANDLE ON LOAD", anEvent, anEvent.src().src); | 80 | //console.log("HANDLE ON LOAD", anEvent, anEvent.src().src); |
84 | if (anEvent.src().complete == false) { | 81 | if (anEvent.src().complete == false) { |
85 | this.setSrc(null); | 82 | this.setSrc(null); |
86 | } | 83 | } |
87 | }, | 84 | }, |
88 | 85 | ||
89 | //------------------------------------------------------------------------- | 86 | //------------------------------------------------------------------------- |
90 | __syntaxFix__: "syntax fix" | 87 | __syntaxFix__: "syntax fix" |
91 | }); | 88 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js index 275bbed..2788b79 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js | |||
@@ -1,164 +1,161 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { | 28 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | // this._openFromElement = args.openFromElement || null; | 33 | // this._openFromElement = args.openFromElement || null; |
37 | this._onOkCloseToElement = args.onOkCloseToElement || null; | 34 | this._onOkCloseToElement = args.onOkCloseToElement || null; |
38 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | 35 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; |
39 | 36 | ||
40 | this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); | 37 | this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar component"; | 49 | return "Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | /* | 53 | /* |
57 | 'openFromElement': function () { | 54 | 'openFromElement': function () { |
58 | return this._openFromElement; | 55 | return this._openFromElement; |
59 | }, | 56 | }, |
60 | */ | 57 | */ |
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'onOkCloseToElement': function () { | 60 | 'onOkCloseToElement': function () { |
64 | return this._onOkCloseToElement; | 61 | return this._onOkCloseToElement; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'setOnOkCloseToElement': function (anElement) { | 64 | 'setOnOkCloseToElement': function (anElement) { |
68 | this._onOkCloseToElement = anElement; | 65 | this._onOkCloseToElement = anElement; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'onCancelCloseToElement': function () { | 70 | 'onCancelCloseToElement': function () { |
74 | return this._onCancelCloseToElement; | 71 | return this._onCancelCloseToElement; |
75 | }, | 72 | }, |
76 | 73 | ||
77 | 'setOnCancelCloseToElement': function (anElement) { | 74 | 'setOnCancelCloseToElement': function (anElement) { |
78 | this._onCancelCloseToElement = anElement; | 75 | this._onCancelCloseToElement = anElement; |
79 | }, | 76 | }, |
80 | 77 | ||
81 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
82 | 79 | ||
83 | 'canCancelWhileProcessing': function () { | 80 | 'canCancelWhileProcessing': function () { |
84 | return this._canCancelWhileProcessing; | 81 | return this._canCancelWhileProcessing; |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'deferredShowModal': function (someArgs, aResult) { | 86 | 'deferredShowModal': function (someArgs, aResult) { |
90 | if (someArgs['onOkCloseToElement'] != null) { | 87 | if (someArgs['onOkCloseToElement'] != null) { |
91 | this.setOnOkCloseToElement(someArgs['onOkCloseToElement']); | 88 | this.setOnOkCloseToElement(someArgs['onOkCloseToElement']); |
92 | } | 89 | } |
93 | 90 | ||
94 | if (someArgs['onCancelCloseToElement'] != null) { | 91 | if (someArgs['onCancelCloseToElement'] != null) { |
95 | this.setOnCancelCloseToElement(someArgs['onCancelCloseToElement']); | 92 | this.setOnCancelCloseToElement(someArgs['onCancelCloseToElement']); |
96 | } | 93 | } |
97 | 94 | ||
98 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.deferredShowModal.apply(this, arguments); | 95 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.deferredShowModal.apply(this, arguments); |
99 | return this.deferred(); | 96 | return this.deferred(); |
100 | }, | 97 | }, |
101 | 98 | ||
102 | //------------------------------------------------------------------------- | 99 | //------------------------------------------------------------------------- |
103 | 100 | ||
104 | 'showProgressBar': function () { | 101 | 'showProgressBar': function () { |
105 | varprogressBarElement; | 102 | varprogressBarElement; |
106 | 103 | ||
107 | this.getElement('container').innerHTML = ''; | 104 | this.getElement('container').innerHTML = ''; |
108 | 105 | ||
109 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | 106 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); |
110 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | 107 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); |
111 | 108 | ||
112 | if (this.canCancelWhileProcessing() == true) { | 109 | if (this.canCancelWhileProcessing() == true) { |
113 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | 110 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); |
114 | } else { | 111 | } else { |
115 | this.setButtons([]); | 112 | this.setButtons([]); |
116 | } | 113 | } |
117 | }, | 114 | }, |
118 | 115 | ||
119 | //------------------------------------------------------------------------- | 116 | //------------------------------------------------------------------------- |
120 | 117 | ||
121 | 'showFailure': function (someParameters) { | 118 | 'showFailure': function (someParameters) { |
122 | // this.setType('ALERT'); | 119 | // this.setType('ALERT'); |
123 | this.setType(someParameters['type']); | 120 | this.setType(someParameters['type']); |
124 | // this.setTitle("Login failed"); | 121 | // this.setTitle("Login failed"); |
125 | this.setTitle(someParameters['title']); | 122 | this.setTitle(someParameters['title']); |
126 | // this.setText("Wrong passphrase; the unlock has failed."); | 123 | // this.setText("Wrong passphrase; the unlock has failed."); |
127 | this.setText(someParameters['text']); | 124 | this.setText(someParameters['text']); |
128 | // this.getElement('container').innerHTML = ''; | 125 | // this.getElement('container').innerHTML = ''; |
129 | this.getElement('container').innerHTML = ''; | 126 | this.getElement('container').innerHTML = ''; |
130 | // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | 127 | // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); |
131 | this.setButtons(someParameters['buttons']); | 128 | this.setButtons(someParameters['buttons']); |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //------------------------------------------------------------------------- | 131 | //------------------------------------------------------------------------- |
135 | 132 | ||
136 | 'closeOk': function () { | 133 | 'closeOk': function () { |
137 | //console.log("=== closeOk"); | 134 | //console.log("=== closeOk"); |
138 | this.showProgressBar(); | 135 | this.showProgressBar(); |
139 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); | 136 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); |
140 | this._deferred = null; | 137 | this._deferred = null; |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'closeCancel': function () { | 140 | 'closeCancel': function () { |
144 | //console.log("=== closeCancel"); | 141 | //console.log("=== closeCancel"); |
145 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | 142 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); |
146 | this.deferred().cancel(); | 143 | this.deferred().cancel(); |
147 | this._deferred = null; | 144 | this._deferred = null; |
148 | }, | 145 | }, |
149 | 146 | ||
150 | //------------------------------------------------------------------------- | 147 | //------------------------------------------------------------------------- |
151 | 148 | ||
152 | 'deferredDone': function () { | 149 | 'deferredDone': function () { |
153 | //console.log("=== deferredDone"); | 150 | //console.log("=== deferredDone"); |
154 | return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | 151 | return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | 'deferredError': function (someParameters) { | 154 | 'deferredError': function (someParameters) { |
158 | //console.log("=== deferredError"); | 155 | //console.log("=== deferredError"); |
159 | this.showFailure(someParameters); | 156 | this.showFailure(someParameters); |
160 | }, | 157 | }, |
161 | 158 | ||
162 | //------------------------------------------------------------------------- | 159 | //------------------------------------------------------------------------- |
163 | __syntaxFix__: "syntax fix" | 160 | __syntaxFix__: "syntax fix" |
164 | }); | 161 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js index c1b4f13..089e3d4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js | |||
@@ -1,140 +1,137 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { | 28 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | //MochiKit.Logging.logDebug(">>> new TextFormField"); | 31 | //MochiKit.Logging.logDebug(">>> new TextFormField"); |
35 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); | 32 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); |
36 | 33 | ||
37 | this._wrapperElement = null; | 34 | this._wrapperElement = null; |
38 | this._entropyElement = null; | 35 | this._entropyElement = null; |
39 | 36 | ||
40 | this.render(); | 37 | this.render(); |
41 | //MochiKit.Logging.logDebug("<<< new TextFormField"); | 38 | //MochiKit.Logging.logDebug("<<< new TextFormField"); |
42 | 39 | ||
43 | return this; | 40 | return this; |
44 | }; | 41 | }; |
45 | 42 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { | 43 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 44 | ||
48 | 'toString': function() { | 45 | 'toString': function() { |
49 | return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; | 46 | return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //----------------------------------------------------- | 49 | //----------------------------------------------------- |
53 | 50 | ||
54 | 'wrapperElement': function() { | 51 | 'wrapperElement': function() { |
55 | return this._wrapperElement; | 52 | return this._wrapperElement; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | 'setWrapperElement': function(aValue) { | 55 | 'setWrapperElement': function(aValue) { |
59 | this._wrapperElement = aValue; | 56 | this._wrapperElement = aValue; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //----------------------------------------------------- | 59 | //----------------------------------------------------- |
63 | 60 | ||
64 | 'passwordElement': function() { | 61 | 'passwordElement': function() { |
65 | return this.element(); | 62 | return this.element(); |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //----------------------------------------------------- | 65 | //----------------------------------------------------- |
69 | 66 | ||
70 | 'entropyElement': function() { | 67 | 'entropyElement': function() { |
71 | return this._entropyElement; | 68 | return this._entropyElement; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'setEntropyElement': function(aValue) { | 71 | 'setEntropyElement': function(aValue) { |
75 | this._entropyElement = aValue; | 72 | this._entropyElement = aValue; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //----------------------------------------------------- | 75 | //----------------------------------------------------- |
79 | 76 | ||
80 | 'render': function() { | 77 | 'render': function() { |
81 | /* | 78 | /* |
82 | MochiKit.Signal.disconnectAllTo(this); | 79 | MochiKit.Signal.disconnectAllTo(this); |
83 | 80 | ||
84 | this.setWrapperElement(this.element().wrap({tag:'div'})); | 81 | this.setWrapperElement(this.element().wrap({tag:'div'})); |
85 | this.setEntropyElement(Clipperz.DOM.Helper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); | 82 | this.setEntropyElement(Clipperz.DOM.Helper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); |
86 | // this.setEntropyElement(Clipperz.DOM.Helper.insertBefore(this.element(), {tag:'div', cls:'passwordEntropy', html:" "}, true)); | 83 | // this.setEntropyElement(Clipperz.DOM.Helper.insertBefore(this.element(), {tag:'div', cls:'passwordEntropy', html:" "}, true)); |
87 | this.entropyElement().wrap({tag:'div', cls:'passwordEntropyWrapper'}); | 84 | this.entropyElement().wrap({tag:'div', cls:'passwordEntropyWrapper'}); |
88 | 85 | ||
89 | this.updateEntropyElement(); | 86 | this.updateEntropyElement(); |
90 | 87 | ||
91 | this.connect('onkeyup', 'updateEntropyElement'); | 88 | this.connect('onkeyup', 'updateEntropyElement'); |
92 | this.connect('onchange', 'updateEntropyElement'); | 89 | this.connect('onchange', 'updateEntropyElement'); |
93 | this.connect('onblur', 'updateEntropyElement'); | 90 | this.connect('onblur', 'updateEntropyElement'); |
94 | */ | 91 | */ |
95 | MochiKit.Signal.disconnectAllTo(this); | 92 | MochiKit.Signal.disconnectAllTo(this); |
96 | 93 | ||
97 | this.setEntropyElement(this.element()); | 94 | this.setEntropyElement(this.element()); |
98 | this.entropyElement().addClass("entropyLevelIndicator"); | 95 | this.entropyElement().addClass("entropyLevelIndicator"); |
99 | 96 | ||
100 | this.updateEntropyElement(); | 97 | this.updateEntropyElement(); |
101 | 98 | ||
102 | this.connect('onkeyup', 'updateEntropyElement'); | 99 | this.connect('onkeyup', 'updateEntropyElement'); |
103 | this.connect('onchange', 'updateEntropyElement'); | 100 | this.connect('onchange', 'updateEntropyElement'); |
104 | this.connect('onblur', 'updateEntropyElement'); | 101 | this.connect('onblur', 'updateEntropyElement'); |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //----------------------------------------------------- | 104 | //----------------------------------------------------- |
108 | 105 | ||
109 | 'computeEntropyForString': function(aValue) { | 106 | 'computeEntropyForString': function(aValue) { |
110 | return Clipperz.PM.Crypto.passwordEntropy(aValue); | 107 | return Clipperz.PM.Crypto.passwordEntropy(aValue); |
111 | }, | 108 | }, |
112 | 109 | ||
113 | //----------------------------------------------------- | 110 | //----------------------------------------------------- |
114 | 111 | ||
115 | 'updateEntropyElement': function(anEvent) { | 112 | 'updateEntropyElement': function(anEvent) { |
116 | /* | 113 | /* |
117 | //MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement"); | 114 | //MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement"); |
118 | varmaxExtent; | 115 | varmaxExtent; |
119 | varentropy; | 116 | varentropy; |
120 | 117 | ||
121 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | 118 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); |
122 | //MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy); | 119 | //MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy); |
123 | this.entropyElement().setStyle('background-position', "0px " + -entropy + "px"); | 120 | this.entropyElement().setStyle('background-position', "0px " + -entropy + "px"); |
124 | this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128)); | 121 | this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128)); |
125 | //MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement"); | 122 | //MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement"); |
126 | */ | 123 | */ |
127 | varentropy; | 124 | varentropy; |
128 | 125 | ||
129 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | 126 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); |
130 | 127 | ||
131 | if (entropy == 0) { | 128 | if (entropy == 0) { |
132 | this.entropyElement().setStyle('background-position', "0px 26px"); | 129 | this.entropyElement().setStyle('background-position', "0px 26px"); |
133 | } else { | 130 | } else { |
134 | this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); | 131 | this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); |
135 | } | 132 | } |
136 | }, | 133 | }, |
137 | 134 | ||
138 | //----------------------------------------------------- | 135 | //----------------------------------------------------- |
139 | __syntaxFix__: '__syntaxFix__' | 136 | __syntaxFix__: '__syntaxFix__' |
140 | }); | 137 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js index 7e7f8fe..5991530 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js | |||
@@ -1,73 +1,70 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { | 28 | Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | 34 | ||
38 | this.renderSelf(); | 35 | this.renderSelf(); |
39 | 36 | ||
40 | MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') | 37 | MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Common.Components.ProgressBar component"; | 49 | return "Clipperz.PM.UI.Common.Components.ProgressBar component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'renderSelf': function() { | 54 | 'renderSelf': function() { |
58 | this.append(this.element(), {tag:'div', cls:'loadingBar', children:[ | 55 | this.append(this.element(), {tag:'div', cls:'loadingBar', children:[ |
59 | {tag:'div', cls:'loadingBarProgressBox', children:[ | 56 | {tag:'div', cls:'loadingBarProgressBox', children:[ |
60 | {tag:'div', id:this.getId('loadingBarProgress'), cls:'loadingBarProgress'} | 57 | {tag:'div', id:this.getId('loadingBarProgress'), cls:'loadingBarProgress'} |
61 | ]} | 58 | ]} |
62 | ]}); | 59 | ]}); |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'updateProgressHandler': function (anEvent) { | 64 | 'updateProgressHandler': function (anEvent) { |
68 | MochiKit.Style.setElementDimensions(this.getId('loadingBarProgress'), {w:anEvent}, '%'); | 65 | MochiKit.Style.setElementDimensions(this.getId('loadingBarProgress'), {w:anEvent}, '%'); |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
72 | __syntaxFix__: "syntax fix" | 69 | __syntaxFix__: "syntax fix" |
73 | }); | 70 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js index b9bb850..1992154 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { | 28 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR | 35 | this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR |
39 | this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); | 36 | this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); |
40 | 37 | ||
41 | this._buttonComponents = []; | 38 | this._buttonComponents = []; |
42 | this._deferred = null; | 39 | this._deferred = null; |
43 | 40 | ||
44 | this.renderModalMask(); | 41 | this.renderModalMask(); |
45 | 42 | ||
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | //============================================================================= | 46 | //============================================================================= |
50 | 47 | ||
51 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | 48 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'toString': function () { | 52 | 'toString': function () { |
56 | return "Clipperz.PM.UI.Common.Components.SimpleMessagePanel component"; | 53 | return "Clipperz.PM.UI.Common.Components.SimpleMessagePanel component"; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'deferred': function() { | 58 | 'deferred': function() { |
62 | if (this._deferred == null) { | 59 | if (this._deferred == null) { |
63 | this._deferred = new Clipperz.Async.Deferred("SimpleMessagePanel.deferred", {trace:false}); | 60 | this._deferred = new Clipperz.Async.Deferred("SimpleMessagePanel.deferred", {trace:false}); |
64 | } | 61 | } |
65 | 62 | ||
66 | return this._deferred; | 63 | return this._deferred; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'title': function () { | 68 | 'title': function () { |
72 | return this._title; | 69 | return this._title; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | 'setTitle': function (aValue) { | 72 | 'setTitle': function (aValue) { |
76 | this._title = aValue; | 73 | this._title = aValue; |
77 | 74 | ||
78 | if (this.getElement('title') != null) { | 75 | if (this.getElement('title') != null) { |
79 | this.getElement('title').innerHTML = aValue; | 76 | this.getElement('title').innerHTML = aValue; |
80 | } | 77 | } |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | 81 | ||
85 | 'text': function () { | 82 | 'text': function () { |
86 | return this._text; | 83 | return this._text; |
87 | }, | 84 | }, |
88 | 85 | ||
89 | 'setText': function (aValue) { | 86 | 'setText': function (aValue) { |
90 | this._text = aValue; | 87 | this._text = aValue; |
91 | 88 | ||
92 | if (this.getElement('text') != null) { | 89 | if (this.getElement('text') != null) { |
93 | this.getElement('text').innerHTML = aValue; | 90 | this.getElement('text').innerHTML = aValue; |
94 | } | 91 | } |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'type': function () { | 96 | 'type': function () { |
100 | return this._type; | 97 | return this._type; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | 'setType': function (aValue) { | 100 | 'setType': function (aValue) { |
104 | if (this.getElement('icon') != null) { | 101 | if (this.getElement('icon') != null) { |
105 | MochiKit.DOM.removeElementClass(this.getId('icon'), this._type); | 102 | MochiKit.DOM.removeElementClass(this.getId('icon'), this._type); |
106 | MochiKit.DOM.addElementClass(this.getId('icon'), aValue); | 103 | MochiKit.DOM.addElementClass(this.getId('icon'), aValue); |
107 | } | 104 | } |
108 | 105 | ||
109 | this._type = aValue; | 106 | this._type = aValue; |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'buttons': function () { | 111 | 'buttons': function () { |
115 | return this._buttons; | 112 | return this._buttons; |
116 | }, | 113 | }, |
117 | 114 | ||
118 | 'setButtons': function (someValues) { | 115 | 'setButtons': function (someValues) { |
119 | MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear')); | 116 | MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear')); |
120 | 117 | ||
121 | this._buttons = someValues; | 118 | this._buttons = someValues; |
122 | 119 | ||
123 | if (this.getElement('buttonArea') != null) { | 120 | if (this.getElement('buttonArea') != null) { |
124 | this.renderButtons(); | 121 | this.renderButtons(); |
125 | } | 122 | } |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //......................................................................... | 125 | //......................................................................... |
129 | 126 | ||
130 | 'buttonComponents': function () { | 127 | 'buttonComponents': function () { |
131 | return this._buttonComponents; | 128 | return this._buttonComponents; |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //------------------------------------------------------------------------- | 131 | //------------------------------------------------------------------------- |
135 | 132 | ||
136 | 'renderSelf': function() { | 133 | 'renderSelf': function() { |
137 | this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [ | 134 | this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [ |
138 | {tag:'div', cls:'header', children:[]}, | 135 | {tag:'div', cls:'header', children:[]}, |
139 | {tag:'div', cls:'body', children:[ | 136 | {tag:'div', cls:'body', children:[ |
140 | {tag:'div', id:this.getId('icon'),cls:'img ' + this.type(), children:[{tag:'div'}]}, | 137 | {tag:'div', id:this.getId('icon'),cls:'img ' + this.type(), children:[{tag:'div'}]}, |
141 | {tag:'h3', id:this.getId('title'),html:this.title()}, | 138 | {tag:'h3', id:this.getId('title'),html:this.title()}, |
142 | {tag:'p', id:this.getId('text'),html:this.text()}, | 139 | {tag:'p', id:this.getId('text'),html:this.text()}, |
143 | {tag:'div', id:this.getId('container')}, | 140 | {tag:'div', id:this.getId('container')}, |
144 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} | 141 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} |
145 | ]}, | 142 | ]}, |
146 | {tag:'div', cls:'footer', children:[]} | 143 | {tag:'div', cls:'footer', children:[]} |
147 | ]}); | 144 | ]}); |
148 | 145 | ||
149 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); | 146 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); |
150 | 147 | ||
151 | this.renderButtons(); | 148 | this.renderButtons(); |
152 | }, | 149 | }, |
153 | 150 | ||
154 | //------------------------------------------------------------------------- | 151 | //------------------------------------------------------------------------- |
155 | 152 | ||
156 | 'renderButtons': function () { | 153 | 'renderButtons': function () { |
157 | this.getElement('buttonArea').innerHTML = ''; | 154 | this.getElement('buttonArea').innerHTML = ''; |
158 | 155 | ||
159 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { | 156 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { |
160 | var buttonElement; | 157 | var buttonElement; |
161 | var buttonComponent; | 158 | var buttonComponent; |
162 | 159 | ||
163 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ | 160 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ |
164 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} | 161 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} |
165 | // ]}); | 162 | // ]}); |
166 | 163 | ||
167 | buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'}); | 164 | buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'}); |
168 | buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']}); | 165 | buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']}); |
169 | this.buttonComponents().push(buttonComponent); | 166 | this.buttonComponents().push(buttonComponent); |
170 | 167 | ||
171 | MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton)); | 168 | MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton)); |
172 | }, this), MochiKit.Iter.reversed(this.buttons())); | 169 | }, this), MochiKit.Iter.reversed(this.buttons())); |
173 | }, | 170 | }, |
174 | 171 | ||
175 | //------------------------------------------------------------------------- | 172 | //------------------------------------------------------------------------- |
176 | 173 | ||
177 | 'displayElement': function() { | 174 | 'displayElement': function() { |
178 | return this.getElement('panel'); | 175 | return this.getElement('panel'); |
179 | }, | 176 | }, |
180 | 177 | ||
181 | //------------------------------------------------------------------------- | 178 | //------------------------------------------------------------------------- |
182 | 179 | ||
183 | 'closeOk': function () { | 180 | 'closeOk': function () { |
184 | this.deferred().callback(); | 181 | this.deferred().callback(); |
185 | this._deferred = null; | 182 | this._deferred = null; |
186 | }, | 183 | }, |
187 | 184 | ||
188 | 'closeCancel': function () { | 185 | 'closeCancel': function () { |
189 | this.deferred().cancel(); | 186 | this.deferred().cancel(); |
190 | this._deferred = null; | 187 | this._deferred = null; |
191 | }, | 188 | }, |
192 | 189 | ||
193 | 'closeError': function () { | 190 | 'closeError': function () { |
194 | this.deferred().errback(); | 191 | this.deferred().errback(); |
195 | this._deferred = null; | 192 | this._deferred = null; |
196 | }, | 193 | }, |
197 | 194 | ||
198 | //------------------------------------------------------------------------- | 195 | //------------------------------------------------------------------------- |
199 | 196 | ||
200 | 'buttonEventHandler': function(aButton, anEvent) { | 197 | 'buttonEventHandler': function(aButton, anEvent) { |
201 | anEvent.preventDefault(); | 198 | anEvent.preventDefault(); |
202 | 199 | ||
203 | // MochiKit.Signal.signal(this, 'cancelEvent'); | 200 | // MochiKit.Signal.signal(this, 'cancelEvent'); |
204 | switch (aButton['result']) { | 201 | switch (aButton['result']) { |
205 | case 'OK': | 202 | case 'OK': |
206 | //console.log("==> OK"); | 203 | //console.log("==> OK"); |
207 | this.closeOk(); | 204 | this.closeOk(); |
208 | break; | 205 | break; |
209 | case 'CANCEL': | 206 | case 'CANCEL': |
210 | //console.log("==> CANCEL"); | 207 | //console.log("==> CANCEL"); |
211 | this.closeCancel(); | 208 | this.closeCancel(); |
212 | break; | 209 | break; |
213 | default: | 210 | default: |
214 | //console.log("==> ????"); | 211 | //console.log("==> ????"); |
215 | this.closeError(); | 212 | this.closeError(); |
216 | break; | 213 | break; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js index afb3bf9..936514a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js | |||
@@ -1,69 +1,66 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { | 28 | Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); |
34 | 31 | ||
35 | this._tabPanelController = null; | 32 | this._tabPanelController = null; |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; | 42 | return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'tabPanelControllerConfiguration': function() { | 47 | 'tabPanelControllerConfiguration': function() { |
51 | return this._tabPanelControllerConfiguration; | 48 | return this._tabPanelControllerConfiguration; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | 'tabPanelController': function() { | 51 | 'tabPanelController': function() { |
55 | if (this._tabPanelController == null) { | 52 | if (this._tabPanelController == null) { |
56 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({component:this, configuration:this.tabPanelControllerConfiguration()}); | 53 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({component:this, configuration:this.tabPanelControllerConfiguration()}); |
57 | } | 54 | } |
58 | 55 | ||
59 | return this._tabPanelController; | 56 | return this._tabPanelController; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | 'initiallySelectedTab': function() { | 59 | 'initiallySelectedTab': function() { |
63 | return this._initiallySelectedTab; | 60 | return this._initiallySelectedTab; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | __syntaxFix__: "syntax fix" | 64 | __syntaxFix__: "syntax fix" |
68 | 65 | ||
69 | }); | 66 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js index 7507b86..095e8ed 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.Tooltip = function(args) { | 28 | Clipperz.PM.UI.Common.Components.Tooltip = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' | 35 | this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' |
39 | 36 | ||
40 | this._boxDimensions = null; | 37 | this._boxDimensions = null; |
41 | this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); | 38 | this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); |
42 | this._isVisible = false; | 39 | this._isVisible = false; |
43 | 40 | ||
44 | this.renderSelf(); | 41 | this.renderSelf(); |
45 | 42 | ||
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | //============================================================================= | 46 | //============================================================================= |
50 | 47 | ||
51 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | 48 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'toString': function () { | 52 | 'toString': function () { |
56 | return "Clipperz.PM.UI.Common.Components.Tooltip component"; | 53 | return "Clipperz.PM.UI.Common.Components.Tooltip component"; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'text': function () { | 58 | 'text': function () { |
62 | return this._text; | 59 | return this._text; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | 'setText': function (aValue) { | 62 | 'setText': function (aValue) { |
66 | this._text = aValue; | 63 | this._text = aValue; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'position': function () { | 68 | 'position': function () { |
72 | return this._position; | 69 | return this._position; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | 'setPosition': function (aValue) { | 72 | 'setPosition': function (aValue) { |
76 | this._position = aValue; | 73 | this._position = aValue; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
80 | 77 | ||
81 | 'enabled': function () { | 78 | 'enabled': function () { |
82 | return this._enabled; | 79 | return this._enabled; |
83 | }, | 80 | }, |
84 | 81 | ||
85 | 'setIsEnabled': function (aValue) { | 82 | 'setIsEnabled': function (aValue) { |
86 | this._enabled = aValue; | 83 | this._enabled = aValue; |
87 | }, | 84 | }, |
88 | 85 | ||
89 | //------------------------------------------------------------------------- | 86 | //------------------------------------------------------------------------- |
90 | 87 | ||
91 | 'isVisible': function () { | 88 | 'isVisible': function () { |
92 | return this._isVisible; | 89 | return this._isVisible; |
93 | }, | 90 | }, |
94 | 91 | ||
95 | 'setIsVisible': function (aValue) { | 92 | 'setIsVisible': function (aValue) { |
96 | this._isVisible = aValue; | 93 | this._isVisible = aValue; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | //------------------------------------------------------------------------- | 96 | //------------------------------------------------------------------------- |
100 | 97 | ||
101 | 'renderSelf': function() { | 98 | 'renderSelf': function() { |
102 | // this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 99 | // this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
103 | // this.append(MochiKit.DOM.currentDocument().body, {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 100 | // this.append(MochiKit.DOM.currentDocument().body, {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
104 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 101 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
105 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | 102 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ |
106 | {tag:'div', cls:'tooltip_text', children:[ | 103 | {tag:'div', cls:'tooltip_text', children:[ |
107 | {tag:'span', html:this.text()} | 104 | {tag:'span', html:this.text()} |
108 | ]}, | 105 | ]}, |
109 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | 106 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} |
110 | ]}, | 107 | ]}, |
111 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | 108 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} |
112 | ]}); | 109 | ]}); |
113 | 110 | ||
114 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 111 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
115 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 112 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
116 | 113 | ||
117 | MochiKit.Style.hideElement(this.displayElement()); | 114 | MochiKit.Style.hideElement(this.displayElement()); |
118 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 115 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
119 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 116 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //----------------------------------------------------- | 119 | //----------------------------------------------------- |
123 | 120 | ||
124 | 'displayElement': function() { | 121 | 'displayElement': function() { |
125 | return this.getElement('tooltip'); | 122 | return this.getElement('tooltip'); |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //------------------------------------------------------------------------- | 125 | //------------------------------------------------------------------------- |
129 | 126 | ||
130 | 'boxDimensions': function () { | 127 | 'boxDimensions': function () { |
131 | return this._boxDimensions; | 128 | return this._boxDimensions; |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //------------------------------------------------------------------------- | 131 | //------------------------------------------------------------------------- |
135 | 132 | ||
136 | 'show': function () { | 133 | 'show': function () { |
137 | var elementSizeAndPosition; | 134 | var elementSizeAndPosition; |
138 | var arrowPosition; | 135 | var arrowPosition; |
139 | var bodyPosition; | 136 | var bodyPosition; |
140 | 137 | ||
141 | if (this.isVisible() == false) { | 138 | if (this.isVisible() == false) { |
142 | arrowPosition = {}; | 139 | arrowPosition = {}; |
143 | bodyPosition = {}; | 140 | bodyPosition = {}; |
144 | 141 | ||
145 | this.setIsVisible(true); | 142 | this.setIsVisible(true); |
146 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | 143 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); |
147 | //console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition)); | 144 | //console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition)); |
148 | //console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions())); | 145 | //console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions())); |
149 | switch (this.position()) { | 146 | switch (this.position()) { |
150 | case 'ABOVE': | 147 | case 'ABOVE': |
151 | //console.log("ABOVE"); | 148 | //console.log("ABOVE"); |
152 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 149 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
153 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 150 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
154 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | 151 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; |
155 | 152 | ||
156 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 153 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
157 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | 154 | arrowPosition.y = elementSizeAndPosition.position.y - 13; |
158 | break; | 155 | break; |
159 | case 'BELOW': | 156 | case 'BELOW': |
160 | //console.log("BELOW"); | 157 | //console.log("BELOW"); |
161 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 158 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
162 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 159 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
163 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; | 160 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; |
164 | 161 | ||
165 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 162 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
166 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; | 163 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; |
167 | break; | 164 | break; |
168 | case 'LEFT': | 165 | case 'LEFT': |
169 | //console.log("LEFT"); | 166 | //console.log("LEFT"); |
170 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 167 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
171 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; | 168 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; |
172 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | 169 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); |
173 | 170 | ||
174 | arrowPosition.x = elementSizeAndPosition.position.x -13; | 171 | arrowPosition.x = elementSizeAndPosition.position.x -13; |
175 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | 172 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); |
176 | break; | 173 | break; |
177 | case 'RIGHT': | 174 | case 'RIGHT': |
178 | //console.log("RIGHT"); | 175 | //console.log("RIGHT"); |
179 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 176 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
180 | bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; | 177 | bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; |
181 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | 178 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); |
182 | 179 | ||
183 | arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; | 180 | arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; |
184 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | 181 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); |
185 | break; | 182 | break; |
186 | } | 183 | } |
187 | //console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y); | 184 | //console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y); |
188 | 185 | ||
189 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | 186 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); |
190 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | 187 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); |
191 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | 188 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); |
192 | } | 189 | } |
193 | }, | 190 | }, |
194 | 191 | ||
195 | 'hide': function () { | 192 | 'hide': function () { |
196 | if (this.isVisible() == true) { | 193 | if (this.isVisible() == true) { |
197 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | 194 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); |
198 | this.setIsVisible(false); | 195 | this.setIsVisible(false); |
199 | } | 196 | } |
200 | }, | 197 | }, |
201 | 198 | ||
202 | //------------------------------------------------------------------------- | 199 | //------------------------------------------------------------------------- |
203 | /* | 200 | /* |
204 | 'shouldRemoveElementWhenClearningUp': function () { | 201 | 'shouldRemoveElementWhenClearningUp': function () { |
205 | return false; | 202 | return false; |
206 | }, | 203 | }, |
207 | */ | 204 | */ |
208 | //------------------------------------------------------------------------- | 205 | //------------------------------------------------------------------------- |
209 | __syntaxFix__: "syntax fix" | 206 | __syntaxFix__: "syntax fix" |
210 | }); | 207 | }); |
211 | 208 | ||
212 | Clipperz.PM.UI.Common.Components.Tooltip.initTooltips = function () { | 209 | Clipperz.PM.UI.Common.Components.Tooltip.initTooltips = function () { |
213 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'}); | 210 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'}); |
214 | } | 211 | } |
215 | 212 | ||
216 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Common.Components.Tooltip.initTooltips); | 213 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Common.Components.Tooltip.initTooltips); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js index c31969e..c41fc7c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js | |||
@@ -1,170 +1,167 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { | 28 | Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { |
32 | Clipperz.log(">>> TranslatorWidget.new"); | 29 | Clipperz.log(">>> TranslatorWidget.new"); |
33 | args = args || {}; | 30 | args = args || {}; |
34 | 31 | ||
35 | Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); | 32 | Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); |
36 | 33 | ||
37 | // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); | 35 | // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); |
39 | 36 | ||
40 | //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 37 | //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
41 | //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 38 | //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
42 | 39 | ||
43 | Clipperz.log("<<< TranslatorWidget.new"); | 40 | Clipperz.log("<<< TranslatorWidget.new"); |
44 | return this; | 41 | return this; |
45 | } | 42 | } |
46 | 43 | ||
47 | //============================================================================= | 44 | //============================================================================= |
48 | 45 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { | 46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'toString': function () { | 50 | 'toString': function () { |
54 | return "Clipperz.PM.UI.Common.Components.TranslatorWidget component"; | 51 | return "Clipperz.PM.UI.Common.Components.TranslatorWidget component"; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
58 | /* | 55 | /* |
59 | 'renderSelf': function() { | 56 | 'renderSelf': function() { |
60 | this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 57 | this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
61 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | 58 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ |
62 | {tag:'div', cls:'tooltip_text', children:[ | 59 | {tag:'div', cls:'tooltip_text', children:[ |
63 | {tag:'span', html:this.text()} | 60 | {tag:'span', html:this.text()} |
64 | ]}, | 61 | ]}, |
65 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | 62 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} |
66 | ]}, | 63 | ]}, |
67 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | 64 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} |
68 | ]}); | 65 | ]}); |
69 | 66 | ||
70 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 67 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
71 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 68 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
72 | 69 | ||
73 | MochiKit.Style.hideElement(this.displayElement()); | 70 | MochiKit.Style.hideElement(this.displayElement()); |
74 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 71 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
75 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 72 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
76 | }, | 73 | }, |
77 | */ | 74 | */ |
78 | //----------------------------------------------------- | 75 | //----------------------------------------------------- |
79 | /* | 76 | /* |
80 | 'displayElement': function() { | 77 | 'displayElement': function() { |
81 | return this.getElement('tooltip'); | 78 | return this.getElement('tooltip'); |
82 | }, | 79 | }, |
83 | */ | 80 | */ |
84 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
85 | /* | 82 | /* |
86 | 'boxDimensions': function () { | 83 | 'boxDimensions': function () { |
87 | return this._boxDimensions; | 84 | return this._boxDimensions; |
88 | }, | 85 | }, |
89 | */ | 86 | */ |
90 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
91 | 88 | ||
92 | 'show': function (anElement, aStringID) { | 89 | 'show': function (anElement, aStringID) { |
93 | Clipperz.log(">>> Clipperz.PM.UI.Common.Components.TranslatorWidget.show: " + aStringID); | 90 | Clipperz.log(">>> Clipperz.PM.UI.Common.Components.TranslatorWidget.show: " + aStringID); |
94 | /* | 91 | /* |
95 | var elementSizeAndPosition; | 92 | var elementSizeAndPosition; |
96 | var arrowPosition; | 93 | var arrowPosition; |
97 | var bodyPosition; | 94 | var bodyPosition; |
98 | 95 | ||
99 | arrowPosition = {}; | 96 | arrowPosition = {}; |
100 | bodyPosition = {}; | 97 | bodyPosition = {}; |
101 | 98 | ||
102 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | 99 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); |
103 | switch (this.position()) { | 100 | switch (this.position()) { |
104 | case 'ABOVE': | 101 | case 'ABOVE': |
105 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 102 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
106 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 103 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
107 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | 104 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; |
108 | 105 | ||
109 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 106 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
110 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | 107 | arrowPosition.y = elementSizeAndPosition.position.y - 13; |
111 | break; | 108 | break; |
112 | case 'BELOW': | 109 | case 'BELOW': |
113 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 110 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
114 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 111 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
115 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; | 112 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; |
116 | 113 | ||
117 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 114 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
118 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; | 115 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; |
119 | break; | 116 | break; |
120 | case 'LEFT': | 117 | case 'LEFT': |
121 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 118 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
122 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; | 119 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; |
123 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | 120 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); |
124 | 121 | ||
125 | arrowPosition.x = elementSizeAndPosition.position.x -13; | 122 | arrowPosition.x = elementSizeAndPosition.position.x -13; |
126 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | 123 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); |
127 | break; | 124 | break; |
128 | case 'RIGHT': | 125 | case 'RIGHT': |
129 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 126 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
130 | break; | 127 | break; |
131 | } | 128 | } |
132 | 129 | ||
133 | // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | 130 | // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); |
134 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | 131 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); |
135 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | 132 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); |
136 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | 133 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); |
137 | */ | 134 | */ |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'hide': function () { | 139 | 'hide': function () { |
143 | Clipperz.log("<<< Clipperz.PM.UI.Common.Components.TranslatorWidget.hide"); | 140 | Clipperz.log("<<< Clipperz.PM.UI.Common.Components.TranslatorWidget.hide"); |
144 | // MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | 141 | // MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | //------------------------------------------------------------------------- | 144 | //------------------------------------------------------------------------- |
148 | __syntaxFix__: "syntax fix" | 145 | __syntaxFix__: "syntax fix" |
149 | }); | 146 | }); |
150 | 147 | ||
151 | //############################################################################# | 148 | //############################################################################# |
152 | 149 | ||
153 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = null; | 150 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = null; |
154 | 151 | ||
155 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget = function () { | 152 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget = function () { |
156 | if (Clipperz.PM.UI.Common.Components.TranslatorWidget._widget == null) { | 153 | if (Clipperz.PM.UI.Common.Components.TranslatorWidget._widget == null) { |
157 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = new Clipperz.PM.UI.Common.Components.TranslatorWidget(); | 154 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = new Clipperz.PM.UI.Common.Components.TranslatorWidget(); |
158 | } | 155 | } |
159 | 156 | ||
160 | return Clipperz.PM.UI.Common.Components.TranslatorWidget._widget; | 157 | return Clipperz.PM.UI.Common.Components.TranslatorWidget._widget; |
161 | } | 158 | } |
162 | Clipperz.PM.UI.Common.Components.TranslatorWidget.show = function (anElement, aStringID) { | 159 | Clipperz.PM.UI.Common.Components.TranslatorWidget.show = function (anElement, aStringID) { |
163 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().show(anElement, aStringID); | 160 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().show(anElement, aStringID); |
164 | } | 161 | } |
165 | 162 | ||
166 | Clipperz.PM.UI.Common.Components.TranslatorWidget.hide = function () { | 163 | Clipperz.PM.UI.Common.Components.TranslatorWidget.hide = function () { |
167 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().hide(); | 164 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().hide(); |
168 | } | 165 | } |
169 | 166 | ||
170 | //############################################################################# | 167 | //############################################################################# |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js index e534435..5fd10f9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { | 28 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { |
32 | this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); | 29 | this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); |
33 | this._target = Clipperz.PM.Crypto.randomKey(); | 30 | this._target = Clipperz.PM.Crypto.randomKey(); |
34 | 31 | ||
35 | return this; | 32 | return this; |
36 | } | 33 | } |
37 | 34 | ||
38 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { | 35 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { |
39 | 36 | ||
40 | 'toString': function() { | 37 | 'toString': function() { |
41 | return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; | 38 | return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; |
42 | }, | 39 | }, |
43 | 40 | ||
44 | //----------------------------------------------------------------------------- | 41 | //----------------------------------------------------------------------------- |
45 | 42 | ||
46 | 'directLogin': function () { | 43 | 'directLogin': function () { |
47 | return this._directLogin; | 44 | return this._directLogin; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //----------------------------------------------------------------------------- | 47 | //----------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'target': function () { | 49 | 'target': function () { |
53 | return this._target; | 50 | return this._target; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //============================================================================= | 53 | //============================================================================= |
57 | 54 | ||
58 | 'setWindowTitle': function (aWindow, aTitle) { | 55 | 'setWindowTitle': function (aWindow, aTitle) { |
59 | aWindow.document.title = aTitle; | 56 | aWindow.document.title = aTitle; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | 'setWindowBody': function (aWindow, anHTML) { | 59 | 'setWindowBody': function (aWindow, anHTML) { |
63 | aWindow.document.body.innerHTML = anHTML; | 60 | aWindow.document.body.innerHTML = anHTML; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //============================================================================= | 63 | //============================================================================= |
67 | 64 | ||
68 | 'initialWindowSetup': function (aWindow) { | 65 | 'initialWindowSetup': function (aWindow) { |
69 | this.setWindowTitle(aWindow, "Loading Clipperz Direct Login"); | 66 | this.setWindowTitle(aWindow, "Loading Clipperz Direct Login"); |
70 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3("Loading Clipperz Direct Login ..."))); | 67 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3("Loading Clipperz Direct Login ..."))); |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //----------------------------------------------------------------------------- | 70 | //----------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'updateWindowWithDirectLoginLabel': function (aWindow, aLabel) { | 72 | 'updateWindowWithDirectLoginLabel': function (aWindow, aLabel) { |
76 | var titleText; | 73 | var titleText; |
77 | var bodyText; | 74 | var bodyText; |
78 | 75 | ||
79 | titleText = "Loading '__label__' Direct Login".replace(/__label__/, aLabel) | 76 | titleText = "Loading '__label__' Direct Login".replace(/__label__/, aLabel) |
80 | bodyText = "Loading '__label__' Direct Login... ".replace(/__label__/, aLabel) | 77 | bodyText = "Loading '__label__' Direct Login... ".replace(/__label__/, aLabel) |
81 | 78 | ||
82 | this.setWindowTitle(aWindow, titleText); | 79 | this.setWindowTitle(aWindow, titleText); |
83 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3(bodyText))); | 80 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3(bodyText))); |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //----------------------------------------------------------------------------- | 83 | //----------------------------------------------------------------------------- |
87 | 84 | ||
88 | 'updateWindowWithHTMLContent': function (aWindow, anHtml) { | 85 | 'updateWindowWithHTMLContent': function (aWindow, anHtml) { |
89 | this.setWindowBody(aWindow, anHtml); | 86 | this.setWindowBody(aWindow, anHtml); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //============================================================================= | 89 | //============================================================================= |
93 | 90 | ||
94 | 'submitLoginForm': function(aWindow, aSubmitFunction) { | 91 | 'submitLoginForm': function(aWindow, aSubmitFunction) { |
95 | MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function () { | 92 | MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function () { |
96 | var formElement; | 93 | var formElement; |
97 | var submitButtons; | 94 | var submitButtons; |
98 | 95 | ||
99 | formElement = MochiKit.DOM.getElement('directLoginForm'); | 96 | formElement = MochiKit.DOM.getElement('directLoginForm'); |
100 | 97 | ||
101 | submitButtons = MochiKit.Base.filter(function(anInputElement) { | 98 | submitButtons = MochiKit.Base.filter(function(anInputElement) { |
102 | return ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('type').toLowerCase() == 'submit')); | 99 | return ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('type').toLowerCase() == 'submit')); |
103 | }, formElement.elements); | 100 | }, formElement.elements); |
104 | 101 | ||
105 | if (submitButtons.length == 0) { | 102 | if (submitButtons.length == 0) { |
106 | if (typeof(formElement.submit) == 'function') { | 103 | if (typeof(formElement.submit) == 'function') { |
107 | formElement.submit(); | 104 | formElement.submit(); |
108 | } else { | 105 | } else { |
109 | aSubmitFunction.apply(formElement); | 106 | aSubmitFunction.apply(formElement); |
110 | } | 107 | } |
111 | /* | 108 | /* |
112 | varformSubmitFunction; | 109 | varformSubmitFunction; |
113 | 110 | ||
114 | formSubmitFunction = MochiKit.Base.method(formElement, 'submit'); | 111 | formSubmitFunction = MochiKit.Base.method(formElement, 'submit'); |
115 | if (Clipperz_IEisBroken == true) { | 112 | if (Clipperz_IEisBroken == true) { |
116 | formElement.submit(); | 113 | formElement.submit(); |
117 | } else { | 114 | } else { |
118 | formSubmitFunction(); | 115 | formSubmitFunction(); |
119 | } | 116 | } |
120 | */ | 117 | */ |
121 | } else { | 118 | } else { |
122 | submitButtons[0].click(); | 119 | submitButtons[0].click(); |
123 | } | 120 | } |
124 | }, this)); | 121 | }, this)); |
125 | }, | 122 | }, |
126 | 123 | ||
127 | //------------------------------------------------------------------------- | 124 | //------------------------------------------------------------------------- |
128 | 125 | ||
129 | 'runSubmitFormDirectLogin': function (aWindow, someAttributes) { | 126 | 'runSubmitFormDirectLogin': function (aWindow, someAttributes) { |
130 | var html; | 127 | var html; |
131 | var formElement; | 128 | var formElement; |
132 | var submitFunction; | 129 | var submitFunction; |
133 | 130 | ||
134 | formElement = MochiKit.DOM.FORM({ | 131 | formElement = MochiKit.DOM.FORM({ |
135 | 'id':'directLoginForm', | 132 | 'id':'directLoginForm', |
136 | 'method':someAttributes['formAttributes']['method'], | 133 | 'method':someAttributes['formAttributes']['method'], |
137 | 'action':someAttributes['formAttributes']['action'] | 134 | 'action':someAttributes['formAttributes']['action'] |
138 | }); | 135 | }); |
139 | 136 | ||
140 | submitFunction = formElement.submit; | 137 | submitFunction = formElement.submit; |
141 | 138 | ||
142 | MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { | 139 | MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { |
143 | return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); | 140 | return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); |
144 | }, MochiKit.Base.items(someAttributes['inputValues']))); | 141 | }, MochiKit.Base.items(someAttributes['inputValues']))); |
145 | 142 | ||
146 | html =''; | 143 | html =''; |
147 | html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; | 144 | html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; |
148 | html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; | 145 | html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; |
149 | 146 | ||
150 | this.updateWindowWithHTMLContent(aWindow, html); | 147 | this.updateWindowWithHTMLContent(aWindow, html); |
151 | this.submitLoginForm(aWindow, submitFunction); | 148 | this.submitLoginForm(aWindow, submitFunction); |
152 | }, | 149 | }, |
153 | 150 | ||
154 | //------------------------------------------------------------------------- | 151 | //------------------------------------------------------------------------- |
155 | 152 | ||
156 | 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { | 153 | 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { |
157 | var completeUrl; | 154 | var completeUrl; |
158 | var url; | 155 | var url; |
159 | 156 | ||
160 | //console.log("runHttpAuthDirectLogin", someAttributes); | 157 | //console.log("runHttpAuthDirectLogin", someAttributes); |
161 | url = someAttributes['inputValues']['url']; | 158 | url = someAttributes['inputValues']['url']; |
162 | 159 | ||
163 | if (/^https?\:\/\//.test(url) == false) { | 160 | if (/^https?\:\/\//.test(url) == false) { |
164 | url = 'http://' + url; | 161 | url = 'http://' + url; |
165 | } | 162 | } |
166 | 163 | ||
167 | if (Clipperz_IEisBroken === true) { | 164 | if (Clipperz_IEisBroken === true) { |
168 | completeUrl = url; | 165 | completeUrl = url; |
169 | } else { | 166 | } else { |
170 | var username; | 167 | var username; |
171 | var password; | 168 | var password; |
172 | 169 | ||
173 | username = someAttributes['inputValues']['username']; | 170 | username = someAttributes['inputValues']['username']; |
174 | password = someAttributes['inputValues']['password']; | 171 | password = someAttributes['inputValues']['password']; |
175 | /(^https?\:\/\/)?(.*)/.test(url); | 172 | /(^https?\:\/\/)?(.*)/.test(url); |
176 | 173 | ||
177 | completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; | 174 | completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; |
178 | } | 175 | } |
179 | 176 | ||
180 | window.open(completeUrl, this.target()); | 177 | window.open(completeUrl, this.target()); |
181 | }, | 178 | }, |
182 | 179 | ||
183 | //============================================================================= | 180 | //============================================================================= |
184 | 181 | ||
185 | 'runDirectLogin': function (aWindow) { | 182 | 'runDirectLogin': function (aWindow) { |
186 | var deferredResult; | 183 | var deferredResult; |
187 | 184 | ||
188 | //console.log(">>> runDirectLogin"); | 185 | //console.log(">>> runDirectLogin"); |
189 | deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); | 186 | deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); |
190 | deferredResult.addMethod(this, 'initialWindowSetup', aWindow); | 187 | deferredResult.addMethod(this, 'initialWindowSetup', aWindow); |
191 | deferredResult.addMethod(this.directLogin(), 'label'); | 188 | deferredResult.addMethod(this.directLogin(), 'label'); |
192 | deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); | 189 | deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); |
193 | deferredResult.collectResults({ | 190 | deferredResult.collectResults({ |
194 | 'type': MochiKit.Base.method(this.directLogin(), 'type'), | 191 | 'type': MochiKit.Base.method(this.directLogin(), 'type'), |
195 | 'label': MochiKit.Base.method(this.directLogin(), 'label'), | 192 | 'label': MochiKit.Base.method(this.directLogin(), 'label'), |
196 | 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), | 193 | 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), |
197 | 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') | 194 | 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') |
198 | }); | 195 | }); |
199 | //deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; }); | 196 | //deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; }); |
200 | deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { | 197 | deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { |
201 | //console.log("SOME ATTRIBUTES", someAttributes); | 198 | //console.log("SOME ATTRIBUTES", someAttributes); |
202 | switch (someAttributes['type']) { | 199 | switch (someAttributes['type']) { |
203 | case 'http_auth': | 200 | case 'http_auth': |
204 | this.runHttpAuthDirectLogin(aWindow, someAttributes); | 201 | this.runHttpAuthDirectLogin(aWindow, someAttributes); |
205 | break; | 202 | break; |
206 | case 'simple_url': | 203 | case 'simple_url': |
207 | this.runSimpleUrlDirectLogin(aWindow, someAttributes); | 204 | this.runSimpleUrlDirectLogin(aWindow, someAttributes); |
208 | break; | 205 | break; |
209 | default: | 206 | default: |
210 | this.runSubmitFormDirectLogin(aWindow, someAttributes); | 207 | this.runSubmitFormDirectLogin(aWindow, someAttributes); |
211 | break; | 208 | break; |
212 | } | 209 | } |
213 | }, this)); | 210 | }, this)); |
214 | deferredResult.callback(); | 211 | deferredResult.callback(); |
215 | //console.log("<<< runDirectLogin"); | 212 | //console.log("<<< runDirectLogin"); |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js index a4fa400..41fe17f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js | |||
@@ -1,143 +1,140 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { | 28 | Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | this._numberOfSteps= 0; | 31 | this._numberOfSteps= 0; |
35 | this._currentStep= 0; | 32 | this._currentStep= 0; |
36 | 33 | ||
37 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); | 34 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); |
38 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); | 35 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); |
39 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); | 36 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); |
40 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); | 37 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { | 42 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { |
46 | 43 | ||
47 | 'toString': function() { | 44 | 'toString': function() { |
48 | return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; | 45 | return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //----------------------------------------------------------------------------- | 48 | //----------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'numberOfSteps': function() { | 50 | 'numberOfSteps': function() { |
54 | return this._numberOfSteps; | 51 | return this._numberOfSteps; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | 'setNumberOfSteps': function (aValue) { | 54 | 'setNumberOfSteps': function (aValue) { |
58 | this._numberOfSteps = aValue; | 55 | this._numberOfSteps = aValue; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'updateNumberOfSteps': function (aValue) { | 58 | 'updateNumberOfSteps': function (aValue) { |
62 | this._numberOfSteps += aValue; | 59 | this._numberOfSteps += aValue; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //----------------------------------------------------------------------------- | 62 | //----------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'currentStep': function() { | 64 | 'currentStep': function() { |
68 | return this._currentStep; | 65 | return this._currentStep; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | 'advanceCurrentStep': function () { | 68 | 'advanceCurrentStep': function () { |
72 | this._currentStep ++; | 69 | this._currentStep ++; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //----------------------------------------------------------------------------- | 72 | //----------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'completedPercentage': function () { | 74 | 'completedPercentage': function () { |
78 | var result; | 75 | var result; |
79 | //Clipperz.log(">>> completedPercentage" + this.currentStep() + "/" + this.numberOfSteps(), this.currentStep() / this.numberOfSteps()); | 76 | //Clipperz.log(">>> completedPercentage" + this.currentStep() + "/" + this.numberOfSteps(), this.currentStep() / this.numberOfSteps()); |
80 | if (this.numberOfSteps() == 0) { | 77 | if (this.numberOfSteps() == 0) { |
81 | result = 0; | 78 | result = 0; |
82 | } else { | 79 | } else { |
83 | result = (Math.min(100, 100 * (this.currentStep() / this.numberOfSteps()))); | 80 | result = (Math.min(100, 100 * (this.currentStep() / this.numberOfSteps()))); |
84 | } | 81 | } |
85 | //Clipperz.log("<<< completedPercentage", result); | 82 | //Clipperz.log("<<< completedPercentage", result); |
86 | return result; | 83 | return result; |
87 | }, | 84 | }, |
88 | 85 | ||
89 | //----------------------------------------------------------------------------- | 86 | //----------------------------------------------------------------------------- |
90 | 87 | ||
91 | 'resetStatus': function () { | 88 | 'resetStatus': function () { |
92 | this._numberOfSteps= 0; | 89 | this._numberOfSteps= 0; |
93 | this._currentStep= 0; | 90 | this._currentStep= 0; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //----------------------------------------------------------------------------- | 93 | //----------------------------------------------------------------------------- |
97 | 94 | ||
98 | 'updateProgress': function () { | 95 | 'updateProgress': function () { |
99 | //Clipperz.log(">>> updateProgress: " + this.completedPercentage() + "%"); | 96 | //Clipperz.log(">>> updateProgress: " + this.completedPercentage() + "%"); |
100 | MochiKit.Signal.signal(this, 'updateProgress', this.completedPercentage()); | 97 | MochiKit.Signal.signal(this, 'updateProgress', this.completedPercentage()); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //============================================================================= | 100 | //============================================================================= |
104 | 101 | ||
105 | 'initProgressHandle': function (anEvent) { | 102 | 'initProgressHandle': function (anEvent) { |
106 | //Clipperz.log(">>> initProgressHandle - steps: " + (anEvent != null ? anEvent['steps'] : 0)); | 103 | //Clipperz.log(">>> initProgressHandle - steps: " + (anEvent != null ? anEvent['steps'] : 0)); |
107 | this.resetStatus(); | 104 | this.resetStatus(); |
108 | if (anEvent != null) { | 105 | if (anEvent != null) { |
109 | this.setNumberOfSteps(anEvent['steps']); | 106 | this.setNumberOfSteps(anEvent['steps']); |
110 | } | 107 | } |
111 | MochiKit.Signal.signal(this, 'initProgress'); | 108 | MochiKit.Signal.signal(this, 'initProgress'); |
112 | this.updateProgress(); | 109 | this.updateProgress(); |
113 | }, | 110 | }, |
114 | 111 | ||
115 | //............................................................................. | 112 | //............................................................................. |
116 | 113 | ||
117 | 'updateProgressHandle': function (anEvent) { | 114 | 'updateProgressHandle': function (anEvent) { |
118 | this.updateNumberOfSteps(anEvent['extraSteps']); | 115 | this.updateNumberOfSteps(anEvent['extraSteps']); |
119 | //Clipperz.log("=== updateProgressHandle - steps: " + this.numberOfSteps() + " (extra " + anEvent['extraSteps'] + ")"); | 116 | //Clipperz.log("=== updateProgressHandle - steps: " + this.numberOfSteps() + " (extra " + anEvent['extraSteps'] + ")"); |
120 | this.updateProgress(); | 117 | this.updateProgress(); |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //............................................................................. | 120 | //............................................................................. |
124 | 121 | ||
125 | 'advanceProgressHandle': function (anEvent) { | 122 | 'advanceProgressHandle': function (anEvent) { |
126 | this.advanceCurrentStep(); | 123 | this.advanceCurrentStep(); |
127 | //Clipperz.log("--- advanceProgressHandle: " + this.currentStep() + "/" + this.numberOfSteps()); | 124 | //Clipperz.log("--- advanceProgressHandle: " + this.currentStep() + "/" + this.numberOfSteps()); |
128 | this.updateProgress(); | 125 | this.updateProgress(); |
129 | }, | 126 | }, |
130 | 127 | ||
131 | //............................................................................. | 128 | //............................................................................. |
132 | 129 | ||
133 | 'progressDoneHandle': function (anEvent) { | 130 | 'progressDoneHandle': function (anEvent) { |
134 | //Clipperz.log("<<< progressDoneHandle: " + this.currentStep() + "/" + this.numberOfSteps()); | 131 | //Clipperz.log("<<< progressDoneHandle: " + this.currentStep() + "/" + this.numberOfSteps()); |
135 | this.resetStatus(); | 132 | this.resetStatus(); |
136 | MochiKit.Signal.signal(this, 'progressDone'); | 133 | MochiKit.Signal.signal(this, 'progressDone'); |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //============================================================================= | 136 | //============================================================================= |
140 | __syntaxFix__: "syntax fix" | 137 | __syntaxFix__: "syntax fix" |
141 | }); | 138 | }); |
142 | 139 | ||
143 | Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController = new Clipperz.PM.UI.Common.Controllers.ProgressBarController(); | 140 | Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController = new Clipperz.PM.UI.Common.Controllers.ProgressBarController(); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js index fbc5929..341fde9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js | |||
@@ -1,188 +1,185 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { | 28 | Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | this._component = args.component; | 31 | this._component = args.component; |
35 | this._configuration = args.configuration; | 32 | this._configuration = args.configuration; |
36 | this._isEnabled = args.enabled || true; | 33 | this._isEnabled = args.enabled || true; |
37 | 34 | ||
38 | this._selectedTab = null; | 35 | this._selectedTab = null; |
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { | 39 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { |
43 | 40 | ||
44 | 'toString': function() { | 41 | 'toString': function() { |
45 | return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; | 42 | return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //----------------------------------------------------------------------------- | 45 | //----------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'component': function() { | 47 | 'component': function() { |
51 | return this._component; | 48 | return this._component; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | 'configuration': function() { | 51 | 'configuration': function() { |
55 | return this._configuration; | 52 | return this._configuration; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //----------------------------------------------------------------------------- | 55 | //----------------------------------------------------------------------------- |
59 | 56 | ||
60 | 'getElement': function(anElementID) { | 57 | 'getElement': function(anElementID) { |
61 | return this.component().getElement(anElementID); | 58 | return this.component().getElement(anElementID); |
62 | }, | 59 | }, |
63 | 60 | ||
64 | 'tabForTabElement': function(anElement) { | 61 | 'tabForTabElement': function(anElement) { |
65 | varresult; | 62 | varresult; |
66 | 63 | ||
67 | for (result in this.configuration()) { | 64 | for (result in this.configuration()) { |
68 | if (this.getElement(this.configuration()[result]['tab']) == anElement) { | 65 | if (this.getElement(this.configuration()[result]['tab']) == anElement) { |
69 | break; | 66 | break; |
70 | } | 67 | } |
71 | } | 68 | } |
72 | 69 | ||
73 | return result; | 70 | return result; |
74 | }, | 71 | }, |
75 | 72 | ||
76 | //----------------------------------------------------------------------------- | 73 | //----------------------------------------------------------------------------- |
77 | 74 | ||
78 | 'setupTab': function(aConfiguration) { | 75 | 'setupTab': function(aConfiguration) { |
79 | vartabElement; | 76 | vartabElement; |
80 | 77 | ||
81 | tabElement = this.getElement(aConfiguration['tab']); | 78 | tabElement = this.getElement(aConfiguration['tab']); |
82 | 79 | ||
83 | MochiKit.DOM.removeElementClass(tabElement, 'selected'); | 80 | MochiKit.DOM.removeElementClass(tabElement, 'selected'); |
84 | MochiKit.Signal.connect(tabElement, 'onclick', this, 'handleTabClick') | 81 | MochiKit.Signal.connect(tabElement, 'onclick', this, 'handleTabClick') |
85 | }, | 82 | }, |
86 | 83 | ||
87 | 'setupPanel': function(aConfiguration) { | 84 | 'setupPanel': function(aConfiguration) { |
88 | this.hidePanel(aConfiguration['panel']); | 85 | this.hidePanel(aConfiguration['panel']); |
89 | }, | 86 | }, |
90 | 87 | ||
91 | 'setup': function(args) { | 88 | 'setup': function(args) { |
92 | args = args || {}; | 89 | args = args || {}; |
93 | 90 | ||
94 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupTab'),MochiKit.Base.values(this.configuration())); | 91 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupTab'),MochiKit.Base.values(this.configuration())); |
95 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupPanel'),MochiKit.Base.values(this.configuration())); | 92 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupPanel'),MochiKit.Base.values(this.configuration())); |
96 | this.selectTab(args.selected); | 93 | this.selectTab(args.selected); |
97 | }, | 94 | }, |
98 | 95 | ||
99 | //----------------------------------------------------------------------------- | 96 | //----------------------------------------------------------------------------- |
100 | 97 | ||
101 | 'hidePanel': function(aPanel) { | 98 | 'hidePanel': function(aPanel) { |
102 | MochiKit.DOM.removeElementClass(this.getElement(aPanel), 'selected'); | 99 | MochiKit.DOM.removeElementClass(this.getElement(aPanel), 'selected'); |
103 | }, | 100 | }, |
104 | 101 | ||
105 | 'selectTab': function(aTab) { | 102 | 'selectTab': function(aTab) { |
106 | if ((aTab != this.selectedTab()) && (this.isEnabled())) { | 103 | if ((aTab != this.selectedTab()) && (this.isEnabled())) { |
107 | if (this.selectedTab() != null) { | 104 | if (this.selectedTab() != null) { |
108 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['tab']),'selected'); | 105 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['tab']),'selected'); |
109 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['panel']),'selected'); | 106 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['panel']),'selected'); |
110 | } | 107 | } |
111 | 108 | ||
112 | if (aTab != null) { | 109 | if (aTab != null) { |
113 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['tab']),'selected'); | 110 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['tab']),'selected'); |
114 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['panel']),'selected'); | 111 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['panel']),'selected'); |
115 | } | 112 | } |
116 | 113 | ||
117 | this.setSelectedTab(aTab); | 114 | this.setSelectedTab(aTab); |
118 | MochiKit.Signal.signal(this, 'tabSelected', aTab); | 115 | MochiKit.Signal.signal(this, 'tabSelected', aTab); |
119 | } | 116 | } |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //----------------------------------------------------------------------------- | 119 | //----------------------------------------------------------------------------- |
123 | 120 | ||
124 | 'selectedTab': function() { | 121 | 'selectedTab': function() { |
125 | return this._selectedTab; | 122 | return this._selectedTab; |
126 | }, | 123 | }, |
127 | 124 | ||
128 | 'setSelectedTab': function(aTab) { | 125 | 'setSelectedTab': function(aTab) { |
129 | this._selectedTab = aTab; | 126 | this._selectedTab = aTab; |
130 | }, | 127 | }, |
131 | 128 | ||
132 | //----------------------------------------------------------------------------- | 129 | //----------------------------------------------------------------------------- |
133 | 130 | ||
134 | 'selectedTabElement': function() { | 131 | 'selectedTabElement': function() { |
135 | var result; | 132 | var result; |
136 | 133 | ||
137 | if (this.selectedTab() != null) { | 134 | if (this.selectedTab() != null) { |
138 | result = this.getElement(this.configuration()[this.selectedTab()]['tab']); | 135 | result = this.getElement(this.configuration()[this.selectedTab()]['tab']); |
139 | } else { | 136 | } else { |
140 | result = null; | 137 | result = null; |
141 | } | 138 | } |
142 | 139 | ||
143 | return null; | 140 | return null; |
144 | }, | 141 | }, |
145 | 142 | ||
146 | 'selectedTabPanelElement': function() { | 143 | 'selectedTabPanelElement': function() { |
147 | var result; | 144 | var result; |
148 | 145 | ||
149 | if (this.selectedTab() != null) { | 146 | if (this.selectedTab() != null) { |
150 | result = this.getElement(this.configuration()[this.selectedTab()]['panel']); | 147 | result = this.getElement(this.configuration()[this.selectedTab()]['panel']); |
151 | } else { | 148 | } else { |
152 | result = null; | 149 | result = null; |
153 | } | 150 | } |
154 | 151 | ||
155 | return result; | 152 | return result; |
156 | }, | 153 | }, |
157 | 154 | ||
158 | //----------------------------------------------------------------------------- | 155 | //----------------------------------------------------------------------------- |
159 | 156 | ||
160 | 'handleTabClick': function(anEvent) { | 157 | 'handleTabClick': function(anEvent) { |
161 | this.selectTab(this.tabForTabElement(anEvent.src())); | 158 | this.selectTab(this.tabForTabElement(anEvent.src())); |
162 | anEvent.preventDefault(); | 159 | anEvent.preventDefault(); |
163 | }, | 160 | }, |
164 | 161 | ||
165 | //============================================================================= | 162 | //============================================================================= |
166 | 163 | ||
167 | 'isEnabled': function () { | 164 | 'isEnabled': function () { |
168 | return this._isEnabled; | 165 | return this._isEnabled; |
169 | }, | 166 | }, |
170 | 167 | ||
171 | 'enable': function () { | 168 | 'enable': function () { |
172 | this._isEnabled = true; | 169 | this._isEnabled = true; |
173 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { | 170 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { |
174 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); | 171 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); |
175 | }, this), MochiKit.Base.keys(this.configuration())); | 172 | }, this), MochiKit.Base.keys(this.configuration())); |
176 | }, | 173 | }, |
177 | 174 | ||
178 | 'disable': function () { | 175 | 'disable': function () { |
179 | this._isEnabled = false; | 176 | this._isEnabled = false; |
180 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { | 177 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { |
181 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); | 178 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); |
182 | }, this), MochiKit.Base.keys(this.configuration())); | 179 | }, this), MochiKit.Base.keys(this.configuration())); |
183 | }, | 180 | }, |
184 | 181 | ||
185 | //============================================================================= | 182 | //============================================================================= |
186 | 183 | ||
187 | __syntaxFix__: "syntax fix" | 184 | __syntaxFix__: "syntax fix" |
188 | }); | 185 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js index 868cea6..ef38bc6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js | |||
@@ -1,31 +1,28 @@ | |||
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 | //Still empty, but here it should be reasonable to factor in code duplicated between | 26 | //Still empty, but here it should be reasonable to factor in code duplicated between |
30 | //- DirectLoginWizardController | 27 | //- DirectLoginWizardController |
31 | //- NewUserWizardController \ No newline at end of file | 28 | //- NewUserWizardController \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js index 22258f6..ea987cd 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js | |||
@@ -1,59 +1,56 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Compact'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Compact'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Compact.MainController = function() { | 28 | Clipperz.PM.UI.Compact.MainController = function() { |
32 | //this._loginPanel = null; | 29 | //this._loginPanel = null; |
33 | //this._user = null; | 30 | //this._user = null; |
34 | // | 31 | // |
35 | //this._isRunningCompact = false; | 32 | //this._isRunningCompact = false; |
36 | // | 33 | // |
37 | //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); | 34 | //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); |
38 | //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); | 35 | //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); |
39 | // | 36 | // |
40 | //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); | 37 | //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { | 42 | MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { |
46 | 43 | ||
47 | 'toString': function() { | 44 | 'toString': function() { |
48 | return "Clipperz.PM.UI.Compact.MainController"; | 45 | return "Clipperz.PM.UI.Compact.MainController"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //----------------------------------------------------------------------------- | 48 | //----------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'run': function(shouldShowRegistrationForm) { | 50 | 'run': function(shouldShowRegistrationForm) { |
54 | MochiKit.Logging.logDebug("running " + this.toString()); | 51 | MochiKit.Logging.logDebug("running " + this.toString()); |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //----------------------------------------------------------------------------- | 54 | //----------------------------------------------------------------------------- |
58 | __syntaxFix__: "syntax fix" | 55 | __syntaxFix__: "syntax fix" |
59 | }); \ No newline at end of file | 56 | }); \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js index 4378b19..ee6d7a3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js | |||
@@ -1,148 +1,145 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { | 28 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; | 33 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; |
37 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; | 34 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; |
38 | this._tabPanelControllerConfiguration = { | 35 | this._tabPanelControllerConfiguration = { |
39 | // 'ACCOUNT': { | 36 | // 'ACCOUNT': { |
40 | // tab:'accountTab', | 37 | // tab:'accountTab', |
41 | // panel:'accountPanel' | 38 | // panel:'accountPanel' |
42 | // }, | 39 | // }, |
43 | 'PASSPHRASE': { | 40 | 'PASSPHRASE': { |
44 | tab:'passphraseTab', | 41 | tab:'passphraseTab', |
45 | panel:'passphrasePanel' | 42 | panel:'passphrasePanel' |
46 | }, | 43 | }, |
47 | 'PREFERENCES': { | 44 | 'PREFERENCES': { |
48 | tab:'preferencesTab', | 45 | tab:'preferencesTab', |
49 | panel:'preferencesPanel' | 46 | panel:'preferencesPanel' |
50 | }, | 47 | }, |
51 | 'LOGIN_HISTORY': { | 48 | 'LOGIN_HISTORY': { |
52 | tab:'loginHistoryTab', | 49 | tab:'loginHistoryTab', |
53 | panel:'loginHistoryPanel' | 50 | panel:'loginHistoryPanel' |
54 | } | 51 | } |
55 | }; | 52 | }; |
56 | 53 | ||
57 | return this; | 54 | return this; |
58 | } | 55 | } |
59 | 56 | ||
60 | //============================================================================= | 57 | //============================================================================= |
61 | 58 | ||
62 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 59 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
63 | 60 | ||
64 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
65 | 62 | ||
66 | 'toString': function () { | 63 | 'toString': function () { |
67 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; | 64 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
71 | 68 | ||
72 | 'renderSelf': function(/*aContainer, aPosition*/) { | 69 | 'renderSelf': function(/*aContainer, aPosition*/) { |
73 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); | 70 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); |
74 | this.append(this.element(), [ | 71 | this.append(this.element(), [ |
75 | {tag:'div', cls:'header', children:[ | 72 | {tag:'div', cls:'header', children:[ |
76 | {tag:'div', cls:'subPanelTabs', children:[ | 73 | {tag:'div', cls:'subPanelTabs', children:[ |
77 | {tag:'ul', children:[ | 74 | {tag:'ul', children:[ |
78 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, | 75 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, |
79 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, | 76 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, |
80 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, | 77 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, |
81 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} | 78 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} |
82 | ]} | 79 | ]} |
83 | ]} | 80 | ]} |
84 | ]}, | 81 | ]}, |
85 | {tag:'div', cls:'body', children:[ | 82 | {tag:'div', cls:'body', children:[ |
86 | {tag:'div', cls:'accountPanel', children:[ | 83 | {tag:'div', cls:'accountPanel', children:[ |
87 | {tag:'div', cls:'subPanelContent', children:[ | 84 | {tag:'div', cls:'subPanelContent', children:[ |
88 | {tag:'ul', children:[ | 85 | {tag:'ul', children:[ |
89 | // {tag:'li', id:this.getId('accountPanel'),children:[ | 86 | // {tag:'li', id:this.getId('accountPanel'),children:[ |
90 | // {tag:'h3', html:"-- Account --"} | 87 | // {tag:'h3', html:"-- Account --"} |
91 | // ]}, | 88 | // ]}, |
92 | {tag:'li', id:this.getId('passphrasePanel'),children:[ | 89 | {tag:'li', id:this.getId('passphrasePanel'),children:[ |
93 | {tag:'h3', cls:'changePassphrase', html:"Change passphrase"}, | 90 | {tag:'h3', cls:'changePassphrase', html:"Change passphrase"}, |
94 | {tag:'form', id:this.getId('changePassphrase'), cls:'changePassphrase', children:[ | 91 | {tag:'form', id:this.getId('changePassphrase'), cls:'changePassphrase', children:[ |
95 | {tag:'div', cls:'currentCredentials', children:[ | 92 | {tag:'div', cls:'currentCredentials', children:[ |
96 | {tag:'div', cls:'field username', children:[ | 93 | {tag:'div', cls:'field username', children:[ |
97 | {tag:'label', html:"username", 'for':this.getId('currentUsername')}, | 94 | {tag:'label', html:"username", 'for':this.getId('currentUsername')}, |
98 | {tag:'input', id:this.getId('currentUsername')} | 95 | {tag:'input', id:this.getId('currentUsername')} |
99 | ]}, | 96 | ]}, |
100 | {tag:'div', cls:'field passphrase', children:[ | 97 | {tag:'div', cls:'field passphrase', children:[ |
101 | {tag:'label', html:"passphrase", 'for':this.getId('currentPassphrase')}, | 98 | {tag:'label', html:"passphrase", 'for':this.getId('currentPassphrase')}, |
102 | {tag:'input', id:this.getId('currentPassphrase')} | 99 | {tag:'input', id:this.getId('currentPassphrase')} |
103 | ]} | 100 | ]} |
104 | ]}, | 101 | ]}, |
105 | {tag:'div', cls:'newPassphrase', children:[ | 102 | {tag:'div', cls:'newPassphrase', children:[ |
106 | {tag:'div', cls:'field', children:[ | 103 | {tag:'div', cls:'field', children:[ |
107 | {tag:'label', html:"new passphrase", 'for':this.getId('newPassphrase')}, | 104 | {tag:'label', html:"new passphrase", 'for':this.getId('newPassphrase')}, |
108 | {tag:'input', id:this.getId('newPassphrase')} | 105 | {tag:'input', id:this.getId('newPassphrase')} |
109 | ]}, | 106 | ]}, |
110 | {tag:'div', cls:'field', children:[ | 107 | {tag:'div', cls:'field', children:[ |
111 | {tag:'label', html:"re-new passphrase", 'for':this.getId('reNewPassphrase')}, | 108 | {tag:'label', html:"re-new passphrase", 'for':this.getId('reNewPassphrase')}, |
112 | {tag:'input', id:this.getId('reNewPassphrase')} | 109 | {tag:'input', id:this.getId('reNewPassphrase')} |
113 | ]} | 110 | ]} |
114 | ]}, | 111 | ]}, |
115 | {tag:'div', cls:'confirm', children:[ | 112 | {tag:'div', cls:'confirm', children:[ |
116 | {tag:'input', type:'checkbox', id:this.getId('confirm')}, | 113 | {tag:'input', type:'checkbox', id:this.getId('confirm')}, |
117 | {tag:'label', html:"I understand that Clipperz will not be able to recover a lost passphrase", 'for':this.getId('confirm')} | 114 | {tag:'label', html:"I understand that Clipperz will not be able to recover a lost passphrase", 'for':this.getId('confirm')} |
118 | ]} | 115 | ]} |
119 | ]}, | 116 | ]}, |
120 | {tag:'div', cls:'clear'}, | 117 | {tag:'div', cls:'clear'}, |
121 | {tag:'div', cls:'confirmButton', id:this.getId('confirmationButton'), children:[ | 118 | {tag:'div', cls:'confirmButton', id:this.getId('confirmationButton'), children:[ |
122 | {tag:'span', html:"change passphrase"} | 119 | {tag:'span', html:"change passphrase"} |
123 | ]}, | 120 | ]}, |
124 | 121 | ||
125 | {tag:'h3', cls:'manageOTP', html:"Manage One-Time Passphrases"}, | 122 | {tag:'h3', cls:'manageOTP', html:"Manage One-Time Passphrases"}, |
126 | {} | 123 | {} |
127 | ]}, | 124 | ]}, |
128 | {tag:'li', id:this.getId('preferencesPanel'), children:[ | 125 | {tag:'li', id:this.getId('preferencesPanel'), children:[ |
129 | {tag:'h3', html:"-- Preferences --"} | 126 | {tag:'h3', html:"-- Preferences --"} |
130 | ]}, | 127 | ]}, |
131 | {tag:'li', id:this.getId('loginHistoryPanel'), children:[ | 128 | {tag:'li', id:this.getId('loginHistoryPanel'), children:[ |
132 | {tag:'h3', html:"-- Login History --"} | 129 | {tag:'h3', html:"-- Login History --"} |
133 | ]} | 130 | ]} |
134 | ]} | 131 | ]} |
135 | ]} | 132 | ]} |
136 | ]} | 133 | ]} |
137 | ]}, | 134 | ]}, |
138 | {tag:'div', cls:'footer'} | 135 | {tag:'div', cls:'footer'} |
139 | ]); | 136 | ]); |
140 | 137 | ||
141 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | 138 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); |
142 | }, | 139 | }, |
143 | 140 | ||
144 | //------------------------------------------------------------------------- | 141 | //------------------------------------------------------------------------- |
145 | 142 | ||
146 | 143 | ||
147 | __syntaxFix__: "syntax fix" | 144 | __syntaxFix__: "syntax fix" |
148 | }); | 145 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js index 67247df..3b3c8b4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js | |||
@@ -1,78 +1,75 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.AppPage = function(args) { | 28 | Clipperz.PM.UI.Web.Components.AppPage = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); |
34 | 31 | ||
35 | this._element = args.element || null; | 32 | this._element = args.element || null; |
36 | 33 | ||
37 | this._slots = { | 34 | this._slots = { |
38 | 'cardGrid' : this.getId('cardGrid'), | 35 | 'cardGrid' : this.getId('cardGrid'), |
39 | // 'directLoginGrid' : this.getId('directLoginGrid'), | 36 | // 'directLoginGrid' : this.getId('directLoginGrid'), |
40 | 'accountPanel': this.getId('accountPanel'), | 37 | 'accountPanel': this.getId('accountPanel'), |
41 | 'dataPanel': this.getId('dataPanel'), | 38 | 'dataPanel': this.getId('dataPanel'), |
42 | 'toolsPanel': this.getId('toolsPanel'), | 39 | 'toolsPanel': this.getId('toolsPanel'), |
43 | 'userInfoBox': this.getId('userInfoBox'), | 40 | 'userInfoBox': this.getId('userInfoBox'), |
44 | 'tabSidePanel': this.getId('tabSidePanel') | 41 | 'tabSidePanel': this.getId('tabSidePanel') |
45 | }; | 42 | }; |
46 | 43 | ||
47 | return this; | 44 | return this; |
48 | } | 45 | } |
49 | 46 | ||
50 | //============================================================================= | 47 | //============================================================================= |
51 | 48 | ||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AppPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | 49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AppPage, Clipperz.PM.UI.Common.Components.BaseComponent, { |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'toString': function () { | 53 | 'toString': function () { |
57 | return "Clipperz.PM.UI.Web.Components.AppPage component"; | 54 | return "Clipperz.PM.UI.Web.Components.AppPage component"; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'renderSelf': function(/*aContainer, aPosition*/) { | 59 | 'renderSelf': function(/*aContainer, aPosition*/) { |
63 | this.append(this.element(), {tag:'div', id:this.getId('userInfoBox'), cls:'userInfoBox'}); | 60 | this.append(this.element(), {tag:'div', id:this.getId('userInfoBox'), cls:'userInfoBox'}); |
64 | this.append(this.element(), {tag:'div', id:this.getId('sidePanels'), cls:'sidePanels'}); | 61 | this.append(this.element(), {tag:'div', id:this.getId('sidePanels'), cls:'sidePanels'}); |
65 | this.append(this.getId('sidePanels'),{tag:'div', id:this.getId('tabSidePanel'), cls:'tabSidePanel', children:[]}); | 62 | this.append(this.getId('sidePanels'),{tag:'div', id:this.getId('tabSidePanel'), cls:'tabSidePanel', children:[]}); |
66 | 63 | ||
67 | this.append(this.element(), {tag:'div', id:this.getId('mainPanels'), cls:'mainPanels'}); | 64 | this.append(this.element(), {tag:'div', id:this.getId('mainPanels'), cls:'mainPanels'}); |
68 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('cardGrid'), cls:'gridComponent cardGrid'}); | 65 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('cardGrid'), cls:'gridComponent cardGrid'}); |
69 | // this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('directLoginGrid'), cls:'gridComponent directLoginGrid'}); | 66 | // this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('directLoginGrid'), cls:'gridComponent directLoginGrid'}); |
70 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('accountPanel'), cls:'otherPanel'}); | 67 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('accountPanel'), cls:'otherPanel'}); |
71 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('dataPanel'), cls:'otherPanel'}); | 68 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('dataPanel'), cls:'otherPanel'}); |
72 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('toolsPanel'), cls:'otherPanel'}); | 69 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('toolsPanel'), cls:'otherPanel'}); |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | __syntaxFix__: "syntax fix" | 74 | __syntaxFix__: "syntax fix" |
78 | }); | 75 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js index 42a6052..1835ca9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js | |||
@@ -1,109 +1,106 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); |
35 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); | 32 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 40 | ||
44 | //------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------- |
45 | 42 | ||
46 | 'toString': function () { | 43 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; | 44 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'renderSelf': function() { | 49 | 'renderSelf': function() { |
53 | // var bookmarkletUrl; | 50 | // var bookmarkletUrl; |
54 | // | 51 | // |
55 | // if (Clipperz_IEisBroken == true) { | 52 | // if (Clipperz_IEisBroken == true) { |
56 | // bookmarkletUrl = bookmarklet_ie; | 53 | // bookmarkletUrl = bookmarklet_ie; |
57 | // } else { | 54 | // } else { |
58 | /// bookmarkletUrl = bookmarklet; | 55 | /// bookmarkletUrl = bookmarklet; |
59 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; | 56 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; |
60 | // } | 57 | // } |
61 | 58 | ||
62 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ | 59 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ |
63 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ | 60 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ |
64 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ | 61 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ |
65 | {tag:'a', id:this.getId('link'), href:'#', children:[ | 62 | {tag:'a', id:this.getId('link'), href:'#', children:[ |
66 | {tag:'div', cls:'icon'}, | 63 | {tag:'div', cls:'icon'}, |
67 | {tag:'div', cls:'text', children:[ | 64 | {tag:'div', cls:'text', children:[ |
68 | {tag:'span', html:"add to Clipperz"} | 65 | {tag:'span', html:"add to Clipperz"} |
69 | ]} | 66 | ]} |
70 | ]} | 67 | ]} |
71 | ]} | 68 | ]} |
72 | ]}); | 69 | ]}); |
73 | 70 | ||
74 | new Clipperz.PM.UI.Common.Components.Tooltip({ | 71 | new Clipperz.PM.UI.Common.Components.Tooltip({ |
75 | element:this.getElement('linkBlock'), | 72 | element:this.getElement('linkBlock'), |
76 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", | 73 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", |
77 | position:'BELOW' | 74 | position:'BELOW' |
78 | }); | 75 | }); |
79 | 76 | ||
80 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); | 77 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); |
81 | this.updateBookmarkletURLs(); | 78 | this.updateBookmarkletURLs(); |
82 | }, | 79 | }, |
83 | 80 | ||
84 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
85 | 82 | ||
86 | 'handleOnclick': function (anEvent) { | 83 | 'handleOnclick': function (anEvent) { |
87 | anEvent.preventDefault(); | 84 | anEvent.preventDefault(); |
88 | 85 | ||
89 | Clipperz.log("BOOKMARKLET CLICK"); | 86 | Clipperz.log("BOOKMARKLET CLICK"); |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //------------------------------------------------------------------------- | 89 | //------------------------------------------------------------------------- |
93 | 90 | ||
94 | 'updateBookmarkletURLs': function () { | 91 | 'updateBookmarkletURLs': function () { |
95 | var bookmarkletUrl; | 92 | var bookmarkletUrl; |
96 | 93 | ||
97 | if (Clipperz_IEisBroken == true) { | 94 | if (Clipperz_IEisBroken == true) { |
98 | bookmarkletUrl = bookmarklet_ie; | 95 | bookmarkletUrl = bookmarklet_ie; |
99 | } else { | 96 | } else { |
100 | // bookmarkletUrl = bookmarklet; | 97 | // bookmarkletUrl = bookmarklet; |
101 | bookmarkletUrl = Clipperz.PM.Strings.getValue('bookmarklet'); | 98 | bookmarkletUrl = Clipperz.PM.Strings.getValue('bookmarklet'); |
102 | } | 99 | } |
103 | 100 | ||
104 | this.getElement('link').href = bookmarkletUrl; | 101 | this.getElement('link').href = bookmarkletUrl; |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------- |
108 | __syntaxFix__: "syntax fix" | 105 | __syntaxFix__: "syntax fix" |
109 | }); | 106 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js index e3238ca..af33d85 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._tabPanelController = null; | 33 | this._tabPanelController = null; |
37 | 34 | ||
38 | this._tabPanelControllerConfiguration = { | 35 | this._tabPanelControllerConfiguration = { |
39 | 'DETAILS': { | 36 | 'DETAILS': { |
40 | tab:'detailTab', | 37 | tab:'detailTab', |
41 | panel:'detailTabpanel' | 38 | panel:'detailTabpanel' |
42 | }, | 39 | }, |
43 | 'DIRECT_LOGINS': { | 40 | 'DIRECT_LOGINS': { |
44 | tab:'directLoginTab', | 41 | tab:'directLoginTab', |
45 | panel:'directLoginTabpanel' | 42 | panel:'directLoginTabpanel' |
46 | }, | 43 | }, |
47 | 'SHARING': { | 44 | 'SHARING': { |
48 | tab:'sharingTab', | 45 | tab:'sharingTab', |
49 | panel:'sharingTabpanel' | 46 | panel:'sharingTabpanel' |
50 | } | 47 | } |
51 | }; | 48 | }; |
52 | 49 | ||
53 | this._tooltips = null; | 50 | this._tooltips = null; |
54 | 51 | ||
55 | this._isSavingEnabled = false; | 52 | this._isSavingEnabled = false; |
56 | this._hintMode = 'OFF'; //'ON' | 53 | this._hintMode = 'OFF'; //'ON' |
57 | 54 | ||
58 | this._fieldComponents = {}; | 55 | this._fieldComponents = {}; |
59 | this._directLoginComponents = {}; | 56 | this._directLoginComponents = {}; |
60 | 57 | ||
61 | this._displayMode = 'fixed'; //'scrollable'; | 58 | this._displayMode = 'fixed'; //'scrollable'; |
62 | 59 | ||
63 | return this; | 60 | return this; |
64 | } | 61 | } |
65 | 62 | ||
66 | //============================================================================= | 63 | //============================================================================= |
67 | 64 | ||
68 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 65 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
69 | 66 | ||
70 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
71 | 68 | ||
72 | 'toString': function () { | 69 | 'toString': function () { |
73 | return "Clipperz.PM.UI.Web.Components.CardDialogComponent component"; | 70 | return "Clipperz.PM.UI.Web.Components.CardDialogComponent component"; |
74 | }, | 71 | }, |
75 | 72 | ||
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | 74 | ||
78 | 'tabPanelController': function () { | 75 | 'tabPanelController': function () { |
79 | if (this._tabPanelController == null) { | 76 | if (this._tabPanelController == null) { |
80 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | 77 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ |
81 | component:this, | 78 | component:this, |
82 | configuration:this._tabPanelControllerConfiguration | 79 | configuration:this._tabPanelControllerConfiguration |
83 | }); | 80 | }); |
84 | 81 | ||
85 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | 82 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') |
86 | } | 83 | } |
87 | 84 | ||
88 | return this._tabPanelController; | 85 | return this._tabPanelController; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------- |
92 | 89 | ||
93 | 'renderSelf': function() { | 90 | 'renderSelf': function() { |
94 | this.append(this.element(), {tag:'div', cls:'CardDialog mainDialog loading', id:this.getId('panel'), children: [ | 91 | this.append(this.element(), {tag:'div', cls:'CardDialog mainDialog loading', id:this.getId('panel'), children: [ |
95 | {tag:'form', id:this.getId('form'), children:[ | 92 | {tag:'form', id:this.getId('form'), children:[ |
96 | // {tag:'input', type:'text', id:this.getId('hidden'), cls:'hidden'}, | 93 | // {tag:'input', type:'text', id:this.getId('hidden'), cls:'hidden'}, |
97 | {tag:'div', cls:'header', children:[ | 94 | {tag:'div', cls:'header', children:[ |
98 | {tag:'div', cls:'title', children:[ | 95 | {tag:'div', cls:'title', children:[ |
99 | {tag:'input', type:'text', id:this.getId('title')} | 96 | {tag:'input', type:'text', id:this.getId('title')} |
100 | ]} | 97 | ]} |
101 | ]}, | 98 | ]}, |
102 | {tag:'div', id:this.getId('body'), cls:'body', children:[ | 99 | {tag:'div', id:this.getId('body'), cls:'body', children:[ |
103 | {tag:'div', cls:'tabs', children:[ | 100 | {tag:'div', cls:'tabs', children:[ |
104 | {tag:'ul', cls:'tabs', children:[ | 101 | {tag:'ul', cls:'tabs', children:[ |
105 | {tag:'li', id:this.getId('detailTab'), children:[{tag:'span', html:"details"}]}, | 102 | {tag:'li', id:this.getId('detailTab'), children:[{tag:'span', html:"details"}]}, |
106 | {tag:'li', id:this.getId('directLoginTab'), children:[ | 103 | {tag:'li', id:this.getId('directLoginTab'), children:[ |
107 | {tag:'span', html:"direct logins"}//, | 104 | {tag:'span', html:"direct logins"}//, |
108 | // {tag:'div', id:this.getId('addDirectLoginButton'), cls:'addDirectLoginButton', children:[ | 105 | // {tag:'div', id:this.getId('addDirectLoginButton'), cls:'addDirectLoginButton', children:[ |
109 | // {tag:'span', html:"+"} | 106 | // {tag:'span', html:"+"} |
110 | // ]} | 107 | // ]} |
111 | ]}, | 108 | ]}, |
112 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'span', html:"sharing"}]} | 109 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'span', html:"sharing"}]} |
113 | ]} | 110 | ]} |
114 | ]}, | 111 | ]}, |
115 | {tag:'div', cls:'tabPanels', children:[ | 112 | {tag:'div', cls:'tabPanels', children:[ |
116 | {tag:'ul', cls:'tabPanels', children:[ | 113 | {tag:'ul', cls:'tabPanels', children:[ |
117 | {tag:'li', id:this.getId('detailTabpanel'), cls:'tabPanel', children:[ | 114 | {tag:'li', id:this.getId('detailTabpanel'), cls:'tabPanel', children:[ |
118 | {tag:'div', id:this.getId('recordFields'), children:[ | 115 | {tag:'div', id:this.getId('recordFields'), children:[ |
119 | {tag:'table', cls:'fields', cellpadding:'0', id:this.getId('fieldTable'), cellspacing:'0', children:[ | 116 | {tag:'table', cls:'fields', cellpadding:'0', id:this.getId('fieldTable'), cellspacing:'0', children:[ |
120 | {tag:'thead', children:[ | 117 | {tag:'thead', children:[ |
121 | {tag:'tr', children:[ | 118 | {tag:'tr', children:[ |
122 | {tag:'th', cls:'fieldStateTH',html:""}, | 119 | {tag:'th', cls:'fieldStateTH',html:""}, |
123 | {tag:'th', cls:'fieldLabelTH',html:"label"}, | 120 | {tag:'th', cls:'fieldLabelTH',html:"label"}, |
124 | {tag:'th', cls:'fieldLockTH',html:""}, | 121 | {tag:'th', cls:'fieldLockTH',html:""}, |
125 | {tag:'th', cls:'fieldValueTH',html:"value"}, | 122 | {tag:'th', cls:'fieldValueTH',html:"value"}, |
126 | {tag:'th', cls:'fieldActionTH',html:""}, | 123 | {tag:'th', cls:'fieldActionTH',html:""}, |
127 | {tag:'th', cls:'fieldDeleteTH',html:""} | 124 | {tag:'th', cls:'fieldDeleteTH',html:""} |
128 | ]} | 125 | ]} |
129 | ]}, | 126 | ]}, |
130 | {tag:'tfoot'}, | 127 | {tag:'tfoot'}, |
131 | {tag:'tbody', id:this.getId('tableBody'), children:[ | 128 | {tag:'tbody', id:this.getId('tableBody'), children:[ |
132 | {tag:'tr', id:this.getId('newFieldTR'), cls:'newFieldTR', children:[ | 129 | {tag:'tr', id:this.getId('newFieldTR'), cls:'newFieldTR', children:[ |
133 | {tag:'td', cls:'fieldState'}, | 130 | {tag:'td', cls:'fieldState'}, |
134 | {tag:'td', cls:'fieldLabel', children:[ | 131 | {tag:'td', cls:'fieldLabel', children:[ |
135 | {tag:'input', cls:'label', id:this.getId('newFieldLabel')} | 132 | {tag:'input', cls:'label', id:this.getId('newFieldLabel')} |
136 | ]}, | 133 | ]}, |
137 | {tag:'td', cls:'fieldLock', children:[ | 134 | {tag:'td', cls:'fieldLock', children:[ |
138 | {tag:'div', cls:'unlocked', id:this.getId('newFieldIsLocked')} | 135 | {tag:'div', cls:'unlocked', id:this.getId('newFieldIsLocked')} |
139 | ]}, | 136 | ]}, |
140 | {tag:'td', cls:'fieldValue', children:[ | 137 | {tag:'td', cls:'fieldValue', children:[ |
141 | {tag:'div', cls:'unlocked', id:this.getId('newFieldValueWrapper'), children:[ | 138 | {tag:'div', cls:'unlocked', id:this.getId('newFieldValueWrapper'), children:[ |
142 | {tag:'input',type:'text', cls:'value', id:this.getId('newFieldValue')} | 139 | {tag:'input',type:'text', cls:'value', id:this.getId('newFieldValue')} |
143 | ]} | 140 | ]} |
144 | ]}, | 141 | ]}, |
145 | {tag:'td', cls:'fieldAction', children:[ | 142 | {tag:'td', cls:'fieldAction', children:[ |
146 | {tag:'div', html:' '} | 143 | {tag:'div', html:' '} |
147 | ]}, | 144 | ]}, |
148 | {tag:'td', cls:'fieldAddDelete', children:[ | 145 | {tag:'td', cls:'fieldAddDelete', children:[ |
149 | {tag:'div', cls:'new', children:[ | 146 | {tag:'div', cls:'new', children:[ |
150 | {tag:'span', children:[ | 147 | {tag:'span', children:[ |
151 | {tag:'a', href:'#', id:this.getId('newFieldAddButton'), html:"add"} | 148 | {tag:'a', href:'#', id:this.getId('newFieldAddButton'), html:"add"} |
152 | ]} | 149 | ]} |
153 | ]} | 150 | ]} |
154 | ]} | 151 | ]} |
155 | ]} | 152 | ]} |
156 | ]} | 153 | ]} |
157 | ]} | 154 | ]} |
158 | ]}, | 155 | ]}, |
159 | {tag:'div', cls:'notes', children:[ | 156 | {tag:'div', cls:'notes', children:[ |
160 | {tag:'div', children:[ | 157 | {tag:'div', children:[ |
161 | {tag:'textarea', id:this.getId('recordNote'), value:""} | 158 | {tag:'textarea', id:this.getId('recordNote'), value:""} |
162 | ]} | 159 | ]} |
163 | ]} | 160 | ]} |
164 | ]}, | 161 | ]}, |
165 | {tag:'li', id:this.getId('directLoginTabpanel'), cls:'tabPanel', children:[ | 162 | {tag:'li', id:this.getId('directLoginTabpanel'), cls:'tabPanel', children:[ |
166 | {tag:'div', id:this.getId('directLoginsComponentContainer'), cls:'directLoginsComponentContainer', children:[ | 163 | {tag:'div', id:this.getId('directLoginsComponentContainer'), cls:'directLoginsComponentContainer', children:[ |
167 | {tag:'div', id:this.getId('directLogins'), cls:'directLogins', children:[ | 164 | {tag:'div', id:this.getId('directLogins'), cls:'directLogins', children:[ |
168 | {tag:'div', id:this.getId('addNewDirectLoginSplash'), cls:'addNewDirectLoginSplash', children:[ | 165 | {tag:'div', id:this.getId('addNewDirectLoginSplash'), cls:'addNewDirectLoginSplash', children:[ |
169 | {tag:'h3', html:"Here you can add a Direct Login for this card: instant access to your favorit website!"}, | 166 | {tag:'h3', html:"Here you can add a Direct Login for this card: instant access to your favorit website!"}, |
170 | {tag:'a', href:'#', id:this.getId('addNewDirectLoginSplashButton'), children:[{tag:'span', html:"Add Direct Login"}]} | 167 | {tag:'a', href:'#', id:this.getId('addNewDirectLoginSplashButton'), children:[{tag:'span', html:"Add Direct Login"}]} |
171 | ]}, | 168 | ]}, |
172 | {tag:'div', id:this.getId('directLoginsList')}, | 169 | {tag:'div', id:this.getId('directLoginsList')}, |
173 | {tag:'div', cls:'addDirectLoginListItem', id:this.getId('addDirectLoginListItem'), children:[{tag:'a', href:'#', id:this.getId('addNewDirectLoginListItemButton'), children:[{tag:'span', html:"Add Direct Login"}]}]} | 170 | {tag:'div', cls:'addDirectLoginListItem', id:this.getId('addDirectLoginListItem'), children:[{tag:'a', href:'#', id:this.getId('addNewDirectLoginListItemButton'), children:[{tag:'span', html:"Add Direct Login"}]}]} |
174 | ]}, | 171 | ]}, |
175 | {tag:'div', id:this.getId('directLoginEditDetail'), cls:'directLoginEditDetail'} | 172 | {tag:'div', id:this.getId('directLoginEditDetail'), cls:'directLoginEditDetail'} |
176 | ]} | 173 | ]} |
177 | ]}, | 174 | ]}, |
178 | {tag:'li', id:this.getId('sharingTabpanel'), cls:'tabPanel', children:[ | 175 | {tag:'li', id:this.getId('sharingTabpanel'), cls:'tabPanel', children:[ |
179 | {tag:'h2', html:"Coming soon!"} | 176 | {tag:'h2', html:"Coming soon!"} |
180 | ]} | 177 | ]} |
181 | ]} | 178 | ]} |
182 | ]}, | 179 | ]}, |
183 | {tag:'div', cls:'mask', children:[ | 180 | {tag:'div', cls:'mask', children:[ |
184 | {tag:'div', id:this.getId('progress'), children:[ | 181 | {tag:'div', id:this.getId('progress'), children:[ |
185 | {tag:'h3', id:this.getId('progressDescription'), cls:'progressDescription', html:"Loading"}, | 182 | {tag:'h3', id:this.getId('progressDescription'), cls:'progressDescription', html:"Loading"}, |
186 | {tag:'div', id:this.getId('progressBar')} | 183 | {tag:'div', id:this.getId('progressBar')} |
187 | ]}, | 184 | ]}, |
188 | {tag:'div', id:this.getId('error'), cls:'error', children:[ | 185 | {tag:'div', id:this.getId('error'), cls:'error', children:[ |
189 | {tag:'div', cls:'img'}, | 186 | {tag:'div', cls:'img'}, |
190 | {tag:'p', id:this.getId('errorMessage')} | 187 | {tag:'p', id:this.getId('errorMessage')} |
191 | ]} | 188 | ]} |
192 | ]} | 189 | ]} |
193 | ]}, | 190 | ]}, |
194 | {tag:'div', cls:'footer', children:[ | 191 | {tag:'div', cls:'footer', children:[ |
195 | {tag:'div', cls:'buttonArea', children:[ | 192 | {tag:'div', cls:'buttonArea', children:[ |
196 | {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, | 193 | {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, |
197 | {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} | 194 | {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} |
198 | ]} | 195 | ]} |
199 | ]} | 196 | ]} |
200 | ]} | 197 | ]} |
201 | ]}); | 198 | ]}); |
202 | 199 | ||
203 | 200 | ||
204 | this.insertAllTooltips(); | 201 | this.insertAllTooltips(); |
205 | 202 | ||
206 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 203 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
207 | 204 | ||
208 | this.tabPanelController().setup({selected:'DETAILS'}); | 205 | this.tabPanelController().setup({selected:'DETAILS'}); |
209 | // this.tabPanelController().setup({selected:'DIRECT_LOGINS'}); | 206 | // this.tabPanelController().setup({selected:'DIRECT_LOGINS'}); |
210 | 207 | ||
211 | MochiKit.Style.hideElement(this.getId('error')); | 208 | MochiKit.Style.hideElement(this.getId('error')); |
212 | MochiKit.Style.hideElement(this.getElement('directLoginEditDetail')); | 209 | MochiKit.Style.hideElement(this.getElement('directLoginEditDetail')); |
213 | MochiKit.Style.hideElement(this.getElement('addDirectLoginListItem')); | 210 | MochiKit.Style.hideElement(this.getElement('addDirectLoginListItem')); |
214 | this.plumbDetailsPanel(); | 211 | this.plumbDetailsPanel(); |
215 | 212 | ||
216 | MochiKit.Signal.connect(this.getId('cancelButton'), 'onclick', this, 'handleCancelEvent'); | 213 | MochiKit.Signal.connect(this.getId('cancelButton'), 'onclick', this, 'handleCancelEvent'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js index 126c5b1..2e61f5f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js | |||
@@ -1,182 +1,179 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._faviconComponent = null; | 34 | this._faviconComponent = null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 42 | ||
46 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
47 | 44 | ||
48 | 'toString': function () { | 45 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; | 46 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'reference': function () { | 51 | 'reference': function () { |
55 | return this._reference; | 52 | return this._reference; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
59 | 56 | ||
60 | 'renderSelf': function() { | 57 | 'renderSelf': function() { |
61 | //console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf"); | 58 | //console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf"); |
62 | this.append(this.element(), [ | 59 | this.append(this.element(), [ |
63 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ | 60 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ |
64 | {tag:'img', cls:'favicon', id:this.getId('favicon')} | 61 | {tag:'img', cls:'favicon', id:this.getId('favicon')} |
65 | ]}, | 62 | ]}, |
66 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ | 63 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ |
67 | {tag:'input', id:this.getId('label'), type:'text'} | 64 | {tag:'input', id:this.getId('label'), type:'text'} |
68 | ]}, | 65 | ]}, |
69 | {tag:'div', cls:'open', children:[ | 66 | {tag:'div', cls:'open', children:[ |
70 | {tag:'span', children:[ | 67 | {tag:'span', children:[ |
71 | {tag:'a', href:'open', id:this.getId('open'), html:' '} | 68 | {tag:'a', href:'open', id:this.getId('open'), html:' '} |
72 | ]} | 69 | ]} |
73 | ]}, | 70 | ]}, |
74 | {tag:'div', cls:'edit', children:[ | 71 | {tag:'div', cls:'edit', children:[ |
75 | {tag:'span', children:[ | 72 | {tag:'span', children:[ |
76 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} | 73 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} |
77 | ]} | 74 | ]} |
78 | ]}, | 75 | ]}, |
79 | {tag:'div', cls:'delete', children:[ | 76 | {tag:'div', cls:'delete', children:[ |
80 | {tag:'span', children:[ | 77 | {tag:'span', children:[ |
81 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} | 78 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} |
82 | ]} | 79 | ]} |
83 | ]} | 80 | ]} |
84 | /* | 81 | /* |
85 | {tag:'td', cls:'fieldState'}, | 82 | {tag:'td', cls:'fieldState'}, |
86 | {tag:'td', cls:'fieldLabel', children:[ | 83 | {tag:'td', cls:'fieldLabel', children:[ |
87 | {tag:'input', cls:'label', id:this.getId('label')} | 84 | {tag:'input', cls:'label', id:this.getId('label')} |
88 | ]}, | 85 | ]}, |
89 | {tag:'td', cls:'fieldLock', children:[ | 86 | {tag:'td', cls:'fieldLock', children:[ |
90 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | 87 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} |
91 | ]}, | 88 | ]}, |
92 | {tag:'td', cls:'fieldValue', children:[ | 89 | {tag:'td', cls:'fieldValue', children:[ |
93 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | 90 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ |
94 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | 91 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} |
95 | ]} | 92 | ]} |
96 | ]}, | 93 | ]}, |
97 | {tag:'td', cls:'fieldAddDelete', children:[ | 94 | {tag:'td', cls:'fieldAddDelete', children:[ |
98 | {tag:'div', cls:'delete', children:[ | 95 | {tag:'div', cls:'delete', children:[ |
99 | {tag:'span', children:[ | 96 | {tag:'span', children:[ |
100 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | 97 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} |
101 | ]} | 98 | ]} |
102 | ]} | 99 | ]} |
103 | ]} | 100 | ]} |
104 | */ | 101 | */ |
105 | ]); | 102 | ]); |
106 | 103 | ||
107 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 104 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
108 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); | 105 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); |
109 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); | 106 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); |
110 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); | 107 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); |
111 | }, | 108 | }, |
112 | 109 | ||
113 | //------------------------------------------------------------------------- | 110 | //------------------------------------------------------------------------- |
114 | 111 | ||
115 | 'shouldShowElementWhileRendering': function () { | 112 | 'shouldShowElementWhileRendering': function () { |
116 | return false; | 113 | return false; |
117 | }, | 114 | }, |
118 | 115 | ||
119 | //------------------------------------------------------------------------- | 116 | //------------------------------------------------------------------------- |
120 | 117 | ||
121 | 'faviconComponent': function () { | 118 | 'faviconComponent': function () { |
122 | if (this._faviconComponent == null) { | 119 | if (this._faviconComponent == null) { |
123 | //console.log("created the FAVICON component"); | 120 | //console.log("created the FAVICON component"); |
124 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); | 121 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); |
125 | } | 122 | } |
126 | 123 | ||
127 | return this._faviconComponent; | 124 | return this._faviconComponent; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //========================================================================= | 127 | //========================================================================= |
131 | 128 | ||
132 | 'label': function () { | 129 | 'label': function () { |
133 | return this.getElement('label').value; | 130 | return this.getElement('label').value; |
134 | }, | 131 | }, |
135 | 132 | ||
136 | 'setLabel': function (aValue) { | 133 | 'setLabel': function (aValue) { |
137 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | 134 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'favicon': function () { | 139 | 'favicon': function () { |
143 | // return this.getElement('favicon').src; | 140 | // return this.getElement('favicon').src; |
144 | return this.faviconComponent().src(); | 141 | return this.faviconComponent().src(); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | 'setFavicon': function (aValue) { | 144 | 'setFavicon': function (aValue) { |
148 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); | 145 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); |
149 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); | 146 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); |
150 | }, | 147 | }, |
151 | 148 | ||
152 | //========================================================================= | 149 | //========================================================================= |
153 | 150 | ||
154 | 'openDirectLogin': function (anEvent) { | 151 | 'openDirectLogin': function (anEvent) { |
155 | anEvent.preventDefault(); | 152 | anEvent.preventDefault(); |
156 | 153 | ||
157 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); | 154 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); |
158 | }, | 155 | }, |
159 | 156 | ||
160 | //------------------------------------------------------------------------- | 157 | //------------------------------------------------------------------------- |
161 | 158 | ||
162 | 'editDirectLogin': function (anEvent) { | 159 | 'editDirectLogin': function (anEvent) { |
163 | anEvent.preventDefault(); | 160 | anEvent.preventDefault(); |
164 | 161 | ||
165 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); | 162 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); |
166 | //console.log("EDIT DIRECT LOGIN"); | 163 | //console.log("EDIT DIRECT LOGIN"); |
167 | }, | 164 | }, |
168 | 165 | ||
169 | //------------------------------------------------------------------------- | 166 | //------------------------------------------------------------------------- |
170 | 167 | ||
171 | 'deleteDirectLogin': function (anEvent) { | 168 | 'deleteDirectLogin': function (anEvent) { |
172 | anEvent.preventDefault(); | 169 | anEvent.preventDefault(); |
173 | 170 | ||
174 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); | 171 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); |
175 | //console.log("DELETE DIRECT LOGIN"); | 172 | //console.log("DELETE DIRECT LOGIN"); |
176 | }, | 173 | }, |
177 | 174 | ||
178 | 175 | ||
179 | 176 | ||
180 | //========================================================================= | 177 | //========================================================================= |
181 | __syntaxFix__: "syntax fix" | 178 | __syntaxFix__: "syntax fix" |
182 | }); | 179 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js index c1a7c13..b58062c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js | |||
@@ -1,190 +1,187 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._actionType = null; | 34 | this._actionType = null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 42 | ||
46 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
47 | 44 | ||
48 | 'toString': function () { | 45 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; | 46 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'renderSelf': function() { | 51 | 'renderSelf': function() { |
55 | this.append(this.element(), [ | 52 | this.append(this.element(), [ |
56 | {tag:'td', cls:'fieldState'}, | 53 | {tag:'td', cls:'fieldState'}, |
57 | {tag:'td', cls:'fieldLabel', children:[ | 54 | {tag:'td', cls:'fieldLabel', children:[ |
58 | {tag:'input', cls:'label', id:this.getId('label')} | 55 | {tag:'input', cls:'label', id:this.getId('label')} |
59 | ]}, | 56 | ]}, |
60 | {tag:'td', cls:'fieldLock', children:[ | 57 | {tag:'td', cls:'fieldLock', children:[ |
61 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | 58 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} |
62 | ]}, | 59 | ]}, |
63 | {tag:'td', cls:'fieldValue', children:[ | 60 | {tag:'td', cls:'fieldValue', children:[ |
64 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | 61 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ |
65 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | 62 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} |
66 | ]} | 63 | ]} |
67 | ]}, | 64 | ]}, |
68 | {tag:'td', cls:'fieldAction', children:[ | 65 | {tag:'td', cls:'fieldAction', children:[ |
69 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} | 66 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} |
70 | ]}, | 67 | ]}, |
71 | {tag:'td', cls:'fieldAddDelete', children:[ | 68 | {tag:'td', cls:'fieldAddDelete', children:[ |
72 | {tag:'div', cls:'delete', children:[ | 69 | {tag:'div', cls:'delete', children:[ |
73 | {tag:'span', children:[ | 70 | {tag:'span', children:[ |
74 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | 71 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} |
75 | ]} | 72 | ]} |
76 | ]} | 73 | ]} |
77 | ]} | 74 | ]} |
78 | ]); | 75 | ]); |
79 | 76 | ||
80 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 77 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
81 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); | 78 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); |
82 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 79 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
83 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); | 80 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); |
84 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); | 81 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); |
85 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); | 82 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'shouldShowElementWhileRendering': function () { | 87 | 'shouldShowElementWhileRendering': function () { |
91 | return false; | 88 | return false; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //========================================================================= | 91 | //========================================================================= |
95 | 92 | ||
96 | 'reference': function () { | 93 | 'reference': function () { |
97 | return this._reference; | 94 | return this._reference; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //========================================================================= | 97 | //========================================================================= |
101 | 98 | ||
102 | 'label': function () { | 99 | 'label': function () { |
103 | return this.getElement('label').value; | 100 | return this.getElement('label').value; |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'setLabel': function (aValue) { | 103 | 'setLabel': function (aValue) { |
107 | // this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | 104 | // this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); |
108 | this.getElement('label').value = aValue; | 105 | this.getElement('label').value = aValue; |
109 | }, | 106 | }, |
110 | 107 | ||
111 | //========================================================================= | 108 | //========================================================================= |
112 | 109 | ||
113 | 'value': function () { | 110 | 'value': function () { |
114 | return this.getElement('value').value; | 111 | return this.getElement('value').value; |
115 | }, | 112 | }, |
116 | 113 | ||
117 | 'setValue': function (aValue) { | 114 | 'setValue': function (aValue) { |
118 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | 115 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); |
119 | this.getElement('value').value = aValue; | 116 | this.getElement('value').value = aValue; |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //------------------------------------------------------------------------- | 119 | //------------------------------------------------------------------------- |
123 | 120 | ||
124 | 'actionType': function () { | 121 | 'actionType': function () { |
125 | return this._actionType; | 122 | return this._actionType; |
126 | }, | 123 | }, |
127 | 124 | ||
128 | 'setActionType': function (anActionType) { | 125 | 'setActionType': function (anActionType) { |
129 | this._actionType = anActionType; | 126 | this._actionType = anActionType; |
130 | 127 | ||
131 | switch (this._actionType) { | 128 | switch (this._actionType) { |
132 | case 'NONE': | 129 | case 'NONE': |
133 | MochiKit.Style.hideElement(this.getId('actionLink')); | 130 | MochiKit.Style.hideElement(this.getId('actionLink')); |
134 | MochiKit.DOM.setElementClass(this.getId('actionLink'), ''); | 131 | MochiKit.DOM.setElementClass(this.getId('actionLink'), ''); |
135 | break; | 132 | break; |
136 | case 'URL': | 133 | case 'URL': |
137 | MochiKit.Style.showElement(this.getId('actionLink')); | 134 | MochiKit.Style.showElement(this.getId('actionLink')); |
138 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'url'); | 135 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'url'); |
139 | break; | 136 | break; |
140 | case 'EMAIL': | 137 | case 'EMAIL': |
141 | MochiKit.Style.showElement(this.getId('actionLink')); | 138 | MochiKit.Style.showElement(this.getId('actionLink')); |
142 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'email'); | 139 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'email'); |
143 | break; | 140 | break; |
144 | case 'PASSWORD': | 141 | case 'PASSWORD': |
145 | MochiKit.Style.showElement(this.getId('actionLink')); | 142 | MochiKit.Style.showElement(this.getId('actionLink')); |
146 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'password'); | 143 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'password'); |
147 | break; | 144 | break; |
148 | } | 145 | } |
149 | }, | 146 | }, |
150 | 147 | ||
151 | //========================================================================= | 148 | //========================================================================= |
152 | 149 | ||
153 | 'isHidden': function () { | 150 | 'isHidden': function () { |
154 | // return this.getElement('value').value; | 151 | // return this.getElement('value').value; |
155 | return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); | 152 | return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); |
156 | }, | 153 | }, |
157 | 154 | ||
158 | 'setIsHidden': function (aValue) { | 155 | 'setIsHidden': function (aValue) { |
159 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | 156 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); |
160 | MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); | 157 | MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); |
161 | MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); | 158 | MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); |
162 | }, | 159 | }, |
163 | 160 | ||
164 | 'toggleIsHidden': function (anEvent) { | 161 | 'toggleIsHidden': function (anEvent) { |
165 | anEvent.preventDefault(); | 162 | anEvent.preventDefault(); |
166 | 163 | ||
167 | this.setIsHidden(! this.isHidden()); | 164 | this.setIsHidden(! this.isHidden()); |
168 | MochiKit.Signal.signal(this, 'changedValue'); | 165 | MochiKit.Signal.signal(this, 'changedValue'); |
169 | }, | 166 | }, |
170 | 167 | ||
171 | //========================================================================= | 168 | //========================================================================= |
172 | 169 | ||
173 | 'handleActionLink': function (anEvent) { | 170 | 'handleActionLink': function (anEvent) { |
174 | anEvent.preventDefault(); | 171 | anEvent.preventDefault(); |
175 | 172 | ||
176 | //console.log("ACTION LINK - " + this.actionType()); | 173 | //console.log("ACTION LINK - " + this.actionType()); |
177 | MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); | 174 | MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); |
178 | }, | 175 | }, |
179 | 176 | ||
180 | //========================================================================= | 177 | //========================================================================= |
181 | 178 | ||
182 | 'deleteField': function (anEvent) { | 179 | 'deleteField': function (anEvent) { |
183 | anEvent.preventDefault(); | 180 | anEvent.preventDefault(); |
184 | 181 | ||
185 | MochiKit.Signal.signal(this, 'deleteField', this.reference()); | 182 | MochiKit.Signal.signal(this, 'deleteField', this.reference()); |
186 | }, | 183 | }, |
187 | 184 | ||
188 | //========================================================================= | 185 | //========================================================================= |
189 | __syntaxFix__: "syntax fix" | 186 | __syntaxFix__: "syntax fix" |
190 | }); | 187 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js index bfc7e61..391c379 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js | |||
@@ -1,203 +1,200 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; | 35 | this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; |
39 | this._label = args.label || null; | 36 | this._label = args.label || null; |
40 | this._isSortable = args.sortable|| false; | 37 | this._isSortable = args.sortable|| false; |
41 | this._comparator = args.comparator|| null; | 38 | this._comparator = args.comparator|| null; |
42 | this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' | 39 | this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' |
43 | this._cssClass = args.cssClass|| ''; | 40 | this._cssClass = args.cssClass|| ''; |
44 | 41 | ||
45 | this._signalIdentifiers = []; | 42 | this._signalIdentifiers = []; |
46 | 43 | ||
47 | return this; | 44 | return this; |
48 | } | 45 | } |
49 | 46 | ||
50 | //============================================================================= | 47 | //============================================================================= |
51 | 48 | ||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ColumnManager, Clipperz.PM.UI.Common.Components.BaseComponent, { | 49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ColumnManager, Clipperz.PM.UI.Common.Components.BaseComponent, { |
53 | 50 | ||
54 | 'toString': function () { | 51 | 'toString': function () { |
55 | return "Clipperz.PM.UI.Web.Components.ColumnManager - " + this._name; | 52 | return "Clipperz.PM.UI.Web.Components.ColumnManager - " + this._name; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | 'name': function () { | 55 | 'name': function () { |
59 | return this._name; | 56 | return this._name; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | 'label': function () { | 59 | 'label': function () { |
63 | return this._label; | 60 | return this._label; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | 'selector': function () { | 63 | 'selector': function () { |
67 | return this._selector; | 64 | return this._selector; |
68 | }, | 65 | }, |
69 | 66 | ||
70 | 'comparator': function() { | 67 | 'comparator': function() { |
71 | return this._comparator; | 68 | return this._comparator; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'cssClass': function() { | 71 | 'cssClass': function() { |
75 | return this._cssClass; | 72 | return this._cssClass; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'isSortable': function () { | 77 | 'isSortable': function () { |
81 | return this._isSortable; | 78 | return this._isSortable; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
85 | 82 | ||
86 | 'sorted': function () { | 83 | 'sorted': function () { |
87 | return this._sorted; | 84 | return this._sorted; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | 'isSorted': function () { | 87 | 'isSorted': function () { |
91 | return (this.sorted() != 'UNSORTED'); | 88 | return (this.sorted() != 'UNSORTED'); |
92 | }, | 89 | }, |
93 | 90 | ||
94 | 'setSorted': function(aValue) { | 91 | 'setSorted': function(aValue) { |
95 | this._sorted = aValue; | 92 | this._sorted = aValue; |
96 | this.updateSortIcon(); | 93 | this.updateSortIcon(); |
97 | }, | 94 | }, |
98 | 95 | ||
99 | //------------------------------------------------------------------------- | 96 | //------------------------------------------------------------------------- |
100 | 97 | ||
101 | 'signalIdentifiers': function () { | 98 | 'signalIdentifiers': function () { |
102 | return this._signalIdentifiers; | 99 | return this._signalIdentifiers; |
103 | }, | 100 | }, |
104 | 101 | ||
105 | 'resetSignalIdentifiers': function () { | 102 | 'resetSignalIdentifiers': function () { |
106 | this._signalIdentifiers = []; | 103 | this._signalIdentifiers = []; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'disconnectRowsSignals': function () { | 108 | 'disconnectRowsSignals': function () { |
112 | MochiKit.Base.map(MochiKit.Signal.disconnect, this.signalIdentifiers()); | 109 | MochiKit.Base.map(MochiKit.Signal.disconnect, this.signalIdentifiers()); |
113 | this.resetSignalIdentifiers(); | 110 | this.resetSignalIdentifiers(); |
114 | }, | 111 | }, |
115 | 112 | ||
116 | 'connectEvent': function () { | 113 | 'connectEvent': function () { |
117 | var ident; | 114 | var ident; |
118 | 115 | ||
119 | ident = MochiKit.Signal.connect.apply(null, arguments); | 116 | ident = MochiKit.Signal.connect.apply(null, arguments); |
120 | this.signalIdentifiers().push(ident); | 117 | this.signalIdentifiers().push(ident); |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //------------------------------------------------------------------------- | 120 | //------------------------------------------------------------------------- |
124 | 121 | ||
125 | 'renderHeader': function(aTRElement) { | 122 | 'renderHeader': function(aTRElement) { |
126 | varthElement; | 123 | varthElement; |
127 | 124 | ||
128 | thElement = Clipperz.DOM.Helper.append(aTRElement, {tag:'th', cls:(this.cssClass() + 'TH'), id:this.getId('sortLink'), children:[ | 125 | thElement = Clipperz.DOM.Helper.append(aTRElement, {tag:'th', cls:(this.cssClass() + 'TH'), id:this.getId('sortLink'), children:[ |
129 | {tag:'span', html:this.label() ? this.label() : ' '} | 126 | {tag:'span', html:this.label() ? this.label() : ' '} |
130 | ]}); | 127 | ]}); |
131 | 128 | ||
132 | if (this.isSortable()) { | 129 | if (this.isSortable()) { |
133 | Clipperz.DOM.Helper.append(thElement, {tag:'span', cls:'sortable', children:[ | 130 | Clipperz.DOM.Helper.append(thElement, {tag:'span', cls:'sortable', children:[ |
134 | {tag:'a', href:'#'/*, id:this.getId('sortLink')*/, html:' '} | 131 | {tag:'a', href:'#'/*, id:this.getId('sortLink')*/, html:' '} |
135 | ]}); | 132 | ]}); |
136 | 133 | ||
137 | MochiKit.DOM.addElementClass(thElement, 'sortable'); | 134 | MochiKit.DOM.addElementClass(thElement, 'sortable'); |
138 | MochiKit.Signal.connect(thElement, 'onclick', this, 'handleClickOnSortingCriteria'); | 135 | MochiKit.Signal.connect(thElement, 'onclick', this, 'handleClickOnSortingCriteria'); |
139 | }; | 136 | }; |
140 | 137 | ||
141 | this.updateSortIcon(); | 138 | this.updateSortIcon(); |
142 | }, | 139 | }, |
143 | 140 | ||
144 | //------------------------------------------------------------------------- | 141 | //------------------------------------------------------------------------- |
145 | 142 | ||
146 | 'toggleSorting': function () { | 143 | 'toggleSorting': function () { |
147 | var result; | 144 | var result; |
148 | switch (this.sorted()) { | 145 | switch (this.sorted()) { |
149 | case 'UNSORTED': | 146 | case 'UNSORTED': |
150 | result = 'ASCENDING'; | 147 | result = 'ASCENDING'; |
151 | break; | 148 | break; |
152 | case 'ASCENDING': | 149 | case 'ASCENDING': |
153 | result = 'DESCENDING'; | 150 | result = 'DESCENDING'; |
154 | break; | 151 | break; |
155 | case 'DESCENDING': | 152 | case 'DESCENDING': |
156 | result = 'ASCENDING'; | 153 | result = 'ASCENDING'; |
157 | break; | 154 | break; |
158 | default: | 155 | default: |
159 | result = 'UNSORTED'; | 156 | result = 'UNSORTED'; |
160 | break; | 157 | break; |
161 | } | 158 | } |
162 | 159 | ||
163 | this.setSorted(result); | 160 | this.setSorted(result); |
164 | 161 | ||
165 | return result; | 162 | return result; |
166 | }, | 163 | }, |
167 | 164 | ||
168 | //------------------------------------------------------------------------- | 165 | //------------------------------------------------------------------------- |
169 | 166 | ||
170 | 'sortElementClass': function () { | 167 | 'sortElementClass': function () { |
171 | return this.sorted().toLowerCase(); | 168 | return this.sorted().toLowerCase(); |
172 | }, | 169 | }, |
173 | 170 | ||
174 | //------------------------------------------------------------------------- | 171 | //------------------------------------------------------------------------- |
175 | 172 | ||
176 | 'updateSortIcon': function () { | 173 | 'updateSortIcon': function () { |
177 | if (this.isSortable()) { | 174 | if (this.isSortable()) { |
178 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'ascending'); | 175 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'ascending'); |
179 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'descending'); | 176 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'descending'); |
180 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'unsorted'); | 177 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'unsorted'); |
181 | 178 | ||
182 | MochiKit.DOM.addElementClass(this.getId('sortLink'), this.sortElementClass()); | 179 | MochiKit.DOM.addElementClass(this.getId('sortLink'), this.sortElementClass()); |
183 | } | 180 | } |
184 | }, | 181 | }, |
185 | 182 | ||
186 | //------------------------------------------------------------------------- | 183 | //------------------------------------------------------------------------- |
187 | 184 | ||
188 | 'renderCell': function(aRowElement, anObject) { | 185 | 'renderCell': function(aRowElement, anObject) { |
189 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[{tag:'span', html:anObject[this.name()]}]}); | 186 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[{tag:'span', html:anObject[this.name()]}]}); |
190 | }, | 187 | }, |
191 | 188 | ||
192 | //----------------------------------------------------- | 189 | //----------------------------------------------------- |
193 | 190 | ||
194 | 'handleClickOnSortingCriteria': function (anEvent) { | 191 | 'handleClickOnSortingCriteria': function (anEvent) { |
195 | anEvent.preventDefault(); | 192 | anEvent.preventDefault(); |
196 | MochiKit.Signal.signal(this, 'sort', this); | 193 | MochiKit.Signal.signal(this, 'sort', this); |
197 | }, | 194 | }, |
198 | 195 | ||
199 | //----------------------------------------------------- | 196 | //----------------------------------------------------- |
200 | '__syntax_fix__' : 'syntax fix' | 197 | '__syntax_fix__' : 'syntax fix' |
201 | 198 | ||
202 | }); | 199 | }); |
203 | 200 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js index 61d6ead..d3aa175 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js | |||
@@ -1,71 +1,68 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | return this; | 33 | return this; |
37 | } | 34 | } |
38 | 35 | ||
39 | //============================================================================= | 36 | //============================================================================= |
40 | 37 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; | 43 | return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'renderSelf': function() { | 48 | 'renderSelf': function() { |
52 | this.append(this.element(), [ | 49 | this.append(this.element(), [ |
53 | {tag:'div', cls:'createNewCardSplash', id:this.getId('button'), children:[ | 50 | {tag:'div', cls:'createNewCardSplash', id:this.getId('button'), children:[ |
54 | {tag:'span', html:"Create New Card"} | 51 | {tag:'span', html:"Create New Card"} |
55 | ]} | 52 | ]} |
56 | ]); | 53 | ]); |
57 | 54 | ||
58 | MochiKit.Signal.connect(this.getElement('button'), 'onclick', this, 'handleClick'); | 55 | MochiKit.Signal.connect(this.getElement('button'), 'onclick', this, 'handleClick'); |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'handleClick': function (anEvent) { | 60 | 'handleClick': function (anEvent) { |
64 | anEvent.preventDefault(); | 61 | anEvent.preventDefault(); |
65 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'addCard', this.element()); | 62 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'addCard', this.element()); |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | __syntaxFix__: "syntax fix" | 67 | __syntaxFix__: "syntax fix" |
71 | }); | 68 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js index 91d99e3..d2f1045 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js | |||
@@ -1,111 +1,108 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.DataPanel = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DataPanel = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; | 33 | this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; |
37 | this._tabPanelControllerConfiguration = { | 34 | this._tabPanelControllerConfiguration = { |
38 | 'OFFLINE_COPY': { | 35 | 'OFFLINE_COPY': { |
39 | tab:'offlineCopyTab', | 36 | tab:'offlineCopyTab', |
40 | panel:'offlineCopyPanel' | 37 | panel:'offlineCopyPanel' |
41 | }, | 38 | }, |
42 | 'SHARING': { | 39 | 'SHARING': { |
43 | tab:'sharingTab', | 40 | tab:'sharingTab', |
44 | panel:'sharingPanel' | 41 | panel:'sharingPanel' |
45 | }, | 42 | }, |
46 | 'IMPORT': { | 43 | 'IMPORT': { |
47 | tab:'importTab', | 44 | tab:'importTab', |
48 | panel:'importPanel' | 45 | panel:'importPanel' |
49 | }, | 46 | }, |
50 | 'EXPORT': { | 47 | 'EXPORT': { |
51 | tab:'exportTab', | 48 | tab:'exportTab', |
52 | panel:'exportPanel' | 49 | panel:'exportPanel' |
53 | } | 50 | } |
54 | }; | 51 | }; |
55 | 52 | ||
56 | return this; | 53 | return this; |
57 | } | 54 | } |
58 | 55 | ||
59 | //============================================================================= | 56 | //============================================================================= |
60 | 57 | ||
61 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 58 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'toString': function () { | 62 | 'toString': function () { |
66 | return "Clipperz.PM.UI.Web.Components.DataPanel component"; | 63 | return "Clipperz.PM.UI.Web.Components.DataPanel component"; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'renderSelf': function(/*aContainer, aPosition*/) { | 68 | 'renderSelf': function(/*aContainer, aPosition*/) { |
72 | this.append(this.element(), [ | 69 | this.append(this.element(), [ |
73 | {tag:'div', cls:'header', children:[ | 70 | {tag:'div', cls:'header', children:[ |
74 | {tag:'div', cls:'subPanelTabs', children:[ | 71 | {tag:'div', cls:'subPanelTabs', children:[ |
75 | {tag:'ul', children:[ | 72 | {tag:'ul', children:[ |
76 | {tag:'li', id:this.getId('offlineCopyTab'),children:[{tag:'a', href:'#', html:'Offline copy'}], cls:'first'}, | 73 | {tag:'li', id:this.getId('offlineCopyTab'),children:[{tag:'a', href:'#', html:'Offline copy'}], cls:'first'}, |
77 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'a', href:'#', html:'Sharing'}]}, | 74 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'a', href:'#', html:'Sharing'}]}, |
78 | {tag:'li', id:this.getId('importTab'), children:[{tag:'a', href:'#', html:'Import'}]}, | 75 | {tag:'li', id:this.getId('importTab'), children:[{tag:'a', href:'#', html:'Import'}]}, |
79 | {tag:'li', id:this.getId('exportTab'), children:[{tag:'a', href:'#', html:'Export'}]} | 76 | {tag:'li', id:this.getId('exportTab'), children:[{tag:'a', href:'#', html:'Export'}]} |
80 | ]} | 77 | ]} |
81 | ]} | 78 | ]} |
82 | ]}, | 79 | ]}, |
83 | {tag:'div', cls:'body', children:[ | 80 | {tag:'div', cls:'body', children:[ |
84 | {tag:'div', cls:'accountPanel', children:[ | 81 | {tag:'div', cls:'accountPanel', children:[ |
85 | {tag:'div', cls:'subPanelContent', children:[ | 82 | {tag:'div', cls:'subPanelContent', children:[ |
86 | {tag:'ul', children:[ | 83 | {tag:'ul', children:[ |
87 | {tag:'li', id:this.getId('offlineCopyPanel'),children:[ | 84 | {tag:'li', id:this.getId('offlineCopyPanel'),children:[ |
88 | {tag:'h3', html:"Offline copy"} | 85 | {tag:'h3', html:"Offline copy"} |
89 | ]}, | 86 | ]}, |
90 | {tag:'li', id:this.getId('sharingPanel'),children:[ | 87 | {tag:'li', id:this.getId('sharingPanel'),children:[ |
91 | {tag:'h3', html:"Sharing"} | 88 | {tag:'h3', html:"Sharing"} |
92 | ]}, | 89 | ]}, |
93 | {tag:'li', id:this.getId('importPanel'), children:[ | 90 | {tag:'li', id:this.getId('importPanel'), children:[ |
94 | {tag:'h3', html:"Import"} | 91 | {tag:'h3', html:"Import"} |
95 | ]}, | 92 | ]}, |
96 | {tag:'li', id:this.getId('exportPanel'), children:[ | 93 | {tag:'li', id:this.getId('exportPanel'), children:[ |
97 | {tag:'h3', html:"Export"} | 94 | {tag:'h3', html:"Export"} |
98 | ]} | 95 | ]} |
99 | ]} | 96 | ]} |
100 | ]} | 97 | ]} |
101 | ]} | 98 | ]} |
102 | ]}, | 99 | ]}, |
103 | {tag:'div', cls:'footer'} | 100 | {tag:'div', cls:'footer'} |
104 | ]); | 101 | ]); |
105 | 102 | ||
106 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | 103 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | __syntaxFix__: "syntax fix" | 107 | __syntaxFix__: "syntax fix" |
111 | }); | 108 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js index 3f8aa88..ea55ba4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js | |||
@@ -1,72 +1,69 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
45 | 42 | ||
46 | 'toString': function () { | 43 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 44 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'format': function () { | 49 | 'format': function () { |
53 | return this._format; | 50 | return this._format; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | 54 | ||
58 | 'renderCell': function(aRowElement, anObject) { | 55 | 'renderCell': function(aRowElement, anObject) { |
59 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 56 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
60 | { | 57 | { |
61 | tag:'span', | 58 | tag:'span', |
62 | title:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], "D, d M Y H:i:s"), | 59 | title:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], "D, d M Y H:i:s"), |
63 | html:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], this.format()) | 60 | html:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], this.format()) |
64 | } | 61 | } |
65 | ]}); | 62 | ]}); |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //----------------------------------------------------- | 65 | //----------------------------------------------------- |
69 | 66 | ||
70 | '__syntax_fix__' : 'syntax fix' | 67 | '__syntax_fix__' : 'syntax fix' |
71 | }); | 68 | }); |
72 | 69 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js index ee60f2f..fe59494 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js | |||
@@ -1,70 +1,67 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'renderCell': function(aRowElement, anObject) { | 47 | 'renderCell': function(aRowElement, anObject) { |
51 | var tdElement; | 48 | var tdElement; |
52 | var linkElement; | 49 | var linkElement; |
53 | 50 | ||
54 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 51 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
55 | {tag:'div', cls:'delete', children:[ | 52 | {tag:'div', cls:'delete', children:[ |
56 | {tag:'span', children:[ | 53 | {tag:'span', children:[ |
57 | {tag:'a', href:'delete', html:"delete"} | 54 | {tag:'a', href:'delete', html:"delete"} |
58 | ]} | 55 | ]} |
59 | ]} | 56 | ]} |
60 | ]}); | 57 | ]}); |
61 | 58 | ||
62 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 59 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
63 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 60 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
64 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 61 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
65 | }, | 62 | }, |
66 | 63 | ||
67 | //----------------------------------------------------- | 64 | //----------------------------------------------------- |
68 | '__syntax_fix__' : 'syntax fix' | 65 | '__syntax_fix__' : 'syntax fix' |
69 | }); | 66 | }); |
70 | 67 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js index 4bf9020..a1f0f9f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js | |||
@@ -1,90 +1,87 @@ | |||
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 | /* | 26 | /* |
30 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 27 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
31 | 28 | ||
32 | //############################################################################# | 29 | //############################################################################# |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { | 31 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); | 33 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); |
37 | 34 | ||
38 | this._actionMethod = args.actionMethod || null; | 35 | this._actionMethod = args.actionMethod || null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 45 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'actionMethod': function () { | 50 | 'actionMethod': function () { |
54 | return this._actionMethod; | 51 | return this._actionMethod; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
58 | 55 | ||
59 | 'renderCell': function(aRowElement, anObject) { | 56 | 'renderCell': function(aRowElement, anObject) { |
60 | vartdElement; | 57 | vartdElement; |
61 | varlinkElement; | 58 | varlinkElement; |
62 | 59 | ||
63 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 60 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
64 | {tag:'div', cls:'directLogin_directLogin', children:[ | 61 | {tag:'div', cls:'directLogin_directLogin', children:[ |
65 | {tag:'div', cls:'directLogin_directLogin_body', children:[ | 62 | {tag:'div', cls:'directLogin_directLogin_body', children:[ |
66 | {tag:'a', href:'#', html:anObject[this.name()]} | 63 | {tag:'a', href:'#', html:anObject[this.name()]} |
67 | ]} | 64 | ]} |
68 | ]} | 65 | ]} |
69 | ]}); | 66 | ]}); |
70 | 67 | ||
71 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 68 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
72 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 69 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
73 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 70 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
74 | }, | 71 | }, |
75 | 72 | ||
76 | //----------------------------------------------------- | 73 | //----------------------------------------------------- |
77 | 74 | ||
78 | 'handleLinkClick': function (anObject, anEvent) { | 75 | 'handleLinkClick': function (anObject, anEvent) { |
79 | anEvent.preventDefault(); | 76 | anEvent.preventDefault(); |
80 | 77 | ||
81 | if (this.actionMethod() != null) { | 78 | if (this.actionMethod() != null) { |
82 | this.actionMethod()(anObject, anEvent); | 79 | this.actionMethod()(anObject, anEvent); |
83 | } | 80 | } |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //----------------------------------------------------- | 83 | //----------------------------------------------------- |
87 | '__syntax_fix__' : 'syntax fix' | 84 | '__syntax_fix__' : 'syntax fix' |
88 | }); | 85 | }); |
89 | 86 | ||
90 | */ \ No newline at end of file | 87 | */ \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js index 9a9c0b2..1a76b0c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js | |||
@@ -1,168 +1,165 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._initiallySelectedFieldKey = args.selectedFieldKey|| null; | 35 | this._initiallySelectedFieldKey = args.selectedFieldKey|| null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent component"; | 47 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'formFieldName': function () { | 52 | 'formFieldName': function () { |
56 | return this._formFieldName; | 53 | return this._formFieldName; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'fields': function () { | 58 | 'fields': function () { |
62 | return this._fields; | 59 | return this._fields; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'selectedValue': function () { | 64 | 'selectedValue': function () { |
68 | var result; | 65 | var result; |
69 | 66 | ||
70 | result = this.getElement('select').value; | 67 | result = this.getElement('select').value; |
71 | 68 | ||
72 | if (result == '---') { | 69 | if (result == '---') { |
73 | result = null; | 70 | result = null; |
74 | } | 71 | } |
75 | 72 | ||
76 | return result; | 73 | return result; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'initiallySelectedFieldKey': function () { | 76 | 'initiallySelectedFieldKey': function () { |
80 | return this._initiallySelectedFieldKey; | 77 | return this._initiallySelectedFieldKey; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //========================================================================= | 80 | //========================================================================= |
84 | 81 | ||
85 | 'renderSelf': function() { | 82 | 'renderSelf': function() { |
86 | var initiallySelectedOptions; | 83 | var initiallySelectedOptions; |
87 | 84 | ||
88 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'binding', children:[ | 85 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'binding', children:[ |
89 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | 86 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, |
90 | {tag:'span', cls:'fieldLock', id:this.getId('isHidden'), children:[ | 87 | {tag:'span', cls:'fieldLock', id:this.getId('isHidden'), children:[ |
91 | {tag:'a', href:'#', id:this.getId('showHide'), html:' '} | 88 | {tag:'a', href:'#', id:this.getId('showHide'), html:' '} |
92 | ]}, | 89 | ]}, |
93 | {tag:'input', id:this.getId('input'), cls:'formFieldExampleValue', disabled:true, value:''}, | 90 | {tag:'input', id:this.getId('input'), cls:'formFieldExampleValue', disabled:true, value:''}, |
94 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: | 91 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: |
95 | MochiKit.Base.flattenArguments( | 92 | MochiKit.Base.flattenArguments( |
96 | {tag:'option', value:'---', html:"---"}, | 93 | {tag:'option', value:'---', html:"---"}, |
97 | MochiKit.Base.map( | 94 | MochiKit.Base.map( |
98 | MochiKit.Base.bind(function (aField) { return {tag:'option', value:aField['reference'], html:aField['label']}; }, this), | 95 | MochiKit.Base.bind(function (aField) { return {tag:'option', value:aField['reference'], html:aField['label']}; }, this), |
99 | this.fields() | 96 | this.fields() |
100 | ) | 97 | ) |
101 | ) | 98 | ) |
102 | } | 99 | } |
103 | ]}); | 100 | ]}); |
104 | 101 | ||
105 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); | 102 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); |
106 | MochiKit.Signal.connect(this.getElement('showHide'), 'onclick', this, 'handleShowHide'); | 103 | MochiKit.Signal.connect(this.getElement('showHide'), 'onclick', this, 'handleShowHide'); |
107 | 104 | ||
108 | if (! MochiKit.Base.isUndefinedOrNull(this.initiallySelectedFieldKey())) { | 105 | if (! MochiKit.Base.isUndefinedOrNull(this.initiallySelectedFieldKey())) { |
109 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initiallySelectedFieldKey() + ']']); | 106 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initiallySelectedFieldKey() + ']']); |
110 | if (initiallySelectedOptions.length == 1) { | 107 | if (initiallySelectedOptions.length == 1) { |
111 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); | 108 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); |
112 | this.handleSelectChange(); | 109 | this.handleSelectChange(); |
113 | } | 110 | } |
114 | } | 111 | } |
115 | }, | 112 | }, |
116 | 113 | ||
117 | //------------------------------------------------------------------------- | 114 | //------------------------------------------------------------------------- |
118 | 115 | ||
119 | 'setFieldValue': function (aValue) { | 116 | 'setFieldValue': function (aValue) { |
120 | this.getElement('input').value = aValue; | 117 | this.getElement('input').value = aValue; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | 'isHidden': function () { | 120 | 'isHidden': function () { |
124 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'locked'); | 121 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'locked'); |
125 | }, | 122 | }, |
126 | 123 | ||
127 | 'setIsHidden': function (aValue) { | 124 | 'setIsHidden': function (aValue) { |
128 | if (aValue == true) { | 125 | if (aValue == true) { |
129 | MochiKit.DOM.addElementClass(this.getElement('div'), 'locked'); | 126 | MochiKit.DOM.addElementClass(this.getElement('div'), 'locked'); |
130 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); | 127 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); |
131 | } else { | 128 | } else { |
132 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'locked'); | 129 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'locked'); |
133 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); | 130 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); |
134 | } | 131 | } |
135 | }, | 132 | }, |
136 | 133 | ||
137 | 'isShowLocked': function () { | 134 | 'isShowLocked': function () { |
138 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'showLocked'); | 135 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'showLocked'); |
139 | }, | 136 | }, |
140 | 137 | ||
141 | //------------------------------------------------------------------------- | 138 | //------------------------------------------------------------------------- |
142 | 139 | ||
143 | 'handleSelectChange': function (anEvent) { | 140 | 'handleSelectChange': function (anEvent) { |
144 | // this.getElement('input').value = this.valueOfField(anEvent.src().value); | 141 | // this.getElement('input').value = this.valueOfField(anEvent.src().value); |
145 | MochiKit.Signal.signal(this, 'bindChange', this); | 142 | MochiKit.Signal.signal(this, 'bindChange', this); |
146 | }, | 143 | }, |
147 | 144 | ||
148 | 'handleShowHide': function (anEvent) { | 145 | 'handleShowHide': function (anEvent) { |
149 | anEvent.preventDefault(); | 146 | anEvent.preventDefault(); |
150 | 147 | ||
151 | if (this.isShowLocked()) { | 148 | if (this.isShowLocked()) { |
152 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); | 149 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); |
153 | } else { | 150 | } else { |
154 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); | 151 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); |
155 | } | 152 | } |
156 | }, | 153 | }, |
157 | 154 | ||
158 | //========================================================================= | 155 | //========================================================================= |
159 | __syntaxFix__: "syntax fix" | 156 | __syntaxFix__: "syntax fix" |
160 | }); | 157 | }); |
161 | 158 | ||
162 | 159 | ||
163 | 160 | ||
164 | 161 | ||
165 | 162 | ||
166 | 163 | ||
167 | 164 | ||
168 | 165 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js index d254c29..5114b1d 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._tabPanelController = null; | 33 | this._tabPanelController = null; |
37 | 34 | ||
38 | this._initiallySelectedTab = args.selected || 'TYPE'; | 35 | this._initiallySelectedTab = args.selected || 'TYPE'; |
39 | this._tabPanelControllerConfiguration = { | 36 | this._tabPanelControllerConfiguration = { |
40 | 'LABEL': { | 37 | 'LABEL': { |
41 | tab:'labelTab', | 38 | tab:'labelTab', |
42 | panel:'labelTabpanel' | 39 | panel:'labelTabpanel' |
43 | }, | 40 | }, |
44 | 'TYPE': { | 41 | 'TYPE': { |
45 | tab:'typeTab', | 42 | tab:'typeTab', |
46 | panel:'typeTabpanel' | 43 | panel:'typeTabpanel' |
47 | }, | 44 | }, |
48 | 'CONFIGURATION': { | 45 | 'CONFIGURATION': { |
49 | tab:'configurationTab', | 46 | tab:'configurationTab', |
50 | panel:'configurationTabpanel' | 47 | panel:'configurationTabpanel' |
51 | }, | 48 | }, |
52 | 'BINDINGS': { | 49 | 'BINDINGS': { |
53 | tab:'bindingsTab', | 50 | tab:'bindingsTab', |
54 | panel:'bindingsTabpanel' | 51 | panel:'bindingsTabpanel' |
55 | }, | 52 | }, |
56 | 'FAVICON': { | 53 | 'FAVICON': { |
57 | tab:'faviconTab', | 54 | tab:'faviconTab', |
58 | panel:'faviconTabpanel' | 55 | panel:'faviconTabpanel' |
59 | }, | 56 | }, |
60 | 'DONE': { | 57 | 'DONE': { |
61 | tab:'doneTab', | 58 | tab:'doneTab', |
62 | panel:'doneTabpanel' | 59 | panel:'doneTabpanel' |
63 | } | 60 | } |
64 | }; | 61 | }; |
65 | 62 | ||
66 | this._directLoginReference = null; | 63 | this._directLoginReference = null; |
67 | 64 | ||
68 | this._directLoginFavicon = null; | 65 | this._directLoginFavicon = null; |
69 | 66 | ||
70 | this._updateFaviconCounter = 0; | 67 | this._updateFaviconCounter = 0; |
71 | this._faviconComponent = null; | 68 | this._faviconComponent = null; |
72 | 69 | ||
73 | this._bindingComponents= []; | 70 | this._bindingComponents= []; |
74 | this._formValueComponents = []; | 71 | this._formValueComponents = []; |
75 | 72 | ||
76 | return this; | 73 | return this; |
77 | } | 74 | } |
78 | 75 | ||
79 | //============================================================================= | 76 | //============================================================================= |
80 | 77 | ||
81 | //Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 78 | //Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
82 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 79 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
83 | 80 | ||
84 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
85 | 82 | ||
86 | 'toString': function () { | 83 | 'toString': function () { |
87 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; | 84 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //========================================================================= | 87 | //========================================================================= |
91 | 88 | ||
92 | 'directLoginReference': function () { | 89 | 'directLoginReference': function () { |
93 | return this._directLoginReference; | 90 | return this._directLoginReference; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //------------------------------------------------------------------------- | 93 | //------------------------------------------------------------------------- |
97 | 94 | ||
98 | 'setDirectLoginReference': function (aDirectLoginReference) { | 95 | 'setDirectLoginReference': function (aDirectLoginReference) { |
99 | this._directLoginReference = aDirectLoginReference; | 96 | this._directLoginReference = aDirectLoginReference; |
100 | 97 | ||
101 | return this._directLoginReference; | 98 | return this._directLoginReference; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //========================================================================= | 101 | //========================================================================= |
105 | 102 | ||
106 | 'label': function () { | 103 | 'label': function () { |
107 | return this.getElement('label').value | 104 | return this.getElement('label').value |
108 | }, | 105 | }, |
109 | 106 | ||
110 | 'setLabel': function (aValue) { | 107 | 'setLabel': function (aValue) { |
111 | //console.log("##> LABEL: " + aValue); | 108 | //console.log("##> LABEL: " + aValue); |
112 | this.getElement('label').value = (aValue ? aValue : ''); | 109 | this.getElement('label').value = (aValue ? aValue : ''); |
113 | }, | 110 | }, |
114 | 111 | ||
115 | //------------------------------------------------------------------------- | 112 | //------------------------------------------------------------------------- |
116 | 113 | ||
117 | 'favicon': function () { | 114 | 'favicon': function () { |
118 | return this.getElement('faviconURL').value; | 115 | return this.getElement('faviconURL').value; |
119 | }, | 116 | }, |
120 | 117 | ||
121 | 'setFavicon': function (aValue) { | 118 | 'setFavicon': function (aValue) { |
122 | var regexp; | 119 | var regexp; |
123 | var displayValue; | 120 | var displayValue; |
124 | 121 | ||
125 | regexp = new RegExp('^data\:\/\/.*', 'i'); | 122 | regexp = new RegExp('^data\:\/\/.*', 'i'); |
126 | if (regexp.test(aValue)) { | 123 | if (regexp.test(aValue)) { |
127 | displayValue = '' | 124 | displayValue = '' |
128 | } else { | 125 | } else { |
129 | displayValue = (aValue ? aValue : ''); | 126 | displayValue = (aValue ? aValue : ''); |
130 | } | 127 | } |
131 | 128 | ||
132 | this.getElement('faviconURL').value = displayValue; | 129 | this.getElement('faviconURL').value = displayValue; |
133 | this.faviconComponent().setSrc(aValue); | 130 | this.faviconComponent().setSrc(aValue); |
134 | }, | 131 | }, |
135 | 132 | ||
136 | //'setFaviconData': function (aValue) { | 133 | //'setFaviconData': function (aValue) { |
137 | // this.getElement('faviconIcon').src = aValue; | 134 | // this.getElement('faviconIcon').src = aValue; |
138 | //}, | 135 | //}, |
139 | 136 | ||
140 | 'directLoginFavicon': function () { | 137 | 'directLoginFavicon': function () { |
141 | return this._directLoginFavicon; | 138 | return this._directLoginFavicon; |
142 | }, | 139 | }, |
143 | 140 | ||
144 | 'setDirectLoginFavicon': function (aValue) { | 141 | 'setDirectLoginFavicon': function (aValue) { |
145 | this._directLoginFavicon = aValue; | 142 | this._directLoginFavicon = aValue; |
146 | this.setFavicon(aValue); | 143 | this.setFavicon(aValue); |
147 | }, | 144 | }, |
148 | 145 | ||
149 | //------------------------------------------------------------------------- | 146 | //------------------------------------------------------------------------- |
150 | 147 | ||
151 | 'bookmarkletConfiguration': function () { | 148 | 'bookmarkletConfiguration': function () { |
152 | return this.getElement('bookmarkletConfiguration').value | 149 | return this.getElement('bookmarkletConfiguration').value |
153 | }, | 150 | }, |
154 | 151 | ||
155 | 'setBookmarkletConfiguration': function (aValue) { | 152 | 'setBookmarkletConfiguration': function (aValue) { |
156 | this.getElement('bookmarkletConfiguration').value = aValue; | 153 | this.getElement('bookmarkletConfiguration').value = aValue; |
157 | }, | 154 | }, |
158 | 155 | ||
159 | 'highlightConfigurationSyntaxError': function () { | 156 | 'highlightConfigurationSyntaxError': function () { |
160 | MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | 157 | MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error'); |
161 | }, | 158 | }, |
162 | 159 | ||
163 | 'removeHighlightConfigurationSyntaxError': function () { | 160 | 'removeHighlightConfigurationSyntaxError': function () { |
164 | MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | 161 | MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error'); |
165 | }, | 162 | }, |
166 | 163 | ||
167 | //========================================================================= | 164 | //========================================================================= |
168 | 165 | ||
169 | 'disableAllPanels': function () { | 166 | 'disableAllPanels': function () { |
170 | this.getElement('label').disabled = true; | 167 | this.getElement('label').disabled = true; |
171 | MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); | 168 | MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); |
172 | 169 | ||
173 | this.tabPanelController().selectTab(null); | 170 | this.tabPanelController().selectTab(null); |
174 | }, | 171 | }, |
175 | 172 | ||
176 | //------------------------------------------------------------------------- | 173 | //------------------------------------------------------------------------- |
177 | 174 | ||
178 | //'disableLabelField': function () { | 175 | //'disableLabelField': function () { |
179 | // this.getElement('label').disabled = true; | 176 | // this.getElement('label').disabled = true; |
180 | // MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); | 177 | // MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); |
181 | //}, | 178 | //}, |
182 | 179 | ||
183 | 'enableLabelField': function () { | 180 | 'enableLabelField': function () { |
184 | this.getElement('label').disabled = false; | 181 | this.getElement('label').disabled = false; |
185 | MochiKit.DOM.removeElementClass(this.getElement('label').parentNode, 'disabled'); | 182 | MochiKit.DOM.removeElementClass(this.getElement('label').parentNode, 'disabled'); |
186 | this.tabPanelController().selectTab('LABEL'); | 183 | this.tabPanelController().selectTab('LABEL'); |
187 | }, | 184 | }, |
188 | 185 | ||
189 | //------------------------------------------------------------------------- | 186 | //------------------------------------------------------------------------- |
190 | 187 | ||
191 | //'disableTypeField': function () { | 188 | //'disableTypeField': function () { |
192 | // this.tabPanelController().selectTab(null); | 189 | // this.tabPanelController().selectTab(null); |
193 | //}, | 190 | //}, |
194 | 191 | ||
195 | 'enableTypeField': function () { | 192 | 'enableTypeField': function () { |
196 | this.tabPanelController().selectTab('TYPE'); | 193 | this.tabPanelController().selectTab('TYPE'); |
197 | }, | 194 | }, |
198 | 195 | ||
199 | //------------------------------------------------------------------------- | 196 | //------------------------------------------------------------------------- |
200 | 197 | ||
201 | //'disableConfigurationField': function () { | 198 | //'disableConfigurationField': function () { |
202 | // this.tabPanelController().selectTab(null); | 199 | // this.tabPanelController().selectTab(null); |
203 | //}, | 200 | //}, |
204 | 201 | ||
205 | 'enableConfigurationField': function () { | 202 | 'enableConfigurationField': function () { |
206 | this.tabPanelController().selectTab('CONFIGURATION'); | 203 | this.tabPanelController().selectTab('CONFIGURATION'); |
207 | }, | 204 | }, |
208 | 205 | ||
209 | //------------------------------------------------------------------------- | 206 | //------------------------------------------------------------------------- |
210 | 207 | ||
211 | //'disableBindingFields': function () { | 208 | //'disableBindingFields': function () { |
212 | // this.tabPanelController().selectTab(null); | 209 | // this.tabPanelController().selectTab(null); |
213 | //}, | 210 | //}, |
214 | 211 | ||
215 | 'enableBindingFields': function () { | 212 | 'enableBindingFields': function () { |
216 | this.tabPanelController().selectTab('BINDINGS'); | 213 | this.tabPanelController().selectTab('BINDINGS'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js index b91eb98..fa57233 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js | |||
@@ -1,179 +1,176 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | this._initialValue = args.initialValue || null; | 35 | this._initialValue = args.initialValue || null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent component"; | 47 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'formFieldName': function () { | 52 | 'formFieldName': function () { |
56 | return this._formFieldName; | 53 | return this._formFieldName; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'fieldOptions': function () { | 58 | 'fieldOptions': function () { |
62 | return this._fieldOptions; | 59 | return this._fieldOptions; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | 'fieldType': function () { | 62 | 'fieldType': function () { |
66 | return this.fieldOptions()['type']; | 63 | return this.fieldOptions()['type']; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | 'optionValues': function () { | 66 | 'optionValues': function () { |
70 | return MochiKit.Base.map(function (anOptionValue) { | 67 | return MochiKit.Base.map(function (anOptionValue) { |
71 | return { | 68 | return { |
72 | 'label': anOptionValue['label'] || anOptionValue['value'], | 69 | 'label': anOptionValue['label'] || anOptionValue['value'], |
73 | 'value': anOptionValue['value'] | 70 | 'value': anOptionValue['value'] |
74 | } | 71 | } |
75 | }, this.fieldOptions()['options']); | 72 | }, this.fieldOptions()['options']); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'selectedValue': function () { | 77 | 'selectedValue': function () { |
81 | var result; | 78 | var result; |
82 | 79 | ||
83 | result = this.getElement('select').value; | 80 | result = this.getElement('select').value; |
84 | 81 | ||
85 | if (result == '---') { | 82 | if (result == '---') { |
86 | result = null; | 83 | result = null; |
87 | } | 84 | } |
88 | 85 | ||
89 | return result; | 86 | return result; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | 'initialValue': function () { | 89 | 'initialValue': function () { |
93 | return this._initialValue; | 90 | return this._initialValue; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | //========================================================================= | 93 | //========================================================================= |
97 | 94 | ||
98 | 'renderSelf': function() { | 95 | 'renderSelf': function() { |
99 | //console.log(">>> DirectLoginEditingFormValueComponent.renderSelf"); | 96 | //console.log(">>> DirectLoginEditingFormValueComponent.renderSelf"); |
100 | //console.log("FIELD OPTIONS", this.fieldOptions()); | 97 | //console.log("FIELD OPTIONS", this.fieldOptions()); |
101 | //console.log("OPTION VALUES", this.optionValues()); | 98 | //console.log("OPTION VALUES", this.optionValues()); |
102 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ | 99 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ |
103 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | 100 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, |
104 | {tag:'div', id:this.getId('values')} | 101 | {tag:'div', id:this.getId('values')} |
105 | ]}); | 102 | ]}); |
106 | 103 | ||
107 | if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { | 104 | if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { |
108 | this.append(this.getElement('values'), | 105 | this.append(this.getElement('values'), |
109 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: | 106 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: |
110 | MochiKit.Base.flattenArguments( | 107 | MochiKit.Base.flattenArguments( |
111 | // {tag:'option', value:'---', html:"---"}, | 108 | // {tag:'option', value:'---', html:"---"}, |
112 | MochiKit.Base.map( | 109 | MochiKit.Base.map( |
113 | MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), | 110 | MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), |
114 | this.optionValues() | 111 | this.optionValues() |
115 | ) | 112 | ) |
116 | ) | 113 | ) |
117 | } | 114 | } |
118 | ); | 115 | ); |
119 | 116 | ||
120 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); | 117 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); |
121 | 118 | ||
122 | if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { | 119 | if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { |
123 | var initiallySelectedOptions; | 120 | var initiallySelectedOptions; |
124 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); | 121 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); |
125 | if (initiallySelectedOptions.length == 1) { | 122 | if (initiallySelectedOptions.length == 1) { |
126 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); | 123 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); |
127 | this.handleSelectChange(); | 124 | this.handleSelectChange(); |
128 | } else { | 125 | } else { |
129 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | 126 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); |
130 | } | 127 | } |
131 | } else { | 128 | } else { |
132 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | 129 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); |
133 | } | 130 | } |
134 | } else if (this.fieldType() == 'checkbox') { | 131 | } else if (this.fieldType() == 'checkbox') { |
135 | this.append(this.getElement('values'), | 132 | this.append(this.getElement('values'), |
136 | {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} | 133 | {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} |
137 | ); | 134 | ); |
138 | 135 | ||
139 | MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); | 136 | MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); |
140 | 137 | ||
141 | if (this.initialValue()) { | 138 | if (this.initialValue()) { |
142 | MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); | 139 | MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); |
143 | } | 140 | } |
144 | } else { | 141 | } else { |
145 | WTF = TODO; | 142 | WTF = TODO; |
146 | } | 143 | } |
147 | //console.log("<<< DirectLoginEditingFormValueComponent.renderSelf"); | 144 | //console.log("<<< DirectLoginEditingFormValueComponent.renderSelf"); |
148 | }, | 145 | }, |
149 | 146 | ||
150 | //========================================================================= | 147 | //========================================================================= |
151 | 148 | ||
152 | 'handleSelectChange': function (anEvent) { | 149 | 'handleSelectChange': function (anEvent) { |
153 | //console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value); | 150 | //console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value); |
154 | var options; | 151 | var options; |
155 | 152 | ||
156 | options = {}; | 153 | options = {}; |
157 | 154 | ||
158 | options['fieldName'] = this.formFieldName(); | 155 | options['fieldName'] = this.formFieldName(); |
159 | 156 | ||
160 | if (this.fieldType() == 'checkbox') { | 157 | if (this.fieldType() == 'checkbox') { |
161 | options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); | 158 | options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); |
162 | } else { | 159 | } else { |
163 | options['selectedValue'] = this.selectedValue(); | 160 | options['selectedValue'] = this.selectedValue(); |
164 | } | 161 | } |
165 | 162 | ||
166 | MochiKit.Signal.signal(this, 'formValueChange', options); | 163 | MochiKit.Signal.signal(this, 'formValueChange', options); |
167 | }, | 164 | }, |
168 | 165 | ||
169 | //========================================================================= | 166 | //========================================================================= |
170 | __syntaxFix__: "syntax fix" | 167 | __syntaxFix__: "syntax fix" |
171 | }); | 168 | }); |
172 | 169 | ||
173 | 170 | ||
174 | 171 | ||
175 | 172 | ||
176 | 173 | ||
177 | 174 | ||
178 | 175 | ||
179 | 176 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js index 1f49575..d8dc941 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._enterLeaveCounter = 0; | 34 | this._enterLeaveCounter = 0; |
38 | this._selectedRowObject = null; | 35 | this._selectedRowObject = null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; | 45 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'renderHeader': function(aTRElement) { | 50 | 'renderHeader': function(aTRElement) { |
54 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); | 51 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); |
55 | 52 | ||
56 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ | 53 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ |
57 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ | 54 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ |
58 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ | 55 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ |
59 | // {tag:'li', children:[ | 56 | // {tag:'li', children:[ |
60 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, | 57 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, |
61 | // {tag:'a', href:'#', html:"Google Mail"} | 58 | // {tag:'a', href:'#', html:"Google Mail"} |
62 | // ]}, | 59 | // ]}, |
63 | // ... | 60 | // ... |
64 | ]} | 61 | ]} |
65 | ]}, | 62 | ]}, |
66 | {tag:'div', cls:'DirectLoginListPopup_footer'} | 63 | {tag:'div', cls:'DirectLoginListPopup_footer'} |
67 | ]}); | 64 | ]}); |
68 | 65 | ||
69 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); | 66 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); |
70 | 67 | ||
71 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh | 68 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh |
72 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); | 69 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); |
73 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); | 70 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); |
74 | }, | 71 | }, |
75 | 72 | ||
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | 74 | ||
78 | 'renderCell': function(aRowElement, anObject) { | 75 | 'renderCell': function(aRowElement, anObject) { |
79 | var i,c; | 76 | var i,c; |
80 | var directLoginsInfo; | 77 | var directLoginsInfo; |
81 | 78 | ||
82 | directLoginsInfo = anObject[this.name()]; | 79 | directLoginsInfo = anObject[this.name()]; |
83 | 80 | ||
84 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); | 81 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); |
85 | 82 | ||
86 | c = Math.min(2, directLoginsInfo.length); | 83 | c = Math.min(2, directLoginsInfo.length); |
87 | for (i=0; i<c; i++) { | 84 | for (i=0; i<c; i++) { |
88 | var elementID; | 85 | var elementID; |
89 | 86 | ||
90 | elementID = 'directLogin_' + directLoginsInfo[i]['_reference']; | 87 | elementID = 'directLogin_' + directLoginsInfo[i]['_reference']; |
91 | 88 | ||
92 | Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin', children:[ | 89 | Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin', children:[ |
93 | {tag:'div', cls:'card_directLogin_body', children:[ | 90 | {tag:'div', cls:'card_directLogin_body', children:[ |
94 | {tag:'a', href:'#', id:elementID, html:directLoginsInfo[i]['label']} | 91 | {tag:'a', href:'#', id:elementID, html:directLoginsInfo[i]['label']} |
95 | ]} | 92 | ]} |
96 | ]}); | 93 | ]}); |
97 | // MochiKit.Signal.connect(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | 94 | // MochiKit.Signal.connect(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); |
98 | this.connectEvent(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | 95 | this.connectEvent(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); |
99 | } | 96 | } |
100 | 97 | ||
101 | if (directLoginsInfo.length > 2) { | 98 | if (directLoginsInfo.length > 2) { |
102 | var ellipsesElement; | 99 | var ellipsesElement; |
103 | 100 | ||
104 | ellipsesElement = Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin_ellipses', children:[ | 101 | ellipsesElement = Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin_ellipses', children:[ |
105 | {tag:'div', cls:'card_directLogin_ellipses_body', children:[ | 102 | {tag:'div', cls:'card_directLogin_ellipses_body', children:[ |
106 | {tag:'span', html:'…'} | 103 | {tag:'span', html:'…'} |
107 | ]} | 104 | ]} |
108 | ]}); | 105 | ]}); |
109 | 106 | ||
110 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseenter', MochiKit.Base.method(this, 'handleEllipsesEnter', anObject)); | 107 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseenter', MochiKit.Base.method(this, 'handleEllipsesEnter', anObject)); |
111 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseleave', MochiKit.Base.method(this, 'handleEllipsesLeave')); | 108 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseleave', MochiKit.Base.method(this, 'handleEllipsesLeave')); |
112 | // MochiKit.Signal.connect(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | 109 | // MochiKit.Signal.connect(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); |
113 | this.connectEvent(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | 110 | this.connectEvent(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); |
114 | } | 111 | } |
115 | // MochiKit.Signal.connect(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | 112 | // MochiKit.Signal.connect(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); |
116 | this.connectEvent(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | 113 | this.connectEvent(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); |
117 | 114 | ||
118 | }, | 115 | }, |
119 | 116 | ||
120 | //========================================================================= | 117 | //========================================================================= |
121 | /* | 118 | /* |
122 | 'handleEllipsesEnter': function (aRecordInfo, anEvent) { | 119 | 'handleEllipsesEnter': function (aRecordInfo, anEvent) { |
123 | this._enterLeaveCounter ++; | 120 | this._enterLeaveCounter ++; |
124 | if (this._enterLeaveCounter > 2) { | 121 | if (this._enterLeaveCounter > 2) { |
125 | this._enterLeaveCounter = 2; | 122 | this._enterLeaveCounter = 2; |
126 | } | 123 | } |
127 | 124 | ||
128 | if (this._enterLeaveCounter == 1) { | 125 | if (this._enterLeaveCounter == 1) { |
129 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); | 126 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); |
130 | } | 127 | } |
131 | }, | 128 | }, |
132 | 129 | ||
133 | 'handleEllipsesLeave': function (anEvent) { | 130 | 'handleEllipsesLeave': function (anEvent) { |
134 | this._enterLeaveCounter --; | 131 | this._enterLeaveCounter --; |
135 | 132 | ||
136 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | 133 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { |
137 | if (this._enterLeaveCounter == 0) { | 134 | if (this._enterLeaveCounter == 0) { |
138 | this.hideDirectLoginListPopup(); | 135 | this.hideDirectLoginListPopup(); |
139 | } | 136 | } |
140 | }, this)) | 137 | }, this)) |
141 | }, | 138 | }, |
142 | */ | 139 | */ |
143 | //------------------------------------------------------------------------- | 140 | //------------------------------------------------------------------------- |
144 | 141 | ||
145 | 'handleTDEnter': function (aRecordInfo, anEvent) { | 142 | 'handleTDEnter': function (aRecordInfo, anEvent) { |
146 | if (MochiKit.Selector.findChildElements(anEvent.src(), ['div.card_directLogin_ellipses']).length > 0) { | 143 | if (MochiKit.Selector.findChildElements(anEvent.src(), ['div.card_directLogin_ellipses']).length > 0) { |
147 | this._enterLeaveCounter ++; | 144 | this._enterLeaveCounter ++; |
148 | if (this._enterLeaveCounter > 2) { | 145 | if (this._enterLeaveCounter > 2) { |
149 | this._enterLeaveCounter = 2; | 146 | this._enterLeaveCounter = 2; |
150 | } | 147 | } |
151 | 148 | ||
152 | if (this._enterLeaveCounter == 1) { | 149 | if (this._enterLeaveCounter == 1) { |
153 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); | 150 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); |
154 | } | 151 | } |
155 | } else { | 152 | } else { |
156 | if (this._selectedRowObject != null) { | 153 | if (this._selectedRowObject != null) { |
157 | this.hideDirectLoginListPopup(); | 154 | this.hideDirectLoginListPopup(); |
158 | } | 155 | } |
159 | } | 156 | } |
160 | }, | 157 | }, |
161 | 158 | ||
162 | 'handleTDLeave': function (anEvent) { | 159 | 'handleTDLeave': function (anEvent) { |
163 | this._enterLeaveCounter --; | 160 | this._enterLeaveCounter --; |
164 | if (this._enterLeaveCounter < 0) { | 161 | if (this._enterLeaveCounter < 0) { |
165 | this._enterLeaveCounter = 0; | 162 | this._enterLeaveCounter = 0; |
166 | } | 163 | } |
167 | 164 | ||
168 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | 165 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { |
169 | if (this._enterLeaveCounter == 0) { | 166 | if (this._enterLeaveCounter == 0) { |
170 | this.hideDirectLoginListPopup(); | 167 | this.hideDirectLoginListPopup(); |
171 | } | 168 | } |
172 | }, this)) | 169 | }, this)) |
173 | }, | 170 | }, |
174 | 171 | ||
175 | //------------------------------------------------------------------------- | 172 | //------------------------------------------------------------------------- |
176 | 173 | ||
177 | 'handleDirectLoginListPopupEnter': function (anEvent) { | 174 | 'handleDirectLoginListPopupEnter': function (anEvent) { |
178 | this._enterLeaveCounter ++; | 175 | this._enterLeaveCounter ++; |
179 | if (this._enterLeaveCounter > 2) { | 176 | if (this._enterLeaveCounter > 2) { |
180 | this._enterLeaveCounter = 2; | 177 | this._enterLeaveCounter = 2; |
181 | } | 178 | } |
182 | }, | 179 | }, |
183 | 180 | ||
184 | 'handleDirectLoginListPopupLeave': function (anEvent) { | 181 | 'handleDirectLoginListPopupLeave': function (anEvent) { |
185 | this._enterLeaveCounter --; | 182 | this._enterLeaveCounter --; |
186 | if (this._enterLeaveCounter < 0) { | 183 | if (this._enterLeaveCounter < 0) { |
187 | this._enterLeaveCounter = 0; | 184 | this._enterLeaveCounter = 0; |
188 | } | 185 | } |
189 | 186 | ||
190 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | 187 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { |
191 | if (this._enterLeaveCounter == 0) { | 188 | if (this._enterLeaveCounter == 0) { |
192 | this.hideDirectLoginListPopup(); | 189 | this.hideDirectLoginListPopup(); |
193 | } | 190 | } |
194 | }, this)) | 191 | }, this)) |
195 | }, | 192 | }, |
196 | 193 | ||
197 | //========================================================================= | 194 | //========================================================================= |
198 | 195 | ||
199 | 'showDirectLoginListPopup': function (aRecordInfo, anElement) { | 196 | 'showDirectLoginListPopup': function (aRecordInfo, anElement) { |
200 | var position; | 197 | var position; |
201 | var directLoginsInfo; | 198 | var directLoginsInfo; |
202 | var directLoginsListElement; | 199 | var directLoginsListElement; |
203 | var ellipsesElement; | 200 | var ellipsesElement; |
204 | 201 | ||
205 | 202 | ||
206 | ellipsesElement = MochiKit.Selector.findChildElements(anElement, ['div.card_directLogin_ellipses'])[0]; | 203 | ellipsesElement = MochiKit.Selector.findChildElements(anElement, ['div.card_directLogin_ellipses'])[0]; |
207 | position = MochiKit.Style.getElementPosition(ellipsesElement); | 204 | position = MochiKit.Style.getElementPosition(ellipsesElement); |
208 | // position = MochiKit.Style.getElementPosition(anElement); | 205 | // position = MochiKit.Style.getElementPosition(anElement); |
209 | position.x += 14; | 206 | position.x += 14; |
210 | position.y -= 26; | 207 | position.y -= 26; |
211 | 208 | ||
212 | MochiKit.Style.setElementPosition(this.getId('DirectLoginListPopup'), position /*[, units='px'] */); | 209 | MochiKit.Style.setElementPosition(this.getId('DirectLoginListPopup'), position /*[, units='px'] */); |
213 | 210 | ||
214 | directLoginsListElement = this.getElement('DirectLoginListPopup_list'); | 211 | directLoginsListElement = this.getElement('DirectLoginListPopup_list'); |
215 | directLoginsListElement.innerHTML = ''; | 212 | directLoginsListElement.innerHTML = ''; |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js index 19d1635..6297002 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js | |||
@@ -1,89 +1,86 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'renderCell': function(aRowElement, anObject) { | 47 | 'renderCell': function(aRowElement, anObject) { |
51 | varfaviconImageElement; | 48 | varfaviconImageElement; |
52 | var faviconUrl; | 49 | var faviconUrl; |
53 | 50 | ||
54 | faviconImageElement = this.getId('favicon'); | 51 | faviconImageElement = this.getId('favicon'); |
55 | faviconUrl = anObject[this.name()]; | 52 | faviconUrl = anObject[this.name()]; |
56 | 53 | ||
57 | if (faviconUrl == null) { | 54 | if (faviconUrl == null) { |
58 | faviconUrl = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 55 | faviconUrl = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
59 | } | 56 | } |
60 | 57 | ||
61 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 58 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
62 | {tag:'img', id:faviconImageElement, src:faviconUrl} | 59 | {tag:'img', id:faviconImageElement, src:faviconUrl} |
63 | ]}); | 60 | ]}); |
64 | 61 | ||
65 | MochiKit.Signal.connect(faviconImageElement, 'onload', this, 'handleLoadedFaviconImage'); | 62 | MochiKit.Signal.connect(faviconImageElement, 'onload', this, 'handleLoadedFaviconImage'); |
66 | MochiKit.Signal.connect(faviconImageElement, 'onerror', this, 'handleMissingFaviconImage'); | 63 | MochiKit.Signal.connect(faviconImageElement, 'onerror', this, 'handleMissingFaviconImage'); |
67 | MochiKit.Signal.connect(faviconImageElement, 'onabort', this, 'handleMissingFaviconImage'); | 64 | MochiKit.Signal.connect(faviconImageElement, 'onabort', this, 'handleMissingFaviconImage'); |
68 | }, | 65 | }, |
69 | 66 | ||
70 | //----------------------------------------------------- | 67 | //----------------------------------------------------- |
71 | 68 | ||
72 | 'handleLoadedFaviconImage': function(anEvent) { | 69 | 'handleLoadedFaviconImage': function(anEvent) { |
73 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | 70 | MochiKit.Signal.disconnectAllTo(anEvent.src()); |
74 | if (anEvent.src().complete == false) { | 71 | if (anEvent.src().complete == false) { |
75 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 72 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
76 | } | 73 | } |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //----------------------------------------------------- | 76 | //----------------------------------------------------- |
80 | 77 | ||
81 | 'handleMissingFaviconImage': function(anEvent) { | 78 | 'handleMissingFaviconImage': function(anEvent) { |
82 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | 79 | MochiKit.Signal.disconnectAllTo(anEvent.src()); |
83 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 80 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
84 | }, | 81 | }, |
85 | 82 | ||
86 | //----------------------------------------------------- | 83 | //----------------------------------------------------- |
87 | '__syntax_fix__' : 'syntax fix' | 84 | '__syntax_fix__' : 'syntax fix' |
88 | }); | 85 | }); |
89 | 86 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js index 8b3e6c9..51d55f4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._columnsManagers = args.columnsManagers; | 33 | this._columnsManagers = args.columnsManagers; |
37 | 34 | ||
38 | this._rowsObjects = []; | 35 | this._rowsObjects = []; |
39 | this._noRowsGridComponent = null; | 36 | this._noRowsGridComponent = null; |
40 | 37 | ||
41 | this._slots = { | 38 | this._slots = { |
42 | 'headerSlot':this.getId('headerSlot') | 39 | 'headerSlot':this.getId('headerSlot') |
43 | }; | 40 | }; |
44 | 41 | ||
45 | return this; | 42 | return this; |
46 | } | 43 | } |
47 | 44 | ||
48 | //============================================================================= | 45 | //============================================================================= |
49 | 46 | ||
50 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'toString': function () { | 51 | 'toString': function () { |
55 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; | 52 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
59 | 56 | ||
60 | 'rows': function () { | 57 | 'rows': function () { |
61 | throw Clipperz.Base.exception.AbstractMethod; | 58 | throw Clipperz.Base.exception.AbstractMethod; |
62 | // return this._rows; | 59 | // return this._rows; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'columnsManagers': function () { | 64 | 'columnsManagers': function () { |
68 | return this._columnsManagers; | 65 | return this._columnsManagers; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'renderSelf': function(/*aContainer, aPosition*/) { | 70 | 'renderSelf': function(/*aContainer, aPosition*/) { |
74 | this.append(this.element(), [ | 71 | this.append(this.element(), [ |
75 | {tag:'div', cls:'header', children:[ | 72 | {tag:'div', cls:'header', children:[ |
76 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ | 73 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ |
77 | {tag:'div', cls:'search', children:[ | 74 | {tag:'div', cls:'search', children:[ |
78 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} | 75 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} |
79 | ]}, | 76 | ]}, |
80 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, | 77 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, |
81 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, | 78 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, |
82 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} | 79 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} |
83 | ]} | 80 | ]} |
84 | ]}, | 81 | ]}, |
85 | {tag:'div', cls:'body', children:[ | 82 | {tag:'div', cls:'body', children:[ |
86 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ | 83 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ |
87 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ | 84 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ |
88 | {tag:'thead', children:[ | 85 | {tag:'thead', children:[ |
89 | {tag:'tr', id:this.getId('thead_tr'), children:[]} | 86 | {tag:'tr', id:this.getId('thead_tr'), children:[]} |
90 | ]}, | 87 | ]}, |
91 | {tag:'tbody', id:this.getId('gridRows'), children:[]} | 88 | {tag:'tbody', id:this.getId('gridRows'), children:[]} |
92 | ]} | 89 | ]} |
93 | ]}, | 90 | ]}, |
94 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} | 91 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} |
95 | ]}, | 92 | ]}, |
96 | {tag:'div', cls:'footer'} | 93 | {tag:'div', cls:'footer'} |
97 | ]); | 94 | ]); |
98 | 95 | ||
99 | this.renderHeader(); | 96 | this.renderHeader(); |
100 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); | 97 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'renderHeader': function () { | 102 | 'renderHeader': function () { |
106 | var headerElement; | 103 | var headerElement; |
107 | 104 | ||
108 | headerElement = this.getElement('thead_tr'); | 105 | headerElement = this.getElement('thead_tr'); |
109 | headerElement.innerHTML = ""; | 106 | headerElement.innerHTML = ""; |
110 | 107 | ||
111 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 108 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
112 | aColumnManager.renderHeader(headerElement); | 109 | aColumnManager.renderHeader(headerElement); |
113 | }); | 110 | }); |
114 | }, | 111 | }, |
115 | 112 | ||
116 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
117 | 114 | ||
118 | 'update': function (someObjects) { | 115 | 'update': function (someObjects) { |
119 | this._rowsObjects = someObjects | 116 | this._rowsObjects = someObjects |
120 | this.refresh(); | 117 | this.refresh(); |
121 | this.focus(); | 118 | this.focus(); |
122 | }, | 119 | }, |
123 | 120 | ||
124 | 'focus': function () { | 121 | 'focus': function () { |
125 | this.getElement('search').focus(); | 122 | this.getElement('search').focus(); |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //------------------------------------------------------------------------- | 125 | //------------------------------------------------------------------------- |
129 | 126 | ||
130 | 'startSearch': function () { | 127 | 'startSearch': function () { |
131 | //console.log("--> startSearch"); | 128 | //console.log("--> startSearch"); |
132 | MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); | 129 | MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); |
133 | }, | 130 | }, |
134 | 131 | ||
135 | 'endSearch': function () { | 132 | 'endSearch': function () { |
136 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); | 133 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); |
137 | //console.log("<-- startSearch"); | 134 | //console.log("<-- startSearch"); |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'disconnectColumnManagersRowsSignals': function () { | 139 | 'disconnectColumnManagersRowsSignals': function () { |
143 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 140 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
144 | aColumnManager.disconnectRowsSignals(); | 141 | aColumnManager.disconnectRowsSignals(); |
145 | }); | 142 | }); |
146 | }, | 143 | }, |
147 | 144 | ||
148 | //------------------------------------------------------------------------- | 145 | //------------------------------------------------------------------------- |
149 | 146 | ||
150 | 'refresh': function () { | 147 | 'refresh': function () { |
151 | var gridRowsElement; | 148 | var gridRowsElement; |
152 | var rowClass; | 149 | var rowClass; |
153 | 150 | ||
154 | this.disconnectColumnManagersRowsSignals(); | 151 | this.disconnectColumnManagersRowsSignals(); |
155 | 152 | ||
156 | { | 153 | { |
157 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); | 154 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); |
158 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); | 155 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); |
159 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | 156 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); |
160 | MochiKit.DOM.removeElementClass(this.element(), 'noRows'); | 157 | MochiKit.DOM.removeElementClass(this.element(), 'noRows'); |
161 | } | 158 | } |
162 | 159 | ||
163 | 160 | ||
164 | gridRowsElement = this.getElement('gridRows'); | 161 | gridRowsElement = this.getElement('gridRows'); |
165 | gridRowsElement.innerHTML = ""; | 162 | gridRowsElement.innerHTML = ""; |
166 | 163 | ||
167 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | 164 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); |
168 | 165 | ||
169 | rowClass = 'odd'; | 166 | rowClass = 'odd'; |
170 | MochiKit.Iter.forEach(this._rowsObjects, MochiKit.Base.bind(function (aRowObject) { | 167 | MochiKit.Iter.forEach(this._rowsObjects, MochiKit.Base.bind(function (aRowObject) { |
171 | var cardRowElement; | 168 | var cardRowElement; |
172 | 169 | ||
173 | cardRowElement = this.append(gridRowsElement, {tag:'tr', id:this.getId(aRowObject['_reference']), cls:rowClass}); | 170 | cardRowElement = this.append(gridRowsElement, {tag:'tr', id:this.getId(aRowObject['_reference']), cls:rowClass}); |
174 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 171 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
175 | aColumnManager.renderCell(cardRowElement, aRowObject); | 172 | aColumnManager.renderCell(cardRowElement, aRowObject); |
176 | }); | 173 | }); |
177 | 174 | ||
178 | rowClass = (rowClass == 'odd') ? 'even' : 'odd'; | 175 | rowClass = (rowClass == 'odd') ? 'even' : 'odd'; |
179 | }, this)); | 176 | }, this)); |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //----------------------------------------------------------------------------- | 179 | //----------------------------------------------------------------------------- |
183 | 180 | ||
184 | 'filterElement': function () { | 181 | 'filterElement': function () { |
185 | return this.getElement('search'); | 182 | return this.getElement('search'); |
186 | }, | 183 | }, |
187 | 184 | ||
188 | //------------------------------------------------------------------------- | 185 | //------------------------------------------------------------------------- |
189 | 186 | ||
190 | 'shouldShowElementWhileRendering': function () { | 187 | 'shouldShowElementWhileRendering': function () { |
191 | return false; | 188 | return false; |
192 | }, | 189 | }, |
193 | 190 | ||
194 | //------------------------------------------------------------------------- | 191 | //------------------------------------------------------------------------- |
195 | 192 | ||
196 | 'selectRow': function (aRowObject) { | 193 | 'selectRow': function (aRowObject) { |
197 | MochiKit.DOM.addElementClass(this.getId(aRowObject['_reference']), 'selected'); | 194 | MochiKit.DOM.addElementClass(this.getId(aRowObject['_reference']), 'selected'); |
198 | }, | 195 | }, |
199 | 196 | ||
200 | 'unselectRow': function (aRowObject) { | 197 | 'unselectRow': function (aRowObject) { |
201 | MochiKit.DOM.removeElementClass(this.getId(aRowObject['_reference']), 'selected'); | 198 | MochiKit.DOM.removeElementClass(this.getId(aRowObject['_reference']), 'selected'); |
202 | }, | 199 | }, |
203 | 200 | ||
204 | //------------------------------------------------------------------------- | 201 | //------------------------------------------------------------------------- |
205 | /* | 202 | /* |
206 | 'passOpenDirectLogin': function(aDirectLoginReferenceId) { | 203 | 'passOpenDirectLogin': function(aDirectLoginReferenceId) { |
207 | MochiKit.Signal.signal(this, 'openDirectLogin', aDirectLoginReferenceId); | 204 | MochiKit.Signal.signal(this, 'openDirectLogin', aDirectLoginReferenceId); |
208 | }, | 205 | }, |
209 | */ | 206 | */ |
210 | //------------------------------------------------------------------------- | 207 | //------------------------------------------------------------------------- |
211 | 208 | ||
212 | 'clearSearchHandler': function (anEvent) { | 209 | 'clearSearchHandler': function (anEvent) { |
213 | var searchElement; | 210 | var searchElement; |
214 | 211 | ||
215 | anEvent.preventDefault(); | 212 | anEvent.preventDefault(); |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js index 07b8dcc..3e03fcf 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js | |||
@@ -1,68 +1,65 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'renderCell': function(aRowElement, anObject) { | 47 | 'renderCell': function(aRowElement, anObject) { |
51 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 48 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
52 | {tag:'img', src:anObject[this.name()]} | 49 | {tag:'img', src:anObject[this.name()]} |
53 | ]}); | 50 | ]}); |
54 | 51 | ||
55 | // return Clipperz.Async.callbacks("ImageColumnManager.renderCell", [ | 52 | // return Clipperz.Async.callbacks("ImageColumnManager.renderCell", [ |
56 | // this.selector(), | 53 | // this.selector(), |
57 | // MochiKit.Base.bind(function (aValue) { | 54 | // MochiKit.Base.bind(function (aValue) { |
58 | // Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 55 | // Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
59 | // {tag:'img', src:aValue} | 56 | // {tag:'img', src:aValue} |
60 | // ]}); | 57 | // ]}); |
61 | // }, this) | 58 | // }, this) |
62 | // ], {trace:false}, anObject); | 59 | // ], {trace:false}, anObject); |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //----------------------------------------------------- | 62 | //----------------------------------------------------- |
66 | '__syntax_fix__' : 'syntax fix' | 63 | '__syntax_fix__' : 'syntax fix' |
67 | }); | 64 | }); |
68 | 65 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js index e833190..f3f9cd5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js | |||
@@ -1,92 +1,89 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._actionMethod = args.actionMethod || null; | 34 | this._actionMethod = args.actionMethod || null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
45 | 42 | ||
46 | 'toString': function () { | 43 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 44 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
48 | }, | 45 | }, |
49 | 46 | ||
50 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
51 | 48 | ||
52 | 'actionMethod': function () { | 49 | 'actionMethod': function () { |
53 | return this._actionMethod; | 50 | return this._actionMethod; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | 54 | ||
58 | 'renderCell': function(aRowElement, anObject) { | 55 | 'renderCell': function(aRowElement, anObject) { |
59 | vartdElement; | 56 | vartdElement; |
60 | varlinkElement; | 57 | varlinkElement; |
61 | 58 | ||
62 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 59 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
63 | {tag:'span', children:[ | 60 | {tag:'span', children:[ |
64 | {tag:'a', href:'#', html:anObject[this.name()]} | 61 | {tag:'a', href:'#', html:anObject[this.name()]} |
65 | ]} | 62 | ]} |
66 | ]}); | 63 | ]}); |
67 | 64 | ||
68 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 65 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
69 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 66 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
70 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 67 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //----------------------------------------------------- | 70 | //----------------------------------------------------- |
74 | 71 | ||
75 | 'handleLinkClick': function (anObject, anEvent) { | 72 | 'handleLinkClick': function (anObject, anEvent) { |
76 | anEvent.preventDefault(); | 73 | anEvent.preventDefault(); |
77 | 74 | ||
78 | if (this.actionMethod() != null) { | 75 | if (this.actionMethod() != null) { |
79 | var deferredResult; | 76 | var deferredResult; |
80 | 77 | ||
81 | deferredResult = new Clipperz.Async.Deferred("LinkColumnManager.handleLinkClick", {trace:false}); | 78 | deferredResult = new Clipperz.Async.Deferred("LinkColumnManager.handleLinkClick", {trace:false}); |
82 | // deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'selectRow', anObject); | 79 | // deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'selectRow', anObject); |
83 | deferredResult.addCallback(this.actionMethod(), anObject, anEvent); | 80 | deferredResult.addCallback(this.actionMethod(), anObject, anEvent); |
84 | // deferredResult.addBothPass(MochiKit.Signal.signal, this, 'unselectRow', anObject); | 81 | // deferredResult.addBothPass(MochiKit.Signal.signal, this, 'unselectRow', anObject); |
85 | deferredResult.callback(); | 82 | deferredResult.callback(); |
86 | } | 83 | } |
87 | }, | 84 | }, |
88 | 85 | ||
89 | //----------------------------------------------------- | 86 | //----------------------------------------------------- |
90 | '__syntax_fix__' : 'syntax fix' | 87 | '__syntax_fix__' : 'syntax fix' |
91 | }); | 88 | }); |
92 | 89 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js index de20853..389d876 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js | |||
@@ -1,203 +1,200 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { | 28 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | this._autocomplete = args.autocomplete || 'off'; | 31 | this._autocomplete = args.autocomplete || 'off'; |
35 | 32 | ||
36 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); | 33 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); |
37 | 34 | ||
38 | this._slots = { | 35 | this._slots = { |
39 | 'passphraseEntropy':this.getId('passphraseEntropy') | 36 | 'passphraseEntropy':this.getId('passphraseEntropy') |
40 | }; | 37 | }; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; | 49 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | 'autocomplete': function () { | 52 | 'autocomplete': function () { |
56 | return this._autocomplete; | 53 | return this._autocomplete; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'renderSelf': function() { | 58 | 'renderSelf': function() { |
62 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ | 59 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ |
63 | {tag:'div', cls:'header'}, | 60 | {tag:'div', cls:'header'}, |
64 | {tag:'div', cls:'body', id:this.getId('body'), children:[ | 61 | {tag:'div', cls:'body', id:this.getId('body'), children:[ |
65 | {tag:'div', id:this.getId('loginForm'), children:[ | 62 | {tag:'div', id:this.getId('loginForm'), children:[ |
66 | {tag:'div', children:[ | 63 | {tag:'div', children:[ |
67 | {tag:'h4', html:'Login'}, | 64 | {tag:'h4', html:'Login'}, |
68 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ | 65 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ |
69 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ | 66 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ |
70 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, | 67 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, |
71 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, | 68 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, |
72 | {tag:'ul', id:this.getId('passwordOptions'), children:[ | 69 | {tag:'ul', id:this.getId('passwordOptions'), children:[ |
73 | {tag:'li', id:this.getId('passphraseOption'), children:[ | 70 | {tag:'li', id:this.getId('passphraseOption'), children:[ |
74 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, | 71 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, |
75 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} | 72 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} |
76 | ]} //, | 73 | ]} //, |
77 | /* | 74 | /* |
78 | {tag:'li', id:this.getId('otpOption'), children:[ | 75 | {tag:'li', id:this.getId('otpOption'), children:[ |
79 | {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, | 76 | {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, |
80 | {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, | 77 | {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, |
81 | {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, | 78 | {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, |
82 | {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, | 79 | {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, |
83 | {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} | 80 | {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} |
84 | ]} | 81 | ]} |
85 | */ | 82 | */ |
86 | ]}, | 83 | ]}, |
87 | // {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, | 84 | // {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, |
88 | // {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, | 85 | // {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, |
89 | 86 | ||
90 | {tag:'div', cls:'translations', children:[ | 87 | {tag:'div', cls:'translations', children:[ |
91 | {tag:'h4', html:'choose your language'}, | 88 | {tag:'h4', html:'choose your language'}, |
92 | {tag:'ul', children:[ | 89 | {tag:'ul', children:[ |
93 | {tag:'li', cls:'selected', html:'english'}, | 90 | {tag:'li', cls:'selected', html:'english'}, |
94 | {tag:'li', html:'italiano'}, | 91 | {tag:'li', html:'italiano'}, |
95 | {tag:'li', html:'dutch'}, | 92 | {tag:'li', html:'dutch'}, |
96 | {tag:'li', html:'french'}, | 93 | {tag:'li', html:'french'}, |
97 | {tag:'li', html:'spanish'}, | 94 | {tag:'li', html:'spanish'}, |
98 | {tag:'li', html:'chinese'}, | 95 | {tag:'li', html:'chinese'}, |
99 | {tag:'li', html:'japanese'}, | 96 | {tag:'li', html:'japanese'}, |
100 | {tag:'li', html:'portugal'}, | 97 | {tag:'li', html:'portugal'}, |
101 | {tag:'li', html:'arabic'} | 98 | {tag:'li', html:'arabic'} |
102 | ]} | 99 | ]} |
103 | ]}, | 100 | ]}, |
104 | 101 | ||
105 | {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} | 102 | {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} |
106 | ]} | 103 | ]} |
107 | ]} | 104 | ]} |
108 | ]} | 105 | ]} |
109 | ]}, | 106 | ]}, |
110 | {tag:'div', cls:'footer'} | 107 | {tag:'div', cls:'footer'} |
111 | ]}); | 108 | ]}); |
112 | 109 | ||
113 | if (this.autocomplete() == 'off') { | 110 | if (this.autocomplete() == 'off') { |
114 | MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); | 111 | MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); |
115 | } | 112 | } |
116 | 113 | ||
117 | // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) | 114 | // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) |
118 | 115 | ||
119 | // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); | 116 | // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); |
120 | 117 | ||
121 | // MochiKit.Signal.connect(this.getId('otpCheckbox'), 'onclick', this, 'togglePasswordFields'); | 118 | // MochiKit.Signal.connect(this.getId('otpCheckbox'), 'onclick', this, 'togglePasswordFields'); |
122 | // this.showPassphraseField(); | 119 | // this.showPassphraseField(); |
123 | 120 | ||
124 | this.getElement('usernameField').focus(); | 121 | this.getElement('usernameField').focus(); |
125 | 122 | ||
126 | MochiKit.Signal.connect(this.getElement('loginForm'), 'onsubmit', this, 'loginEventHandler'); | 123 | MochiKit.Signal.connect(this.getElement('loginForm'), 'onsubmit', this, 'loginEventHandler'); |
127 | }, | 124 | }, |
128 | 125 | ||
129 | //----------------------------------------------------------------------------- | 126 | //----------------------------------------------------------------------------- |
130 | /* | 127 | /* |
131 | 'togglePasswordFields': function(anEvent) { | 128 | 'togglePasswordFields': function(anEvent) { |
132 | var shouldUseOTP; | 129 | var shouldUseOTP; |
133 | 130 | ||
134 | shouldUseOTP = this.getElement('otpCheckbox').checked; | 131 | shouldUseOTP = this.getElement('otpCheckbox').checked; |
135 | 132 | ||
136 | if (shouldUseOTP == false) { | 133 | if (shouldUseOTP == false) { |
137 | this.showPassphraseField(); | 134 | this.showPassphraseField(); |
138 | } else { | 135 | } else { |
139 | this.showOTPFields(); | 136 | this.showOTPFields(); |
140 | } | 137 | } |
141 | }, | 138 | }, |
142 | */ | 139 | */ |
143 | //----------------------------------------------------------------------------- | 140 | //----------------------------------------------------------------------------- |
144 | /* | 141 | /* |
145 | 'showPassphraseField': function() { | 142 | 'showPassphraseField': function() { |
146 | this.showElement('passphraseOption'); | 143 | this.showElement('passphraseOption'); |
147 | this.hideElement('otpOption'); | 144 | this.hideElement('otpOption'); |
148 | }, | 145 | }, |
149 | */ | 146 | */ |
150 | //----------------------------------------------------------------------------- | 147 | //----------------------------------------------------------------------------- |
151 | 148 | ||
152 | 'focusOnPassphraseField': function () { | 149 | 'focusOnPassphraseField': function () { |
153 | this.getElement('passphraseField').focus(); | 150 | this.getElement('passphraseField').focus(); |
154 | this.getElement('passphraseField').select(); | 151 | this.getElement('passphraseField').select(); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //----------------------------------------------------------------------------- | 154 | //----------------------------------------------------------------------------- |
158 | /* | 155 | /* |
159 | 'showOTPFields': function() { | 156 | 'showOTPFields': function() { |
160 | this.hideElement('passphraseOption'); | 157 | this.hideElement('passphraseOption'); |
161 | this.showElement('otpOption'); | 158 | this.showElement('otpOption'); |
162 | }, | 159 | }, |
163 | */ | 160 | */ |
164 | //------------------------------------------------------------------------- | 161 | //------------------------------------------------------------------------- |
165 | 162 | ||
166 | 'loginEventHandler': function(anEvent) { | 163 | 'loginEventHandler': function(anEvent) { |
167 | varusername; | 164 | varusername; |
168 | var passphrase; | 165 | var passphrase; |
169 | // var shouldUseOTP; | 166 | // var shouldUseOTP; |
170 | // var otp; | 167 | // var otp; |
171 | var signalArguments; | 168 | var signalArguments; |
172 | 169 | ||
173 | anEvent.preventDefault(); | 170 | anEvent.preventDefault(); |
174 | 171 | ||
175 | username = this.getElement('usernameField').value; | 172 | username = this.getElement('usernameField').value; |
176 | passphrase = this.getElement('passphraseField').value; | 173 | passphrase = this.getElement('passphraseField').value; |
177 | // otp =this.getElement('otpField_1').value + | 174 | // otp =this.getElement('otpField_1').value + |
178 | // this.getElement('otpField_2').value + | 175 | // this.getElement('otpField_2').value + |
179 | // this.getElement('otpField_3').value + | 176 | // this.getElement('otpField_3').value + |
180 | // this.getElement('otpField_4').value; | 177 | // this.getElement('otpField_4').value; |
181 | // shouldUseOTP = this.getElement('otpCheckbox').checked; | 178 | // shouldUseOTP = this.getElement('otpCheckbox').checked; |
182 | 179 | ||
183 | signalArguments = {username:username}; | 180 | signalArguments = {username:username}; |
184 | 181 | ||
185 | // if (shouldUseOTP) { | 182 | // if (shouldUseOTP) { |
186 | // signalArguments.otp = otp; | 183 | // signalArguments.otp = otp; |
187 | // } else { | 184 | // } else { |
188 | signalArguments.passphrase = passphrase; | 185 | signalArguments.passphrase = passphrase; |
189 | // } | 186 | // } |
190 | 187 | ||
191 | MochiKit.Signal.signal(this, 'doLogin', signalArguments); | 188 | MochiKit.Signal.signal(this, 'doLogin', signalArguments); |
192 | }, | 189 | }, |
193 | 190 | ||
194 | //------------------------------------------------------------------------- | 191 | //------------------------------------------------------------------------- |
195 | 192 | ||
196 | 'submitButtonElement': function() { | 193 | 'submitButtonElement': function() { |
197 | return this.getElement('submitButton'); | 194 | return this.getElement('submitButton'); |
198 | }, | 195 | }, |
199 | 196 | ||
200 | //------------------------------------------------------------------------- | 197 | //------------------------------------------------------------------------- |
201 | 198 | ||
202 | __syntaxFix__: "syntax fix" | 199 | __syntaxFix__: "syntax fix" |
203 | }); | 200 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js index 49c030d..2894af8 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js | |||
@@ -1,206 +1,203 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.LoginPage = function(args) { | 28 | Clipperz.PM.UI.Web.Components.LoginPage = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._slots = { | 33 | this._slots = { |
37 | 'loginForm':this.getId('loginBoxSlot') | 34 | 'loginForm':this.getId('loginBoxSlot') |
38 | }; | 35 | }; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.LoginPage component"; | 47 | return "Clipperz.PM.UI.Web.Components.LoginPage component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'renderSelf': function(/*aContainer, aPosition*/) { | 52 | 'renderSelf': function(/*aContainer, aPosition*/) { |
56 | this.append(this.element(), [ | 53 | this.append(this.element(), [ |
57 | {tag:'div', id:this.getId('loginBoxSlot')}, | 54 | {tag:'div', id:this.getId('loginBoxSlot')}, |
58 | {tag:'div', id:'main', children:[ | 55 | {tag:'div', id:'main', children:[ |
59 | {tag:'div', id:'featurePoints', children:[ | 56 | {tag:'div', id:'featurePoints', children:[ |
60 | {tag:'table', children:[ | 57 | {tag:'table', children:[ |
61 | {tag:'tr', children:[ | 58 | {tag:'tr', children:[ |
62 | {tag:'td', children:[ | 59 | {tag:'td', children:[ |
63 | {tag:'div', cls:'block', children:[ | 60 | {tag:'div', cls:'block', children:[ |
64 | {tag:'h3', html:'Clipperz is:'}, | 61 | {tag:'h3', html:'Clipperz is:'}, |
65 | {tag:'ul', children:[ | 62 | {tag:'ul', children:[ |
66 | {tag:'li', html:'a secure and simple password manager'}, | 63 | {tag:'li', html:'a secure and simple password manager'}, |
67 | {tag:'li', html:'an effective single sign-on solution'}, | 64 | {tag:'li', html:'an effective single sign-on solution'}, |
68 | {tag:'li', html:'a digital vault for your personal data'} | 65 | {tag:'li', html:'a digital vault for your personal data'} |
69 | ]} | 66 | ]} |
70 | ]}, | 67 | ]}, |
71 | {tag:'div', cls:'block', children:[ | 68 | {tag:'div', cls:'block', children:[ |
72 | {tag:'h3', html:'Clipperz benefits:'}, | 69 | {tag:'h3', html:'Clipperz benefits:'}, |
73 | {tag:'ul', children:[ | 70 | {tag:'ul', children:[ |
74 | {tag:'li', html:'free and completely anonymous'}, | 71 | {tag:'li', html:'free and completely anonymous'}, |
75 | {tag:'li', html:'access it any time from any computer'}, | 72 | {tag:'li', html:'access it any time from any computer'}, |
76 | {tag:'li', html:'no software to download and nothing to install'}, | 73 | {tag:'li', html:'no software to download and nothing to install'}, |
77 | {tag:'li', html:'avoid keeping secrets on your PC or on paper'} | 74 | {tag:'li', html:'avoid keeping secrets on your PC or on paper'} |
78 | ]} | 75 | ]} |
79 | ]} | 76 | ]} |
80 | ]}, {tag:'td', children:[ | 77 | ]}, {tag:'td', children:[ |
81 | {tag:'div', cls:'block', children:[ | 78 | {tag:'div', cls:'block', children:[ |
82 | {tag:'h3', html:'Clipperz security:'}, | 79 | {tag:'h3', html:'Clipperz security:'}, |
83 | {tag:'ul', children:[ | 80 | {tag:'ul', children:[ |
84 | {tag:'li', html:'your secretes are locally encrypted by your browser before being uploaded to Clipperz'}, | 81 | {tag:'li', html:'your secretes are locally encrypted by your browser before being uploaded to Clipperz'}, |
85 | {tag:'li', html:'the encryption key is a passphrase known only to you'}, | 82 | {tag:'li', html:'the encryption key is a passphrase known only to you'}, |
86 | {tag:'li', html:'Clipperz hosts your sensitive data in an encrypted form and could never access the data in its plain form'}, | 83 | {tag:'li', html:'Clipperz hosts your sensitive data in an encrypted form and could never access the data in its plain form'}, |
87 | {tag:'li', html:'Clipperz is built upon standard encryption schemes, nothing fancies of homemade'}, | 84 | {tag:'li', html:'Clipperz is built upon standard encryption schemes, nothing fancies of homemade'}, |
88 | {tag:'li', html:'you can review the source code anytime you like, but you need to know nothing about cryptography to be an happy user!'} | 85 | {tag:'li', html:'you can review the source code anytime you like, but you need to know nothing about cryptography to be an happy user!'} |
89 | ]} | 86 | ]} |
90 | ]} | 87 | ]} |
91 | ]} | 88 | ]} |
92 | ]} | 89 | ]} |
93 | ]} | 90 | ]} |
94 | ]}, | 91 | ]}, |
95 | {tag:'div', cls:'activeFeatures', children:[ | 92 | {tag:'div', cls:'activeFeatures', children:[ |
96 | {tag:'div', id:this.getId('registerButton'), cls:'createAccountLink', children:[ | 93 | {tag:'div', id:this.getId('registerButton'), cls:'createAccountLink', children:[ |
97 | {tag:'canvas', id:this.getId('registerButtonIcon')}, | 94 | {tag:'canvas', id:this.getId('registerButtonIcon')}, |
98 | {tag:'a', href:'#', id:this.getId('createAccountLink'), cls:'createAccountLink', children:[ | 95 | {tag:'a', href:'#', id:this.getId('createAccountLink'), cls:'createAccountLink', children:[ |
99 | {tag:'span', cls:'payoff', html:"Free sign up!"}, | 96 | {tag:'span', cls:'payoff', html:"Free sign up!"}, |
100 | {tag:'span', cls:'link', html:"Create account >>"} | 97 | {tag:'span', cls:'link', html:"Create account >>"} |
101 | ]} | 98 | ]} |
102 | ]}, | 99 | ]}, |
103 | {tag:'div', cls:'keepTogether', children:[ | 100 | {tag:'div', cls:'keepTogether', children:[ |
104 | {tag:'div', id:this.getId('screenshotLink'), cls:'screenshotLink', children:[ | 101 | {tag:'div', id:this.getId('screenshotLink'), cls:'screenshotLink', children:[ |
105 | {tag:'canvas', id:this.getId('lookIcon')}, | 102 | {tag:'canvas', id:this.getId('lookIcon')}, |
106 | {tag:'a', href:'#', cls:'screenshotLink', children:[ | 103 | {tag:'a', href:'#', cls:'screenshotLink', children:[ |
107 | {tag:'span', cls:'payoff', html:"Look Clipperz!"}, | 104 | {tag:'span', cls:'payoff', html:"Look Clipperz!"}, |
108 | {tag:'span', cls:'link', html:"screenshot tour >>"} | 105 | {tag:'span', cls:'link', html:"screenshot tour >>"} |
109 | ]} | 106 | ]} |
110 | ]}, | 107 | ]}, |
111 | {tag:'div', id:this.getId('offlineLink'), cls:'offlineLink', children:[ | 108 | {tag:'div', id:this.getId('offlineLink'), cls:'offlineLink', children:[ |
112 | {tag:'canvas', id:this.getId('downloadIcon')}, | 109 | {tag:'canvas', id:this.getId('downloadIcon')}, |
113 | {tag:'a', href:'#', cls:'offlineLink', children:[ | 110 | {tag:'a', href:'#', cls:'offlineLink', children:[ |
114 | {tag:'span', cls:'payoff', html:"Download!"}, | 111 | {tag:'span', cls:'payoff', html:"Download!"}, |
115 | {tag:'span', cls:'link', html:"Offline version >>"} | 112 | {tag:'span', cls:'link', html:"Offline version >>"} |
116 | ]} | 113 | ]} |
117 | ]} | 114 | ]} |
118 | ]} | 115 | ]} |
119 | ]} | 116 | ]} |
120 | ]} | 117 | ]} |
121 | ]); | 118 | ]); |
122 | 119 | ||
123 | this.setRegistrationButtonIconDefaultColors(); | 120 | this.setRegistrationButtonIconDefaultColors(); |
124 | this.setLookIconDefaultColors(); | 121 | this.setLookIconDefaultColors(); |
125 | this.setDownloadIconDefaultColors(); | 122 | this.setDownloadIconDefaultColors(); |
126 | 123 | ||
127 | // MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') | 124 | // MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') |
128 | 125 | ||
129 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseenter', this, 'handleMouseEnterOnRegisterButtonIcon'); | 126 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseenter', this, 'handleMouseEnterOnRegisterButtonIcon'); |
130 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseleave', this, 'handleMouseLeaveOnRegisterButtonIcon'); | 127 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseleave', this, 'handleMouseLeaveOnRegisterButtonIcon'); |
131 | 128 | ||
132 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseenter', this, 'handleMouseEnterOnLookIcon'); | 129 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseenter', this, 'handleMouseEnterOnLookIcon'); |
133 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseleave', this, 'handleMouseLeaveOnLookIcon'); | 130 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseleave', this, 'handleMouseLeaveOnLookIcon'); |
134 | 131 | ||
135 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseenter', this, 'handleMouseEnterOnDownloadIcon'); | 132 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseenter', this, 'handleMouseEnterOnDownloadIcon'); |
136 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseleave', this, 'handleMouseLeaveOnDownloadIcon'); | 133 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseleave', this, 'handleMouseLeaveOnDownloadIcon'); |
137 | 134 | ||
138 | MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') | 135 | MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') |
139 | }, | 136 | }, |
140 | 137 | ||
141 | //------------------------------------------------------------------------- | 138 | //------------------------------------------------------------------------- |
142 | 139 | ||
143 | 'setRegistrationButtonIconDefaultColors': function () { | 140 | 'setRegistrationButtonIconDefaultColors': function () { |
144 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#eeeeee", "#eeeeee", "#ecab12", "#e14624", "#ffffff"); | 141 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#eeeeee", "#eeeeee", "#ecab12", "#e14624", "#ffffff"); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | 'setRegistrationButtonIconHoverColors': function () { | 144 | 'setRegistrationButtonIconHoverColors': function () { |
148 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#cccccc", "#999999", "#ffb710", "#ff4d27", "#ffffff"); | 145 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#cccccc", "#999999", "#ffb710", "#ff4d27", "#ffffff"); |
149 | }, | 146 | }, |
150 | 147 | ||
151 | 'handleMouseEnterOnRegisterButtonIcon': function (anEvent) { | 148 | 'handleMouseEnterOnRegisterButtonIcon': function (anEvent) { |
152 | this.setRegistrationButtonIconHoverColors(); | 149 | this.setRegistrationButtonIconHoverColors(); |
153 | }, | 150 | }, |
154 | 151 | ||
155 | 'handleMouseLeaveOnRegisterButtonIcon': function (anEvent) { | 152 | 'handleMouseLeaveOnRegisterButtonIcon': function (anEvent) { |
156 | this.setRegistrationButtonIconDefaultColors(); | 153 | this.setRegistrationButtonIconDefaultColors(); |
157 | }, | 154 | }, |
158 | 155 | ||
159 | //------------------------------------------------------------------------- | 156 | //------------------------------------------------------------------------- |
160 | 157 | ||
161 | 'setLookIconDefaultColors': function () { | 158 | 'setLookIconDefaultColors': function () { |
162 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#7e7e7e", "#ffffff", 1); | 159 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#7e7e7e", "#ffffff", 1); |
163 | }, | 160 | }, |
164 | 161 | ||
165 | 'setLookIconHoverColors': function () { | 162 | 'setLookIconHoverColors': function () { |
166 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#666666", "#ffffff", 2); | 163 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#666666", "#ffffff", 2); |
167 | }, | 164 | }, |
168 | 165 | ||
169 | 'handleMouseEnterOnLookIcon': function (anEvent) { | 166 | 'handleMouseEnterOnLookIcon': function (anEvent) { |
170 | this.setLookIconHoverColors(); | 167 | this.setLookIconHoverColors(); |
171 | }, | 168 | }, |
172 | 169 | ||
173 | 'handleMouseLeaveOnLookIcon': function (anEvent) { | 170 | 'handleMouseLeaveOnLookIcon': function (anEvent) { |
174 | this.setLookIconDefaultColors(); | 171 | this.setLookIconDefaultColors(); |
175 | }, | 172 | }, |
176 | 173 | ||
177 | //------------------------------------------------------------------------- | 174 | //------------------------------------------------------------------------- |
178 | 175 | ||
179 | 'setDownloadIconDefaultColors': function () { | 176 | 'setDownloadIconDefaultColors': function () { |
180 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#7e7e7e", "#ffffff", 1); | 177 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#7e7e7e", "#ffffff", 1); |
181 | }, | 178 | }, |
182 | 179 | ||
183 | 'setDownloadIconHoverColors': function () { | 180 | 'setDownloadIconHoverColors': function () { |
184 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#666666", "#ffffff", 2); | 181 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#666666", "#ffffff", 2); |
185 | }, | 182 | }, |
186 | 183 | ||
187 | 'handleMouseEnterOnDownloadIcon': function (anEvent) { | 184 | 'handleMouseEnterOnDownloadIcon': function (anEvent) { |
188 | this.setDownloadIconHoverColors(); | 185 | this.setDownloadIconHoverColors(); |
189 | }, | 186 | }, |
190 | 187 | ||
191 | 'handleMouseLeaveOnDownloadIcon': function (anEvent) { | 188 | 'handleMouseLeaveOnDownloadIcon': function (anEvent) { |
192 | this.setDownloadIconDefaultColors(); | 189 | this.setDownloadIconDefaultColors(); |
193 | }, | 190 | }, |
194 | 191 | ||
195 | //------------------------------------------------------------------------- | 192 | //------------------------------------------------------------------------- |
196 | 193 | ||
197 | 'handleCreateAccountLink': function (anEvent) { | 194 | 'handleCreateAccountLink': function (anEvent) { |
198 | anEvent.preventDefault(); | 195 | anEvent.preventDefault(); |
199 | 196 | ||
200 | MochiKit.Signal.signal(this, 'createNewAccountClick', anEvent.src()); | 197 | MochiKit.Signal.signal(this, 'createNewAccountClick', anEvent.src()); |
201 | }, | 198 | }, |
202 | 199 | ||
203 | //------------------------------------------------------------------------- | 200 | //------------------------------------------------------------------------- |
204 | 201 | ||
205 | __syntaxFix__: "syntax fix" | 202 | __syntaxFix__: "syntax fix" |
206 | }); | 203 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js index 03c7b9e..5d082b5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js | |||
@@ -1,155 +1,152 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { | 28 | Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._deferred = null; | 33 | this._deferred = null; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | //============================================================================= | 38 | //============================================================================= |
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.Web.Components.LoginProgress component"; | 45 | return "Clipperz.PM.UI.Web.Components.LoginProgress component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'deferred': function() { | 50 | 'deferred': function() { |
54 | return this._deferred; | 51 | return this._deferred; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | 'setDeferred': function(aValue) { | 54 | 'setDeferred': function(aValue) { |
58 | this._deferred = aValue; | 55 | this._deferred = aValue; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'renderSelf': function() { | 60 | 'renderSelf': function() { |
64 | // var loginProgressElement; | 61 | // var loginProgressElement; |
65 | // | 62 | // |
66 | // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); | 63 | // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); |
67 | // | 64 | // |
68 | // if (loginProgressElement == null) { | 65 | // if (loginProgressElement == null) { |
69 | // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); | 66 | // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); |
70 | // } | 67 | // } |
71 | 68 | ||
72 | //console.log(">> LoginProgress.renderSelf", this.element()); | 69 | //console.log(">> LoginProgress.renderSelf", this.element()); |
73 | this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ | 70 | this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ |
74 | // this.append(loginProgressElement, [ | 71 | // this.append(loginProgressElement, [ |
75 | {tag:'div', cls:'header', children:[ | 72 | {tag:'div', cls:'header', children:[ |
76 | {tag:'h3', id:this.getId('title'), html:"login progress"} | 73 | {tag:'h3', id:this.getId('title'), html:"login progress"} |
77 | ]}, | 74 | ]}, |
78 | {tag:'div', cls:'body', children:[ | 75 | {tag:'div', cls:'body', children:[ |
79 | {tag:'div', id:this.getId('progressBar')}, | 76 | {tag:'div', id:this.getId('progressBar')}, |
80 | {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ | 77 | {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ |
81 | // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, | 78 | // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, |
82 | {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, | 79 | {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, |
83 | {tag:'p', html:"Login failed"} | 80 | {tag:'p', html:"Login failed"} |
84 | ]} | 81 | ]} |
85 | ]}, | 82 | ]}, |
86 | {tag:'div', cls:'footer', children:[ | 83 | {tag:'div', cls:'footer', children:[ |
87 | {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ | 84 | {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ |
88 | {tag:'div', cls:'button', id:this.getId('button'), children:[ | 85 | {tag:'div', cls:'button', id:this.getId('button'), children:[ |
89 | {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} | 86 | {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} |
90 | ]} | 87 | ]} |
91 | ]} | 88 | ]} |
92 | ]} | 89 | ]} |
93 | ]}); | 90 | ]}); |
94 | // ]); | 91 | // ]); |
95 | 92 | ||
96 | Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff"); | 93 | Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff"); |
97 | 94 | ||
98 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 95 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
99 | MochiKit.Style.hideElement(this.getElement('errorBox')); | 96 | MochiKit.Style.hideElement(this.getElement('errorBox')); |
100 | 97 | ||
101 | MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); | 98 | MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
105 | 102 | ||
106 | 'displayElement': function() { | 103 | 'displayElement': function() { |
107 | return MochiKit.DOM.getElement('loginProgress'); | 104 | return MochiKit.DOM.getElement('loginProgress'); |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //------------------------------------------------------------------------- | 107 | //------------------------------------------------------------------------- |
111 | 108 | ||
112 | 'cancelEventHandler': function(anEvent) { | 109 | 'cancelEventHandler': function(anEvent) { |
113 | anEvent.preventDefault(); | 110 | anEvent.preventDefault(); |
114 | 111 | ||
115 | MochiKit.Signal.signal(this, 'cancelEvent'); | 112 | MochiKit.Signal.signal(this, 'cancelEvent'); |
116 | }, | 113 | }, |
117 | 114 | ||
118 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
119 | 116 | ||
120 | 'disableCancel': function() { | 117 | 'disableCancel': function() { |
121 | MochiKit.Style.hideElement(this.getElement('buttonArea')); | 118 | MochiKit.Style.hideElement(this.getElement('buttonArea')); |
122 | }, | 119 | }, |
123 | 120 | ||
124 | //------------------------------------------------------------------------- | 121 | //------------------------------------------------------------------------- |
125 | 122 | ||
126 | 'showErrorMessage': function() { | 123 | 'showErrorMessage': function() { |
127 | this.getElement('buttonLink').innerHTML = "close"; | 124 | this.getElement('buttonLink').innerHTML = "close"; |
128 | 125 | ||
129 | MochiKit.Style.hideElement(this.getElement('progressBar')); | 126 | MochiKit.Style.hideElement(this.getElement('progressBar')); |
130 | 127 | ||
131 | this.getElement('title').innerHTML = "Error"; | 128 | this.getElement('title').innerHTML = "Error"; |
132 | MochiKit.Style.showElement(this.getElement('errorBox')); | 129 | MochiKit.Style.showElement(this.getElement('errorBox')); |
133 | MochiKit.Style.showElement(this.getElement('buttonArea')); | 130 | MochiKit.Style.showElement(this.getElement('buttonArea')); |
134 | }, | 131 | }, |
135 | 132 | ||
136 | //------------------------------------------------------------------------- | 133 | //------------------------------------------------------------------------- |
137 | 134 | ||
138 | 'deferredHideModalAndRemove': function(someParameters, aResult) { | 135 | 'deferredHideModalAndRemove': function(someParameters, aResult) { |
139 | vardeferredResult; | 136 | vardeferredResult; |
140 | 137 | ||
141 | deferredResult = new Clipperz.Async.Deferred("LoginProgress.deferredHideModalAndRemove", {trace:false}); | 138 | deferredResult = new Clipperz.Async.Deferred("LoginProgress.deferredHideModalAndRemove", {trace:false}); |
142 | deferredResult.addMethod(this, 'deferredHideModal'); | 139 | deferredResult.addMethod(this, 'deferredHideModal'); |
143 | deferredResult.addMethod(this, 'remove'); | 140 | deferredResult.addMethod(this, 'remove'); |
144 | deferredResult.addCallback(function () { | 141 | deferredResult.addCallback(function () { |
145 | return aResult; | 142 | return aResult; |
146 | }); | 143 | }); |
147 | deferredResult.callback(someParameters); | 144 | deferredResult.callback(someParameters); |
148 | 145 | ||
149 | return deferredResult; | 146 | return deferredResult; |
150 | }, | 147 | }, |
151 | 148 | ||
152 | //------------------------------------------------------------------------- | 149 | //------------------------------------------------------------------------- |
153 | 150 | ||
154 | __syntaxFix__: "syntax fix" | 151 | __syntaxFix__: "syntax fix" |
155 | }); | 152 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js index b40d1f3..feb16ad 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._tabPanelController = null; | 33 | this._tabPanelController = null; |
37 | 34 | ||
38 | this._initiallySelectedTab = args.selected || 'CREDENTIALS'; | 35 | this._initiallySelectedTab = args.selected || 'CREDENTIALS'; |
39 | this._tabPanelControllerConfiguration = { | 36 | this._tabPanelControllerConfiguration = { |
40 | 'CREDENTIALS': { | 37 | 'CREDENTIALS': { |
41 | tab:'credentialsTab', | 38 | tab:'credentialsTab', |
42 | panel:'credentialsTabpanel' | 39 | panel:'credentialsTabpanel' |
43 | }, | 40 | }, |
44 | 'CHECK_CREDENTIALS': { | 41 | 'CHECK_CREDENTIALS': { |
45 | tab:'checkCredentialsTab', | 42 | tab:'checkCredentialsTab', |
46 | panel:'checkCredentialsTabpanel' | 43 | panel:'checkCredentialsTabpanel' |
47 | }, | 44 | }, |
48 | 'TERMS_OF_SERVICE': { | 45 | 'TERMS_OF_SERVICE': { |
49 | tab:'termsOfServiceTab', | 46 | tab:'termsOfServiceTab', |
50 | panel:'termsOfServiceTabpanel' | 47 | panel:'termsOfServiceTabpanel' |
51 | }, | 48 | }, |
52 | 'CREATE_USER': { | 49 | 'CREATE_USER': { |
53 | tab:'createUserTab', | 50 | tab:'createUserTab', |
54 | panel:'createUserTabpanel' | 51 | panel:'createUserTabpanel' |
55 | }//, | 52 | }//, |
56 | /* | 53 | /* |
57 | 'LOGIN': { | 54 | 'LOGIN': { |
58 | tab:'loginTab', | 55 | tab:'loginTab', |
59 | panel:'loginTabpanel' | 56 | panel:'loginTabpanel' |
60 | } | 57 | } |
61 | */ | 58 | */ |
62 | }; | 59 | }; |
63 | 60 | ||
64 | return this; | 61 | return this; |
65 | } | 62 | } |
66 | 63 | ||
67 | //============================================================================= | 64 | //============================================================================= |
68 | 65 | ||
69 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 66 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
70 | 67 | ||
71 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'toString': function () { | 70 | 'toString': function () { |
74 | return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; | 71 | return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; |
75 | }, | 72 | }, |
76 | 73 | ||
77 | //========================================================================= | 74 | //========================================================================= |
78 | 75 | ||
79 | 'disableAllPanels': function () { | 76 | 'disableAllPanels': function () { |
80 | this.tabPanelController().selectTab(null); | 77 | this.tabPanelController().selectTab(null); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | 81 | ||
85 | 'enableCredentialsPanel': function () { | 82 | 'enableCredentialsPanel': function () { |
86 | this.tabPanelController().selectTab('CREDENTIALS'); | 83 | this.tabPanelController().selectTab('CREDENTIALS'); |
87 | }, | 84 | }, |
88 | 85 | ||
89 | 'enableCheckCredentialsPanel': function () { | 86 | 'enableCheckCredentialsPanel': function () { |
90 | this.tabPanelController().selectTab('CHECK_CREDENTIALS'); | 87 | this.tabPanelController().selectTab('CHECK_CREDENTIALS'); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | 'enableTermsOfServicePanel': function () { | 90 | 'enableTermsOfServicePanel': function () { |
94 | this.tabPanelController().selectTab('TERMS_OF_SERVICE'); | 91 | this.tabPanelController().selectTab('TERMS_OF_SERVICE'); |
95 | }, | 92 | }, |
96 | 93 | ||
97 | 'enableCreateUserPanel': function () { | 94 | 'enableCreateUserPanel': function () { |
98 | this.tabPanelController().selectTab('CREATE_USER'); | 95 | this.tabPanelController().selectTab('CREATE_USER'); |
99 | }, | 96 | }, |
100 | 97 | ||
101 | //'enableLoginPanel': function () { | 98 | //'enableLoginPanel': function () { |
102 | // this.tabPanelController().selectTab('LOGIN'); | 99 | // this.tabPanelController().selectTab('LOGIN'); |
103 | //}, | 100 | //}, |
104 | 101 | ||
105 | //========================================================================= | 102 | //========================================================================= |
106 | 103 | ||
107 | 'shouldShowElementWhileRendering': function() { | 104 | 'shouldShowElementWhileRendering': function() { |
108 | return false; | 105 | return false; |
109 | }, | 106 | }, |
110 | 107 | ||
111 | //========================================================================= | 108 | //========================================================================= |
112 | 109 | ||
113 | 'tabPanelController': function () { | 110 | 'tabPanelController': function () { |
114 | if (this._tabPanelController == null) { | 111 | if (this._tabPanelController == null) { |
115 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | 112 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ |
116 | component:this, | 113 | component:this, |
117 | configuration:this._tabPanelControllerConfiguration | 114 | configuration:this._tabPanelControllerConfiguration |
118 | }); | 115 | }); |
119 | 116 | ||
120 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | 117 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') |
121 | } | 118 | } |
122 | 119 | ||
123 | return this._tabPanelController; | 120 | return this._tabPanelController; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
127 | 124 | ||
128 | 'renderSelf': function() { | 125 | 'renderSelf': function() { |
129 | //console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); | 126 | //console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); |
130 | 127 | ||
131 | this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ | 128 | this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ |
132 | {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ | 129 | {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ |
133 | {tag:'div', cls:'header', children:[ | 130 | {tag:'div', cls:'header', children:[ |
134 | {tag:'div', cls:'title', children:[ | 131 | {tag:'div', cls:'title', children:[ |
135 | {tag:'h3', id:this.getId('title'), html:"Create new user"} | 132 | {tag:'h3', id:this.getId('title'), html:"Create new user"} |
136 | ]} | 133 | ]} |
137 | ]}, | 134 | ]}, |
138 | {tag:'div', id:this.getId('body'), cls:'body', children:[ | 135 | {tag:'div', id:this.getId('body'), cls:'body', children:[ |
139 | {tag:'div', cls:'tabContainer', children:[ | 136 | {tag:'div', cls:'tabContainer', children:[ |
140 | {tag:'ul', cls:'tabs', children:[ | 137 | {tag:'ul', cls:'tabs', children:[ |
141 | {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, | 138 | {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, |
142 | {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, | 139 | {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, |
143 | {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, | 140 | {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, |
144 | {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, | 141 | {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, |
145 | // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, | 142 | // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, |
146 | ]}, | 143 | ]}, |
147 | {tag:'ul', cls:'tabPanels', children:[ | 144 | {tag:'ul', cls:'tabPanels', children:[ |
148 | {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ | 145 | {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ |
149 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, | 146 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, |
150 | {tag:'ul', cls:'credentials', children:[ | 147 | {tag:'ul', cls:'credentials', children:[ |
151 | {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, | 148 | {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, |
152 | {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} | 149 | {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} |
153 | ]} | 150 | ]} |
154 | ]}, | 151 | ]}, |
155 | {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ | 152 | {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ |
156 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, | 153 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, |
157 | {tag:'ul', cls:'credentials', children:[ | 154 | {tag:'ul', cls:'credentials', children:[ |
158 | {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} | 155 | {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} |
159 | ]} | 156 | ]} |
160 | ]}, | 157 | ]}, |
161 | {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ | 158 | {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ |
162 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, | 159 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, |
163 | {tag:'ul', cls:'termsOfService', children:[ | 160 | {tag:'ul', cls:'termsOfService', children:[ |
164 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('awareOfUnrecoverablePassphrase')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('awareOfUnrecoverablePassphrase'), html:"I understand that Clipperz will not be able to recover a lost passphrase."}]}, | 161 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('awareOfUnrecoverablePassphrase')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('awareOfUnrecoverablePassphrase'), html:"I understand that Clipperz will not be able to recover a lost passphrase."}]}, |
165 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('readTermsOfService')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('readTermsOfService'), htmlString:"I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>."}]} | 162 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('readTermsOfService')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('readTermsOfService'), htmlString:"I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>."}]} |
166 | ]} | 163 | ]} |
167 | ]}, | 164 | ]}, |
168 | {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ | 165 | {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ |
169 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, | 166 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, |
170 | {tag:'ul', cls:'createUserStates', children:[ | 167 | {tag:'ul', cls:'createUserStates', children:[ |
171 | {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, | 168 | {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, |
172 | {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, | 169 | {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, |
173 | {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} | 170 | {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} |
174 | ]} | 171 | ]} |
175 | ]}//, | 172 | ]}//, |
176 | // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ | 173 | // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ |
177 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, | 174 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, |
178 | // ]} | 175 | // ]} |
179 | ]} | 176 | ]} |
180 | ]} | 177 | ]} |
181 | ]}, | 178 | ]}, |
182 | {tag:'div', id:this.getId('footer'), cls:'footer', children:[ | 179 | {tag:'div', id:this.getId('footer'), cls:'footer', children:[ |
183 | {tag:'div', cls:'buttonArea', children:[ | 180 | {tag:'div', cls:'buttonArea', children:[ |
184 | // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, | 181 | // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, |
185 | // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} | 182 | // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} |
186 | ]} | 183 | ]} |
187 | ]} | 184 | ]} |
188 | ]}, | 185 | ]}, |
189 | {tag:'div', cls:'clear'} | 186 | {tag:'div', cls:'clear'} |
190 | ]}); | 187 | ]}); |
191 | 188 | ||
192 | this.tabPanelController().setup(); | 189 | this.tabPanelController().setup(); |
193 | // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); | 190 | // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); |
194 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); | 191 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); |
195 | MochiKit.Signal.connect(this.getId('awareOfUnrecoverablePassphrase'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); | 192 | MochiKit.Signal.connect(this.getId('awareOfUnrecoverablePassphrase'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); |
196 | MochiKit.Signal.connect(this.getId('readTermsOfService'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); | 193 | MochiKit.Signal.connect(this.getId('readTermsOfService'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); |
197 | }, | 194 | }, |
198 | 195 | ||
199 | //------------------------------------------------------------------------- | 196 | //------------------------------------------------------------------------- |
200 | /* | 197 | /* |
201 | 'resetContent': function () { | 198 | 'resetContent': function () { |
202 | this.getElement('username').value = ''; | 199 | this.getElement('username').value = ''; |
203 | this.getElement('passphrase').value = ''; | 200 | this.getElement('passphrase').value = ''; |
204 | }, | 201 | }, |
205 | */ | 202 | */ |
206 | //------------------------------------------------------------------------- | 203 | //------------------------------------------------------------------------- |
207 | 204 | ||
208 | 'displayElement': function() { | 205 | 'displayElement': function() { |
209 | return this.getElement('panel'); | 206 | return this.getElement('panel'); |
210 | }, | 207 | }, |
211 | 208 | ||
212 | //------------------------------------------------------------------------- | 209 | //------------------------------------------------------------------------- |
213 | 210 | ||
214 | 'handleTabSelected': function (aSelectedTab) { | 211 | 'handleTabSelected': function (aSelectedTab) { |
215 | /* | 212 | /* |
216 | switch (aSelectedTab) { | 213 | switch (aSelectedTab) { |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js index bed6675..3cc5a37 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js | |||
@@ -1,71 +1,68 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.Page = function(args) { | 28 | Clipperz.PM.UI.Web.Components.Page = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._slots = { | 33 | this._slots = { |
37 | 'header':'pageHeader', | 34 | 'header':'pageHeader', |
38 | 'body': 'pageBody', | 35 | 'body': 'pageBody', |
39 | 'footer':'pageFooter' | 36 | 'footer':'pageFooter' |
40 | }; | 37 | }; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.Page component"; | 49 | return "Clipperz.PM.UI.Web.Components.Page component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'renderSelf': function(/*aContainer, aPosition*/) { | 54 | 'renderSelf': function(/*aContainer, aPosition*/) { |
58 | this.append(this.element(), [ | 55 | this.append(this.element(), [ |
59 | {tag:'div', id:'pageHeaderAndBody', cls:'pageHeaderAndBody', children:[ | 56 | {tag:'div', id:'pageHeaderAndBody', cls:'pageHeaderAndBody', children:[ |
60 | {tag:'div', id:'pageHeader', cls:'pageHeader'}, | 57 | {tag:'div', id:'pageHeader', cls:'pageHeader'}, |
61 | {tag:'div', id:'pageBody', cls:'pageBody'} | 58 | {tag:'div', id:'pageBody', cls:'pageBody'} |
62 | ]}, | 59 | ]}, |
63 | {tag:'div', id:'pageFooter', cls:'pageFooter'} | 60 | {tag:'div', id:'pageFooter', cls:'pageFooter'} |
64 | ]); | 61 | ]); |
65 | 62 | ||
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | __syntaxFix__: "syntax fix" | 67 | __syntaxFix__: "syntax fix" |
71 | }); | 68 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js index 11135d8..5e8cd7f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js | |||
@@ -1,71 +1,68 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.PageFooter = function(args) { | 28 | Clipperz.PM.UI.Web.Components.PageFooter = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | return this; | 33 | return this; |
37 | } | 34 | } |
38 | 35 | ||
39 | //============================================================================= | 36 | //============================================================================= |
40 | 37 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return "Clipperz.PM.UI.Web.Components.PageFooter component"; | 43 | return "Clipperz.PM.UI.Web.Components.PageFooter component"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'renderSelf': function(/*aContainer, aPosition*/) { | 48 | 'renderSelf': function(/*aContainer, aPosition*/) { |
52 | this.append(this.element(), [ | 49 | this.append(this.element(), [ |
53 | {tag:'div', cls:'footerWrapper', children:[ | 50 | {tag:'div', cls:'footerWrapper', children:[ |
54 | {tag:'div', cls:'footerContent', children:[ | 51 | {tag:'div', cls:'footerContent', children:[ |
55 | // {tag:'div', cls:'footerStarIcon'}, | 52 | // {tag:'div', cls:'footerStarIcon'}, |
56 | {tag:'canvas', id:this.getId('footerStarIcon'), cls:'footerStarIcon'}, | 53 | {tag:'canvas', id:this.getId('footerStarIcon'), cls:'footerStarIcon'}, |
57 | {tag:'span', cls:'copyright', html:'Copyright © 2009 Clipperz Srl'}, | 54 | {tag:'span', cls:'copyright', html:'Copyright © 2009 Clipperz Srl'}, |
58 | {tag:'a', href:'http://www.clipperz.com/terms_of_service',target:'_blank', html:'terms of service'}, | 55 | {tag:'a', href:'http://www.clipperz.com/terms_of_service',target:'_blank', html:'terms of service'}, |
59 | {tag:'a', href:'http://www.clipperz.com/privacy_policy',target:'_blank', html:'privacy policy'}, | 56 | {tag:'a', href:'http://www.clipperz.com/privacy_policy',target:'_blank', html:'privacy policy'}, |
60 | {tag:'span', cls:'applicationVersion', html:'application version: [1992]'} | 57 | {tag:'span', cls:'applicationVersion', html:'application version: [1992]'} |
61 | ]} | 58 | ]} |
62 | ]} | 59 | ]} |
63 | ]); | 60 | ]); |
64 | 61 | ||
65 | Clipperz.PM.UI.Canvas.star.normal(this.getElement('footerStarIcon'), "#7e7e7e"); | 62 | Clipperz.PM.UI.Canvas.star.normal(this.getElement('footerStarIcon'), "#7e7e7e"); |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | __syntaxFix__: "syntax fix" | 67 | __syntaxFix__: "syntax fix" |
71 | }); | 68 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js index 3924434..bce8395 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js | |||
@@ -1,184 +1,181 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { | 28 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); |
35 | this._newsIsOpen = args.newsIsOpen || false; | 32 | this._newsIsOpen = args.newsIsOpen || false; |
36 | this._animationDuration = args.animationDuration || 0.5; | 33 | this._animationDuration = args.animationDuration || 0.5; |
37 | 34 | ||
38 | this._offset = 82; | 35 | this._offset = 82; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; | 47 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'iframeURL': function () { | 52 | 'iframeURL': function () { |
56 | // return './rss_view.html'; | 53 | // return './rss_view.html'; |
57 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; | 54 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'renderSelf': function(/*aContainer, aPosition*/) { | 59 | 'renderSelf': function(/*aContainer, aPosition*/) { |
63 | this.append(this.element(), [ | 60 | this.append(this.element(), [ |
64 | {tag:'div', id:'miscLinks', children:[ | 61 | {tag:'div', id:'miscLinks', children:[ |
65 | {tag:'ul', children:[ | 62 | {tag:'ul', children:[ |
66 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, | 63 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, |
67 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, | 64 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, |
68 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, | 65 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, |
69 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, | 66 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, |
70 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} | 67 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} |
71 | ]} | 68 | ]} |
72 | ]}, | 69 | ]}, |
73 | {tag:'div', id:'logoFrame', children:[ | 70 | {tag:'div', id:'logoFrame', children:[ |
74 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[{tag:'div', id:'logo'}]}, | 71 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[{tag:'div', id:'logo'}]}, |
75 | {tag:'h5', cls:'clipperzPayoff', html:'keep it to yourself!'} | 72 | {tag:'h5', cls:'clipperzPayoff', html:'keep it to yourself!'} |
76 | ]}, | 73 | ]}, |
77 | {tag:'div', id:'news', cls:'hidden', children:[ | 74 | {tag:'div', id:'news', cls:'hidden', children:[ |
78 | // {tag:'div', cls:'close', children:[ | 75 | // {tag:'div', cls:'close', children:[ |
79 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} | 76 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} |
80 | // ]}, | 77 | // ]}, |
81 | {tag:'div', id:'newsframe', children:[ | 78 | {tag:'div', id:'newsframe', children:[ |
82 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} | 79 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} |
83 | ]}, | 80 | ]}, |
84 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[]} | 81 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[]} |
85 | ]}, | 82 | ]}, |
86 | {tag:'div', id:'featureTabs', children:[ | 83 | {tag:'div', id:'featureTabs', children:[ |
87 | {tag:'table', children:[{tag:'tr', children:[ | 84 | {tag:'table', children:[{tag:'tr', children:[ |
88 | {tag:'td', children:[{tag:'div', id:'feature_store', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('storeIcon')}, {tag:'span', html:"Store and manage your password and online credentials"}]}]}, | 85 | {tag:'td', children:[{tag:'div', id:'feature_store', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('storeIcon')}, {tag:'span', html:"Store and manage your password and online credentials"}]}]}, |
89 | {tag:'td', children:[{tag:'div', id:'feature_protect', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('protectIcon')}, {tag:'span', html:"Protect all your sensitive data"}]}]}, | 86 | {tag:'td', children:[{tag:'div', id:'feature_protect', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('protectIcon')}, {tag:'span', html:"Protect all your sensitive data"}]}]}, |
90 | {tag:'td', children:[{tag:'div', id:'feature_directLogin', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('directLoginIcon')},{tag:'span', html:"Login to your web services without entering any username or password"}]}]}, | 87 | {tag:'td', children:[{tag:'div', id:'feature_directLogin', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('directLoginIcon')},{tag:'span', html:"Login to your web services without entering any username or password"}]}]}, |
91 | {tag:'td', children:[{tag:'div', id:'feature_share', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('shareIcon')}, {tag:'span', html:"Share secret with family members and associates"}]}]} | 88 | {tag:'td', children:[{tag:'div', id:'feature_share', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('shareIcon')}, {tag:'span', html:"Share secret with family members and associates"}]}]} |
92 | ]}]} | 89 | ]}]} |
93 | ]} | 90 | ]} |
94 | ]); | 91 | ]); |
95 | 92 | ||
96 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); | 93 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); |
97 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); | 94 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); |
98 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); | 95 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); |
99 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); | 96 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); |
100 | 97 | ||
101 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); | 98 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); |
102 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 99 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
103 | }, | 100 | }, |
104 | 101 | ||
105 | //------------------------------------------------------------------------- | 102 | //------------------------------------------------------------------------- |
106 | 103 | ||
107 | 'switchToLoggedMode': function() { | 104 | 'switchToLoggedMode': function() { |
108 | // MochiKit.Style.addElementClass(this.element(), 'logged'); | 105 | // MochiKit.Style.addElementClass(this.element(), 'logged'); |
109 | MochiKit.Style.hideElement('featureTabs'); | 106 | MochiKit.Style.hideElement('featureTabs'); |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'animationDuration': function () { | 111 | 'animationDuration': function () { |
115 | return this._animationDuration; | 112 | return this._animationDuration; |
116 | }, | 113 | }, |
117 | 114 | ||
118 | 'offset': function () { | 115 | 'offset': function () { |
119 | return this._offset; | 116 | return this._offset; |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //------------------------------------------------------------------------- | 119 | //------------------------------------------------------------------------- |
123 | 120 | ||
124 | 'isNewsOpen': function () { | 121 | 'isNewsOpen': function () { |
125 | return this._newsIsOpen; | 122 | return this._newsIsOpen; |
126 | }, | 123 | }, |
127 | 124 | ||
128 | 'toggleNewsIsOpen': function () { | 125 | 'toggleNewsIsOpen': function () { |
129 | this._newsIsOpen = !this._newsIsOpen; | 126 | this._newsIsOpen = !this._newsIsOpen; |
130 | }, | 127 | }, |
131 | 128 | ||
132 | 'toggleTips': function(anEvent) { | 129 | 'toggleTips': function(anEvent) { |
133 | anEvent.preventDefault(); | 130 | anEvent.preventDefault(); |
134 | 131 | ||
135 | if (this.isNewsOpen() == true) { | 132 | if (this.isNewsOpen() == true) { |
136 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 133 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
137 | x: 0, | 134 | x: 0, |
138 | y: -this.offset(), | 135 | y: -this.offset(), |
139 | mode: 'relative', | 136 | mode: 'relative', |
140 | duration: this.animationDuration(), | 137 | duration: this.animationDuration(), |
141 | beforeStart: function () { | 138 | beforeStart: function () { |
142 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); | 139 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); |
143 | }, | 140 | }, |
144 | afterFinish: function () { | 141 | afterFinish: function () { |
145 | Clipperz.DOM.get('newsframe').innerHTML = ""; | 142 | Clipperz.DOM.get('newsframe').innerHTML = ""; |
146 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); | 143 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); |
147 | } | 144 | } |
148 | }) | 145 | }) |
149 | this.toggleNewsIsOpen(); | 146 | this.toggleNewsIsOpen(); |
150 | } else { | 147 | } else { |
151 | MochiKit.DOM.addElementClass('newsframe', 'loading'); | 148 | MochiKit.DOM.addElementClass('newsframe', 'loading'); |
152 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 149 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
153 | x: 0, | 150 | x: 0, |
154 | y: this.offset(), | 151 | y: this.offset(), |
155 | mode: 'relative', | 152 | mode: 'relative', |
156 | duration: this.animationDuration(), | 153 | duration: this.animationDuration(), |
157 | beforeStart: MochiKit.Base.bind(function () { | 154 | beforeStart: MochiKit.Base.bind(function () { |
158 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); | 155 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); |
159 | 156 | ||
160 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 157 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
161 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); | 158 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); |
162 | }, this), | 159 | }, this), |
163 | afterFinish: function () { | 160 | afterFinish: function () { |
164 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); | 161 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); |
165 | } | 162 | } |
166 | }) | 163 | }) |
167 | this.toggleNewsIsOpen(); | 164 | this.toggleNewsIsOpen(); |
168 | } | 165 | } |
169 | }, | 166 | }, |
170 | 167 | ||
171 | //------------------------------------------------------------------------- | 168 | //------------------------------------------------------------------------- |
172 | 169 | ||
173 | 'handleIframeDidLoad': function (anEvent) { | 170 | 'handleIframeDidLoad': function (anEvent) { |
174 | if (this.isNewsOpen() == false) { | 171 | if (this.isNewsOpen() == false) { |
175 | this.toggleTips(anEvent); | 172 | this.toggleTips(anEvent); |
176 | } | 173 | } |
177 | 174 | ||
178 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); | 175 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); |
179 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); | 176 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //------------------------------------------------------------------------- | 179 | //------------------------------------------------------------------------- |
183 | __syntaxFix__: "syntax fix" | 180 | __syntaxFix__: "syntax fix" |
184 | }); | 181 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js index 79c8d4f..987e51e 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js | |||
@@ -1,164 +1,161 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { | 28 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | 35 | ||
39 | this._boxDimensions = null; | 36 | this._boxDimensions = null; |
40 | this._isVisible = false; | 37 | this._isVisible = false; |
41 | 38 | ||
42 | this.renderSelf(); | 39 | this.renderSelf(); |
43 | 40 | ||
44 | return this; | 41 | return this; |
45 | } | 42 | } |
46 | 43 | ||
47 | //============================================================================= | 44 | //============================================================================= |
48 | 45 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | 46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'toString': function () { | 50 | 'toString': function () { |
54 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; | 51 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
58 | 55 | ||
59 | 'referenceElement': function () { | 56 | 'referenceElement': function () { |
60 | return this._referenceElement; | 57 | return this._referenceElement; |
61 | }, | 58 | }, |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'text': function () { | 62 | 'text': function () { |
66 | return this._text; | 63 | return this._text; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | 'setText': function (aValue) { | 66 | 'setText': function (aValue) { |
70 | this._text = aValue; | 67 | this._text = aValue; |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'isVisible': function () { | 72 | 'isVisible': function () { |
76 | return this._isVisible; | 73 | return this._isVisible; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'setIsVisible': function (aValue) { | 76 | 'setIsVisible': function (aValue) { |
80 | this._isVisible = aValue; | 77 | this._isVisible = aValue; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | 81 | ||
85 | 'renderSelf': function() { | 82 | 'renderSelf': function() { |
86 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ | 83 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ |
87 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ | 84 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ |
88 | {tag:'div', cls:'passwordTooltip_text', children:[ | 85 | {tag:'div', cls:'passwordTooltip_text', children:[ |
89 | {tag:'span', html:this.text()} | 86 | {tag:'span', html:this.text()} |
90 | ]}, | 87 | ]}, |
91 | {tag:'div', id:this.getId('footer'), cls:'passwordTooltip_footer'} | 88 | {tag:'div', id:this.getId('footer'), cls:'passwordTooltip_footer'} |
92 | ]}, | 89 | ]}, |
93 | {tag:'div', id:this.getId('arrow'), cls:'passwordTooltip_arrow'} | 90 | {tag:'div', id:this.getId('arrow'), cls:'passwordTooltip_arrow'} |
94 | ]}); | 91 | ]}); |
95 | 92 | ||
96 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 93 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
97 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 94 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
98 | 95 | ||
99 | MochiKit.Style.hideElement(this.displayElement()); | 96 | MochiKit.Style.hideElement(this.displayElement()); |
100 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 97 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
101 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 98 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //----------------------------------------------------- | 101 | //----------------------------------------------------- |
105 | 102 | ||
106 | 'displayElement': function() { | 103 | 'displayElement': function() { |
107 | return this.getElement('tooltip'); | 104 | return this.getElement('tooltip'); |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //------------------------------------------------------------------------- | 107 | //------------------------------------------------------------------------- |
111 | 108 | ||
112 | 'boxDimensions': function () { | 109 | 'boxDimensions': function () { |
113 | return this._boxDimensions; | 110 | return this._boxDimensions; |
114 | }, | 111 | }, |
115 | 112 | ||
116 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
117 | 114 | ||
118 | 'show': function () { | 115 | 'show': function () { |
119 | var elementSizeAndPosition; | 116 | var elementSizeAndPosition; |
120 | var arrowPosition; | 117 | var arrowPosition; |
121 | var bodyPosition; | 118 | var bodyPosition; |
122 | 119 | ||
123 | if (this.isVisible() == false) { | 120 | if (this.isVisible() == false) { |
124 | arrowPosition = {}; | 121 | arrowPosition = {}; |
125 | bodyPosition = {}; | 122 | bodyPosition = {}; |
126 | 123 | ||
127 | this.setIsVisible(true); | 124 | this.setIsVisible(true); |
128 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | 125 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); |
129 | 126 | ||
130 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 127 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
131 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 128 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
132 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | 129 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; |
133 | 130 | ||
134 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 131 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
135 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | 132 | arrowPosition.y = elementSizeAndPosition.position.y - 13; |
136 | 133 | ||
137 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | 134 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); |
138 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | 135 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); |
139 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | 136 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); |
140 | } | 137 | } |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'hide': function () { | 140 | 'hide': function () { |
144 | if (this.isVisible() == true) { | 141 | if (this.isVisible() == true) { |
145 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | 142 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); |
146 | this.setIsVisible(false); | 143 | this.setIsVisible(false); |
147 | } | 144 | } |
148 | }, | 145 | }, |
149 | 146 | ||
150 | //------------------------------------------------------------------------- | 147 | //------------------------------------------------------------------------- |
151 | /* | 148 | /* |
152 | 'shouldRemoveElementWhenClearningUp': function () { | 149 | 'shouldRemoveElementWhenClearningUp': function () { |
153 | return false; | 150 | return false; |
154 | }, | 151 | }, |
155 | */ | 152 | */ |
156 | //------------------------------------------------------------------------- | 153 | //------------------------------------------------------------------------- |
157 | __syntaxFix__: "syntax fix" | 154 | __syntaxFix__: "syntax fix" |
158 | }); | 155 | }); |
159 | 156 | ||
160 | Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips = function () { | 157 | Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips = function () { |
161 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Web_Components_PasswordTooltip_wrapperNode'}); | 158 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Web_Components_PasswordTooltip_wrapperNode'}); |
162 | } | 159 | } |
163 | 160 | ||
164 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips); | 161 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js index ab8a38c..69c1ede 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); | 30 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); |
34 | 31 | ||
35 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); |
36 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._steps = args.steps; | 34 | this._steps = args.steps; |
38 | 35 | ||
39 | this._currentStep = -1; | 36 | this._currentStep = -1; |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | //============================================================================= | 41 | //============================================================================= |
45 | 42 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 43 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 44 | ||
48 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
49 | 46 | ||
50 | 'toString': function () { | 47 | 'toString': function () { |
51 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; | 48 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; |
52 | }, | 49 | }, |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'resetStatus': function (args) { | 53 | 'resetStatus': function (args) { |
57 | args = args || {}; | 54 | args = args || {}; |
58 | 55 | ||
59 | if (this.currentStep() != 0) { | 56 | if (this.currentStep() != 0) { |
60 | var shouldAnimateTransition; | 57 | var shouldAnimateTransition; |
61 | 58 | ||
62 | shouldAnimateTransition = args.animateTransition || false; | 59 | shouldAnimateTransition = args.animateTransition || false; |
63 | 60 | ||
64 | if (shouldAnimateTransition) { | 61 | if (shouldAnimateTransition) { |
65 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); | 62 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); |
66 | } else { | 63 | } else { |
67 | this._currentStep = 0; | 64 | this._currentStep = 0; |
68 | this.cursorMoved(); | 65 | this.cursorMoved(); |
69 | } | 66 | } |
70 | } | 67 | } |
71 | }, | 68 | }, |
72 | 69 | ||
73 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
74 | 71 | ||
75 | 'translationContext': function () { | 72 | 'translationContext': function () { |
76 | return this._translationContext; | 73 | return this._translationContext; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'steps': function () { | 76 | 'steps': function () { |
80 | return this._steps; | 77 | return this._steps; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | 'setSteps': function (aValue) { | 80 | 'setSteps': function (aValue) { |
84 | this._steps = aValue; | 81 | this._steps = aValue; |
85 | this.renderStepsComponents(); | 82 | this.renderStepsComponents(); |
86 | this.resetStatus(); | 83 | this.resetStatus(); |
87 | }, | 84 | }, |
88 | 85 | ||
89 | 'translatedStepDescription': function (aStep) { | 86 | 'translatedStepDescription': function (aStep) { |
90 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); | 87 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); |
91 | }, | 88 | }, |
92 | 89 | ||
93 | //------------------------------------------------------------------------- | 90 | //------------------------------------------------------------------------- |
94 | 91 | ||
95 | 'renderSelf': function(/*aContainer, aPosition*/) { | 92 | 'renderSelf': function(/*aContainer, aPosition*/) { |
96 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ | 93 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ |
97 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ | 94 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ |
98 | {tag:'div', cls:'ruler', children:[ | 95 | {tag:'div', cls:'ruler', children:[ |
99 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, | 96 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, |
100 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, | 97 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, |
101 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, | 98 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, |
102 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ | 99 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ |
103 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, | 100 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, |
104 | {tag:'div', cls:'markerBody'}, | 101 | {tag:'div', cls:'markerBody'}, |
105 | {tag:'div', cls:'next', id:this.getId('nextButton')} | 102 | {tag:'div', cls:'next', id:this.getId('nextButton')} |
106 | ]}, | 103 | ]}, |
107 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, | 104 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, |
108 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ | 105 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ |
109 | // {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map(MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), this.steps())} | 106 | // {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map(MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), this.steps())} |
110 | // ]}, | 107 | // ]}, |
111 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} | 108 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} |
112 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ | 109 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ |
113 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} | 110 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} |
114 | // ]} | 111 | // ]} |
115 | ]} | 112 | ]} |
116 | ]} | 113 | ]} |
117 | ])); | 114 | ])); |
118 | //console.log("ELEMENT", this.element()); | 115 | //console.log("ELEMENT", this.element()); |
119 | 116 | ||
120 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); | 117 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); |
121 | 118 | ||
122 | MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); | 119 | MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); |
123 | MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); | 120 | MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); |
124 | 121 | ||
125 | MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); | 122 | MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); |
126 | MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); | 123 | MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); |
127 | 124 | ||
128 | this.enablePrevious(false); | 125 | this.enablePrevious(false); |
129 | this.enableNext(false); | 126 | this.enableNext(false); |
130 | 127 | ||
131 | // this.cursorMoved(); | 128 | // this.cursorMoved(); |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //......................................................................... | 131 | //......................................................................... |
135 | 132 | ||
136 | 'renderStepsComponents': function () { | 133 | 'renderStepsComponents': function () { |
137 | varstepsFrame; | 134 | varstepsFrame; |
138 | var dotsFrame; | 135 | var dotsFrame; |
139 | 136 | ||
140 | stepsFrames = this.getElement('stepsFrame'); | 137 | stepsFrames = this.getElement('stepsFrame'); |
141 | MochiKit.DOM.setElementClass(stepsFrames, 'steps'); | 138 | MochiKit.DOM.setElementClass(stepsFrames, 'steps'); |
142 | MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); | 139 | MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); |
143 | 140 | ||
144 | stepsFrames.innerHTML = ""; | 141 | stepsFrames.innerHTML = ""; |
145 | this.append(stepsFrames, {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map( | 142 | this.append(stepsFrames, {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map( |
146 | MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), | 143 | MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), |
147 | this.steps())} | 144 | this.steps())} |
148 | ); | 145 | ); |
149 | 146 | ||
150 | dotsFrames = this.getElement('dotsFrame'); | 147 | dotsFrames = this.getElement('dotsFrame'); |
151 | MochiKit.DOM.setElementClass(dotsFrames, 'dots'); | 148 | MochiKit.DOM.setElementClass(dotsFrames, 'dots'); |
152 | MochiKit.DOM.addElementClass(dotsFrames, 'steps_' + this.steps().length); | 149 | MochiKit.DOM.addElementClass(dotsFrames, 'steps_' + this.steps().length); |
153 | 150 | ||
154 | dotsFrames.innerHTML = ""; | 151 | dotsFrames.innerHTML = ""; |
155 | this.append(dotsFrames, {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map( | 152 | this.append(dotsFrames, {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map( |
156 | function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}; }, | 153 | function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}; }, |
157 | this.steps())} | 154 | this.steps())} |
158 | ); | 155 | ); |
159 | }, | 156 | }, |
160 | 157 | ||
161 | //------------------------------------------------------------------------- | 158 | //------------------------------------------------------------------------- |
162 | 159 | ||
163 | 'handleExit': function (anEvent) { | 160 | 'handleExit': function (anEvent) { |
164 | anEvent.preventDefault(); | 161 | anEvent.preventDefault(); |
165 | 162 | ||
166 | MochiKit.Signal.signal(this, 'exit'); | 163 | MochiKit.Signal.signal(this, 'exit'); |
167 | }, | 164 | }, |
168 | 165 | ||
169 | //------------------------------------------------------------------------- | 166 | //------------------------------------------------------------------------- |
170 | 167 | ||
171 | 'handlePrevious': function (anEvent) { | 168 | 'handlePrevious': function (anEvent) { |
172 | anEvent.preventDefault(); | 169 | anEvent.preventDefault(); |
173 | 170 | ||
174 | // if (!MochiKit.DOM.hasElementClass(this.getElement('previousButton'), 'disabled')) { | 171 | // if (!MochiKit.DOM.hasElementClass(this.getElement('previousButton'), 'disabled')) { |
175 | // this.moveBackward(); | 172 | // this.moveBackward(); |
176 | // } | 173 | // } |
177 | 174 | ||
178 | MochiKit.Signal.signal(this, 'moveBackward'); | 175 | MochiKit.Signal.signal(this, 'moveBackward'); |
179 | }, | 176 | }, |
180 | 177 | ||
181 | 'handleNext': function (anEvent) { | 178 | 'handleNext': function (anEvent) { |
182 | anEvent.preventDefault(); | 179 | anEvent.preventDefault(); |
183 | 180 | ||
184 | // if (!MochiKit.DOM.hasElementClass(this.getElement('nextButton'), 'disabled')) { | 181 | // if (!MochiKit.DOM.hasElementClass(this.getElement('nextButton'), 'disabled')) { |
185 | // this.moveForward(); | 182 | // this.moveForward(); |
186 | // } | 183 | // } |
187 | 184 | ||
188 | MochiKit.Signal.signal(this, 'moveForward'); | 185 | MochiKit.Signal.signal(this, 'moveForward'); |
189 | }, | 186 | }, |
190 | 187 | ||
191 | //------------------------------------------------------------------------- | 188 | //------------------------------------------------------------------------- |
192 | 189 | ||
193 | 'currentStep': function () { | 190 | 'currentStep': function () { |
194 | return this._currentStep; | 191 | return this._currentStep; |
195 | }, | 192 | }, |
196 | 193 | ||
197 | 'markerInitialOffset': function () { | 194 | 'markerInitialOffset': function () { |
198 | return -246; | 195 | return -246; |
199 | }, | 196 | }, |
200 | 197 | ||
201 | 'markerStepOffset': function () { | 198 | 'markerStepOffset': function () { |
202 | return 410 / (this.steps().length - 1); | 199 | return 410 / (this.steps().length - 1); |
203 | // return 100; | 200 | // return 100; |
204 | }, | 201 | }, |
205 | 202 | ||
206 | //------------------------------------------------------------------------- | 203 | //------------------------------------------------------------------------- |
207 | 204 | ||
208 | 'moveToFirstStep': function (aCallback) { | 205 | 'moveToFirstStep': function (aCallback) { |
209 | varstepsToMove; | 206 | varstepsToMove; |
210 | 207 | ||
211 | stepsToMove = this._currentStep; | 208 | stepsToMove = this._currentStep; |
212 | this._currentStep = 0; | 209 | this._currentStep = 0; |
213 | 210 | ||
214 | this.enablePrevious(false); | 211 | this.enablePrevious(false); |
215 | this.enableNext(false); | 212 | this.enableNext(false); |
216 | // MochiKit.Signal.signal(this, 'moveBackward'); | 213 | // MochiKit.Signal.signal(this, 'moveBackward'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js index 39a1ccb..666afe9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js | |||
@@ -1,193 +1,190 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { | 28 | Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); |
34 | 31 | ||
35 | this._element = args.element || null; | 32 | this._element = args.element || null; |
36 | 33 | ||
37 | this._slots = { | 34 | this._slots = { |
38 | }; | 35 | }; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.TabSidePanel component"; | 47 | return "Clipperz.PM.UI.Web.Components.TabSidePanel component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'deselectAllTabs': function() { | 52 | 'deselectAllTabs': function() { |
56 | var tabListItems; | 53 | var tabListItems; |
57 | 54 | ||
58 | tabListItems = [ | 55 | tabListItems = [ |
59 | 'cardsLI', | 56 | 'cardsLI', |
60 | // 'directLoginLI', | 57 | // 'directLoginLI', |
61 | 'accountLI', | 58 | 'accountLI', |
62 | 'dataLI', | 59 | 'dataLI', |
63 | 'toolsLI' | 60 | 'toolsLI' |
64 | ]; | 61 | ]; |
65 | 62 | ||
66 | //Clipperz.log("=== TabSidePanel.tabSelected anEvent.src().id", anEvent.src().id); | 63 | //Clipperz.log("=== TabSidePanel.tabSelected anEvent.src().id", anEvent.src().id); |
67 | for (var i in tabListItems) { | 64 | for (var i in tabListItems) { |
68 | //Clipperz.log("=== TabSidePanel.tabSelected aTabListItem", tabListItems[i]); | 65 | //Clipperz.log("=== TabSidePanel.tabSelected aTabListItem", tabListItems[i]); |
69 | MochiKit.DOM.removeElementClass(this.getId(tabListItems[i]), 'selected'); | 66 | MochiKit.DOM.removeElementClass(this.getId(tabListItems[i]), 'selected'); |
70 | } | 67 | } |
71 | }, | 68 | }, |
72 | 69 | ||
73 | 'selectTab': function(aTabName) { | 70 | 'selectTab': function(aTabName) { |
74 | this.deselectAllTabs(); | 71 | this.deselectAllTabs(); |
75 | MochiKit.DOM.addElementClass(this.getId(this.listItemIdForTabNamed(aTabName)), 'selected'); | 72 | MochiKit.DOM.addElementClass(this.getId(this.listItemIdForTabNamed(aTabName)), 'selected'); |
76 | MochiKit.Signal.signal(this, 'tabSelected', aTabName); | 73 | MochiKit.Signal.signal(this, 'tabSelected', aTabName); |
77 | }, | 74 | }, |
78 | 75 | ||
79 | 'tabNameForAnchorId': function(anId) { | 76 | 'tabNameForAnchorId': function(anId) { |
80 | var result; | 77 | var result; |
81 | 78 | ||
82 | switch(anId) { | 79 | switch(anId) { |
83 | case 'cards_tabSidePanel': | 80 | case 'cards_tabSidePanel': |
84 | result = 'cards'; | 81 | result = 'cards'; |
85 | break; | 82 | break; |
86 | // case 'directLogins_tabSidePanel': | 83 | // case 'directLogins_tabSidePanel': |
87 | // result = 'directLogins'; | 84 | // result = 'directLogins'; |
88 | // break; | 85 | // break; |
89 | case 'account_tabSidePanel': | 86 | case 'account_tabSidePanel': |
90 | result = 'account'; | 87 | result = 'account'; |
91 | break; | 88 | break; |
92 | case 'data_tabSidePanel': | 89 | case 'data_tabSidePanel': |
93 | result = 'data'; | 90 | result = 'data'; |
94 | break; | 91 | break; |
95 | case 'tools_tabSidePanel': | 92 | case 'tools_tabSidePanel': |
96 | result = 'tools'; | 93 | result = 'tools'; |
97 | break; | 94 | break; |
98 | } | 95 | } |
99 | 96 | ||
100 | return result; | 97 | return result; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | 'listItemIdForTabNamed': function(aTabName) { | 100 | 'listItemIdForTabNamed': function(aTabName) { |
104 | var result; | 101 | var result; |
105 | 102 | ||
106 | switch (aTabName) { | 103 | switch (aTabName) { |
107 | case 'cards': | 104 | case 'cards': |
108 | result = 'cardsLI'; | 105 | result = 'cardsLI'; |
109 | break; | 106 | break; |
110 | // case 'directLogins': | 107 | // case 'directLogins': |
111 | // result = 'directLoginLI'; | 108 | // result = 'directLoginLI'; |
112 | // break; | 109 | // break; |
113 | case 'account': | 110 | case 'account': |
114 | result = 'accountLI'; | 111 | result = 'accountLI'; |
115 | break; | 112 | break; |
116 | case 'data': | 113 | case 'data': |
117 | result = 'dataLI'; | 114 | result = 'dataLI'; |
118 | break; | 115 | break; |
119 | case 'tools': | 116 | case 'tools': |
120 | result = 'toolsLI'; | 117 | result = 'toolsLI'; |
121 | break; | 118 | break; |
122 | } | 119 | } |
123 | 120 | ||
124 | return result; | 121 | return result; |
125 | }, | 122 | }, |
126 | 123 | ||
127 | 'tabSelected': function (anEvent) { | 124 | 'tabSelected': function (anEvent) { |
128 | this.selectTab(this.tabNameForAnchorId(anEvent.src().id)); | 125 | this.selectTab(this.tabNameForAnchorId(anEvent.src().id)); |
129 | // anEvent.stop(); | 126 | // anEvent.stop(); |
130 | anEvent.preventDefault(); | 127 | anEvent.preventDefault(); |
131 | }, | 128 | }, |
132 | 129 | ||
133 | //------------------------------------------------------------------------- | 130 | //------------------------------------------------------------------------- |
134 | 131 | ||
135 | 'addCard': function (anEvent) { | 132 | 'addCard': function (anEvent) { |
136 | anEvent.stop(); | 133 | anEvent.stop(); |
137 | MochiKit.Signal.signal(this, 'addCard', anEvent.src()); | 134 | MochiKit.Signal.signal(this, 'addCard', anEvent.src()); |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'renderSelf': function(/*aContainer, aPosition*/) { | 139 | 'renderSelf': function(/*aContainer, aPosition*/) { |
143 | this.append(this.element(), [ | 140 | this.append(this.element(), [ |
144 | {tag:'div', cls:'header'}, | 141 | {tag:'div', cls:'header'}, |
145 | {tag:'div', cls:'body', children:[ | 142 | {tag:'div', cls:'body', children:[ |
146 | {tag:'ul', cls:'mainTabs', children:[ | 143 | {tag:'ul', cls:'mainTabs', children:[ |
147 | {tag:'li', id:this.getId('cardsLI'), cls:'cards', children:[ | 144 | {tag:'li', id:this.getId('cardsLI'), cls:'cards', children:[ |
148 | {tag:'a', id:'cards_tabSidePanel', href:'#', html:"cards"}, | 145 | {tag:'a', id:'cards_tabSidePanel', href:'#', html:"cards"}, |
149 | {tag:'div', cls:'selectionHighlighter', children:[ | 146 | {tag:'div', cls:'selectionHighlighter', children:[ |
150 | {tag:'img', src:'./images/old/main/tabs/selectionHighligher.png'}, | 147 | {tag:'img', src:'./images/old/main/tabs/selectionHighligher.png'}, |
151 | {tag:'a', id:this.getId('addCardA'), cls:'add', href:'#', children:[ | 148 | {tag:'a', id:this.getId('addCardA'), cls:'add', href:'#', children:[ |
152 | {tag:'span', html:"add"}, | 149 | {tag:'span', html:"add"}, |
153 | {tag:'h3', html:"+"} | 150 | {tag:'h3', html:"+"} |
154 | ]} | 151 | ]} |
155 | ]} | 152 | ]} |
156 | ]} | 153 | ]} |
157 | ]}, | 154 | ]}, |
158 | {tag:'ul', cls:'otherTabs', children:[ | 155 | {tag:'ul', cls:'otherTabs', children:[ |
159 | {tag:'li', id:this.getId('accountLI'), children:[ | 156 | {tag:'li', id:this.getId('accountLI'), children:[ |
160 | {tag:'a', id:'account_tabSidePanel', href:'#', html:"account"}, | 157 | {tag:'a', id:'account_tabSidePanel', href:'#', html:"account"}, |
161 | {tag:'div', cls:'selectionHighlighter', children:[ | 158 | {tag:'div', cls:'selectionHighlighter', children:[ |
162 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | 159 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} |
163 | ]} | 160 | ]} |
164 | ]}, | 161 | ]}, |
165 | {tag:'li', id:this.getId('dataLI'), children:[ | 162 | {tag:'li', id:this.getId('dataLI'), children:[ |
166 | {tag:'a', id:'data_tabSidePanel', href:'#', html:"data"}, | 163 | {tag:'a', id:'data_tabSidePanel', href:'#', html:"data"}, |
167 | {tag:'div', cls:'selectionHighlighter', children:[ | 164 | {tag:'div', cls:'selectionHighlighter', children:[ |
168 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | 165 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} |
169 | ]} | 166 | ]} |
170 | ]}, | 167 | ]}, |
171 | {tag:'li', id:this.getId('toolsLI'), children:[ | 168 | {tag:'li', id:this.getId('toolsLI'), children:[ |
172 | {tag:'a', id:'tools_tabSidePanel', href:'#', html:"tools"}, | 169 | {tag:'a', id:'tools_tabSidePanel', href:'#', html:"tools"}, |
173 | {tag:'div', cls:'selectionHighlighter', children:[ | 170 | {tag:'div', cls:'selectionHighlighter', children:[ |
174 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | 171 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} |
175 | ]} | 172 | ]} |
176 | ]} | 173 | ]} |
177 | ]} | 174 | ]} |
178 | ]}, | 175 | ]}, |
179 | {tag:'div', cls:'footer'} | 176 | {tag:'div', cls:'footer'} |
180 | ]); | 177 | ]); |
181 | 178 | ||
182 | MochiKit.Signal.connect('cards_tabSidePanel', 'onclick', this, 'tabSelected'); | 179 | MochiKit.Signal.connect('cards_tabSidePanel', 'onclick', this, 'tabSelected'); |
183 | // MochiKit.Signal.connect('directLogins_tabSidePanel', 'onclick', this, 'tabSelected'); | 180 | // MochiKit.Signal.connect('directLogins_tabSidePanel', 'onclick', this, 'tabSelected'); |
184 | MochiKit.Signal.connect('account_tabSidePanel', 'onclick', this, 'tabSelected'); | 181 | MochiKit.Signal.connect('account_tabSidePanel', 'onclick', this, 'tabSelected'); |
185 | MochiKit.Signal.connect('data_tabSidePanel', 'onclick', this, 'tabSelected'); | 182 | MochiKit.Signal.connect('data_tabSidePanel', 'onclick', this, 'tabSelected'); |
186 | MochiKit.Signal.connect('tools_tabSidePanel', 'onclick', this, 'tabSelected'); | 183 | MochiKit.Signal.connect('tools_tabSidePanel', 'onclick', this, 'tabSelected'); |
187 | MochiKit.Signal.connect(this.getId('addCardA'), 'onclick', this, 'addCard'); | 184 | MochiKit.Signal.connect(this.getId('addCardA'), 'onclick', this, 'addCard'); |
188 | }, | 185 | }, |
189 | 186 | ||
190 | //------------------------------------------------------------------------- | 187 | //------------------------------------------------------------------------- |
191 | 188 | ||
192 | __syntaxFix__: "syntax fix" | 189 | __syntaxFix__: "syntax fix" |
193 | }); | 190 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js index 97e81b4..3dc9ce9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js | |||
@@ -1,53 +1,50 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | return this; | 34 | return this; |
38 | } | 35 | } |
39 | 36 | ||
40 | //============================================================================= | 37 | //============================================================================= |
41 | 38 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
43 | 40 | ||
44 | 'toString': function () { | 41 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | //----------------------------------------------------- | 45 | //----------------------------------------------------- |
49 | 46 | ||
50 | '__syntax_fix__' : 'syntax fix' | 47 | '__syntax_fix__' : 'syntax fix' |
51 | 48 | ||
52 | }); | 49 | }); |
53 | 50 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js index 179c495..3ee6189 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js | |||
@@ -1,113 +1,110 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { | 28 | Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; | 33 | this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; |
37 | this._tabPanelControllerConfiguration = { | 34 | this._tabPanelControllerConfiguration = { |
38 | 'PASSWORD_GENERATOR': { | 35 | 'PASSWORD_GENERATOR': { |
39 | tab:'passwordGeneratorTab', | 36 | tab:'passwordGeneratorTab', |
40 | panel:'passwordGeneratorPanel' | 37 | panel:'passwordGeneratorPanel' |
41 | }, | 38 | }, |
42 | 'BOOKMARKLET': { | 39 | 'BOOKMARKLET': { |
43 | tab:'bookmarkletTab', | 40 | tab:'bookmarkletTab', |
44 | panel:'bookmarkletPanel' | 41 | panel:'bookmarkletPanel' |
45 | }, | 42 | }, |
46 | 'COMPACT_EDITION': { | 43 | 'COMPACT_EDITION': { |
47 | tab:'compactEditionTab', | 44 | tab:'compactEditionTab', |
48 | panel:'compactEditionPanel' | 45 | panel:'compactEditionPanel' |
49 | }, | 46 | }, |
50 | 'HTTP_AUTH': { | 47 | 'HTTP_AUTH': { |
51 | tab:'httpAuthTab', | 48 | tab:'httpAuthTab', |
52 | panel:'httpAuthPanel' | 49 | panel:'httpAuthPanel' |
53 | } | 50 | } |
54 | }; | 51 | }; |
55 | 52 | ||
56 | return this; | 53 | return this; |
57 | } | 54 | } |
58 | 55 | ||
59 | //============================================================================= | 56 | //============================================================================= |
60 | 57 | ||
61 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 58 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'toString': function () { | 62 | 'toString': function () { |
66 | return "Clipperz.PM.UI.Web.Components.ToolsPanel component"; | 63 | return "Clipperz.PM.UI.Web.Components.ToolsPanel component"; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'renderSelf': function(/*aContainer, aPosition*/) { | 68 | 'renderSelf': function(/*aContainer, aPosition*/) { |
72 | this.append(this.element(), [ | 69 | this.append(this.element(), [ |
73 | {tag:'div', cls:'header', children:[ | 70 | {tag:'div', cls:'header', children:[ |
74 | {tag:'div', cls:'subPanelTabs', children:[ | 71 | {tag:'div', cls:'subPanelTabs', children:[ |
75 | {tag:'ul', children:[ | 72 | {tag:'ul', children:[ |
76 | {tag:'li', id:this.getId('passwordGeneratorTab'),children:[{tag:'a', href:'#', html:'Password generator'}], cls:'first'}, | 73 | {tag:'li', id:this.getId('passwordGeneratorTab'),children:[{tag:'a', href:'#', html:'Password generator'}], cls:'first'}, |
77 | {tag:'li', id:this.getId('bookmarkletTab'), children:[{tag:'a', href:'#', html:'Bookmarklet'}]}, | 74 | {tag:'li', id:this.getId('bookmarkletTab'), children:[{tag:'a', href:'#', html:'Bookmarklet'}]}, |
78 | {tag:'li', id:this.getId('compactEditionTab'), children:[{tag:'a', href:'#', html:'Compact edition'}]}, | 75 | {tag:'li', id:this.getId('compactEditionTab'), children:[{tag:'a', href:'#', html:'Compact edition'}]}, |
79 | {tag:'li', id:this.getId('httpAuthTab'), children:[{tag:'a', href:'#', html:'HTTP Auth'}]} | 76 | {tag:'li', id:this.getId('httpAuthTab'), children:[{tag:'a', href:'#', html:'HTTP Auth'}]} |
80 | ]} | 77 | ]} |
81 | ]} | 78 | ]} |
82 | ]}, | 79 | ]}, |
83 | {tag:'div', cls:'body', children:[ | 80 | {tag:'div', cls:'body', children:[ |
84 | {tag:'div', cls:'accountPanel', children:[ | 81 | {tag:'div', cls:'accountPanel', children:[ |
85 | {tag:'div', cls:'subPanelContent', children:[ | 82 | {tag:'div', cls:'subPanelContent', children:[ |
86 | {tag:'ul', children:[ | 83 | {tag:'ul', children:[ |
87 | {tag:'li', id:this.getId('passwordGeneratorPanel'),children:[ | 84 | {tag:'li', id:this.getId('passwordGeneratorPanel'),children:[ |
88 | {tag:'h3', html:"Password generator"} | 85 | {tag:'h3', html:"Password generator"} |
89 | ]}, | 86 | ]}, |
90 | {tag:'li', id:this.getId('bookmarkletPanel'),children:[ | 87 | {tag:'li', id:this.getId('bookmarkletPanel'),children:[ |
91 | {tag:'h3', html:"Bookmarklet"} | 88 | {tag:'h3', html:"Bookmarklet"} |
92 | ]}, | 89 | ]}, |
93 | {tag:'li', id:this.getId('compactEditionPanel'), children:[ | 90 | {tag:'li', id:this.getId('compactEditionPanel'), children:[ |
94 | {tag:'h3', html:"Compact edition"} | 91 | {tag:'h3', html:"Compact edition"} |
95 | ]}, | 92 | ]}, |
96 | {tag:'li', id:this.getId('httpAuthPanel'), children:[ | 93 | {tag:'li', id:this.getId('httpAuthPanel'), children:[ |
97 | {tag:'h3', html:"HTTP Auth"} | 94 | {tag:'h3', html:"HTTP Auth"} |
98 | ]} | 95 | ]} |
99 | ]} | 96 | ]} |
100 | ]} | 97 | ]} |
101 | ]} | 98 | ]} |
102 | ]}, | 99 | ]}, |
103 | {tag:'div', cls:'footer'} | 100 | {tag:'div', cls:'footer'} |
104 | ]); | 101 | ]); |
105 | 102 | ||
106 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | 103 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 108 | ||
112 | __syntaxFix__: "syntax fix" | 109 | __syntaxFix__: "syntax fix" |
113 | }); | 110 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js index 5b9d522..21ccf2a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js | |||
@@ -1,184 +1,181 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._openFromElement = args.openFromElement || null; | 33 | this._openFromElement = args.openFromElement || null; |
37 | this._onOkCloseToElement = args.onOkCloseToElement || null; | 34 | this._onOkCloseToElement = args.onOkCloseToElement || null; |
38 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | 35 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; |
39 | 36 | ||
40 | this._progressBarComponent = null; | 37 | this._progressBarComponent = null; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; | 49 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'getPassphrase': function () { | 54 | 'getPassphrase': function () { |
58 | /* var deferredResult; | 55 | /* var deferredResult; |
59 | 56 | ||
60 | if (this.passphrase() == null) { | 57 | if (this.passphrase() == null) { |
61 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 58 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
62 | deferredResult = this.deferred(); | 59 | deferredResult = this.deferred(); |
63 | } else { | 60 | } else { |
64 | deferredResult = MochiKit.Async.succeed(this.passphrase()); | 61 | deferredResult = MochiKit.Async.succeed(this.passphrase()); |
65 | } | 62 | } |
66 | 63 | ||
67 | return deferredResult; | 64 | return deferredResult; |
68 | */ | 65 | */ |
69 | 66 | ||
70 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 67 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
71 | 68 | ||
72 | return this.deferred(); | 69 | return this.deferred(); |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'deferredShowModal': function (someParameters) { | 74 | 'deferredShowModal': function (someParameters) { |
78 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ | 75 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ |
79 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), | 76 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), |
80 | MochiKit.Base.method(this, 'getElement', 'passphrase'), | 77 | MochiKit.Base.method(this, 'getElement', 'passphrase'), |
81 | MochiKit.Base.methodcaller('focus') | 78 | MochiKit.Base.methodcaller('focus') |
82 | ], {trace:false}) | 79 | ], {trace:false}) |
83 | }, | 80 | }, |
84 | 81 | ||
85 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
86 | 83 | ||
87 | 'openFromElement': function () { | 84 | 'openFromElement': function () { |
88 | return this._openFromElement; | 85 | return this._openFromElement; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | 'onOkCloseToElement': function () { | 88 | 'onOkCloseToElement': function () { |
92 | return this._onOkCloseToElement; | 89 | return this._onOkCloseToElement; |
93 | }, | 90 | }, |
94 | 91 | ||
95 | 'onCancelCloseToElement': function () { | 92 | 'onCancelCloseToElement': function () { |
96 | return this._onCancelCloseToElement; | 93 | return this._onCancelCloseToElement; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | //------------------------------------------------------------------------- | 96 | //------------------------------------------------------------------------- |
100 | 97 | ||
101 | 'renderSelf': function() { | 98 | 'renderSelf': function() { |
102 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); | 99 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); |
103 | 100 | ||
104 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ | 101 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ |
105 | // {tag:'form', id:this.getId('passphraseForm'), children:[ | 102 | // {tag:'form', id:this.getId('passphraseForm'), children:[ |
106 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} | 103 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} |
107 | // ]} | 104 | // ]} |
108 | ]}); | 105 | ]}); |
109 | 106 | ||
110 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); | 107 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); |
111 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); | 108 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); |
112 | 109 | ||
113 | 110 | ||
114 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); | 111 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); |
115 | // this.getElement('passphrase').select(); | 112 | // this.getElement('passphrase').select(); |
116 | }, | 113 | }, |
117 | 114 | ||
118 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
119 | 116 | ||
120 | 'showProgressBar': function () { | 117 | 'showProgressBar': function () { |
121 | varprogressBarElement; | 118 | varprogressBarElement; |
122 | 119 | ||
123 | this.getElement('container').innerHTML = ''; | 120 | this.getElement('container').innerHTML = ''; |
124 | 121 | ||
125 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | 122 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); |
126 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | 123 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); |
127 | 124 | ||
128 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | 125 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); |
129 | }, | 126 | }, |
130 | 127 | ||
131 | //------------------------------------------------------------------------- | 128 | //------------------------------------------------------------------------- |
132 | 129 | ||
133 | 'showFailure': function () { | 130 | 'showFailure': function () { |
134 | this.setType('ALERT'); | 131 | this.setType('ALERT'); |
135 | this.setTitle("Login failed"); | 132 | this.setTitle("Login failed"); |
136 | this.setText("Wrong passphrase; the unlock has failed."); | 133 | this.setText("Wrong passphrase; the unlock has failed."); |
137 | this.getElement('container').innerHTML = ''; | 134 | this.getElement('container').innerHTML = ''; |
138 | this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | 135 | this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); |
139 | }, | 136 | }, |
140 | 137 | ||
141 | //------------------------------------------------------------------------- | 138 | //------------------------------------------------------------------------- |
142 | 139 | ||
143 | 'closeOk': function () { | 140 | 'closeOk': function () { |
144 | var passphrase; | 141 | var passphrase; |
145 | 142 | ||
146 | passphrase = this.getElement('passphrase').value; | 143 | passphrase = this.getElement('passphrase').value; |
147 | this.showProgressBar(); | 144 | this.showProgressBar(); |
148 | // this.deferred().callback(passphrase); | 145 | // this.deferred().callback(passphrase); |
149 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); | 146 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); |
150 | this._deferred = null; | 147 | this._deferred = null; |
151 | }, | 148 | }, |
152 | 149 | ||
153 | 'closeCancel': function () { | 150 | 'closeCancel': function () { |
154 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | 151 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); |
155 | this.deferred().cancel(); | 152 | this.deferred().cancel(); |
156 | this._deferred = null; | 153 | this._deferred = null; |
157 | }, | 154 | }, |
158 | 155 | ||
159 | //------------------------------------------------------------------------- | 156 | //------------------------------------------------------------------------- |
160 | 157 | ||
161 | 'userSuccessfullyLoggedInHandler': function (anEvent) { | 158 | 'userSuccessfullyLoggedInHandler': function (anEvent) { |
162 | this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | 159 | this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); |
163 | }, | 160 | }, |
164 | 161 | ||
165 | 'userLoginFailedHandler': function (anEvent) { | 162 | 'userLoginFailedHandler': function (anEvent) { |
166 | //console.log("############### FAILED LOGIN ################"); | 163 | //console.log("############### FAILED LOGIN ################"); |
167 | this.showFailure(); | 164 | this.showFailure(); |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //------------------------------------------------------------------------- | 167 | //------------------------------------------------------------------------- |
171 | /* | 168 | /* |
172 | 'deferredShow': function (someArgs, aResult) { | 169 | 'deferredShow': function (someArgs, aResult) { |
173 | this.deferredShowModal(someArgs); | 170 | this.deferredShowModal(someArgs); |
174 | 171 | ||
175 | // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); | 172 | // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); |
176 | // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); | 173 | // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); |
177 | // this.deferred().addCallback(MochiKit.Async.succeed, aResult); | 174 | // this.deferred().addCallback(MochiKit.Async.succeed, aResult); |
178 | 175 | ||
179 | return this.deferred(); | 176 | return this.deferred(); |
180 | }, | 177 | }, |
181 | */ | 178 | */ |
182 | //------------------------------------------------------------------------- | 179 | //------------------------------------------------------------------------- |
183 | __syntaxFix__: "syntax fix" | 180 | __syntaxFix__: "syntax fix" |
184 | }); | 181 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js index f26118e..d699dc6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { | 28 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._slots = {}; | 33 | this._slots = {}; |
37 | this._isLocked = false; | 34 | this._isLocked = false; |
38 | this._lockTooltip = null; | 35 | this._lockTooltip = null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; | 47 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'handleLogout': function(anEvent) { | 52 | 'handleLogout': function(anEvent) { |
56 | //Clipperz.log(">>> UserInfoBox.handleLogout"); | 53 | //Clipperz.log(">>> UserInfoBox.handleLogout"); |
57 | anEvent.preventDefault(); | 54 | anEvent.preventDefault(); |
58 | MochiKit.Signal.signal(this, 'logout'); | 55 | MochiKit.Signal.signal(this, 'logout'); |
59 | //Clipperz.log("<<< UserInfoBox.handleLogout"); | 56 | //Clipperz.log("<<< UserInfoBox.handleLogout"); |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'lockTooltip': function () { | 61 | 'lockTooltip': function () { |
65 | return this._lockTooltip; | 62 | return this._lockTooltip; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'isLocked': function () { | 67 | 'isLocked': function () { |
71 | return this._isLocked; | 68 | return this._isLocked; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'setIsLocked': function (aValue) { | 71 | 'setIsLocked': function (aValue) { |
75 | this._isLocked = aValue; | 72 | this._isLocked = aValue; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'toggleLock': function(anEvent) { | 75 | 'toggleLock': function(anEvent) { |
79 | var deferredResult; | 76 | var deferredResult; |
80 | var shouldLock; | 77 | var shouldLock; |
81 | 78 | ||
82 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); | 79 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); |
83 | anEvent.preventDefault(); | 80 | anEvent.preventDefault(); |
84 | this.lockTooltip().hide(); | 81 | this.lockTooltip().hide(); |
85 | 82 | ||
86 | shouldLock = (this.isLocked() == false); | 83 | shouldLock = (this.isLocked() == false); |
87 | 84 | ||
88 | if (shouldLock) { | 85 | if (shouldLock) { |
89 | var maskElement; | 86 | var maskElement; |
90 | 87 | ||
91 | this.setIsLocked(true); | 88 | this.setIsLocked(true); |
92 | maskElement = this.getId('modalDialogMask'); | 89 | maskElement = this.getId('modalDialogMask'); |
93 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ | 90 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ |
94 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), | 91 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), |
95 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), | 92 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), |
96 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), | 93 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), |
97 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') | 94 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') |
98 | ], {trace:false}); | 95 | ], {trace:false}); |
99 | } else { | 96 | } else { |
100 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ | 97 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ |
101 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') | 98 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') |
102 | ], {trace:false}); | 99 | ], {trace:false}); |
103 | } | 100 | } |
104 | //console.log("<<< UserInfoBox.toggleLock"); | 101 | //console.log("<<< UserInfoBox.toggleLock"); |
105 | 102 | ||
106 | return deferredResult; | 103 | return deferredResult; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'unlock': function () { | 108 | 'unlock': function () { |
112 | var deferredResult; | 109 | var deferredResult; |
113 | var maskElement; | 110 | var maskElement; |
114 | 111 | ||
115 | this.setIsLocked(false); | 112 | this.setIsLocked(false); |
116 | maskElement = this.getId('modalDialogMask'); | 113 | maskElement = this.getId('modalDialogMask'); |
117 | 114 | ||
118 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ | 115 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ |
119 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 116 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |
120 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 117 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |
121 | MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') | 118 | MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') |
122 | ], {trace:false}); | 119 | ], {trace:false}); |
123 | }, | 120 | }, |
124 | 121 | ||
125 | //------------------------------------------------------------------------- | 122 | //------------------------------------------------------------------------- |
126 | 123 | ||
127 | 'askForPassphrase': function () { | 124 | 'askForPassphrase': function () { |
128 | varunlockPasswordComponent; | 125 | varunlockPasswordComponent; |
129 | /* | 126 | /* |
130 | vardeferredResult; | 127 | vardeferredResult; |
131 | 128 | ||
132 | deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); | 129 | deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); |
133 | deferredResult.addCallback(MochiKit.Async.succeed, 'test'); | 130 | deferredResult.addCallback(MochiKit.Async.succeed, 'test'); |
134 | 131 | ||
135 | deferredResult.callback(); | 132 | deferredResult.callback(); |
136 | 133 | ||
137 | return deferredResult; | 134 | return deferredResult; |
138 | */ | 135 | */ |
139 | //console.log(">>> UserInfoBox.askForPassphrase"); | 136 | //console.log(">>> UserInfoBox.askForPassphrase"); |
140 | unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ | 137 | unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ |
141 | 'title':"Unlock account", | 138 | 'title':"Unlock account", |
142 | 'text': "Insert the passprase to unlock the account", | 139 | 'text': "Insert the passprase to unlock the account", |
143 | 'type': 'INFO', | 140 | 'type': 'INFO', |
144 | 'buttons': [ | 141 | 'buttons': [ |
145 | {text:"Cancel",result:'CANCEL'}, | 142 | {text:"Cancel",result:'CANCEL'}, |
146 | {text:"Unlock", result:'OK',isDefault:true} | 143 | {text:"Unlock", result:'OK',isDefault:true} |
147 | ], | 144 | ], |
148 | 'openFromElement': this.getElement('lock'), | 145 | 'openFromElement': this.getElement('lock'), |
149 | 'onOkCloseToElement': null, | 146 | 'onOkCloseToElement': null, |
150 | 'onCancelCloseToElement':this.getId('lock') | 147 | 'onCancelCloseToElement':this.getId('lock') |
151 | }); | 148 | }); |
152 | //console.log("<<< UserInfoBox.askForPassphrase"); | 149 | //console.log("<<< UserInfoBox.askForPassphrase"); |
153 | 150 | ||
154 | return unlockPasswordComponent.getPassphrase(); | 151 | return unlockPasswordComponent.getPassphrase(); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //========================================================================= | 154 | //========================================================================= |
158 | 155 | ||
159 | 'renderSelf': function(/*aContainer, aPosition*/) { | 156 | 'renderSelf': function(/*aContainer, aPosition*/) { |
160 | this.append(this.element(), [ | 157 | this.append(this.element(), [ |
161 | // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, | 158 | // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, |
162 | {tag:'div', cls:'header', children:[ | 159 | {tag:'div', cls:'header', children:[ |
163 | {tag:'h1', html:"Welcome"}, | 160 | {tag:'h1', html:"Welcome"}, |
164 | {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:' '} | 161 | {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:' '} |
165 | ]}, | 162 | ]}, |
166 | {tag:'div', cls:'body', children:[ | 163 | {tag:'div', cls:'body', children:[ |
167 | {tag:'h3', id:this.getId('username'), html:""}, | 164 | {tag:'h3', id:this.getId('username'), html:""}, |
168 | {tag:'ul', children:[ | 165 | {tag:'ul', children:[ |
169 | {tag:'li', id:this.getId('cards'), children:[ | 166 | {tag:'li', id:this.getId('cards'), children:[ |
170 | {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, | 167 | {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, |
171 | {tag:'span', id:this.getId('cardsLabel'), html:"cards"} | 168 | {tag:'span', id:this.getId('cardsLabel'), html:"cards"} |
172 | ]}, | 169 | ]}, |
173 | {tag:'li', id:this.getId('directLogins'), children:[ | 170 | {tag:'li', id:this.getId('directLogins'), children:[ |
174 | {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, | 171 | {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, |
175 | {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} | 172 | {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} |
176 | ]} | 173 | ]} |
177 | ]}, | 174 | ]}, |
178 | {tag:'a', href:'#', id:this.getId('logout'), html:"logout >"} | 175 | {tag:'a', href:'#', id:this.getId('logout'), html:"logout >"} |
179 | ]}, | 176 | ]}, |
180 | {tag:'div', cls:'footer'} | 177 | {tag:'div', cls:'footer'} |
181 | ]); | 178 | ]); |
182 | 179 | ||
183 | MochiKit.Signal.connect(this.getElement('logout'), 'onclick', this, 'handleLogout'); | 180 | MochiKit.Signal.connect(this.getElement('logout'), 'onclick', this, 'handleLogout'); |
184 | MochiKit.Signal.connect(this.getElement('lock'), 'onclick', this, 'toggleLock'); | 181 | MochiKit.Signal.connect(this.getElement('lock'), 'onclick', this, 'toggleLock'); |
185 | 182 | ||
186 | this._lockTooltip = new Clipperz.PM.UI.Common.Components.Tooltip({ | 183 | this._lockTooltip = new Clipperz.PM.UI.Common.Components.Tooltip({ |
187 | element:this.getElement('lock'), | 184 | element:this.getElement('lock'), |
188 | text: "Click here to lock/unlock your account.", | 185 | text: "Click here to lock/unlock your account.", |
189 | position:'RIGHT' | 186 | position:'RIGHT' |
190 | }); | 187 | }); |
191 | 188 | ||
192 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | 189 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, |
193 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper', children:[ | 190 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper', children:[ |
194 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask userInfoBoxMask'} | 191 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask userInfoBoxMask'} |
195 | ]} | 192 | ]} |
196 | ); | 193 | ); |
197 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); | 194 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); |
198 | 195 | ||
199 | // this.drawUserInfoBackground(this.getElement('canvas')); | 196 | // this.drawUserInfoBackground(this.getElement('canvas')); |
200 | }, | 197 | }, |
201 | 198 | ||
202 | //------------------------------------------------------------------------- | 199 | //------------------------------------------------------------------------- |
203 | /* | 200 | /* |
204 | 'drawUserInfoBackground': function (canvas) { | 201 | 'drawUserInfoBackground': function (canvas) { |
205 | var kMyDrawingFunctionWidth = 188.0; | 202 | var kMyDrawingFunctionWidth = 188.0; |
206 | var kMyDrawingFunctionHeight = 154.0; | 203 | var kMyDrawingFunctionHeight = 154.0; |
207 | 204 | ||
208 | var context = canvas.getContext("2d"); | 205 | var context = canvas.getContext("2d"); |
209 | var color; | 206 | var color; |
210 | var resolution; | 207 | var resolution; |
211 | var alignStroke; | 208 | var alignStroke; |
212 | var path; | 209 | var path; |
213 | var pointX; | 210 | var pointX; |
214 | var pointY; | 211 | var pointY; |
215 | var controlPoint1X; | 212 | var controlPoint1X; |
216 | var controlPoint1Y; | 213 | var controlPoint1Y; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js index 05563bf..9a0e744 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { |
32 | 29 | ||
33 | this._user = null; | 30 | this._user = null; |
34 | this._tabSlotNames = { | 31 | this._tabSlotNames = { |
35 | //tabName: slotName | 32 | //tabName: slotName |
36 | 'cards': 'cardGrid', | 33 | 'cards': 'cardGrid', |
37 | // 'directLogins':'directLoginGrid', | 34 | // 'directLogins':'directLoginGrid', |
38 | 'account': 'accountPanel', | 35 | 'account': 'accountPanel', |
39 | 'data': 'dataPanel', | 36 | 'data': 'dataPanel', |
40 | 'tools': 'toolsPanel' | 37 | 'tools': 'toolsPanel' |
41 | }; | 38 | }; |
42 | 39 | ||
43 | //controllers | 40 | //controllers |
44 | this._cardsController= null; | 41 | this._cardsController= null; |
45 | //this._directLoginsController = null; | 42 | //this._directLoginsController = null; |
46 | this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); | 43 | this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); |
47 | 44 | ||
48 | //components | 45 | //components |
49 | this._appPage = null; | 46 | this._appPage = null; |
50 | this._userInfoBox = null; | 47 | this._userInfoBox = null; |
51 | this._tabSidePanel = null; | 48 | this._tabSidePanel = null; |
52 | 49 | ||
53 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); | 50 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); |
54 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); | 51 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); |
55 | 52 | ||
56 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); | 53 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); |
57 | 54 | ||
58 | return this; | 55 | return this; |
59 | } | 56 | } |
60 | 57 | ||
61 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | 58 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { |
62 | 59 | ||
63 | 'toString': function() { | 60 | 'toString': function() { |
64 | return "Clipperz.PM.UI.Web.Controllers.AppController"; | 61 | return "Clipperz.PM.UI.Web.Controllers.AppController"; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | //----------------------------------------------------------------------------- | 64 | //----------------------------------------------------------------------------- |
68 | 65 | ||
69 | 'setUser': function(anUser) { | 66 | 'setUser': function(anUser) { |
70 | this._user = anUser; | 67 | this._user = anUser; |
71 | }, | 68 | }, |
72 | 69 | ||
73 | 'user': function() { | 70 | 'user': function() { |
74 | return this._user; | 71 | return this._user; |
75 | }, | 72 | }, |
76 | 73 | ||
77 | //----------------------------------------------------------------------------- | 74 | //----------------------------------------------------------------------------- |
78 | /* | 75 | /* |
79 | 'tabSlotNames': function() { | 76 | 'tabSlotNames': function() { |
80 | return this._tabSlotNames; | 77 | return this._tabSlotNames; |
81 | }, | 78 | }, |
82 | */ | 79 | */ |
83 | 'slotNameForTab': function(aTabName) { | 80 | 'slotNameForTab': function(aTabName) { |
84 | return this._tabSlotNames[aTabName]; | 81 | return this._tabSlotNames[aTabName]; |
85 | }, | 82 | }, |
86 | 83 | ||
87 | 'hideAllAppPageTabSlots': function() { | 84 | 'hideAllAppPageTabSlots': function() { |
88 | var aTabName; | 85 | var aTabName; |
89 | 86 | ||
90 | for (aTabName in this._tabSlotNames) { | 87 | for (aTabName in this._tabSlotNames) { |
91 | this.appPage().hideSlot(this.slotNameForTab(aTabName)); | 88 | this.appPage().hideSlot(this.slotNameForTab(aTabName)); |
92 | } | 89 | } |
93 | }, | 90 | }, |
94 | 91 | ||
95 | //----------------------------------------------------------------------------- | 92 | //----------------------------------------------------------------------------- |
96 | 93 | ||
97 | 'appPage': function() { | 94 | 'appPage': function() { |
98 | if (this._appPage == null) { | 95 | if (this._appPage == null) { |
99 | this._appPage = new Clipperz.PM.UI.Web.Components.AppPage(); | 96 | this._appPage = new Clipperz.PM.UI.Web.Components.AppPage(); |
100 | } | 97 | } |
101 | 98 | ||
102 | return this._appPage; | 99 | return this._appPage; |
103 | }, | 100 | }, |
104 | 101 | ||
105 | //----------------------------------------------------------------------------- | 102 | //----------------------------------------------------------------------------- |
106 | 103 | ||
107 | 'tabSidePanel': function() { | 104 | 'tabSidePanel': function() { |
108 | if (this._tabSidePanel == null) { | 105 | if (this._tabSidePanel == null) { |
109 | this._tabSidePanel = new Clipperz.PM.UI.Web.Components.TabSidePanel(); | 106 | this._tabSidePanel = new Clipperz.PM.UI.Web.Components.TabSidePanel(); |
110 | } | 107 | } |
111 | 108 | ||
112 | return this._tabSidePanel; | 109 | return this._tabSidePanel; |
113 | }, | 110 | }, |
114 | 111 | ||
115 | //----------------------------------------------------------------------------- | 112 | //----------------------------------------------------------------------------- |
116 | 113 | ||
117 | 'userInfoBox': function() { | 114 | 'userInfoBox': function() { |
118 | if (this._userInfoBox == null) { | 115 | if (this._userInfoBox == null) { |
119 | this._userInfoBox = new Clipperz.PM.UI.Web.Components.UserInfoBox(); | 116 | this._userInfoBox = new Clipperz.PM.UI.Web.Components.UserInfoBox(); |
120 | 117 | ||
121 | MochiKit.Signal.connect(this._userInfoBox, 'logout',this, 'handleLogout'); | 118 | MochiKit.Signal.connect(this._userInfoBox, 'logout',this, 'handleLogout'); |
122 | MochiKit.Signal.connect(this._userInfoBox, 'lock', this, 'handleLock'); | 119 | MochiKit.Signal.connect(this._userInfoBox, 'lock', this, 'handleLock'); |
123 | MochiKit.Signal.connect(this._userInfoBox, 'unlock',this, 'handleUnlock'); | 120 | MochiKit.Signal.connect(this._userInfoBox, 'unlock',this, 'handleUnlock'); |
124 | } | 121 | } |
125 | 122 | ||
126 | return this._userInfoBox; | 123 | return this._userInfoBox; |
127 | }, | 124 | }, |
128 | 125 | ||
129 | //----------------------------------------------------------------------------- | 126 | //----------------------------------------------------------------------------- |
130 | 127 | ||
131 | 'accountPanel': function () { | 128 | 'accountPanel': function () { |
132 | if (this._accountPanel == null) { | 129 | if (this._accountPanel == null) { |
133 | this._accountPanel = new Clipperz.PM.UI.Web.Components.AccountPanel(/*{selected:'Preferences'}*/); | 130 | this._accountPanel = new Clipperz.PM.UI.Web.Components.AccountPanel(/*{selected:'Preferences'}*/); |
134 | } | 131 | } |
135 | 132 | ||
136 | return this._accountPanel; | 133 | return this._accountPanel; |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //......................................................................... | 136 | //......................................................................... |
140 | 137 | ||
141 | 'dataPanel': function () { | 138 | 'dataPanel': function () { |
142 | if (this._dataPanel == null) { | 139 | if (this._dataPanel == null) { |
143 | this._dataPanel = new Clipperz.PM.UI.Web.Components.DataPanel(); | 140 | this._dataPanel = new Clipperz.PM.UI.Web.Components.DataPanel(); |
144 | } | 141 | } |
145 | 142 | ||
146 | return this._dataPanel; | 143 | return this._dataPanel; |
147 | }, | 144 | }, |
148 | 145 | ||
149 | //......................................................................... | 146 | //......................................................................... |
150 | 147 | ||
151 | 'toolsPanel': function () { | 148 | 'toolsPanel': function () { |
152 | if (this._toolsPanel == null) { | 149 | if (this._toolsPanel == null) { |
153 | this._toolsPanel = new Clipperz.PM.UI.Web.Components.ToolsPanel(); | 150 | this._toolsPanel = new Clipperz.PM.UI.Web.Components.ToolsPanel(); |
154 | } | 151 | } |
155 | 152 | ||
156 | return this._toolsPanel; | 153 | return this._toolsPanel; |
157 | }, | 154 | }, |
158 | 155 | ||
159 | //----------------------------------------------------------------------------- | 156 | //----------------------------------------------------------------------------- |
160 | 157 | ||
161 | 'filterController': function () { | 158 | 'filterController': function () { |
162 | if (this._filterController == null) { | 159 | if (this._filterController == null) { |
163 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); | 160 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); |
164 | } | 161 | } |
165 | 162 | ||
166 | return this._filterController; | 163 | return this._filterController; |
167 | }, | 164 | }, |
168 | 165 | ||
169 | 'cardsController': function() { | 166 | 'cardsController': function() { |
170 | if (this._cardsController == null) { | 167 | if (this._cardsController == null) { |
171 | this._cardsController = new Clipperz.PM.UI.Web.Controllers.CardsController({'filterController':this._filterController}); | 168 | this._cardsController = new Clipperz.PM.UI.Web.Controllers.CardsController({'filterController':this._filterController}); |
172 | } | 169 | } |
173 | 170 | ||
174 | return this._cardsController; | 171 | return this._cardsController; |
175 | }, | 172 | }, |
176 | 173 | ||
177 | //----------------------------------------------------------------------------- | 174 | //----------------------------------------------------------------------------- |
178 | /* | 175 | /* |
179 | 'directLoginsController': function() { | 176 | 'directLoginsController': function() { |
180 | //Clipperz.log(">>> AppController.directLoginsController"); | 177 | //Clipperz.log(">>> AppController.directLoginsController"); |
181 | if (this._directLoginsController == null) { | 178 | if (this._directLoginsController == null) { |
182 | this._directLoginsController = new Clipperz.PM.UI.Web.Controllers.DirectLoginsController({'filterController':this._filterController}); | 179 | this._directLoginsController = new Clipperz.PM.UI.Web.Controllers.DirectLoginsController({'filterController':this._filterController}); |
183 | } | 180 | } |
184 | //Clipperz.log("<<< AppController.directLoginsController"); | 181 | //Clipperz.log("<<< AppController.directLoginsController"); |
185 | 182 | ||
186 | return this._directLoginsController; | 183 | return this._directLoginsController; |
187 | }, | 184 | }, |
188 | */ | 185 | */ |
189 | //----------------------------------------------------------------------------- | 186 | //----------------------------------------------------------------------------- |
190 | 187 | ||
191 | 'populateUserInfo': function() { | 188 | 'populateUserInfo': function() { |
192 | var deferredResult; | 189 | var deferredResult; |
193 | 190 | ||
194 | deferredResult = new Clipperz.Async.Deferred("AppController.populateUserInfo", {trace:false}); | 191 | deferredResult = new Clipperz.Async.Deferred("AppController.populateUserInfo", {trace:false}); |
195 | deferredResult.collectResults({ | 192 | deferredResult.collectResults({ |
196 | 'username':MochiKit.Base.methodcaller('displayName'), | 193 | 'username':MochiKit.Base.methodcaller('displayName'), |
197 | 'cardsNumber':[ | 194 | 'cardsNumber':[ |
198 | MochiKit.Base.methodcaller('getRecords'), | 195 | MochiKit.Base.methodcaller('getRecords'), |
199 | function (someResults) { return someResults.length; } | 196 | function (someResults) { return someResults.length; } |
200 | ], | 197 | ], |
201 | 'directLoginsNumber': [ | 198 | 'directLoginsNumber': [ |
202 | MochiKit.Base.methodcaller('getDirectLogins'), | 199 | MochiKit.Base.methodcaller('getDirectLogins'), |
203 | function (someResults) { return someResults.length; } | 200 | function (someResults) { return someResults.length; } |
204 | ] | 201 | ] |
205 | }) | 202 | }) |
206 | deferredResult.addMethod(this.userInfoBox(), 'updateUserDetails'); | 203 | deferredResult.addMethod(this.userInfoBox(), 'updateUserDetails'); |
207 | deferredResult.callback(this.user()); | 204 | deferredResult.callback(this.user()); |
208 | 205 | ||
209 | return deferredResult; | 206 | return deferredResult; |
210 | }, | 207 | }, |
211 | 208 | ||
212 | //----------------------------------------------------------------------------- | 209 | //----------------------------------------------------------------------------- |
213 | 210 | ||
214 | 'run': function(args) { | 211 | 'run': function(args) { |
215 | var deferredResult; | 212 | var deferredResult; |
216 | varslot; | 213 | varslot; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js index 2340aeb..effde31 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); | 31 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); |
35 | 32 | ||
36 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); |
38 | 35 | ||
39 | this._referenceElement = null; | 36 | this._referenceElement = null; |
40 | this._cardDialogComponent = null; | 37 | this._cardDialogComponent = null; |
41 | 38 | ||
42 | this._fieldsReferences = {}; | 39 | this._fieldsReferences = {}; |
43 | this._directLoginReferences = {}; | 40 | this._directLoginReferences = {}; |
44 | 41 | ||
45 | this._directLoginWizardController = null; | 42 | this._directLoginWizardController = null; |
46 | this._directLoginEditingComponent = null; | 43 | this._directLoginEditingComponent = null; |
47 | this._isDirectLoginEditingComponentVisible = false; | 44 | this._isDirectLoginEditingComponentVisible = false; |
48 | 45 | ||
49 | return this; | 46 | return this; |
50 | }; | 47 | }; |
51 | 48 | ||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { | 49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { |
53 | 50 | ||
54 | 'toString': function() { | 51 | 'toString': function() { |
55 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; | 52 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
59 | 56 | ||
60 | 'record': function () { | 57 | 'record': function () { |
61 | return this._record; | 58 | return this._record; |
62 | }, | 59 | }, |
63 | 60 | ||
64 | 'delegate': function () { | 61 | 'delegate': function () { |
65 | return this._delegate; | 62 | return this._delegate; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'fieldsReferences': function () { | 67 | 'fieldsReferences': function () { |
71 | return this._fieldsReferences; | 68 | return this._fieldsReferences; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'directLoginReferences': function () { | 71 | 'directLoginReferences': function () { |
75 | return this._directLoginReferences; | 72 | return this._directLoginReferences; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'referenceElement': function () { | 77 | 'referenceElement': function () { |
81 | return this._referenceElement; | 78 | return this._referenceElement; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | 'setReferenceElement': function (anElement) { | 81 | 'setReferenceElement': function (anElement) { |
85 | this._referenceElement = anElement; | 82 | this._referenceElement = anElement; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'cardDialogComponent': function () { | 87 | 'cardDialogComponent': function () { |
91 | if (this._cardDialogComponent == null) { | 88 | if (this._cardDialogComponent == null) { |
92 | this._cardDialogComponent = new Clipperz.PM.UI.Web.Components.CardDialogComponent(); | 89 | this._cardDialogComponent = new Clipperz.PM.UI.Web.Components.CardDialogComponent(); |
93 | 90 | ||
94 | MochiKit.Signal.connect(this._cardDialogComponent, 'cancel', this, 'handleCancel'); | 91 | MochiKit.Signal.connect(this._cardDialogComponent, 'cancel', this, 'handleCancel'); |
95 | MochiKit.Signal.connect(this._cardDialogComponent, 'save', this, 'handleSave'); | 92 | MochiKit.Signal.connect(this._cardDialogComponent, 'save', this, 'handleSave'); |
96 | 93 | ||
97 | MochiKit.Signal.connect(this._cardDialogComponent, 'addField', this, 'handleAddField'); | 94 | MochiKit.Signal.connect(this._cardDialogComponent, 'addField', this, 'handleAddField'); |
98 | MochiKit.Signal.connect(this._cardDialogComponent, 'changedValue',this, 'handleChangedValue'); | 95 | MochiKit.Signal.connect(this._cardDialogComponent, 'changedValue',this, 'handleChangedValue'); |
99 | 96 | ||
100 | MochiKit.Signal.connect(this._cardDialogComponent, 'addDirectLogin',this, 'handleAddDirectLogin'); | 97 | MochiKit.Signal.connect(this._cardDialogComponent, 'addDirectLogin',this, 'handleAddDirectLogin'); |
101 | MochiKit.Signal.connect(this._cardDialogComponent, 'keyPressed',this, 'handleCardDialogComponentKeyPressed'); | 98 | MochiKit.Signal.connect(this._cardDialogComponent, 'keyPressed',this, 'handleCardDialogComponentKeyPressed'); |
102 | } | 99 | } |
103 | 100 | ||
104 | return this._cardDialogComponent; | 101 | return this._cardDialogComponent; |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //========================================================================= | 104 | //========================================================================= |
108 | 105 | ||
109 | 'directLoginWizardController': function () { | 106 | 'directLoginWizardController': function () { |
110 | if (this._directLoginWizardController == null) { | 107 | if (this._directLoginWizardController == null) { |
111 | this._directLoginWizardController = new Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController({ | 108 | this._directLoginWizardController = new Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController({ |
112 | 'cardLabel': this.cardDialogComponent().title(), | 109 | 'cardLabel': this.cardDialogComponent().title(), |
113 | 'directLoginEditingComponent': this.directLoginEditingComponent() | 110 | 'directLoginEditingComponent': this.directLoginEditingComponent() |
114 | }) | 111 | }) |
115 | 112 | ||
116 | MochiKit.Signal.connect(this._directLoginWizardController, 'exit',this, 'handleHideDirectLoginEditingComponent'); | 113 | MochiKit.Signal.connect(this._directLoginWizardController, 'exit',this, 'handleHideDirectLoginEditingComponent'); |
117 | MochiKit.Signal.connect(this._directLoginWizardController, 'done',this, 'handleCompleteDirectLoginEditingComponent'); | 114 | MochiKit.Signal.connect(this._directLoginWizardController, 'done',this, 'handleCompleteDirectLoginEditingComponent'); |
118 | } | 115 | } |
119 | 116 | ||
120 | return this._directLoginWizardController; | 117 | return this._directLoginWizardController; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //------------------------------------------------------------------------- | 120 | //------------------------------------------------------------------------- |
124 | 121 | ||
125 | 'directLoginEditingComponent': function () { | 122 | 'directLoginEditingComponent': function () { |
126 | if (this._directLoginEditingComponent == null) { | 123 | if (this._directLoginEditingComponent == null) { |
127 | this._directLoginEditingComponent = new Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent(); | 124 | this._directLoginEditingComponent = new Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent(); |
128 | 125 | ||
129 | this.cardDialogComponent().renderDirectLoginEditingComponent(this._directLoginEditingComponent); | 126 | this.cardDialogComponent().renderDirectLoginEditingComponent(this._directLoginEditingComponent); |
130 | 127 | ||
131 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'back', this, 'handleHideDirectLoginEditingComponent') | 128 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'back', this, 'handleHideDirectLoginEditingComponent') |
132 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | 129 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); |
133 | // MochiKit.Signal.connect(this.__directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | 130 | // MochiKit.Signal.connect(this.__directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); |
134 | } | 131 | } |
135 | 132 | ||
136 | return this._directLoginEditingComponent; | 133 | return this._directLoginEditingComponent; |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //------------------------------------------------------------------------- | 136 | //------------------------------------------------------------------------- |
140 | 137 | ||
141 | 'isDirectLoginEditingComponentVisible': function () { | 138 | 'isDirectLoginEditingComponentVisible': function () { |
142 | return this._isDirectLoginEditingComponentVisible; | 139 | return this._isDirectLoginEditingComponentVisible; |
143 | }, | 140 | }, |
144 | 141 | ||
145 | 'setIsDirectLoginEditingComponentVisible': function (aValue) { | 142 | 'setIsDirectLoginEditingComponentVisible': function (aValue) { |
146 | this._isDirectLoginEditingComponentVisible = aValue; | 143 | this._isDirectLoginEditingComponentVisible = aValue; |
147 | }, | 144 | }, |
148 | 145 | ||
149 | //========================================================================= | 146 | //========================================================================= |
150 | 147 | ||
151 | 'run': function (anElement) { | 148 | 'run': function (anElement) { |
152 | var deferredResult; | 149 | var deferredResult; |
153 | 150 | ||
154 | this.setReferenceElement(anElement); | 151 | this.setReferenceElement(anElement); |
155 | 152 | ||
156 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.run", {trace:false}); | 153 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.run", {trace:false}); |
157 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':11}); | 154 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':11}); |
158 | 155 | ||
159 | deferredResult.addMethod(this.cardDialogComponent(), 'deferredShowModal', {openFromElement:this.referenceElement()}); | 156 | deferredResult.addMethod(this.cardDialogComponent(), 'deferredShowModal', {openFromElement:this.referenceElement()}); |
160 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | 157 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); |
161 | 158 | ||
162 | deferredResult.addMethod(this.record(), 'label'); | 159 | deferredResult.addMethod(this.record(), 'label'); |
163 | deferredResult.addMethod(this.cardDialogComponent(), 'setTitle'); | 160 | deferredResult.addMethod(this.cardDialogComponent(), 'setTitle'); |
164 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | 161 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); |
165 | 162 | ||
166 | deferredResult.addMethod(this, 'updateComponentState'); | 163 | deferredResult.addMethod(this, 'updateComponentState'); |
167 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | 164 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); |
168 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'); | 165 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'); |
169 | 166 | ||
170 | deferredResult.addMethod(this.cardDialogComponent(), 'fixRendering'); | 167 | deferredResult.addMethod(this.cardDialogComponent(), 'fixRendering'); |
171 | deferredResult.addMethod(this.cardDialogComponent(), 'hideProgressMask'); | 168 | deferredResult.addMethod(this.cardDialogComponent(), 'hideProgressMask'); |
172 | 169 | ||
173 | if (this.record().isBrandNew()) { | 170 | if (this.record().isBrandNew()) { |
174 | deferredResult.addMethod(this.cardDialogComponent(), 'setHintMode', 'ON'); | 171 | deferredResult.addMethod(this.cardDialogComponent(), 'setHintMode', 'ON'); |
175 | deferredResult.addMethod(this.cardDialogComponent(), 'setFocusOnTitleField'); | 172 | deferredResult.addMethod(this.cardDialogComponent(), 'setFocusOnTitleField'); |
176 | } | 173 | } |
177 | 174 | ||
178 | deferredResult.addErrback(MochiKit.Base.method(this.cardDialogComponent(), 'showError')); | 175 | deferredResult.addErrback(MochiKit.Base.method(this.cardDialogComponent(), 'showError')); |
179 | deferredResult.callback(); | 176 | deferredResult.callback(); |
180 | 177 | ||
181 | return deferredResult; | 178 | return deferredResult; |
182 | }, | 179 | }, |
183 | 180 | ||
184 | //========================================================================= | 181 | //========================================================================= |
185 | 182 | ||
186 | 'updateComponentState': function () { | 183 | 'updateComponentState': function () { |
187 | return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ | 184 | return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ |
188 | MochiKit.Base.method(this.record(), 'hasPendingChanges'), | 185 | MochiKit.Base.method(this.record(), 'hasPendingChanges'), |
189 | MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), | 186 | MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), |
190 | 187 | ||
191 | MochiKit.Base.method(this.record(), 'label'), | 188 | MochiKit.Base.method(this.record(), 'label'), |
192 | MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), | 189 | MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), |
193 | MochiKit.Base.method(this.record(), 'notes'), | 190 | MochiKit.Base.method(this.record(), 'notes'), |
194 | MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), | 191 | MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), |
195 | 192 | ||
196 | MochiKit.Base.method(this.record(), 'fields'), | 193 | MochiKit.Base.method(this.record(), 'fields'), |
197 | MochiKit.Base.values, | 194 | MochiKit.Base.values, |
198 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithField')), | 195 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithField')), |
199 | 196 | ||
200 | MochiKit.Base.method(this.record(), 'directLogins'), | 197 | MochiKit.Base.method(this.record(), 'directLogins'), |
201 | MochiKit.Base.values, | 198 | MochiKit.Base.values, |
202 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin')), | 199 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin')), |
203 | 200 | ||
204 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | 201 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), |
205 | MochiKit.Base.noop | 202 | MochiKit.Base.noop |
206 | ], {trace:false}); | 203 | ], {trace:false}); |
207 | }, | 204 | }, |
208 | 205 | ||
209 | //------------------------------------------------------------------------- | 206 | //------------------------------------------------------------------------- |
210 | 207 | ||
211 | 'addCardDialogComponentWithField': function (aField) { | 208 | 'addCardDialogComponentWithField': function (aField) { |
212 | varfieldComponent; | 209 | varfieldComponent; |
213 | 210 | ||
214 | fieldComponent = new Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent({reference: aField.reference()}); | 211 | fieldComponent = new Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent({reference: aField.reference()}); |
215 | MochiKit.Signal.connect(fieldComponent, 'changedValue',this, 'handleChangedValue'); | 212 | MochiKit.Signal.connect(fieldComponent, 'changedValue',this, 'handleChangedValue'); |
216 | MochiKit.Signal.connect(fieldComponent, 'performAction',this, 'handlePerformFieldAction'); | 213 | MochiKit.Signal.connect(fieldComponent, 'performAction',this, 'handlePerformFieldAction'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js index b1a34b2..f58f0b8 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js | |||
@@ -1,207 +1,204 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { | 28 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { |
32 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); |
33 | 30 | ||
34 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); | 31 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); |
35 | 32 | ||
36 | return this; | 33 | return this; |
37 | } | 34 | } |
38 | 35 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 36 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
40 | 37 | ||
41 | 'toString': function() { | 38 | 'toString': function() { |
42 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; | 39 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; |
43 | }, | 40 | }, |
44 | 41 | ||
45 | 'createGrid': function () { | 42 | 'createGrid': function () { |
46 | var grid; | 43 | var grid; |
47 | 44 | ||
48 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 45 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
49 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 46 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
50 | 'name': 'Cards.favicon', | 47 | 'name': 'Cards.favicon', |
51 | 'selector': MochiKit.Base.methodcaller('favicon'), | 48 | 'selector': MochiKit.Base.methodcaller('favicon'), |
52 | 'cssClass': 'favicon' | 49 | 'cssClass': 'favicon' |
53 | }), | 50 | }), |
54 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 51 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
55 | 'name': 'Cards.title', | 52 | 'name': 'Cards.title', |
56 | 'selector': MochiKit.Base.methodcaller('label'), | 53 | 'selector': MochiKit.Base.methodcaller('label'), |
57 | 'label': 'title', | 54 | 'label': 'title', |
58 | 'cssClass': 'title', | 55 | 'cssClass': 'title', |
59 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 56 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
60 | 'sortable': true, | 57 | 'sortable': true, |
61 | 'sorted': 'ASCENDING', | 58 | 'sorted': 'ASCENDING', |
62 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} | 59 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} |
63 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 60 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
64 | }), | 61 | }), |
65 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ | 62 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ |
66 | 'name': 'Cards.directLogins', | 63 | 'name': 'Cards.directLogins', |
67 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), | 64 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), |
68 | 'label': 'direct logins', | 65 | 'label': 'direct logins', |
69 | 'cssClass': 'directLogin' | 66 | 'cssClass': 'directLogin' |
70 | }), | 67 | }), |
71 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ | 68 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ |
72 | 'name': 'Cards.latestUpdate', | 69 | 'name': 'Cards.latestUpdate', |
73 | 'selector': MochiKit.Base.methodcaller('updateDate'), | 70 | 'selector': MochiKit.Base.methodcaller('updateDate'), |
74 | 'label': 'latest update', | 71 | 'label': 'latest update', |
75 | 'cssClass': 'latestUpdate', | 72 | 'cssClass': 'latestUpdate', |
76 | 'format': 'd-m-Y', | 73 | 'format': 'd-m-Y', |
77 | 'comparator': MochiKit.Base.compare, | 74 | 'comparator': MochiKit.Base.compare, |
78 | 'sortable': true, | 75 | 'sortable': true, |
79 | 'sorted': 'UNSORTED' | 76 | 'sorted': 'UNSORTED' |
80 | }), | 77 | }), |
81 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | 78 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ |
82 | 'name': 'Cards.delete', | 79 | 'name': 'Cards.delete', |
83 | 'selector': MochiKit.Base.noop, | 80 | 'selector': MochiKit.Base.noop, |
84 | 'cssClass': 'delete', | 81 | 'cssClass': 'delete', |
85 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteCard', {objectData:anObject, element:anEvent.src()})} | 82 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteCard', {objectData:anObject, element:anEvent.src()})} |
86 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteCard') | 83 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteCard') |
87 | }) | 84 | }) |
88 | ]}); | 85 | ]}); |
89 | 86 | ||
90 | grid.setComponentForSlotNamed(new Clipperz.PM.UI.Web.Components.BookmarkletComponent(), 'headerSlot'); | 87 | grid.setComponentForSlotNamed(new Clipperz.PM.UI.Web.Components.BookmarkletComponent(), 'headerSlot'); |
91 | 88 | ||
92 | return grid; | 89 | return grid; |
93 | }, | 90 | }, |
94 | 91 | ||
95 | //----------------------------------------------------------------------------- | 92 | //----------------------------------------------------------------------------- |
96 | 93 | ||
97 | 'getRows': function () { | 94 | 'getRows': function () { |
98 | //TODO relying on user() in GridController, bad code smell :| | 95 | //TODO relying on user() in GridController, bad code smell :| |
99 | return this.user().getRecords(); | 96 | return this.user().getRecords(); |
100 | }, | 97 | }, |
101 | 98 | ||
102 | //============================================================================= | 99 | //============================================================================= |
103 | 100 | ||
104 | 'displayEmptyContent': function () { | 101 | 'displayEmptyContent': function () { |
105 | varemptyGridComponent; | 102 | varemptyGridComponent; |
106 | 103 | ||
107 | emptyGridComponent = new Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent(); | 104 | emptyGridComponent = new Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent(); |
108 | 105 | ||
109 | return Clipperz.Async.callbacks("CardsController.displayEmptyContent", [ | 106 | return Clipperz.Async.callbacks("CardsController.displayEmptyContent", [ |
110 | MochiKit.Base.method(this.grid(), 'setNoRowsGridComponent', emptyGridComponent), | 107 | MochiKit.Base.method(this.grid(), 'setNoRowsGridComponent', emptyGridComponent), |
111 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displayEmptyContent, this) | 108 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displayEmptyContent, this) |
112 | ], {trace:false}); | 109 | ], {trace:false}); |
113 | }, | 110 | }, |
114 | 111 | ||
115 | 'displaySelectedRows': function (aFilter) { | 112 | 'displaySelectedRows': function (aFilter) { |
116 | this.columnManagerWithName('Cards.directLogins').hideDirectLoginListPopup(); | 113 | this.columnManagerWithName('Cards.directLogins').hideDirectLoginListPopup(); |
117 | 114 | ||
118 | return Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displaySelectedRows.apply(this, arguments); | 115 | return Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displaySelectedRows.apply(this, arguments); |
119 | }, | 116 | }, |
120 | 117 | ||
121 | //============================================================================= | 118 | //============================================================================= |
122 | 119 | ||
123 | 'handleShowCard': function (anObject, anEvent) { | 120 | 'handleShowCard': function (anObject, anEvent) { |
124 | var cardDialogController; | 121 | var cardDialogController; |
125 | 122 | ||
126 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject, delegate:this}); | 123 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject, delegate:this}); |
127 | this.grid().selectRow(anObject); | 124 | this.grid().selectRow(anObject); |
128 | 125 | ||
129 | cardDialogController.run(anEvent.src()); | 126 | cardDialogController.run(anEvent.src()); |
130 | }, | 127 | }, |
131 | 128 | ||
132 | //......................................................................... | 129 | //......................................................................... |
133 | 130 | ||
134 | 'handleHideCard': function () { | 131 | 'handleHideCard': function () { |
135 | this.focus(); | 132 | this.focus(); |
136 | }, | 133 | }, |
137 | 134 | ||
138 | //----------------------------------------------------------------------------- | 135 | //----------------------------------------------------------------------------- |
139 | 136 | ||
140 | 'addCard': function (aSourceElement) { | 137 | 'addCard': function (aSourceElement) { |
141 | return Clipperz.Async.callbacks("CardsController.addCard", [ | 138 | return Clipperz.Async.callbacks("CardsController.addCard", [ |
142 | Clipperz.Async.collectResults("CardsController.addCard <inner results>", { | 139 | Clipperz.Async.collectResults("CardsController.addCard <inner results>", { |
143 | 'record': MochiKit.Base.method(this.user(), 'createNewRecord'), | 140 | 'record': MochiKit.Base.method(this.user(), 'createNewRecord'), |
144 | 'delegate':MochiKit.Base.partial(MochiKit.Async.succeed, this) | 141 | 'delegate':MochiKit.Base.partial(MochiKit.Async.succeed, this) |
145 | }, {trace:false}), | 142 | }, {trace:false}), |
146 | function (someParameters) { | 143 | function (someParameters) { |
147 | return new Clipperz.PM.UI.Web.Controllers.CardDialogController(someParameters); | 144 | return new Clipperz.PM.UI.Web.Controllers.CardDialogController(someParameters); |
148 | }, | 145 | }, |
149 | MochiKit.Base.methodcaller('run', aSourceElement) | 146 | MochiKit.Base.methodcaller('run', aSourceElement) |
150 | ], {trace:false}); | 147 | ], {trace:false}); |
151 | }, | 148 | }, |
152 | 149 | ||
153 | //----------------------------------------------------------------------------- | 150 | //----------------------------------------------------------------------------- |
154 | 151 | ||
155 | 'handleDeleteCard': function (anObject, anEvent) { | 152 | 'handleDeleteCard': function (anObject, anEvent) { |
156 | var deferredResult; | 153 | var deferredResult; |
157 | var confirmationDialog; | 154 | var confirmationDialog; |
158 | 155 | ||
159 | // confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | 156 | // confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ |
160 | confirmationDialog = new Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar({ | 157 | confirmationDialog = new Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar({ |
161 | 'title':"Delete Card", | 158 | 'title':"Delete Card", |
162 | 'text': "Do you want to delete …", | 159 | 'text': "Do you want to delete …", |
163 | 'type': 'ALERT', | 160 | 'type': 'ALERT', |
164 | 'buttons': [ | 161 | 'buttons': [ |
165 | {text:"Cancel",result:'CANCEL'}, | 162 | {text:"Cancel",result:'CANCEL'}, |
166 | {text:"Delete", result:'OK', isDefault:true} | 163 | {text:"Delete", result:'OK', isDefault:true} |
167 | ], | 164 | ], |
168 | 'canCancelWhileProcessing':false | 165 | 'canCancelWhileProcessing':false |
169 | }); | 166 | }); |
170 | 167 | ||
171 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); | 168 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); |
172 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':5}), | 169 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':5}), |
173 | deferredResult.addMethod(this.grid(), 'selectRow', anObject); | 170 | deferredResult.addMethod(this.grid(), 'selectRow', anObject); |
174 | deferredResult.addMethod(confirmationDialog, 'deferredShowModal', { | 171 | deferredResult.addMethod(confirmationDialog, 'deferredShowModal', { |
175 | 'openFromElement': anEvent.src(), | 172 | 'openFromElement': anEvent.src(), |
176 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, | 173 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, |
177 | 'onCancelCloseToElement':anEvent.src() | 174 | 'onCancelCloseToElement':anEvent.src() |
178 | }); | 175 | }); |
179 | // deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); | 176 | // deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); |
180 | deferredResult.addMethod(this.user(), 'deleteRecord', anObject); | 177 | deferredResult.addMethod(this.user(), 'deleteRecord', anObject); |
181 | deferredResult.addBothPass(MochiKit.Base.method(this.grid(), 'unselectRow', anObject)); | 178 | deferredResult.addBothPass(MochiKit.Base.method(this.grid(), 'unselectRow', anObject)); |
182 | deferredResult.addMethod(this, 'saveChanges'); | 179 | deferredResult.addMethod(this, 'saveChanges'); |
183 | deferredResult.addMethod(confirmationDialog, 'deferredDone'); | 180 | deferredResult.addMethod(confirmationDialog, 'deferredDone'); |
184 | deferredResult.addErrbackPass(function (anError) { | 181 | deferredResult.addErrbackPass(function (anError) { |
185 | var result; | 182 | var result; |
186 | 183 | ||
187 | if (! (anError instanceof MochiKit.Async.CancelledError)) { | 184 | if (! (anError instanceof MochiKit.Async.CancelledError)) { |
188 | result = confirmationDialog.deferredError({ | 185 | result = confirmationDialog.deferredError({ |
189 | 'type': 'ALERT', | 186 | 'type': 'ALERT', |
190 | 'title':"Error", | 187 | 'title':"Error", |
191 | 'text': Clipperz.PM.Strings.errorDescriptionForException(anError), | 188 | 'text': Clipperz.PM.Strings.errorDescriptionForException(anError), |
192 | 'buttons':[{text:"Close", result:'CANCEL', isDefault:true}] | 189 | 'buttons':[{text:"Close", result:'CANCEL', isDefault:true}] |
193 | }) | 190 | }) |
194 | } else { | 191 | } else { |
195 | result = anError; | 192 | result = anError; |
196 | } | 193 | } |
197 | 194 | ||
198 | return result; | 195 | return result; |
199 | }); | 196 | }); |
200 | deferredResult.callback(); | 197 | deferredResult.callback(); |
201 | 198 | ||
202 | return deferredResult; | 199 | return deferredResult; |
203 | }, | 200 | }, |
204 | 201 | ||
205 | //============================================================================= | 202 | //============================================================================= |
206 | __syntaxFix__: "syntax fix" | 203 | __syntaxFix__: "syntax fix" |
207 | }); | 204 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js index 38fdc08..c025a51 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { |
32 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 29 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
33 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); | 30 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | 31 | ||
35 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | 32 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); |
36 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); | 33 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); |
37 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | 34 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); |
38 | 35 | ||
39 | this._directLogin = null; | 36 | this._directLogin = null; |
40 | this._directLoginHasJustBeenAdded = false; | 37 | this._directLoginHasJustBeenAdded = false; |
41 | 38 | ||
42 | this._rulerComponent = null; | 39 | this._rulerComponent = null; |
43 | 40 | ||
44 | this._steps = null; | 41 | this._steps = null; |
45 | this._currentStepIndex = 0; | 42 | this._currentStepIndex = 0; |
46 | this._isNextEnabled = false; | 43 | this._isNextEnabled = false; |
47 | 44 | ||
48 | this._recordFields = null; | 45 | this._recordFields = null; |
49 | this._originalBindings = null; | 46 | this._originalBindings = null; |
50 | 47 | ||
51 | this._bindingComponents = []; | 48 | this._bindingComponents = []; |
52 | this._formValueComponents = []; | 49 | this._formValueComponents = []; |
53 | 50 | ||
54 | return this; | 51 | return this; |
55 | } | 52 | } |
56 | 53 | ||
57 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { | 54 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { |
58 | 55 | ||
59 | 'toString': function() { | 56 | 'toString': function() { |
60 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; | 57 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; |
61 | }, | 58 | }, |
62 | 59 | ||
63 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
64 | 61 | ||
65 | 'directLogin': function () { | 62 | 'directLogin': function () { |
66 | return this._directLogin; | 63 | return this._directLogin; |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'directLoginHasJustBeenAdded': function () { | 68 | 'directLoginHasJustBeenAdded': function () { |
72 | return this._directLoginHasJustBeenAdded; | 69 | return this._directLoginHasJustBeenAdded; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | 'setDirectLoginHasJustBeenAdded': function (aValue) { | 72 | 'setDirectLoginHasJustBeenAdded': function (aValue) { |
76 | this._directLoginHasJustBeenAdded = aValue; | 73 | this._directLoginHasJustBeenAdded = aValue; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
80 | 77 | ||
81 | 'directLoginEditingComponent': function () { | 78 | 'directLoginEditingComponent': function () { |
82 | return this._directLoginEditingComponent; | 79 | return this._directLoginEditingComponent; |
83 | }, | 80 | }, |
84 | 81 | ||
85 | //============================================================================= | 82 | //============================================================================= |
86 | 83 | ||
87 | 'cardLabel': function () { | 84 | 'cardLabel': function () { |
88 | return this._cardLabel; | 85 | return this._cardLabel; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //============================================================================= | 88 | //============================================================================= |
92 | 89 | ||
93 | 'resetCurrentStepIndex': function () { | 90 | 'resetCurrentStepIndex': function () { |
94 | this._currentStepIndex = 0; | 91 | this._currentStepIndex = 0; |
95 | this.rulerComponent().resetStatus(); | 92 | this.rulerComponent().resetStatus(); |
96 | }, | 93 | }, |
97 | 94 | ||
98 | //----------------------------------------------------------------------------- | 95 | //----------------------------------------------------------------------------- |
99 | 96 | ||
100 | 'enableNext': function (aValue) { | 97 | 'enableNext': function (aValue) { |
101 | this.rulerComponent().enableNext(aValue); | 98 | this.rulerComponent().enableNext(aValue); |
102 | this._isNextEnabled = aValue; | 99 | this._isNextEnabled = aValue; |
103 | }, | 100 | }, |
104 | 101 | ||
105 | 'isNextEnabled': function () { | 102 | 'isNextEnabled': function () { |
106 | return this._isNextEnabled; | 103 | return this._isNextEnabled; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //----------------------------------------------------------------------------- | 106 | //----------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'enablePrevious': function (aValue) { | 108 | 'enablePrevious': function (aValue) { |
112 | this.rulerComponent().enablePrevious(aValue); | 109 | this.rulerComponent().enablePrevious(aValue); |
113 | }, | 110 | }, |
114 | 111 | ||
115 | //============================================================================= | 112 | //============================================================================= |
116 | 113 | ||
117 | 'bindingComponents': function () { | 114 | 'bindingComponents': function () { |
118 | return this._bindingComponents; | 115 | return this._bindingComponents; |
119 | }, | 116 | }, |
120 | 117 | ||
121 | 'resetBindingComponents': function () { | 118 | 'resetBindingComponents': function () { |
122 | this.directLoginEditingComponent().clearAllBindingsComponents(); | 119 | this.directLoginEditingComponent().clearAllBindingsComponents(); |
123 | this._bindingComponents = []; | 120 | this._bindingComponents = []; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | //============================================================================= | 123 | //============================================================================= |
127 | 124 | ||
128 | 'formValueComponents': function () { | 125 | 'formValueComponents': function () { |
129 | return this._formValueComponents; | 126 | return this._formValueComponents; |
130 | }, | 127 | }, |
131 | 128 | ||
132 | 'resetFormValueComponents': function () { | 129 | 'resetFormValueComponents': function () { |
133 | this.directLoginEditingComponent().clearAllFormValueComponents(); | 130 | this.directLoginEditingComponent().clearAllFormValueComponents(); |
134 | this._formValueComponents = []; | 131 | this._formValueComponents = []; |
135 | }, | 132 | }, |
136 | 133 | ||
137 | //============================================================================= | 134 | //============================================================================= |
138 | 135 | ||
139 | 'recordFields': function () { | 136 | 'recordFields': function () { |
140 | return this._recordFields; | 137 | return this._recordFields; |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'setRecordFields': function (aValue) { | 140 | 'setRecordFields': function (aValue) { |
144 | this._recordFields = aValue; | 141 | this._recordFields = aValue; |
145 | }, | 142 | }, |
146 | 143 | ||
147 | 'recordFieldWithReference': function (aReference) { | 144 | 'recordFieldWithReference': function (aReference) { |
148 | var matchingValues; | 145 | var matchingValues; |
149 | var result; | 146 | var result; |
150 | 147 | ||
151 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); | 148 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); |
152 | 149 | ||
153 | if (matchingValues.length == 0) { | 150 | if (matchingValues.length == 0) { |
154 | result = null; | 151 | result = null; |
155 | } else { | 152 | } else { |
156 | result = matchingValues[0]; | 153 | result = matchingValues[0]; |
157 | } | 154 | } |
158 | 155 | ||
159 | return result; | 156 | return result; |
160 | }, | 157 | }, |
161 | 158 | ||
162 | //----------------------------------------------------------------------------- | 159 | //----------------------------------------------------------------------------- |
163 | 160 | ||
164 | 'originalBindings': function () { | 161 | 'originalBindings': function () { |
165 | return this._originalBindings; | 162 | return this._originalBindings; |
166 | }, | 163 | }, |
167 | 164 | ||
168 | 'setOriginalBindings': function (aValue) { | 165 | 'setOriginalBindings': function (aValue) { |
169 | //console.log("BINDINGS", aValue); | 166 | //console.log("BINDINGS", aValue); |
170 | this._originalBindings = aValue; | 167 | this._originalBindings = aValue; |
171 | }, | 168 | }, |
172 | 169 | ||
173 | //============================================================================= | 170 | //============================================================================= |
174 | 171 | ||
175 | 'rulerComponent': function () { | 172 | 'rulerComponent': function () { |
176 | if (this._rulerComponent == null) { | 173 | if (this._rulerComponent == null) { |
177 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 174 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
178 | translationContext:'Wizards.DirectLoginWizard' | 175 | translationContext:'Wizards.DirectLoginWizard' |
179 | }); | 176 | }); |
180 | this._rulerComponent.render(); | 177 | this._rulerComponent.render(); |
181 | 178 | ||
182 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 179 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
183 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 180 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
184 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 181 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
185 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 182 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
186 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 183 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
187 | } | 184 | } |
188 | 185 | ||
189 | return this._rulerComponent; | 186 | return this._rulerComponent; |
190 | }, | 187 | }, |
191 | 188 | ||
192 | //----------------------------------------------------------------------------- | 189 | //----------------------------------------------------------------------------- |
193 | 190 | ||
194 | 'showRuler': function (someSteps) { | 191 | 'showRuler': function (someSteps) { |
195 | var rulerElement; | 192 | var rulerElement; |
196 | 193 | ||
197 | this.setSteps(someSteps); | 194 | this.setSteps(someSteps); |
198 | 195 | ||
199 | rulerElement = this.rulerComponent().element(); | 196 | rulerElement = this.rulerComponent().element(); |
200 | this.directLoginEditingComponent().disableAllPanels(); | 197 | this.directLoginEditingComponent().disableAllPanels(); |
201 | 198 | ||
202 | MochiKit.Style.showElement(rulerElement); | 199 | MochiKit.Style.showElement(rulerElement); |
203 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); | 200 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); |
204 | new MochiKit.Visual.Move(rulerElement, { | 201 | new MochiKit.Visual.Move(rulerElement, { |
205 | x:0, y:this.directLoginEditingComponent().bottomMargin(), | 202 | x:0, y:this.directLoginEditingComponent().bottomMargin(), |
206 | mode:'absolute', | 203 | mode:'absolute', |
207 | duration:1, | 204 | duration:1, |
208 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | 205 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') |
209 | }); | 206 | }); |
210 | }, | 207 | }, |
211 | 208 | ||
212 | 'fixRulerRendering': function (aValue) { | 209 | 'fixRulerRendering': function (aValue) { |
213 | this.rulerComponent().setDisplayMode(aValue); | 210 | this.rulerComponent().setDisplayMode(aValue); |
214 | }, | 211 | }, |
215 | 212 | ||
216 | //----------------------------------------------------------------------------- | 213 | //----------------------------------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js index 28401a2..6ca3be4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js | |||
@@ -1,145 +1,142 @@ | |||
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 | /* | 26 | /* |
30 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 27 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
31 | 28 | ||
32 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { | 29 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { |
33 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); | 30 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); |
34 | 31 | ||
35 | return this; | 32 | return this; |
36 | }; | 33 | }; |
37 | 34 | ||
38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 35 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
39 | 36 | ||
40 | 'createGrid': function () { | 37 | 'createGrid': function () { |
41 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 38 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
42 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 39 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
43 | 'name': 'DirectLogins.favicon', | 40 | 'name': 'DirectLogins.favicon', |
44 | 'selector': MochiKit.Base.methodcaller('favicon'), | 41 | 'selector': MochiKit.Base.methodcaller('favicon'), |
45 | 'cssClass': 'favicon' | 42 | 'cssClass': 'favicon' |
46 | }), | 43 | }), |
47 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 44 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
48 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ | 45 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ |
49 | 'name': 'DirectLogins.title', | 46 | 'name': 'DirectLogins.title', |
50 | 'selector': MochiKit.Base.methodcaller('label'), | 47 | 'selector': MochiKit.Base.methodcaller('label'), |
51 | 'label': 'title', | 48 | 'label': 'title', |
52 | 'cssClass': 'title', | 49 | 'cssClass': 'title', |
53 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 50 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
54 | 'sortable': true, | 51 | 'sortable': true, |
55 | 'sorted': 'ASCENDING', | 52 | 'sorted': 'ASCENDING', |
56 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') | 53 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') |
57 | }), | 54 | }), |
58 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 55 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
59 | // 'label':'strength', | 56 | // 'label':'strength', |
60 | // 'cssClass':'title', | 57 | // 'cssClass':'title', |
61 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function | 58 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function |
62 | // }), | 59 | // }), |
63 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 60 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
64 | 'name': 'DirectLogins.cardTitle', | 61 | 'name': 'DirectLogins.cardTitle', |
65 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), | 62 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), |
66 | 'label': 'card', | 63 | 'label': 'card', |
67 | 'cssClass': 'cardTitle', | 64 | 'cssClass': 'cardTitle', |
68 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 65 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
69 | 'sortable': true, | 66 | 'sortable': true, |
70 | 'sorted': 'UNSORTED', | 67 | 'sorted': 'UNSORTED', |
71 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 68 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
72 | }), | 69 | }), |
73 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 70 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
74 | // 'label':'last access', | 71 | // 'label':'last access', |
75 | // 'cssClass':'title', | 72 | // 'cssClass':'title', |
76 | // 'selector': MochiKit.Base.methodcaller('label') | 73 | // 'selector': MochiKit.Base.methodcaller('label') |
77 | // // 'sortable': true, | 74 | // // 'sortable': true, |
78 | // // 'sorted': 'UNSORTED' | 75 | // // 'sorted': 'UNSORTED' |
79 | // }), | 76 | // }), |
80 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ | 77 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ |
81 | // 'label':'commands', | 78 | // 'label':'commands', |
82 | // 'cssClass':'title', | 79 | // 'cssClass':'title', |
83 | // 'selector': MochiKit.Base.methodcaller('label'), //should be a function for commands display | 80 | // 'selector': MochiKit.Base.methodcaller('label'), //should be a function for commands display |
84 | // }), | 81 | // }), |
85 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | 82 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ |
86 | 'name': 'DirectLogins.delete', | 83 | 'name': 'DirectLogins.delete', |
87 | 'selector': MochiKit.Base.noop, | 84 | 'selector': MochiKit.Base.noop, |
88 | 'cssClass': 'delete', | 85 | 'cssClass': 'delete', |
89 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteDirectLogin', {objectData:anObject, element:anEvent.src()})} | 86 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteDirectLogin', {objectData:anObject, element:anEvent.src()})} |
90 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteDirectLogin') | 87 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteDirectLogin') |
91 | }) | 88 | }) |
92 | ]}); | 89 | ]}); |
93 | 90 | ||
94 | }, | 91 | }, |
95 | 92 | ||
96 | //----------------------------------------------------------------------------- | 93 | //----------------------------------------------------------------------------- |
97 | 94 | ||
98 | 'getRows': function () { | 95 | 'getRows': function () { |
99 | //TODO: relying on user() in GridController, bad code smell :| | 96 | //TODO: relying on user() in GridController, bad code smell :| |
100 | return this.user().getDirectLogins(); | 97 | return this.user().getDirectLogins(); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //----------------------------------------------------------------------------- | 100 | //----------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'handleShowCard': function (anObject, anEvent) { | 102 | 'handleShowCard': function (anObject, anEvent) { |
106 | var cardDialogController; | 103 | var cardDialogController; |
107 | 104 | ||
108 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject.record()}) | 105 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject.record()}) |
109 | cardDialogController.run(anEvent.src()); | 106 | cardDialogController.run(anEvent.src()); |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //----------------------------------------------------------------------------- | 109 | //----------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'handleDeleteDirectLogin': function (anObject, anEvent) { | 111 | 'handleDeleteDirectLogin': function (anObject, anEvent) { |
115 | var deferredResult; | 112 | var deferredResult; |
116 | var confirmationDialog; | 113 | var confirmationDialog; |
117 | 114 | ||
118 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | 115 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ |
119 | title:"Delete DirectLogin", | 116 | title:"Delete DirectLogin", |
120 | text:"Do you want to delete …", | 117 | text:"Do you want to delete …", |
121 | type:'ALERT', | 118 | type:'ALERT', |
122 | buttons: [ | 119 | buttons: [ |
123 | {text:"Cancel",result:'CANCEL', isDefault:true}, | 120 | {text:"Cancel",result:'CANCEL', isDefault:true}, |
124 | {text:"Delete", result:'OK'} | 121 | {text:"Delete", result:'OK'} |
125 | ] | 122 | ] |
126 | }); | 123 | }); |
127 | 124 | ||
128 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); | 125 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); |
129 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); | 126 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); |
130 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { | 127 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { |
131 | 'openFromElement': anEvent.src(), | 128 | 'openFromElement': anEvent.src(), |
132 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, | 129 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, |
133 | 'onCancelCloseToElement':anEvent.src() | 130 | 'onCancelCloseToElement':anEvent.src() |
134 | }); | 131 | }); |
135 | deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); | 132 | deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); |
136 | deferredResult.addErrbackPass(function () { Clipperz.log("skip deletion: " + anObject.toString(), anObject); }); | 133 | deferredResult.addErrbackPass(function () { Clipperz.log("skip deletion: " + anObject.toString(), anObject); }); |
137 | deferredResult.callback(); | 134 | deferredResult.callback(); |
138 | 135 | ||
139 | return deferredResult; | 136 | return deferredResult; |
140 | }, | 137 | }, |
141 | 138 | ||
142 | //----------------------------------------------------------------------------- | 139 | //----------------------------------------------------------------------------- |
143 | __syntaxFix__: "syntax fix" | 140 | __syntaxFix__: "syntax fix" |
144 | }); | 141 | }); |
145 | */ \ No newline at end of file | 142 | */ \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js index 13e02bc..bfc093a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js | |||
@@ -1,158 +1,155 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); | 31 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); |
35 | 32 | ||
36 | this._filterElements = []; | 33 | this._filterElements = []; |
37 | this._filter = ""; | 34 | this._filter = ""; |
38 | 35 | ||
39 | this._pendingSearchClicks = 0; | 36 | this._pendingSearchClicks = 0; |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | }; | 39 | }; |
43 | 40 | ||
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { |
46 | 43 | ||
47 | //----------------------------------------------------------------------------- | 44 | //----------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'getFilter': function () { | 46 | 'getFilter': function () { |
50 | return this._filter; | 47 | return this._filter; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | '_setFilter': function (aFilterElement, aFilter) { | 50 | '_setFilter': function (aFilterElement, aFilter) { |
54 | if (aFilter != this._filter) { | 51 | if (aFilter != this._filter) { |
55 | this._filter = aFilter; | 52 | this._filter = aFilter; |
56 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); | 53 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); |
57 | this.updateFilterElements(aFilterElement, aFilter); | 54 | this.updateFilterElements(aFilterElement, aFilter); |
58 | } | 55 | } |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'setFilter': function (aFilter) { | 58 | 'setFilter': function (aFilter) { |
62 | this._setFilter(null, aFilter); | 59 | this._setFilter(null, aFilter); |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //----------------------------------------------------------------------------- | 62 | //----------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'filterElements': function () { | 64 | 'filterElements': function () { |
68 | return this._filterElements; | 65 | return this._filterElements; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | 'registerFilterElement': function (aFilterElement) { | 68 | 'registerFilterElement': function (aFilterElement) { |
72 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); | 69 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); |
73 | this._filterElements.push(aFilterElement); | 70 | this._filterElements.push(aFilterElement); |
74 | MochiKit.Signal.connect(aFilterElement, 'onkeydown', this, 'searchClickHandler'); | 71 | MochiKit.Signal.connect(aFilterElement, 'onkeydown', this, 'searchClickHandler'); |
75 | MochiKit.Signal.connect(aFilterElement, 'onfocus', this, 'searchClickHandler'); | 72 | MochiKit.Signal.connect(aFilterElement, 'onfocus', this, 'searchClickHandler'); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'removeFilterElement': function (aFilterElement) { | 75 | 'removeFilterElement': function (aFilterElement) { |
79 | var i; | 76 | var i; |
80 | var filterElements; | 77 | var filterElements; |
81 | for (i=0; i < filterElements; i++) { | 78 | for (i=0; i < filterElements; i++) { |
82 | if (filterElements[i] == aFilterElement); | 79 | if (filterElements[i] == aFilterElement); |
83 | filterElements.splice(i, 1); | 80 | filterElements.splice(i, 1); |
84 | // TODO unregister/disconnect filterElement ??MochiKit.Signal.disconnect(this.grid().filterElement(), 'updateFilter', this.filterController(), 'handleUpdateFilter'); | 81 | // TODO unregister/disconnect filterElement ??MochiKit.Signal.disconnect(this.grid().filterElement(), 'updateFilter', this.filterController(), 'handleUpdateFilter'); |
85 | } | 82 | } |
86 | }, | 83 | }, |
87 | 84 | ||
88 | 'updateFilterElements': function (aSourceElement, aFilterString) { | 85 | 'updateFilterElements': function (aSourceElement, aFilterString) { |
89 | MochiKit.Iter.forEach(this.filterElements(), | 86 | MochiKit.Iter.forEach(this.filterElements(), |
90 | function (aFilterElement) { | 87 | function (aFilterElement) { |
91 | if (aFilterElement != aSourceElement) { | 88 | if (aFilterElement != aSourceElement) { |
92 | aFilterElement.value = aFilterString; | 89 | aFilterElement.value = aFilterString; |
93 | } | 90 | } |
94 | } | 91 | } |
95 | ); | 92 | ); |
96 | 93 | ||
97 | if (aSourceElement != null) { | 94 | if (aSourceElement != null) { |
98 | aSourceElement.focus(); | 95 | aSourceElement.focus(); |
99 | } | 96 | } |
100 | }, | 97 | }, |
101 | 98 | ||
102 | //----------------------------------------------------------------------------- | 99 | //----------------------------------------------------------------------------- |
103 | 100 | ||
104 | 'run': function () { | 101 | 'run': function () { |
105 | //Clipperz.log("=== FilterController.run"); | 102 | //Clipperz.log("=== FilterController.run"); |
106 | }, | 103 | }, |
107 | 104 | ||
108 | //----------------------------------------------------------------------------- | 105 | //----------------------------------------------------------------------------- |
109 | 106 | ||
110 | 'pendingSearchClicks': function () { | 107 | 'pendingSearchClicks': function () { |
111 | return this._pendingSearchClicks; | 108 | return this._pendingSearchClicks; |
112 | }, | 109 | }, |
113 | 110 | ||
114 | 'incrementPendingSearchClicks': function () { | 111 | 'incrementPendingSearchClicks': function () { |
115 | this._pendingSearchClicks++; | 112 | this._pendingSearchClicks++; |
116 | }, | 113 | }, |
117 | 114 | ||
118 | 'decrementPendingSearchClicks': function () { | 115 | 'decrementPendingSearchClicks': function () { |
119 | this._pendingSearchClicks--; | 116 | this._pendingSearchClicks--; |
120 | }, | 117 | }, |
121 | 118 | ||
122 | //----------------------------------------------------------------------------- | 119 | //----------------------------------------------------------------------------- |
123 | 120 | ||
124 | 'searchClickHandler': function (anEvent) { | 121 | 'searchClickHandler': function (anEvent) { |
125 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { | 122 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { |
126 | anEvent.preventDefault(); | 123 | anEvent.preventDefault(); |
127 | } else { | 124 | } else { |
128 | var value; | 125 | var value; |
129 | 126 | ||
130 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { | 127 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { |
131 | value = "" | 128 | value = "" |
132 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_UP')) { | 129 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_UP')) { |
133 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_DOWN')) { | 130 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_DOWN')) { |
134 | } else { | 131 | } else { |
135 | value = null; | 132 | value = null; |
136 | } | 133 | } |
137 | 134 | ||
138 | this.incrementPendingSearchClicks(); | 135 | this.incrementPendingSearchClicks(); |
139 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, "searchClickDeferredHandler", anEvent.src(), value)); | 136 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, "searchClickDeferredHandler", anEvent.src(), value)); |
140 | } | 137 | } |
141 | }, | 138 | }, |
142 | 139 | ||
143 | //......................................................................... | 140 | //......................................................................... |
144 | 141 | ||
145 | 'searchClickDeferredHandler': function (aFilterElement, aValue) { | 142 | 'searchClickDeferredHandler': function (aFilterElement, aValue) { |
146 | if (aValue != null) { | 143 | if (aValue != null) { |
147 | aFilterElement.value = aValue; | 144 | aFilterElement.value = aValue; |
148 | } | 145 | } |
149 | 146 | ||
150 | this.decrementPendingSearchClicks(); | 147 | this.decrementPendingSearchClicks(); |
151 | if (this.pendingSearchClicks()==0) { | 148 | if (this.pendingSearchClicks()==0) { |
152 | this._setFilter(aFilterElement, aFilterElement.value); | 149 | this._setFilter(aFilterElement, aFilterElement.value); |
153 | } | 150 | } |
154 | }, | 151 | }, |
155 | 152 | ||
156 | //----------------------------------------------------------------------------- | 153 | //----------------------------------------------------------------------------- |
157 | 'syntaxFix': 'syntax fix' | 154 | 'syntaxFix': 'syntax fix' |
158 | }); \ No newline at end of file | 155 | }); \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js index 740a091..8bb3016 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); | 31 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); |
35 | 32 | ||
36 | this._grid = null; | 33 | this._grid = null; |
37 | this._user = null; | 34 | this._user = null; |
38 | this._sortedColumnManager = null; | 35 | this._sortedColumnManager = null; |
39 | this._cachedObjects = null; | 36 | this._cachedObjects = null; |
40 | this._filterController = args.filterController || null; | 37 | this._filterController = args.filterController || null; |
41 | 38 | ||
42 | this._deferredDisplaySelectedRowsInvocation = null; | 39 | this._deferredDisplaySelectedRowsInvocation = null; |
43 | 40 | ||
44 | return this; | 41 | return this; |
45 | }; | 42 | }; |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { |
48 | 45 | ||
49 | 'toString': function() { | 46 | 'toString': function() { |
50 | return "Clipperz.PM.UI.Web.Controllers.GridController"; | 47 | return "Clipperz.PM.UI.Web.Controllers.GridController"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //----------------------------------------------------------------------------- | 50 | //----------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'createGrid': function () { | 52 | 'createGrid': function () { |
56 | throw Clipperz.Base.exception.AbstractMethod; | 53 | throw Clipperz.Base.exception.AbstractMethod; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | 'setupWithGrid': function (aGrid) { | 56 | 'setupWithGrid': function (aGrid) { |
60 | this._grid = aGrid; | 57 | this._grid = aGrid; |
61 | 58 | ||
62 | if (this._grid != null) { | 59 | if (this._grid != null) { |
63 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 60 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
64 | if (aColumnManager.isSortable()) { | 61 | if (aColumnManager.isSortable()) { |
65 | if (aColumnManager.isSorted()) { | 62 | if (aColumnManager.isSorted()) { |
66 | this.setSortedColumnManager(aColumnManager); | 63 | this.setSortedColumnManager(aColumnManager); |
67 | } | 64 | } |
68 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); | 65 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); |
69 | } | 66 | } |
70 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); | 67 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); |
71 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); | 68 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); |
72 | }, this); | 69 | }, this); |
73 | } | 70 | } |
74 | }, | 71 | }, |
75 | 72 | ||
76 | 'grid': function() { | 73 | 'grid': function() { |
77 | if (this._grid == null) { | 74 | if (this._grid == null) { |
78 | this.setupWithGrid(this.createGrid()); | 75 | this.setupWithGrid(this.createGrid()); |
79 | } | 76 | } |
80 | 77 | ||
81 | return this._grid; | 78 | return this._grid; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | 'filterController': function () { | 81 | 'filterController': function () { |
85 | //Clipperz.log('GridController.filterController >>>', this._filterController); | 82 | //Clipperz.log('GridController.filterController >>>', this._filterController); |
86 | if (this._filterController == null) { | 83 | if (this._filterController == null) { |
87 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); | 84 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); |
88 | } | 85 | } |
89 | //Clipperz.log('GridController.filterController <<<', this._filterController); | 86 | //Clipperz.log('GridController.filterController <<<', this._filterController); |
90 | return this._filterController; | 87 | return this._filterController; |
91 | }, | 88 | }, |
92 | 89 | ||
93 | //----------------------------------------------------------------------------- | 90 | //----------------------------------------------------------------------------- |
94 | 91 | ||
95 | 'columnsManagers': function () { | 92 | 'columnsManagers': function () { |
96 | return this.grid().columnsManagers(); | 93 | return this.grid().columnsManagers(); |
97 | }, | 94 | }, |
98 | 95 | ||
99 | 'columnManagerWithName': function (aName) { | 96 | 'columnManagerWithName': function (aName) { |
100 | varmanagers; | 97 | varmanagers; |
101 | var result; | 98 | var result; |
102 | 99 | ||
103 | managers = MochiKit.Base.filter(function (aManager) { return aManager.name() == aName; } , this.columnsManagers()); | 100 | managers = MochiKit.Base.filter(function (aManager) { return aManager.name() == aName; } , this.columnsManagers()); |
104 | 101 | ||
105 | if (managers.length == 1) { | 102 | if (managers.length == 1) { |
106 | result = managers[0]; | 103 | result = managers[0]; |
107 | } else if (managers.length == 0) { | 104 | } else if (managers.length == 0) { |
108 | result = null; | 105 | result = null; |
109 | } else { | 106 | } else { |
110 | throw "WTF!!!"; | 107 | throw "WTF!!!"; |
111 | } | 108 | } |
112 | 109 | ||
113 | return result; | 110 | return result; |
114 | }, | 111 | }, |
115 | 112 | ||
116 | 'sortedColumnManager': function () { | 113 | 'sortedColumnManager': function () { |
117 | return this._sortedColumnManager; | 114 | return this._sortedColumnManager; |
118 | }, | 115 | }, |
119 | 116 | ||
120 | 'setSortedColumnManager': function(aValue) { | 117 | 'setSortedColumnManager': function(aValue) { |
121 | if (aValue.sorted() != 'UNSORTED') { | 118 | if (aValue.sorted() != 'UNSORTED') { |
122 | this._sortedColumnManager = aValue; | 119 | this._sortedColumnManager = aValue; |
123 | } else { | 120 | } else { |
124 | this._sortedColumnManager = null; | 121 | this._sortedColumnManager = null; |
125 | } | 122 | } |
126 | }, | 123 | }, |
127 | 124 | ||
128 | //----------------------------------------------------------------------------- | 125 | //----------------------------------------------------------------------------- |
129 | 126 | ||
130 | 'handleColumnManagerSort': function(aSelectedColumnManager) { | 127 | 'handleColumnManagerSort': function(aSelectedColumnManager) { |
131 | MochiKit.Iter.forEach(this.columnsManagers(), function(aColumnManager) { | 128 | MochiKit.Iter.forEach(this.columnsManagers(), function(aColumnManager) { |
132 | if (aSelectedColumnManager != aColumnManager) { | 129 | if (aSelectedColumnManager != aColumnManager) { |
133 | if (aColumnManager.isSortable()) { | 130 | if (aColumnManager.isSortable()) { |
134 | aColumnManager.setSorted('UNSORTED'); | 131 | aColumnManager.setSorted('UNSORTED'); |
135 | } | 132 | } |
136 | } | 133 | } |
137 | }); | 134 | }); |
138 | 135 | ||
139 | aSelectedColumnManager.toggleSorting(); | 136 | aSelectedColumnManager.toggleSorting(); |
140 | this.setSortedColumnManager(aSelectedColumnManager); | 137 | this.setSortedColumnManager(aSelectedColumnManager); |
141 | 138 | ||
142 | this.displaySelectedRows(this.filterController().getFilter()); | 139 | this.displaySelectedRows(this.filterController().getFilter()); |
143 | }, | 140 | }, |
144 | 141 | ||
145 | 'handleColumnManagerSelectRow': function (aRowObject) { | 142 | 'handleColumnManagerSelectRow': function (aRowObject) { |
146 | this.grid().selectRow(aRowObject); | 143 | this.grid().selectRow(aRowObject); |
147 | }, | 144 | }, |
148 | 145 | ||
149 | 'handleColumnManagerUnselectRow': function (aRowObject) { | 146 | 'handleColumnManagerUnselectRow': function (aRowObject) { |
150 | this.grid().unselectRow(aRowObject); | 147 | this.grid().unselectRow(aRowObject); |
151 | }, | 148 | }, |
152 | 149 | ||
153 | //----------------------------------------------------------------------------- | 150 | //----------------------------------------------------------------------------- |
154 | 151 | ||
155 | 'handleFilterUpdated': function (aFilter) { | 152 | 'handleFilterUpdated': function (aFilter) { |
156 | if (this.grid().isActive()) { | 153 | if (this.grid().isActive()) { |
157 | this.displaySelectedRows(aFilter); | 154 | this.displaySelectedRows(aFilter); |
158 | } | 155 | } |
159 | }, | 156 | }, |
160 | 157 | ||
161 | //----------------------------------------------------------------------------- | 158 | //----------------------------------------------------------------------------- |
162 | //TODO: relying on user() in GridController, bad code smell :| | 159 | //TODO: relying on user() in GridController, bad code smell :| |
163 | //mhh: a controller should have access to business logic object too. Otherwise it will fail its controller role. [Giulio Cesare] | 160 | //mhh: a controller should have access to business logic object too. Otherwise it will fail its controller role. [Giulio Cesare] |
164 | 161 | ||
165 | 'setUser': function(anUser) { | 162 | 'setUser': function(anUser) { |
166 | this._user = anUser; | 163 | this._user = anUser; |
167 | }, | 164 | }, |
168 | 165 | ||
169 | 'user': function() { | 166 | 'user': function() { |
170 | return this._user; | 167 | return this._user; |
171 | }, | 168 | }, |
172 | 169 | ||
173 | //----------------------------------------------------------------------------- | 170 | //----------------------------------------------------------------------------- |
174 | 171 | ||
175 | 'run': function(args) { | 172 | 'run': function(args) { |
176 | //Clipperz.log("=== GridController.run"); | 173 | //Clipperz.log("=== GridController.run"); |
177 | var deferredResult; | 174 | var deferredResult; |
178 | 175 | ||
179 | this.setUser(args.user); | 176 | this.setUser(args.user); |
180 | args.slot.setContent(this.grid()); | 177 | args.slot.setContent(this.grid()); |
181 | this.filterController().registerFilterElement(this.grid().filterElement()); | 178 | this.filterController().registerFilterElement(this.grid().filterElement()); |
182 | MochiKit.Signal.connect(this.filterController(), 'filterUpdated', this, 'handleFilterUpdated'); | 179 | MochiKit.Signal.connect(this.filterController(), 'filterUpdated', this, 'handleFilterUpdated'); |
183 | 180 | ||
184 | return this.displaySelectedRows(); | 181 | return this.displaySelectedRows(); |
185 | }, | 182 | }, |
186 | 183 | ||
187 | //----------------------------------------------------------------------------- | 184 | //----------------------------------------------------------------------------- |
188 | 185 | ||
189 | 'handleGenericError': function(anError) { | 186 | 'handleGenericError': function(anError) { |
190 | var result; | 187 | var result; |
191 | 188 | ||
192 | if (anError instanceof MochiKit.Async.CancelledError) { | 189 | if (anError instanceof MochiKit.Async.CancelledError) { |
193 | result = anError; | 190 | result = anError; |
194 | } else { | 191 | } else { |
195 | Clipperz.log("## GridController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | 192 | Clipperz.log("## GridController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); |
196 | result = new MochiKit.Async.CancelledError(anError); | 193 | result = new MochiKit.Async.CancelledError(anError); |
197 | } | 194 | } |
198 | 195 | ||
199 | return result; | 196 | return result; |
200 | }, | 197 | }, |
201 | 198 | ||
202 | //----------------------------------------------------------------------------- | 199 | //----------------------------------------------------------------------------- |
203 | 200 | ||
204 | 'getRows': function () { | 201 | 'getRows': function () { |
205 | throw Clipperz.Base.AbstractMethod; | 202 | throw Clipperz.Base.AbstractMethod; |
206 | }, | 203 | }, |
207 | 204 | ||
208 | //----------------------------------------------------------------------------- | 205 | //----------------------------------------------------------------------------- |
209 | 206 | ||
210 | 'setDeferredDisplaySelectedRowsInvocation': function (aDeferred) { | 207 | 'setDeferredDisplaySelectedRowsInvocation': function (aDeferred) { |
211 | if (this._deferredDisplaySelectedRowsInvocation != null) { | 208 | if (this._deferredDisplaySelectedRowsInvocation != null) { |
212 | this._deferredDisplaySelectedRowsInvocation.cancel(); | 209 | this._deferredDisplaySelectedRowsInvocation.cancel(); |
213 | } | 210 | } |
214 | 211 | ||
215 | this._deferredDisplaySelectedRowsInvocation = aDeferred; | 212 | this._deferredDisplaySelectedRowsInvocation = aDeferred; |
216 | }, | 213 | }, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js index d88af41..d0b378c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { |
32 | this._args = args || {}; | 29 | this._args = args || {}; |
33 | 30 | ||
34 | this._loginPage = null; | 31 | this._loginPage = null; |
35 | 32 | ||
36 | this._newUserWizardController = null; | 33 | this._newUserWizardController = null; |
37 | this._newUserCreationComponent = null; | 34 | this._newUserCreationComponent = null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | 39 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { |
43 | 40 | ||
44 | 'toString': function() { | 41 | 'toString': function() { |
45 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; | 42 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; |
46 | }, | 43 | }, |
47 | 44 | ||
48 | 'args': function () { | 45 | 'args': function () { |
49 | return this._args; | 46 | return this._args; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //----------------------------------------------------------------------------- | 49 | //----------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'loginPage': function() { | 51 | 'loginPage': function() { |
55 | if (this._loginPage == null) { | 52 | if (this._loginPage == null) { |
56 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); | 53 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); |
57 | 54 | ||
58 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') | 55 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') |
59 | } | 56 | } |
60 | 57 | ||
61 | return this._loginPage; | 58 | return this._loginPage; |
62 | }, | 59 | }, |
63 | 60 | ||
64 | //----------------------------------------------------------------------------- | 61 | //----------------------------------------------------------------------------- |
65 | 62 | ||
66 | 'run': function(args) { | 63 | 'run': function(args) { |
67 | varslot; | 64 | varslot; |
68 | varloginPage; | 65 | varloginPage; |
69 | varloginForm; | 66 | varloginForm; |
70 | 67 | ||
71 | slot = args.slot; | 68 | slot = args.slot; |
72 | 69 | ||
73 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); | 70 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); |
74 | 71 | ||
75 | slot.setContent(this.loginPage()); | 72 | slot.setContent(this.loginPage()); |
76 | this.loginPage().slotNamed('loginForm').setContent(loginForm); | 73 | this.loginPage().slotNamed('loginForm').setContent(loginForm); |
77 | 74 | ||
78 | MochiKit.Signal.connect(loginForm, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | 75 | MochiKit.Signal.connect(loginForm, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); |
79 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | 76 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //----------------------------------------------------------------------------- | 79 | //----------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'doLogin': function(aLoginForm, anEvent) { | 81 | 'doLogin': function(aLoginForm, anEvent) { |
85 | var deferredResult; | 82 | var deferredResult; |
86 | varparameters; | 83 | varparameters; |
87 | // varshouldUseOTP; | 84 | // varshouldUseOTP; |
88 | var loginProgress; | 85 | var loginProgress; |
89 | varuser; | 86 | varuser; |
90 | var getPassphraseDelegate; | 87 | var getPassphraseDelegate; |
91 | 88 | ||
92 | parameters = anEvent; | 89 | parameters = anEvent; |
93 | // shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); | 90 | // shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); |
94 | 91 | ||
95 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); | 92 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); |
96 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase')}); | 93 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase')}); |
97 | 94 | ||
98 | loginProgress = new Clipperz.PM.UI.Web.Components.LoginProgress(); | 95 | loginProgress = new Clipperz.PM.UI.Web.Components.LoginProgress(); |
99 | 96 | ||
100 | deferredResult = new Clipperz.Async.Deferred("LoginController.doLogin", {trace:false}); | 97 | deferredResult = new Clipperz.Async.Deferred("LoginController.doLogin", {trace:false}); |
101 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); | 98 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); |
102 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', getPassphraseDelegate); | 99 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', getPassphraseDelegate); |
103 | deferredResult.addMethod(loginProgress, 'deferredShowModal', {deferredObject:deferredResult, openFromElement:aLoginForm.submitButtonElement()}); | 100 | deferredResult.addMethod(loginProgress, 'deferredShowModal', {deferredObject:deferredResult, openFromElement:aLoginForm.submitButtonElement()}); |
104 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); | 101 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); |
105 | // if (shouldUseOTP == false) { | 102 | // if (shouldUseOTP == false) { |
106 | deferredResult.addMethod(user, 'login'); | 103 | deferredResult.addMethod(user, 'login'); |
107 | // } else { | 104 | // } else { |
108 | // deferredResult.addMethod(user, 'loginUsingOTP', parameters.username, parameters.otp); | 105 | // deferredResult.addMethod(user, 'loginUsingOTP', parameters.username, parameters.otp); |
109 | // } | 106 | // } |
110 | deferredResult.addCallback(function(aLoginProgress, res) { | 107 | deferredResult.addCallback(function(aLoginProgress, res) { |
111 | aLoginProgress.disableCancel(); | 108 | aLoginProgress.disableCancel(); |
112 | return res; | 109 | return res; |
113 | }, loginProgress); | 110 | }, loginProgress); |
114 | deferredResult.addCallback(function () { | 111 | deferredResult.addCallback(function () { |
115 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:MochiKit.DOM.currentDocument().body})); | 112 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:MochiKit.DOM.currentDocument().body})); |
116 | }) | 113 | }) |
117 | deferredResult.addMethod(this, 'userLoggedIn', user, loginProgress, aLoginForm); | 114 | deferredResult.addMethod(this, 'userLoggedIn', user, loginProgress, aLoginForm); |
118 | deferredResult.addErrback (MochiKit.Base.method(this, 'handleFailedLogin', loginProgress)); | 115 | deferredResult.addErrback (MochiKit.Base.method(this, 'handleFailedLogin', loginProgress)); |
119 | 116 | ||
120 | deferredResult.addErrback (MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:aLoginForm.submitButtonElement()})); | 117 | deferredResult.addErrback (MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:aLoginForm.submitButtonElement()})); |
121 | deferredResult.addErrbackPass (MochiKit.Base.method(aLoginForm, 'focusOnPassphraseField')); | 118 | deferredResult.addErrbackPass (MochiKit.Base.method(aLoginForm, 'focusOnPassphraseField')); |
122 | deferredResult.addBoth(MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'removePassphraseDelegate', getPassphraseDelegate)); | 119 | deferredResult.addBoth(MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'removePassphraseDelegate', getPassphraseDelegate)); |
123 | deferredResult.callback(); | 120 | deferredResult.callback(); |
124 | 121 | ||
125 | MochiKit.Signal.connect(loginProgress, 'cancelEvent', deferredResult, 'cancel'); | 122 | MochiKit.Signal.connect(loginProgress, 'cancelEvent', deferredResult, 'cancel'); |
126 | 123 | ||
127 | return deferredResult; | 124 | return deferredResult; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //----------------------------------------------------------------------------- | 127 | //----------------------------------------------------------------------------- |
131 | 128 | ||
132 | 'userLoggedIn': function(aUser) { | 129 | 'userLoggedIn': function(aUser) { |
133 | //Clipperz.log(">>> LoginController.userLoggedIn"); | 130 | //Clipperz.log(">>> LoginController.userLoggedIn"); |
134 | MochiKit.Signal.signal(this, 'userLoggedIn', {user: aUser}); | 131 | MochiKit.Signal.signal(this, 'userLoggedIn', {user: aUser}); |
135 | //Clipperz.log("<<< LoginController.userLoggedIn"); | 132 | //Clipperz.log("<<< LoginController.userLoggedIn"); |
136 | }, | 133 | }, |
137 | 134 | ||
138 | //========================================================================= | 135 | //========================================================================= |
139 | 136 | ||
140 | 'handleCreateNewAccountClick': function (aComponent) { | 137 | 'handleCreateNewAccountClick': function (aComponent) { |
141 | // return Clipperz.PM.DataModel.User.registerNewAccount("new", "user"); | 138 | // return Clipperz.PM.DataModel.User.registerNewAccount("new", "user"); |
142 | return Clipperz.Async.callbacks("LoginController.handleCreateNewAccountClick", [ | 139 | return Clipperz.Async.callbacks("LoginController.handleCreateNewAccountClick", [ |
143 | //' MochiKit.Base.method(this, 'newUserCreationComponent'), | 140 | //' MochiKit.Base.method(this, 'newUserCreationComponent'), |
144 | // MochiKit.Base.methodcaller('deferredShowModal', {openFromElement:aComponent}), | 141 | // MochiKit.Base.methodcaller('deferredShowModal', {openFromElement:aComponent}), |
145 | // MochiKit.Base.method(this.newUserWizardController(), 'run') | 142 | // MochiKit.Base.method(this.newUserWizardController(), 'run') |
146 | 143 | ||
147 | 144 | ||
148 | MochiKit.Base.method(this, 'newUserCreationComponent'), | 145 | MochiKit.Base.method(this, 'newUserCreationComponent'), |
149 | Clipperz.Async.forkAndJoin("Async.test succeedingForkedAndWaitDeferrer", [ | 146 | Clipperz.Async.forkAndJoin("Async.test succeedingForkedAndWaitDeferrer", [ |
150 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredShowModal', {openFromElement:aComponent, duration:0.5}), | 147 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredShowModal', {openFromElement:aComponent, duration:0.5}), |
151 | MochiKit.Base.method(this.newUserWizardController(), 'run') | 148 | MochiKit.Base.method(this.newUserWizardController(), 'run') |
152 | ], {trace:false}), | 149 | ], {trace:false}), |
153 | // MochiKit.Base.method(this.newUserCreationComponent(), 'enableCredentialsField') | 150 | // MochiKit.Base.method(this.newUserCreationComponent(), 'enableCredentialsField') |
154 | ], {trace:false}); | 151 | ], {trace:false}); |
155 | }, | 152 | }, |
156 | 153 | ||
157 | //----------------------------------------------------------------------------- | 154 | //----------------------------------------------------------------------------- |
158 | 155 | ||
159 | 'newUserWizardController': function () { | 156 | 'newUserWizardController': function () { |
160 | if (this._newUserWizardController == null) { | 157 | if (this._newUserWizardController == null) { |
161 | this._newUserWizardController = new Clipperz.PM.UI.Web.Controllers.NewUserWizardController({ | 158 | this._newUserWizardController = new Clipperz.PM.UI.Web.Controllers.NewUserWizardController({ |
162 | 'newUserCreationComponent': this.newUserCreationComponent() | 159 | 'newUserCreationComponent': this.newUserCreationComponent() |
163 | }) | 160 | }) |
164 | 161 | ||
165 | // MochiKit.Signal.connect(this._newUserWizardController, 'exit',this, 'handleHideNewUserCreationComponent'); | 162 | // MochiKit.Signal.connect(this._newUserWizardController, 'exit',this, 'handleHideNewUserCreationComponent'); |
166 | MochiKit.Signal.connect(this._newUserWizardController, 'done',this, 'handleCompleteNewUserCreationComponent'); | 163 | MochiKit.Signal.connect(this._newUserWizardController, 'done',this, 'handleCompleteNewUserCreationComponent'); |
167 | } | 164 | } |
168 | 165 | ||
169 | return this._newUserWizardController; | 166 | return this._newUserWizardController; |
170 | }, | 167 | }, |
171 | 168 | ||
172 | //------------------------------------------------------------------------- | 169 | //------------------------------------------------------------------------- |
173 | 170 | ||
174 | 'newUserCreationComponent': function () { | 171 | 'newUserCreationComponent': function () { |
175 | if (this._newUserCreationComponent == null) { | 172 | if (this._newUserCreationComponent == null) { |
176 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); | 173 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); |
177 | } | 174 | } |
178 | 175 | ||
179 | return this._newUserCreationComponent; | 176 | return this._newUserCreationComponent; |
180 | }, | 177 | }, |
181 | 178 | ||
182 | 'clearNewUserCreationComponent': function () { | 179 | 'clearNewUserCreationComponent': function () { |
183 | if (this._newUserCreationComponent != null) { | 180 | if (this._newUserCreationComponent != null) { |
184 | this._newUserCreationComponent.clear(); | 181 | this._newUserCreationComponent.clear(); |
185 | } | 182 | } |
186 | this._newUserCreationComponent = null; | 183 | this._newUserCreationComponent = null; |
187 | }, | 184 | }, |
188 | 185 | ||
189 | //------------------------------------------------------------------------- | 186 | //------------------------------------------------------------------------- |
190 | 187 | ||
191 | 'handleHideNewUserCreationComponent': function () { | 188 | 'handleHideNewUserCreationComponent': function () { |
192 | this.clearNewUserCreationComponent(); | 189 | this.clearNewUserCreationComponent(); |
193 | }, | 190 | }, |
194 | 191 | ||
195 | 'handleCompleteNewUserCreationComponent': function (someParameters) { | 192 | 'handleCompleteNewUserCreationComponent': function (someParameters) { |
196 | vardeferredResult; | 193 | vardeferredResult; |
197 | varuser; | 194 | varuser; |
198 | varnewUserCreationComponent; | 195 | varnewUserCreationComponent; |
199 | 196 | ||
200 | user = someParameters.user; | 197 | user = someParameters.user; |
201 | newUserCreationComponent = this.newUserCreationComponent(); | 198 | newUserCreationComponent = this.newUserCreationComponent(); |
202 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), | 199 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), |
203 | 200 | ||
204 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); | 201 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); |
205 | 202 | ||
206 | deferredResult.addCallbackList([ | 203 | deferredResult.addCallbackList([ |
207 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), | 204 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), |
208 | MochiKit.Base.method(user, 'login'), | 205 | MochiKit.Base.method(user, 'login'), |
209 | MochiKit.Base.method(this, 'userLoggedIn', user), | 206 | MochiKit.Base.method(this, 'userLoggedIn', user), |
210 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') | 207 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') |
211 | ]); | 208 | ]); |
212 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); | 209 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); |
213 | deferredResult.callback(); | 210 | deferredResult.callback(); |
214 | 211 | ||
215 | return deferredResult; | 212 | return deferredResult; |
216 | }, | 213 | }, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js index aa0d6ad..c83e3c0 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { |
32 | this._args = args; | 29 | this._args = args; |
33 | 30 | ||
34 | //controllers | 31 | //controllers |
35 | this._loginController =null; | 32 | this._loginController =null; |
36 | this._appController =null; | 33 | this._appController =null; |
37 | 34 | ||
38 | //components | 35 | //components |
39 | this._headerComponent = null; | 36 | this._headerComponent = null; |
40 | this._pageComponent =null; | 37 | this._pageComponent =null; |
41 | this._footerComponent = null; | 38 | this._footerComponent = null; |
42 | 39 | ||
43 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); | 40 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); |
44 | this._passphraseDelegateLock.acquire(); | 41 | this._passphraseDelegateLock.acquire(); |
45 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); | 42 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); |
46 | this._passphraseDelegate = null; | 43 | this._passphraseDelegate = null; |
47 | 44 | ||
48 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); | 45 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); |
49 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); | 46 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); |
50 | 47 | ||
51 | return this; | 48 | return this; |
52 | } | 49 | } |
53 | 50 | ||
54 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | 51 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { |
55 | 52 | ||
56 | 'toString': function() { | 53 | 'toString': function() { |
57 | return "Clipperz.PM.UI.Web.Controllers.MainController"; | 54 | return "Clipperz.PM.UI.Web.Controllers.MainController"; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | 'args': function () { | 57 | 'args': function () { |
61 | return this._args; | 58 | return this._args; |
62 | }, | 59 | }, |
63 | 60 | ||
64 | //----------------------------------------------------------------------------- | 61 | //----------------------------------------------------------------------------- |
65 | 62 | ||
66 | 'headerComponent': function() { | 63 | 'headerComponent': function() { |
67 | if (this._headerComponent == null) { | 64 | if (this._headerComponent == null) { |
68 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); | 65 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); |
69 | } | 66 | } |
70 | 67 | ||
71 | return this._headerComponent; | 68 | return this._headerComponent; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'footerComponent': function() { | 71 | 'footerComponent': function() { |
75 | if (this._footerComponent == null) { | 72 | if (this._footerComponent == null) { |
76 | this._footerComponent = new Clipperz.PM.UI.Web.Components.PageFooter(); | 73 | this._footerComponent = new Clipperz.PM.UI.Web.Components.PageFooter(); |
77 | } | 74 | } |
78 | 75 | ||
79 | return this._footerComponent; | 76 | return this._footerComponent; |
80 | }, | 77 | }, |
81 | 78 | ||
82 | //----------------------------------------------------------------------------- | 79 | //----------------------------------------------------------------------------- |
83 | 80 | ||
84 | 'pageComponent': function() { | 81 | 'pageComponent': function() { |
85 | if (this._pageComponent == null) { | 82 | if (this._pageComponent == null) { |
86 | this._pageComponent = new Clipperz.PM.UI.Web.Components.Page({element:MochiKit.DOM.getElement('mainDiv')}); | 83 | this._pageComponent = new Clipperz.PM.UI.Web.Components.Page({element:MochiKit.DOM.getElement('mainDiv')}); |
87 | } | 84 | } |
88 | 85 | ||
89 | return this._pageComponent; | 86 | return this._pageComponent; |
90 | }, | 87 | }, |
91 | 88 | ||
92 | //----------------------------------------------------------------------------- | 89 | //----------------------------------------------------------------------------- |
93 | 90 | ||
94 | 'loginController': function() { | 91 | 'loginController': function() { |
95 | if (this._loginController == null) { | 92 | if (this._loginController == null) { |
96 | this._loginController = new Clipperz.PM.UI.Web.Controllers.LoginController(this.args()); | 93 | this._loginController = new Clipperz.PM.UI.Web.Controllers.LoginController(this.args()); |
97 | 94 | ||
98 | MochiKit.Signal.connect(this._loginController, 'userLoggedIn', this, 'loginControllerUserLoggedInCallback'); | 95 | MochiKit.Signal.connect(this._loginController, 'userLoggedIn', this, 'loginControllerUserLoggedInCallback'); |
99 | } | 96 | } |
100 | 97 | ||
101 | return this._loginController; | 98 | return this._loginController; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | 'appController': function() { | 101 | 'appController': function() { |
105 | if (this._appController == null) { | 102 | if (this._appController == null) { |
106 | this._appController = new Clipperz.PM.UI.Web.Controllers.AppController(); | 103 | this._appController = new Clipperz.PM.UI.Web.Controllers.AppController(); |
107 | 104 | ||
108 | MochiKit.Signal.connect(this._appController, 'logout', this, 'handleLogout'); | 105 | MochiKit.Signal.connect(this._appController, 'logout', this, 'handleLogout'); |
109 | } | 106 | } |
110 | 107 | ||
111 | return this._appController; | 108 | return this._appController; |
112 | }, | 109 | }, |
113 | 110 | ||
114 | //----------------------------------------------------------------------------- | 111 | //----------------------------------------------------------------------------- |
115 | 112 | ||
116 | 'run': function(shoudShowRegistrationForm) { | 113 | 'run': function(shoudShowRegistrationForm) { |
117 | this.pageComponent().slotNamed('header').setContent(this.headerComponent()); | 114 | this.pageComponent().slotNamed('header').setContent(this.headerComponent()); |
118 | this.pageComponent().slotNamed('footer').setContent(this.footerComponent()); | 115 | this.pageComponent().slotNamed('footer').setContent(this.footerComponent()); |
119 | 116 | ||
120 | this.pageComponent().render(); | 117 | this.pageComponent().render(); |
121 | 118 | ||
122 | this.loginController().run({slot:this.pageComponent().slotNamed('body')}); | 119 | this.loginController().run({slot:this.pageComponent().slotNamed('body')}); |
123 | 120 | ||
124 | if (shoudShowRegistrationForm) { | 121 | if (shoudShowRegistrationForm) { |
125 | MochiKit.Signal.signal(this.loginController().loginPage(), 'createNewAccountClick'); | 122 | MochiKit.Signal.signal(this.loginController().loginPage(), 'createNewAccountClick'); |
126 | // this.loginController().handleCreateNewAccountClick(); | 123 | // this.loginController().handleCreateNewAccountClick(); |
127 | } | 124 | } |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //----------------------------------------------------------------------------- | 127 | //----------------------------------------------------------------------------- |
131 | 128 | ||
132 | 'getPassphrase': function () { | 129 | 'getPassphrase': function () { |
133 | var deferredResult; | 130 | var deferredResult; |
134 | 131 | ||
135 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); | 132 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); |
136 | 133 | ||
137 | deferredResult.acquireLock(this._passphraseDelegateLock); | 134 | deferredResult.acquireLock(this._passphraseDelegateLock); |
138 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); | 135 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); |
139 | deferredResult.releaseLock(this._passphraseDelegateLock); | 136 | deferredResult.releaseLock(this._passphraseDelegateLock); |
140 | deferredResult.callback(); | 137 | deferredResult.callback(); |
141 | 138 | ||
142 | return deferredResult; | 139 | return deferredResult; |
143 | }, | 140 | }, |
144 | 141 | ||
145 | //......................................................................... | 142 | //......................................................................... |
146 | 143 | ||
147 | 'invokePassphraseDelegate': function () { | 144 | 'invokePassphraseDelegate': function () { |
148 | return this._passphraseDelegate(); | 145 | return this._passphraseDelegate(); |
149 | }, | 146 | }, |
150 | 147 | ||
151 | 'passphraseDelegateLock': function () { | 148 | 'passphraseDelegateLock': function () { |
152 | return this._passphraseDelegateLock; | 149 | return this._passphraseDelegateLock; |
153 | }, | 150 | }, |
154 | 151 | ||
155 | //......................................................................... | 152 | //......................................................................... |
156 | 153 | ||
157 | 'setPassphraseDelegate': function (aDelegate) { | 154 | 'setPassphraseDelegate': function (aDelegate) { |
158 | var shouldReleaseLock; | 155 | var shouldReleaseLock; |
159 | 156 | ||
160 | shouldReleaseLock = (this._passphraseDelegate == null); | 157 | shouldReleaseLock = (this._passphraseDelegate == null); |
161 | 158 | ||
162 | this._passphraseDelegate = aDelegate; | 159 | this._passphraseDelegate = aDelegate; |
163 | 160 | ||
164 | if (shouldReleaseLock) { | 161 | if (shouldReleaseLock) { |
165 | this._passphraseDelegateLock.release(); | 162 | this._passphraseDelegateLock.release(); |
166 | } | 163 | } |
167 | }, | 164 | }, |
168 | 165 | ||
169 | //......................................................................... | 166 | //......................................................................... |
170 | 167 | ||
171 | 'removePassphraseDelegate': function (aDelegate) { | 168 | 'removePassphraseDelegate': function (aDelegate) { |
172 | if (this._passphraseDelegate == aDelegate) { | 169 | if (this._passphraseDelegate == aDelegate) { |
173 | this._passphraseDelegate = null; | 170 | this._passphraseDelegate = null; |
174 | this._passphraseDelegateLock.acquire(); | 171 | this._passphraseDelegateLock.acquire(); |
175 | } | 172 | } |
176 | }, | 173 | }, |
177 | 174 | ||
178 | //------------------------------------------------------------------------- | 175 | //------------------------------------------------------------------------- |
179 | 176 | ||
180 | 'loginControllerUserLoggedInCallback': function(anEvent) { | 177 | 'loginControllerUserLoggedInCallback': function(anEvent) { |
181 | //Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent); | 178 | //Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent); |
182 | // this.setUser(anEvent.parameters()['user']); | 179 | // this.setUser(anEvent.parameters()['user']); |
183 | //console.log("--- loginControllerUserLoggedInCallback - 1"); | 180 | //console.log("--- loginControllerUserLoggedInCallback - 1"); |
184 | 181 | ||
185 | //console.log("--- loginControllerUserLoggedInCallback - 2"); | 182 | //console.log("--- loginControllerUserLoggedInCallback - 2"); |
186 | this.headerComponent().switchToLoggedMode(); | 183 | this.headerComponent().switchToLoggedMode(); |
187 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); | 184 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); |
188 | //Clipperz.log("<<< loginControllerUserLoggedInCallback"); | 185 | //Clipperz.log("<<< loginControllerUserLoggedInCallback"); |
189 | }, | 186 | }, |
190 | 187 | ||
191 | //----------------------------------------------------------------------------- | 188 | //----------------------------------------------------------------------------- |
192 | 189 | ||
193 | 'handleRemoteRequestSent': function () { | 190 | 'handleRemoteRequestSent': function () { |
194 | //Clipperz.log("REMOTE REQUEST sent >>>"); | 191 | //Clipperz.log("REMOTE REQUEST sent >>>"); |
195 | }, | 192 | }, |
196 | 193 | ||
197 | 'handleRemoteRequestReceived': function () { | 194 | 'handleRemoteRequestReceived': function () { |
198 | //Clipperz.log("REMOTE REQUEST received <<<"); | 195 | //Clipperz.log("REMOTE REQUEST received <<<"); |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //----------------------------------------------------------------------------- | 198 | //----------------------------------------------------------------------------- |
202 | 199 | ||
203 | 'handleLogout': function(anEvent) { | 200 | 'handleLogout': function(anEvent) { |
204 | this.exit('logout.html'); | 201 | this.exit('logout.html'); |
205 | }, | 202 | }, |
206 | 203 | ||
207 | //----------------------------------------------------------------------------- | 204 | //----------------------------------------------------------------------------- |
208 | 205 | ||
209 | 'exit': function(aPageName) { | 206 | 'exit': function(aPageName) { |
210 | //Clipperz.log("### exit " + aPageName); | 207 | //Clipperz.log("### exit " + aPageName); |
211 | MochiKit.Async.wait(0).addCallback(function() { | 208 | MochiKit.Async.wait(0).addCallback(function() { |
212 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; | 209 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; |
213 | }); | 210 | }); |
214 | }, | 211 | }, |
215 | 212 | ||
216 | //----------------------------------------------------------------------------- | 213 | //----------------------------------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js index 28d9d20..7db6888 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { |
32 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 29 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
33 | 30 | ||
34 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); | 31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); |
35 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); | 32 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); |
36 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); | 33 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); |
37 | 34 | ||
38 | this._rulerComponent = null; | 35 | this._rulerComponent = null; |
39 | 36 | ||
40 | this._steps = null; | 37 | this._steps = null; |
41 | this._currentStepIndex = 0; | 38 | this._currentStepIndex = 0; |
42 | this._isNextEnabled = false; | 39 | this._isNextEnabled = false; |
43 | 40 | ||
44 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' | 41 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' |
45 | this._user = null; | 42 | this._user = null; |
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { | 46 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { |
50 | 47 | ||
51 | 'toString': function() { | 48 | 'toString': function() { |
52 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; | 49 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'newUserCreationComponent': function () { | 54 | 'newUserCreationComponent': function () { |
58 | return this._newUserCreationComponent; | 55 | return this._newUserCreationComponent; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //============================================================================= | 58 | //============================================================================= |
62 | 59 | ||
63 | 'user': function () { | 60 | 'user': function () { |
64 | return this._user; | 61 | return this._user; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'setUser': function (aValue) { | 64 | 'setUser': function (aValue) { |
68 | this._user = aValue; | 65 | this._user = aValue; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //----------------------------------------------------------------------------- | 68 | //----------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'userCreationState': function () { | 70 | 'userCreationState': function () { |
74 | return this._userCreationState; | 71 | return this._userCreationState; |
75 | }, | 72 | }, |
76 | 73 | ||
77 | 'setUserCreationState': function (aValue) { | 74 | 'setUserCreationState': function (aValue) { |
78 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); | 75 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); |
79 | this._userCreationState = aValue; | 76 | this._userCreationState = aValue; |
80 | this.checkState(); | 77 | this.checkState(); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //============================================================================= | 80 | //============================================================================= |
84 | 81 | ||
85 | 'resetCurrentStepIndex': function () { | 82 | 'resetCurrentStepIndex': function () { |
86 | this._currentStepIndex = 0; | 83 | this._currentStepIndex = 0; |
87 | this.rulerComponent().resetStatus({animateTransition:true}); | 84 | this.rulerComponent().resetStatus({animateTransition:true}); |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //----------------------------------------------------------------------------- | 87 | //----------------------------------------------------------------------------- |
91 | 88 | ||
92 | 'enableNext': function (aValue) { | 89 | 'enableNext': function (aValue) { |
93 | this.rulerComponent().enableNext(aValue); | 90 | this.rulerComponent().enableNext(aValue); |
94 | this._isNextEnabled = aValue; | 91 | this._isNextEnabled = aValue; |
95 | }, | 92 | }, |
96 | 93 | ||
97 | 'isNextEnabled': function () { | 94 | 'isNextEnabled': function () { |
98 | return this._isNextEnabled; | 95 | return this._isNextEnabled; |
99 | }, | 96 | }, |
100 | 97 | ||
101 | //----------------------------------------------------------------------------- | 98 | //----------------------------------------------------------------------------- |
102 | 99 | ||
103 | 'enablePrevious': function (aValue) { | 100 | 'enablePrevious': function (aValue) { |
104 | this.rulerComponent().enablePrevious(aValue); | 101 | this.rulerComponent().enablePrevious(aValue); |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //============================================================================= | 104 | //============================================================================= |
108 | 105 | ||
109 | 'rulerComponent': function () { | 106 | 'rulerComponent': function () { |
110 | if (this._rulerComponent == null) { | 107 | if (this._rulerComponent == null) { |
111 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 108 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
112 | translationContext:'Wizards.NewUserWizard' | 109 | translationContext:'Wizards.NewUserWizard' |
113 | }); | 110 | }); |
114 | this._rulerComponent.render(); | 111 | this._rulerComponent.render(); |
115 | 112 | ||
116 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 113 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
117 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 114 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
118 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 115 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
119 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 116 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
120 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 117 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
121 | } | 118 | } |
122 | 119 | ||
123 | return this._rulerComponent; | 120 | return this._rulerComponent; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | 'resetRuler': function () { | 123 | 'resetRuler': function () { |
127 | // if (this._rulerComponent != null) { | 124 | // if (this._rulerComponent != null) { |
128 | // this._rulerComponent.clear(); | 125 | // this._rulerComponent.clear(); |
129 | // } | 126 | // } |
130 | // this._rulerComponent = null; | 127 | // this._rulerComponent = null; |
131 | }, | 128 | }, |
132 | 129 | ||
133 | //----------------------------------------------------------------------------- | 130 | //----------------------------------------------------------------------------- |
134 | 131 | ||
135 | 'showRuler': function (someSteps) { | 132 | 'showRuler': function (someSteps) { |
136 | var rulerElement; | 133 | var rulerElement; |
137 | 134 | ||
138 | this.setSteps(someSteps); | 135 | this.setSteps(someSteps); |
139 | 136 | ||
140 | rulerElement = this.rulerComponent().element(); | 137 | rulerElement = this.rulerComponent().element(); |
141 | this.newUserCreationComponent().disableAllPanels(); | 138 | this.newUserCreationComponent().disableAllPanels(); |
142 | 139 | ||
143 | MochiKit.Style.showElement(rulerElement); | 140 | MochiKit.Style.showElement(rulerElement); |
144 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.newUserCreationComponent().bottomMargin()}); | 141 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.newUserCreationComponent().bottomMargin()}); |
145 | new MochiKit.Visual.Move(rulerElement, { | 142 | new MochiKit.Visual.Move(rulerElement, { |
146 | x:0, y:this.newUserCreationComponent().bottomMargin(), | 143 | x:0, y:this.newUserCreationComponent().bottomMargin(), |
147 | mode:'absolute', | 144 | mode:'absolute', |
148 | duration:0.5, | 145 | duration:0.5, |
149 | // afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | 146 | // afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') |
150 | afterFinish:MochiKit.Base.method(this, 'handleRulerShowed') | 147 | afterFinish:MochiKit.Base.method(this, 'handleRulerShowed') |
151 | }); | 148 | }); |
152 | }, | 149 | }, |
153 | 150 | ||
154 | //----------------------------------------------------------------------------- | 151 | //----------------------------------------------------------------------------- |
155 | 152 | ||
156 | 'handleRulerShowed':function () { | 153 | 'handleRulerShowed':function () { |
157 | return Clipperz.Async.callbacks("NewUserWizardController.handlerRulerShowed", [ | 154 | return Clipperz.Async.callbacks("NewUserWizardController.handlerRulerShowed", [ |
158 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), | 155 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), |
159 | MochiKit.Base.method(this, 'handleCursorMoved') | 156 | MochiKit.Base.method(this, 'handleCursorMoved') |
160 | ], {trace:false}); | 157 | ], {trace:false}); |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //----------------------------------------------------------------------------- | 160 | //----------------------------------------------------------------------------- |
164 | 161 | ||
165 | 'hideRuler': function () { | 162 | 'hideRuler': function () { |
166 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:0.5}); | 163 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:0.5}); |
167 | }, | 164 | }, |
168 | 165 | ||
169 | 'doneWithRuler': function () { | 166 | 'doneWithRuler': function () { |
170 | var rulerComponentElement; | 167 | var rulerComponentElement; |
171 | 168 | ||
172 | rulerComponentElement = this.rulerComponent().element(); | 169 | rulerComponentElement = this.rulerComponent().element(); |
173 | new MochiKit.Visual.Move(this.rulerComponent().element(), { | 170 | new MochiKit.Visual.Move(this.rulerComponent().element(), { |
174 | x:1000, | 171 | x:1000, |
175 | mode:'relative', | 172 | mode:'relative', |
176 | duration:1, | 173 | duration:1, |
177 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) | 174 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) |
178 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } | 175 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } |
179 | }); | 176 | }); |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //============================================================================= | 179 | //============================================================================= |
183 | 180 | ||
184 | 'createNewUserRulerSteps': function () { | 181 | 'createNewUserRulerSteps': function () { |
185 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; | 182 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; |
186 | }, | 183 | }, |
187 | 184 | ||
188 | //------------------------------------------------------------------------- | 185 | //------------------------------------------------------------------------- |
189 | 186 | ||
190 | 'run': function () { | 187 | 'run': function () { |
191 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ | 188 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ |
192 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), | 189 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), |
193 | MochiKit.Base.method(this, 'showRuler') | 190 | MochiKit.Base.method(this, 'showRuler') |
194 | ], {trace:false}); | 191 | ], {trace:false}); |
195 | }, | 192 | }, |
196 | 193 | ||
197 | //----------------------------------------------------------------------------- | 194 | //----------------------------------------------------------------------------- |
198 | 195 | ||
199 | 'checkState': function () { | 196 | 'checkState': function () { |
200 | var enablePrevious; | 197 | var enablePrevious; |
201 | var enableNext; | 198 | var enableNext; |
202 | 199 | ||
203 | enablePrevious = true; | 200 | enablePrevious = true; |
204 | enableNext = false; | 201 | enableNext = false; |
205 | 202 | ||
206 | this.newUserCreationComponent().disableAllPanels(); | 203 | this.newUserCreationComponent().disableAllPanels(); |
207 | 204 | ||
208 | switch(this.currentStep()) { | 205 | switch(this.currentStep()) { |
209 | case 'CREDENTIALS': | 206 | case 'CREDENTIALS': |
210 | this.newUserCreationComponent().enableCredentialsPanel(); | 207 | this.newUserCreationComponent().enableCredentialsPanel(); |
211 | 208 | ||
212 | enableNext = ( | 209 | enableNext = ( |
213 | (this.newUserCreationComponent().username() != '') | 210 | (this.newUserCreationComponent().username() != '') |
214 | && | 211 | && |
215 | (this.newUserCreationComponent().passphrase() != '') | 212 | (this.newUserCreationComponent().passphrase() != '') |
216 | ); | 213 | ); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js index 23fd236..5380aa1 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js | |||
@@ -1,166 +1,163 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { | 28 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._cardReference = null; | 33 | this._cardReference = null; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | //============================================================================= | 38 | //============================================================================= |
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; | 45 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'cardReference': function () { | 50 | 'cardReference': function () { |
54 | return this._cardReference; | 51 | return this._cardReference; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | 'setCardReference': function (aValue) { | 54 | 'setCardReference': function (aValue) { |
58 | this._cardReference = aValue; | 55 | this._cardReference = aValue; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'renderSelf': function(/*aContainer, aPosition*/) { | 60 | 'renderSelf': function(/*aContainer, aPosition*/) { |
64 | this.append(this.element(), [ | 61 | this.append(this.element(), [ |
65 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ | 62 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ |
66 | {tag:'div', id:this.getId('progressBar')} //, | 63 | {tag:'div', id:this.getId('progressBar')} //, |
67 | // {tag:'h1', cls:'loading', html:"loading"} | 64 | // {tag:'h1', cls:'loading', html:"loading"} |
68 | ]} | 65 | ]} |
69 | ]); | 66 | ]); |
70 | 67 | ||
71 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 68 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
72 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); | 69 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //========================================================================= | 72 | //========================================================================= |
76 | 73 | ||
77 | 'showCardDetails': function (someData) { | 74 | 'showCardDetails': function (someData) { |
78 | this.element().innerHTML = ''; | 75 | this.element().innerHTML = ''; |
79 | this.append(this.element(), [ | 76 | this.append(this.element(), [ |
80 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { | 77 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { |
81 | return {tag:'div', cls:'row', children:[ | 78 | return {tag:'div', cls:'row', children:[ |
82 | {tag:'label', html:aFieldData['label']}, | 79 | {tag:'label', html:aFieldData['label']}, |
83 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} | 80 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} |
84 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ | 81 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ |
85 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} | 82 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} |
86 | ]} | 83 | ]} |
87 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} | 84 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} |
88 | 85 | ||
89 | ]} | 86 | ]} |
90 | }, someData['fields'])} | 87 | }, someData['fields'])} |
91 | ]); | 88 | ]); |
92 | 89 | ||
93 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { | 90 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { |
94 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) | 91 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) |
95 | }, this)); | 92 | }, this)); |
96 | 93 | ||
97 | if (someData['directLogins'].length > 0) { | 94 | if (someData['directLogins'].length > 0) { |
98 | this.append(this.element(), [ | 95 | this.append(this.element(), [ |
99 | {tag:'h2', html:"Direct logins"}, | 96 | {tag:'h2', html:"Direct logins"}, |
100 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { | 97 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { |
101 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ | 98 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ |
102 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, | 99 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, |
103 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} | 100 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} |
104 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} | 101 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} |
105 | ]} | 102 | ]} |
106 | }, someData['directLogins'])} | 103 | }, someData['directLogins'])} |
107 | ]); | 104 | ]); |
108 | 105 | ||
109 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { | 106 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { |
110 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); | 107 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); |
111 | }, this), | 108 | }, this), |
112 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) | 109 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) |
113 | ) | 110 | ) |
114 | }; | 111 | }; |
115 | 112 | ||
116 | if (someData['notes'] != '') { | 113 | if (someData['notes'] != '') { |
117 | this.append(this.element(), [ | 114 | this.append(this.element(), [ |
118 | {tag:'h2', html:"Notes"}, | 115 | {tag:'h2', html:"Notes"}, |
119 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | 116 | {tag:'fieldset', id:this.getId('fieldset'), children:[ |
120 | {tag:'div', cls:'row notes', children:[ | 117 | {tag:'div', cls:'row notes', children:[ |
121 | {tag:'span', html:someData['notes']} | 118 | {tag:'span', html:someData['notes']} |
122 | ]} | 119 | ]} |
123 | ]} | 120 | ]} |
124 | ]); | 121 | ]); |
125 | }; | 122 | }; |
126 | 123 | ||
127 | return true; | 124 | return true; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //------------------------------------------------------------------------- | 127 | //------------------------------------------------------------------------- |
131 | /* | 128 | /* |
132 | 'toggleClickHandler': function (anEvent) { | 129 | 'toggleClickHandler': function (anEvent) { |
133 | varnextState; | 130 | varnextState; |
134 | varfieldValue; | 131 | varfieldValue; |
135 | 132 | ||
136 | //console.log("TOGGLE"); | 133 | //console.log("TOGGLE"); |
137 | anEvent.preventDefault; | 134 | anEvent.preventDefault; |
138 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; | 135 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; |
139 | 136 | ||
140 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); | 137 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); |
141 | if (nextState) { | 138 | if (nextState) { |
142 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); | 139 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); |
143 | } else { | 140 | } else { |
144 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); | 141 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); |
145 | } | 142 | } |
146 | 143 | ||
147 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); | 144 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); |
148 | }, | 145 | }, |
149 | */ | 146 | */ |
150 | //========================================================================= | 147 | //========================================================================= |
151 | 148 | ||
152 | 'directLoginClickHandler': function (anEvent) { | 149 | 'directLoginClickHandler': function (anEvent) { |
153 | anEvent.preventDefault(); | 150 | anEvent.preventDefault(); |
154 | 151 | ||
155 | if (/(directLogin_)/.test(anEvent.src().id)) { | 152 | if (/(directLogin_)/.test(anEvent.src().id)) { |
156 | var directLoginReference; | 153 | var directLoginReference; |
157 | 154 | ||
158 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; | 155 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; |
159 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); | 156 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); |
160 | } | 157 | } |
161 | }, | 158 | }, |
162 | 159 | ||
163 | //========================================================================= | 160 | //========================================================================= |
164 | 161 | ||
165 | __syntaxFix__: "syntax fix" | 162 | __syntaxFix__: "syntax fix" |
166 | }); | 163 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js index 770f983..c3f2701 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js | |||
@@ -1,204 +1,201 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.iPhone.Components.CardList = function(args) { | 28 | Clipperz.PM.UI.iPhone.Components.CardList = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.iPhone.Components.CardList.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.iPhone.Components.CardList.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._cardDetail = null; | 33 | this._cardDetail = null; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | //============================================================================= | 38 | //============================================================================= |
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.iPhone.Components.CardList component"; | 45 | return "Clipperz.PM.UI.iPhone.Components.CardList component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'renderSelf': function(/*aContainer, aPosition*/) { | 50 | 'renderSelf': function(/*aContainer, aPosition*/) { |
54 | this.append(this.element(), [ | 51 | this.append(this.element(), [ |
55 | {tag:'div', cls:'toolbar', id:'toolbar', children:[ | 52 | {tag:'div', cls:'toolbar', id:'toolbar', children:[ |
56 | {tag:'h1', id:'pageTitle', html:"cards"}, | 53 | {tag:'h1', id:'pageTitle', html:"cards"}, |
57 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"cards"} | 54 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"cards"} |
58 | ]}, | 55 | ]}, |
59 | {tag:'div', cls:'cardList', id:this.getId('cardList'), children:[ | 56 | {tag:'div', cls:'cardList', id:this.getId('cardList'), children:[ |
60 | {tag:'form', title:'search', cls:'panel cardListSearchForm', id:this.getId('cardListSearchForm'), children:[ | 57 | {tag:'form', title:'search', cls:'panel cardListSearchForm', id:this.getId('cardListSearchForm'), children:[ |
61 | {tag:'input', type:'search', name:'search', value:"", placeholder:"search", id:this.getId('searchField')} | 58 | {tag:'input', type:'search', name:'search', value:"", placeholder:"search", id:this.getId('searchField')} |
62 | ]}, | 59 | ]}, |
63 | {tag:'ul', cls:'panel cardListPanel', id:this.getId('cardListPanel'), children:[]} | 60 | {tag:'ul', cls:'panel cardListPanel', id:this.getId('cardListPanel'), children:[]} |
64 | ]}, | 61 | ]}, |
65 | {tag:'div', cls:'panel cardDetailPanel', id:this.getId('cardDetail')} | 62 | {tag:'div', cls:'panel cardDetailPanel', id:this.getId('cardDetail')} |
66 | ]); | 63 | ]); |
67 | 64 | ||
68 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this,'searchHandler'); | 65 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this,'searchHandler'); |
69 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this,'searchHandler'); | 66 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this,'searchHandler'); |
70 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this,'searchHandler'); | 67 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this,'searchHandler'); |
71 | 68 | ||
72 | MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); | 69 | MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); |
73 | MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); | 70 | MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); |
74 | 71 | ||
75 | MochiKit.Style.hideElement('backButton'); | 72 | MochiKit.Style.hideElement('backButton'); |
76 | MochiKit.Style.hideElement(this.getElement('cardDetail')); | 73 | MochiKit.Style.hideElement(this.getElement('cardDetail')); |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
80 | 77 | ||
81 | 'searchHandler': function (anEvent) { | 78 | 'searchHandler': function (anEvent) { |
82 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN | 79 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN |
83 | anEvent.preventDefault(); | 80 | anEvent.preventDefault(); |
84 | } else { | 81 | } else { |
85 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { | 82 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { |
86 | anEvent.target().value = ""; | 83 | anEvent.target().value = ""; |
87 | } | 84 | } |
88 | 85 | ||
89 | if (anEvent.type() == 'keyup') { | 86 | if (anEvent.type() == 'keyup') { |
90 | MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); | 87 | MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); |
91 | } | 88 | } |
92 | } | 89 | } |
93 | }, | 90 | }, |
94 | 91 | ||
95 | //------------------------------------------------------------------------- | 92 | //------------------------------------------------------------------------- |
96 | 93 | ||
97 | 'update': function (someObjects) { | 94 | 'update': function (someObjects) { |
98 | varcardListPanel; | 95 | varcardListPanel; |
99 | var i,c; | 96 | var i,c; |
100 | 97 | ||
101 | cardListPanel = this.getElement('cardListPanel'); | 98 | cardListPanel = this.getElement('cardListPanel'); |
102 | cardListPanel.innerHTML = ''; | 99 | cardListPanel.innerHTML = ''; |
103 | 100 | ||
104 | c = someObjects.length; | 101 | c = someObjects.length; |
105 | 102 | ||
106 | for (i=0; i<c; i++) { | 103 | for (i=0; i<c; i++) { |
107 | this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ | 104 | this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ |
108 | {tag:'img', src:(someObjects[i]['favicon'] ? someObjects[i]['favicon'] : 'data:application/octet-stream;charset=utf-8;base64,AAABAAEAFxcAAAEAGAD8BgAAFgAAACgAAAAXAAAALgAAAAEAGAAAAAAAAAAAABIXAAASFwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////9zAC////////////////////////////////////////////////////////////////////////////////////////////9pAG////////////////////////////////////////////////////////////////////////////////////////////9rAC////////////////////////////////////////////////////////////////////////////////////////////9yAHP////////////////////////IyMizs7O6urrq6ur////////////Ozs6zs7Ozs7Pq6ur///////////////////////8AAAD////////////////////V1dWXl5eXl5eXl5elpaX4+Pj////Ozs6Xl5eXl5eXl5eenp7///////////////////////8AAAD////////////////////Ozs6Xl5eXl5eXl5eXl5fBwcHq6uqenp6Xl5eXl5eXl5eXl5f///////////////////////8AAAD////////////////////j4+OXl5eXl5eXl5eXl5eXl5elpaWXl5eXl5eXl5eXl5ezs7P///////////////////////8AAAD////////////////////////IyMiXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eenp7x8fH////////////////////////////////////////////////////4+PilpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5fOzs7////////////////////////////////////////////////////////q6uq6urqXl5eXl5eXl5eXl5eXl5eXl5eenp7V1dX4+Pj///////////////////////8AAAD////////////4+PjOzs6lpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5e6urrj4+P///////////////8AAAD////////////BwcGXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fx8fH///////////8AAAD///////////+zs7OXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fj4+P///////////8AAAD////////////IyMiXl5eXl5eXl5eXl5e6urqXl5eXl5eXl5eXl5esrKylpaWXl5eXl5eXl5eenp7x8fH///////////8AAAD////////////////Ozs7Ozs7V1dX4+Pj///+Xl5eXl5eXl5eXl5fOzs7////q6urOzs7Ozs7q6ur///////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD////////////////////////////////////IyMiXl5eXl5eenp7x8fH///////////////////////////////////8AAAD////////////////////////////////////////j4+Pj4+Px8fH///////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo=')}, | 105 | {tag:'img', src:(someObjects[i]['favicon'] ? someObjects[i]['favicon'] : 'data:application/octet-stream;charset=utf-8;base64,AAABAAEAFxcAAAEAGAD8BgAAFgAAACgAAAAXAAAALgAAAAEAGAAAAAAAAAAAABIXAAASFwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////9zAC////////////////////////////////////////////////////////////////////////////////////////////9pAG////////////////////////////////////////////////////////////////////////////////////////////9rAC////////////////////////////////////////////////////////////////////////////////////////////9yAHP////////////////////////IyMizs7O6urrq6ur////////////Ozs6zs7Ozs7Pq6ur///////////////////////8AAAD////////////////////V1dWXl5eXl5eXl5elpaX4+Pj////Ozs6Xl5eXl5eXl5eenp7///////////////////////8AAAD////////////////////Ozs6Xl5eXl5eXl5eXl5fBwcHq6uqenp6Xl5eXl5eXl5eXl5f///////////////////////8AAAD////////////////////j4+OXl5eXl5eXl5eXl5eXl5elpaWXl5eXl5eXl5eXl5ezs7P///////////////////////8AAAD////////////////////////IyMiXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eenp7x8fH////////////////////////////////////////////////////4+PilpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5fOzs7////////////////////////////////////////////////////////q6uq6urqXl5eXl5eXl5eXl5eXl5eXl5eenp7V1dX4+Pj///////////////////////8AAAD////////////4+PjOzs6lpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5e6urrj4+P///////////////8AAAD////////////BwcGXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fx8fH///////////8AAAD///////////+zs7OXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fj4+P///////////8AAAD////////////IyMiXl5eXl5eXl5eXl5e6urqXl5eXl5eXl5eXl5esrKylpaWXl5eXl5eXl5eenp7x8fH///////////8AAAD////////////////Ozs7Ozs7V1dX4+Pj///+Xl5eXl5eXl5eXl5fOzs7////q6urOzs7Ozs7q6ur///////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD////////////////////////////////////IyMiXl5eXl5eenp7x8fH///////////////////////////////////8AAAD////////////////////////////////////////j4+Pj4+Px8fH///////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo=')}, |
109 | {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} | 106 | {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} |
110 | ]}) | 107 | ]}) |
111 | 108 | ||
112 | MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); | 109 | MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); |
113 | } | 110 | } |
114 | 111 | ||
115 | }, | 112 | }, |
116 | 113 | ||
117 | 'cardListClickHandler': function (anEvent) { | 114 | 'cardListClickHandler': function (anEvent) { |
118 | anEvent.preventDefault(); | 115 | anEvent.preventDefault(); |
119 | 116 | ||
120 | if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { | 117 | if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { |
121 | var cardListReference; | 118 | var cardListReference; |
122 | 119 | ||
123 | cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; | 120 | cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; |
124 | //console.log("Showing detail for card named", cardListReference); | 121 | //console.log("Showing detail for card named", cardListReference); |
125 | MochiKit.Signal.signal(this, 'selectedCard', cardListReference); | 122 | MochiKit.Signal.signal(this, 'selectedCard', cardListReference); |
126 | } | 123 | } |
127 | }, | 124 | }, |
128 | 125 | ||
129 | //========================================================================= | 126 | //========================================================================= |
130 | 127 | ||
131 | 'cardDetail': function (someData) { | 128 | 'cardDetail': function (someData) { |
132 | if (this._cardDetail == null) { | 129 | if (this._cardDetail == null) { |
133 | this._cardDetail = new Clipperz.PM.UI.iPhone.Components.CardDetail({element:this.getElement('cardDetail')}); | 130 | this._cardDetail = new Clipperz.PM.UI.iPhone.Components.CardDetail({element:this.getElement('cardDetail')}); |
134 | } | 131 | } |
135 | 132 | ||
136 | return this._cardDetail; | 133 | return this._cardDetail; |
137 | }, | 134 | }, |
138 | 135 | ||
139 | //------------------------------------------------------------------------- | 136 | //------------------------------------------------------------------------- |
140 | 137 | ||
141 | 'removeCardDetail': function () { | 138 | 'removeCardDetail': function () { |
142 | if (this._cardDetail != null) { | 139 | if (this._cardDetail != null) { |
143 | this._cardDetail.remove(); | 140 | this._cardDetail.remove(); |
144 | this._cardDetail = null; | 141 | this._cardDetail = null; |
145 | } | 142 | } |
146 | }, | 143 | }, |
147 | 144 | ||
148 | //========================================================================= | 145 | //========================================================================= |
149 | 146 | ||
150 | 'showCard': function (someData) { | 147 | 'showCard': function (someData) { |
151 | vardeferredResult; | 148 | vardeferredResult; |
152 | varoffset; | 149 | varoffset; |
153 | 150 | ||
154 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | 151 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); |
155 | this.cardDetail().render(); | 152 | this.cardDetail().render(); |
156 | this.cardDetail().setCardReference(someData['_reference']); | 153 | this.cardDetail().setCardReference(someData['_reference']); |
157 | MochiKit.Style.setElementPosition(this.cardDetail().element(), {x:offset}); | 154 | MochiKit.Style.setElementPosition(this.cardDetail().element(), {x:offset}); |
158 | new MochiKit.Visual.Sequence([ | 155 | new MochiKit.Visual.Sequence([ |
159 | // new MochiKit.Visual.Move(this.cardDetail().element(), {x:offset, y:45, mode:'absolute', duration:0, sync:true}), | 156 | // new MochiKit.Visual.Move(this.cardDetail().element(), {x:offset, y:45, mode:'absolute', duration:0, sync:true}), |
160 | new MochiKit.Visual.Parallel([ | 157 | new MochiKit.Visual.Parallel([ |
161 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:-offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 158 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:-offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
162 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:0, y:45, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 159 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:0, y:45, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
163 | // new MochiKit.Visual.ScrollTo('toolbar', {sync:true}), | 160 | // new MochiKit.Visual.ScrollTo('toolbar', {sync:true}), |
164 | MochiKit.Visual.appear ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | 161 | MochiKit.Visual.appear ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) |
165 | ], {duration:1, sync:true}), | 162 | ], {duration:1, sync:true}), |
166 | MochiKit.Visual.fade(this.getElement('cardList'), {duration:0, sync:true}) | 163 | MochiKit.Visual.fade(this.getElement('cardList'), {duration:0, sync:true}) |
167 | ], {}) | 164 | ], {}) |
168 | 165 | ||
169 | MochiKit.DOM.getElement('pageTitle').innerHTML = someData['title']; | 166 | MochiKit.DOM.getElement('pageTitle').innerHTML = someData['title']; |
170 | 167 | ||
171 | return true; | 168 | return true; |
172 | }, | 169 | }, |
173 | 170 | ||
174 | //------------------------------------------------------------------------- | 171 | //------------------------------------------------------------------------- |
175 | 172 | ||
176 | 'showCardDetails': function (someData) { | 173 | 'showCardDetails': function (someData) { |
177 | return this.cardDetail().showCardDetails(someData); | 174 | return this.cardDetail().showCardDetails(someData); |
178 | }, | 175 | }, |
179 | 176 | ||
180 | //========================================================================= | 177 | //========================================================================= |
181 | 178 | ||
182 | 'backButtonClickHandler': function (anEvent) { | 179 | 'backButtonClickHandler': function (anEvent) { |
183 | varoffset; | 180 | varoffset; |
184 | 181 | ||
185 | anEvent.preventDefault(); | 182 | anEvent.preventDefault(); |
186 | 183 | ||
187 | MochiKit.DOM.getElement('pageTitle').innerHTML = "cards"; | 184 | MochiKit.DOM.getElement('pageTitle').innerHTML = "cards"; |
188 | 185 | ||
189 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | 186 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); |
190 | MochiKit.Style.setElementPosition(this.getElement('cardList'), {x:-offset}); | 187 | MochiKit.Style.setElementPosition(this.getElement('cardList'), {x:-offset}); |
191 | MochiKit.DOM.showElement(this.getElement('cardList')); | 188 | MochiKit.DOM.showElement(this.getElement('cardList')); |
192 | 189 | ||
193 | new MochiKit.Visual.Parallel([ | 190 | new MochiKit.Visual.Parallel([ |
194 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 191 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
195 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 192 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
196 | MochiKit.Visual.fade (this.getElement('cardDetail'), { transition:MochiKit.Visual.Transitions.linear, sync:true}), | 193 | MochiKit.Visual.fade (this.getElement('cardDetail'), { transition:MochiKit.Visual.Transitions.linear, sync:true}), |
197 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | 194 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) |
198 | ], {duration:1, afterFinish:MochiKit.Base.method(this, 'removeCardDetail')}) | 195 | ], {duration:1, afterFinish:MochiKit.Base.method(this, 'removeCardDetail')}) |
199 | 196 | ||
200 | }, | 197 | }, |
201 | 198 | ||
202 | //========================================================================= | 199 | //========================================================================= |
203 | __syntaxFix__: "syntax fix" | 200 | __syntaxFix__: "syntax fix" |
204 | }); | 201 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js index eec83b0..5341878 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js | |||
@@ -1,181 +1,178 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) { | 28 | Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | return this; | 33 | return this; |
37 | } | 34 | } |
38 | 35 | ||
39 | //============================================================================= | 36 | //============================================================================= |
40 | 37 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return "Clipperz.PM.UI.iPhone.Components.LoginForm component"; | 43 | return "Clipperz.PM.UI.iPhone.Components.LoginForm component"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'focusOnUsername': function () { | 48 | 'focusOnUsername': function () { |
52 | this.getElement('username').focus(); | 49 | this.getElement('username').focus(); |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'username': function () { | 54 | 'username': function () { |
58 | return this.getElement('username').value; | 55 | return this.getElement('username').value; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'passphrase': function () { | 58 | 'passphrase': function () { |
62 | return this.getElement('passphrase').value; | 59 | return this.getElement('passphrase').value; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'renderSelf': function(/*aContainer, aPosition*/) { | 64 | 'renderSelf': function(/*aContainer, aPosition*/) { |
68 | this.append(this.element(), [ | 65 | this.append(this.element(), [ |
69 | {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[ | 66 | {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[ |
70 | {tag:'h1', id:'pageTitle', html:'Clipperz'}, | 67 | {tag:'h1', id:'pageTitle', html:'Clipperz'}, |
71 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"} | 68 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"} |
72 | ]}, | 69 | ]}, |
73 | {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[ | 70 | {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[ |
74 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | 71 | {tag:'fieldset', id:this.getId('fieldset'), children:[ |
75 | {tag:'div', cls:'row', children:[ | 72 | {tag:'div', cls:'row', children:[ |
76 | {tag:'label', html:"username"}, | 73 | {tag:'label', html:"username"}, |
77 | {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')} | 74 | {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')} |
78 | ]}, | 75 | ]}, |
79 | {tag:'div', cls:'row', children:[ | 76 | {tag:'div', cls:'row', children:[ |
80 | {tag:'label', html:"passphrase"}, | 77 | {tag:'label', html:"passphrase"}, |
81 | {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')} | 78 | {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')} |
82 | ]} | 79 | ]} |
83 | ]}, | 80 | ]}, |
84 | {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')} | 81 | {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')} |
85 | ]}, | 82 | ]}, |
86 | {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[ | 83 | {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[ |
87 | {tag:'div', id:this.getId('progressBar')} //, | 84 | {tag:'div', id:this.getId('progressBar')} //, |
88 | // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')} | 85 | // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')} |
89 | ]}, | 86 | ]}, |
90 | {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[ | 87 | {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[ |
91 | {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[ | 88 | {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[ |
92 | {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"} | 89 | {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"} |
93 | ]} | 90 | ]} |
94 | ]} | 91 | ]} |
95 | ]); | 92 | ]); |
96 | 93 | ||
97 | MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler'); | 94 | MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler'); |
98 | MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler'); | 95 | MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler'); |
99 | 96 | ||
100 | // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler'); | 97 | // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler'); |
101 | MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler'); | 98 | MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler'); |
102 | 99 | ||
103 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 100 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
104 | 101 | ||
105 | // MochiKit.Style.hideElement(this.getElement('errorMessage')); | 102 | // MochiKit.Style.hideElement(this.getElement('errorMessage')); |
106 | 103 | ||
107 | this.showLoginForm(); | 104 | this.showLoginForm(); |
108 | // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername')); | 105 | // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername')); |
109 | }, | 106 | }, |
110 | 107 | ||
111 | //------------------------------------------------------------------------- | 108 | //------------------------------------------------------------------------- |
112 | 109 | ||
113 | 'showLoginForm': function () { | 110 | 'showLoginForm': function () { |
114 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); | 111 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); |
115 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); | 112 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); |
116 | MochiKit.Style.hideElement(this.getElement('loginErrorPanel')); | 113 | MochiKit.Style.hideElement(this.getElement('loginErrorPanel')); |
117 | MochiKit.Style.hideElement('backButton'); | 114 | MochiKit.Style.hideElement('backButton'); |
118 | }, | 115 | }, |
119 | 116 | ||
120 | 'slideInLoginForm': function () { | 117 | 'slideInLoginForm': function () { |
121 | varoffset; | 118 | varoffset; |
122 | 119 | ||
123 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | 120 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); |
124 | 121 | ||
125 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); | 122 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); |
126 | MochiKit.Style.setElementPosition(this.getElement('loginFormPanel'), {x:-offset, y:0}); | 123 | MochiKit.Style.setElementPosition(this.getElement('loginFormPanel'), {x:-offset, y:0}); |
127 | 124 | ||
128 | new MochiKit.Visual.Sequence([ | 125 | new MochiKit.Visual.Sequence([ |
129 | new MochiKit.Visual.Parallel([ | 126 | new MochiKit.Visual.Parallel([ |
130 | new MochiKit.Visual.Move(this.getElement('loginErrorPanel'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 127 | new MochiKit.Visual.Move(this.getElement('loginErrorPanel'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
131 | new MochiKit.Visual.Move(this.getElement('loginFormPanel'), {x:0, y:0, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 128 | new MochiKit.Visual.Move(this.getElement('loginFormPanel'), {x:0, y:0, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
132 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | 129 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) |
133 | ], {duration:0.5, sync:true}), | 130 | ], {duration:0.5, sync:true}), |
134 | MochiKit.Visual.fade(this.getElement('loginErrorPanel'), {duration:0, sync:true}) | 131 | MochiKit.Visual.fade(this.getElement('loginErrorPanel'), {duration:0, sync:true}) |
135 | ], {}) | 132 | ], {}) |
136 | }, | 133 | }, |
137 | 134 | ||
138 | 'showLoginProgress': function () { | 135 | 'showLoginProgress': function () { |
139 | MochiKit.Style.hideElement(this.getElement('loginFormPanel')); | 136 | MochiKit.Style.hideElement(this.getElement('loginFormPanel')); |
140 | MochiKit.Style.showElement(this.getElement('loginProgressPanel')); | 137 | MochiKit.Style.showElement(this.getElement('loginProgressPanel')); |
141 | }, | 138 | }, |
142 | 139 | ||
143 | 'showLoginError': function (anError) { | 140 | 'showLoginError': function (anError) { |
144 | this.getElement('errorMessage').innerHTML = "Login error"; | 141 | this.getElement('errorMessage').innerHTML = "Login error"; |
145 | 142 | ||
146 | MochiKit.Style.showElement('backButton'); | 143 | MochiKit.Style.showElement('backButton'); |
147 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); | 144 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); |
148 | MochiKit.Style.showElement(this.getElement('loginErrorPanel')); | 145 | MochiKit.Style.showElement(this.getElement('loginErrorPanel')); |
149 | MochiKit.Style.setElementPosition(this.getElement('loginErrorPanel'), {x:0, y:45}); | 146 | MochiKit.Style.setElementPosition(this.getElement('loginErrorPanel'), {x:0, y:45}); |
150 | }, | 147 | }, |
151 | 148 | ||
152 | //------------------------------------------------------------------------- | 149 | //------------------------------------------------------------------------- |
153 | /* | 150 | /* |
154 | 'disableCancelButton': function () { | 151 | 'disableCancelButton': function () { |
155 | MochiKit.DOM.hideElement(this.getElement('cancel')); | 152 | MochiKit.DOM.hideElement(this.getElement('cancel')); |
156 | }, | 153 | }, |
157 | */ | 154 | */ |
158 | //------------------------------------------------------------------------- | 155 | //------------------------------------------------------------------------- |
159 | 156 | ||
160 | 'submitHandler': function (anEvent) { | 157 | 'submitHandler': function (anEvent) { |
161 | anEvent.preventDefault(); | 158 | anEvent.preventDefault(); |
162 | 159 | ||
163 | MochiKit.Signal.signal(this, 'doLogin', {'username':this.username(), 'passphrase':this.passphrase()}); | 160 | MochiKit.Signal.signal(this, 'doLogin', {'username':this.username(), 'passphrase':this.passphrase()}); |
164 | }, | 161 | }, |
165 | 162 | ||
166 | 'cancelHandler': function (anEvent) { | 163 | 'cancelHandler': function (anEvent) { |
167 | anEvent.preventDefault(); | 164 | anEvent.preventDefault(); |
168 | 165 | ||
169 | //console.log("CANCEL"); | 166 | //console.log("CANCEL"); |
170 | }, | 167 | }, |
171 | 168 | ||
172 | 'backHandler': function (anEvent) { | 169 | 'backHandler': function (anEvent) { |
173 | anEvent.preventDefault(); | 170 | anEvent.preventDefault(); |
174 | 171 | ||
175 | this.slideInLoginForm(); | 172 | this.slideInLoginForm(); |
176 | }, | 173 | }, |
177 | 174 | ||
178 | //------------------------------------------------------------------------- | 175 | //------------------------------------------------------------------------- |
179 | 176 | ||
180 | __syntaxFix__: "syntax fix" | 177 | __syntaxFix__: "syntax fix" |
181 | }); | 178 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js index b43d877..3fcaae1 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js | |||
@@ -1,216 +1,213 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Controllers'); |
30 | 27 | ||
31 | //Some parts of this controller have been derived from the iUI library. | 28 | //Some parts of this controller have been derived from the iUI library. |
32 | 29 | ||
33 | Clipperz.PM.UI.iPhone.Controllers.MainController = function() { | 30 | Clipperz.PM.UI.iPhone.Controllers.MainController = function() { |
34 | this._loginForm = null; | 31 | this._loginForm = null; |
35 | this._cardList = null; | 32 | this._cardList = null; |
36 | this._cachedValues =null; | 33 | this._cachedValues =null; |
37 | this._user = null; | 34 | this._user = null; |
38 | 35 | ||
39 | if (typeof window.onorientationchange == 'object') { | 36 | if (typeof window.onorientationchange == 'object') { |
40 | MochiKit.Signal.connect(window, 'onorientationchange', this, 'orientationChangeHandler'); | 37 | MochiKit.Signal.connect(window, 'onorientationchange', this, 'orientationChangeHandler'); |
41 | MochiKit.Async.callLater(0, MochiKit.Base.method(this, 'orientationChangeHandler')); | 38 | MochiKit.Async.callLater(0, MochiKit.Base.method(this, 'orientationChangeHandler')); |
42 | } else { | 39 | } else { |
43 | this.setOrientation('portrait'); | 40 | this.setOrientation('portrait'); |
44 | // this.setOrientation('landscape'); | 41 | // this.setOrientation('landscape'); |
45 | } | 42 | } |
46 | 43 | ||
47 | this.addMetaTag('viewport', 'width=devicewidth; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'); | 44 | this.addMetaTag('viewport', 'width=devicewidth; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'); |
48 | this.addMetaTag('apple-mobile-web-app-capable', 'yes'); | 45 | this.addMetaTag('apple-mobile-web-app-capable', 'yes'); |
49 | this.addMetaTag('apple-mobile-web-app-status-bar-style', 'black'); | 46 | this.addMetaTag('apple-mobile-web-app-status-bar-style', 'black'); |
50 | 47 | ||
51 | this.addLinkTag('apple-touch-icon', 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABfCAYAAACOTBv1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAQC0lEQVR4nO2ce3wU1b3AvzOzz2TzBpKQhIS3CnLxgYoPqAgiQS8igiAqiFprtT571YpKUa9tvVgrVvhc7IXS4lUUvGgR5CWIoiAIYoQgJGDI+0k2yW42szNz7h8pGBHIPmazqeb7+UD4DHt+vzPfPTnnzJkzIwGCLqKCHO0K/JTpkh9FuuRHkS75UaRLfhTpkh9FuuRHkS75UaRLfhTpkh9FLNGuwKnIzc3l9WXLQAIhQILWvwQnjn3vUNtjkoQQ4kSZr77KY+TIkR1/EgHQKeWnp6eTkJiI0P2gqyeOnxD7T+ttxf/wp4SwOOnTp0/UzqM9OqV8oFXygSVIm3/xvePSKf59up/cWfO9z3c2OnmfH646qVMv2XZa+RKtrT8cWruoztv2O6384/15OLSODZ237Xda+W1nMKEiROe+U9Rp5ZtFJ+51Oq/8E/P7MOjE3oFOLL/1Iik8fUJoCF03pT6RoNPKF4Q/2zF0P0J0yQ8aM/pqoesIXQs/UITotPKFYRDuXMXQ/dDV8oNECIShgRGmOKFjGIY5dYoAnVK+QCB0DSNM+Ybmb/0SOylhy8/NzWXYsGFm1OU7hGhd0RThtdrW2Y758kdcdhGLX30h7Dhhr2ouWrSI9PQ0ykrLeHn+fBYsWIDX6w0zqsAwNOQwW77QtbBnTMdJSkzgkfvuZPqkXOJi7SAMLhl2Htt37gk5ZlgtPycnh7TU7oiGo6TH6zz/3DPUVpXz3qp3+Lch54YeWLR2OyLcbkcPf9wY/bNL2fjuMg7uWM09t11PnE1FaSwADB65746wYofV8ufMeQph6MhfvoT09atIWWORBt7GNaOv5urRWyktLeWll//MXxb/FZ/PF3BcgcDQVeRwux1DQxjBz1m7JSfx2IM/Z/J1Y3A5LUiShFK3G3vpWuwVW9Bjs6i/eCGXnjcgrPqF1fJzrxkLuopUuAJJGMhH12LZMA3LG2ej7JxDZmwT//W7uVSVFPDW/y5l4ID+gQUWAmHo4V8g6VrAA64kSYwfM5It//g7+z9Zye2TxxJPDY7CpSRsnUrCzgdwlH2AZPiwNB5CajyMYqjkjhkRcvVCbvnnnzeUBJcDUbIFyVv+/RNprsKSNx/y5mP0uAS53zSuvWoc48duoqi4lD++vIC/vb4cVVVPHVyA0P1hLw0Yhh/EmU8xtXsyv3noHiaMu5xYmwXJ8GMr34ijfB3Wut2nvR3jKN9EU850fnXHNNZs2BpS/UKW/+QTj4GhIxe+fcbPyVXbsVVtR1ifRMueQE7fKbz0u6f5/dzfsGb9JuY8+wJHiopPKmXObAdDwzhFtyPLMhPGjeKRe2cyIDsVCYHiPoCjcB32qi3Imqfd0PaqrTRmTWFw31QURUbXg69ryPKvuOxihN+LXLQ6oM9L/kasBcuwFixDTzwbS+8buf6q8UwYu4bDR8t4cf5/8+bK99C01hmKOfP87/f5PdO6M/vhX3DdmOHYLTKyWo/92zdxlm/A4j0aVGyLrxzFfQDD1ZdpE8exbMX7QdcvJPmjR/2MWJuCVLIBSXUHXV6pz0fZ8yz2vS+gZYymX/ZEXvnDbOY99yjvrd1CwZFiU65wDd0PhsTUieN44O7p9E5PQhI6trrPcJavx1a7E4nQf7uc1Z/gj8nmjptCk39860tQrFu9ksuGDcX+6f1YioNPeir0mEzUrOtQs65FtyYhSWA7uorYr0O/mKm5/C0MJRYhDBRPEc6KjTirNiP7g28wp6yzNZHywfMQsoUBo+7C1+IPqnxILf+ioYMRaj1K2aZQip8SxVuC85uFOA4uwt/9EloyxkOYSwNSyzEcdRtxVm7C2lRoUk2/Q/HXY2vYj881kLumX88ri888/p1M0PKnTr4BRfKjHN2ApAc+dw8USejYqrZhq9qGkJSwYiXv+iVShFc1nXXbaXb2Ydq1VwQtP+h5/r13zUAYOpbiwAbacAhXXKTFA8S492BoPlLjBPGumKDKBiVfURQG9ctCeKuxVH0WVKIfK4rRjLMhD8lQeWDWpKDKBiX/njtngFCxlK7rkFb1r4KrYTeG5ue6kcGtZwUlf8bUCWBo2ErWBZXkx06MJx+hNZFg8dCzR1LA5QKWH+N0kpOeCJ4yLPVfhVTJHyuy0HA17Qeh8+Cs6wMvF+gHH77vTjA0JG85emx2SJX8saLJsaA3I3Q/V52fE3C5gKeaY6+6AmH4UV39qRu2EMVThL1qK47qj7F4S0Kp8780ftlFo3MATc6z8Fp6Ht/ZS0xiMg6bFZ/a/gVXwFe4TqeTqVMmMevm6zk7pwea9xhCGCAEFk8RjpptOGo/xdJcFuZpdV78sotGxwAanQNptvZEIJAkGUtiDnuLmnht+Xo2bNoS8E37kJYXYmNjmXbTjcy8aTwDMpLRmmtb1+CFQPEcIaZuB87a7VhaKoMN3enwy3E0OgfQYO9PsyWt1ZikYEnKIa+oidfe2sj6jZtD2iURkvy2uFwupk+9kRmTc+mT7kLz1CAMAQgsniPEHNtJzLGdWNTqcNJ0KKoST6O9Pw2O/visaQjDQJJlrEl9+KrYy+IVm/hg/YfoYd5vCFt+W+Lj47ll2mRuvWE02d0crV+EECAMbN4iYty7iKnfjcVfa1ZK01CVBBrs/Wi098dnTUUIA0lubeH7in0sXrmZNes2hi28LabKb0tCQgIzpk/h5glXkpko//OLaB0jbM1FxLh3E9uwF6t2LBLpA0JVEmiw9afB3heftUfrLjlZxprUm/wylSXvbOH9DzaiaZHZ+xMx+W1JSkpi5i1TuGn85fSMF2hNVSe6JntzEbGNe3E15WHRzFnqPRMtSiIN9n402Pris3RrHasAW3IfDlT4WfLOVlav3RAx4W3pEPltSUlJYdYtU5g8bjipMS2oDa2DclzDLlJrVkU0twCK4q7DY81AIGFP6UN+ucZfV33M6rUb8PuDW48Plw6X35aZU3J5YvowbGoVWRWvIYvItzZNclIQNxHVlsK4B/5OWXV9xHOejqjt1UzvkcRj04eD5iWtenmHiAewiGYyPZsQ3jqWzp2CIkdvu2pUMsuyxMo/3Y+keehRtxq7Vteh+V16Janql6RY3Lz48IQOzd2WqMh/dc7PSbJ6iG/cSUJzfjSqQKq2D5dWyuV9YPKYoVGpQ4fLv/Ga4YwY6MTmKyO1YUtHpz+BBORon2PVm3h0Yj/6ZAS+FGwWHSo/My2FObMuR9K8ZLjfRya6N2SsqPQWu8DvZsmjY3DYwrtnHCwdJl+WJd78w+2gNtKzaSN2I/Jz+kCI4xgZ4iBOo4ZFj4/v0NwdJn/h0zOJl9wkN+8lQT0cdjyBRAtOE2oGaVIRcUYF/WJr+NVkkx/0OAMdIn/KuEu4OBuc/nLSmneYErNc6k8hF2CY8KizJEFfy0FseJk2zMqFZ6WaUMP2ibj8XunJzJ42FFn3kOXdjBzG9rzjeIinzMjBI2IpNQLcdt4OVkljgO0QQvXw4syBxDkj3/9HVL4iyyx75iaMlnqyfNuwi/Z3/7aHISQO62cj2eOxxCRTbvTEbSSaUFuIUzxk24qR1RqWPnpFxF8XE1H5C2ZPxWXU0K1lP4lGqSkxS4zeeA0HGwqd/N8+G8IwKFD7429nH36gZDjqSJLrSDaKmDvjfFNino6IyZ86bhgXpHtxalVkGHmmxGw04inX0tESB/HEvGU8+6eluBOGoxoShS05puQAGOiqxI6XKzIqGHdRpmlxTyYi8nN6JvPrCX1QdC+99R2mvGxLFzIFLb2R7XHc+8cNJ54yvPnx17B0P4taNZZyNSXsPAAWWXBOQi3oXv7jaomMFLspcU/GdPkWRWbp7FyE6ibH2IMdczbTFqkZeDWZLSUp7N136MTx2to65r5xGMUWw2FPCh7dZkq+eJtG3zg3oqWEhXenYY3A+Gu6/AWPT8ShVtDDKCBRMue+bb3mosyXgEgewuPz3vjB/7+/8RN2egah6xr57m4YwpyBMivOoLsDnL6jvDjLnFlVW0yVf8v4CxmSXItL1JIlFZgSUxMyhzypWOxxPLjgs9PuEnjouSWQOQqPJlHYGGdKboCzUwQOBAMdBdx2lbn9v2ny+2amcN+YZBTdSz9ln2mv1zrs6YZPk9hWm80XeQdP+zld15n5n+uwJedQ0iRT4zOnn7DIMCQNEIKbB9UwqFesKXHBRPnzf/3vGC1udF3jmBZvSszaFgflXgei+1Aem9f+gwdHior5y45YJFmQX2vQYsK6nRBQ3dT6eJhQVZ672bzuxzT5D/75I6SMK9ENQaEvk2+8vdBE6OH9hsQ37ngUu5NH/+frgLdsLF6+nrKECbSosK86vDcUtmiwq0jiYIWEoUnY++by9HvhXygexzT5hwoOM+L2F9mnjES2u6huiWFPQ28aNEdI8Q7Wx9Ki+dnlGcyOPQeCKnvnb9/Gnn0NtR6ZohBv0dY0wceHJKobQFJiqO11K7lPbSRv/6H2CweIAvzWrGCGYfCPjds5ZhvAqGF98R4roaI5BgmDeKsa8DhQ6VU44jawpF3ILXM3BL0VT9M08sqtjD03luraerq7wB7gBbAQcLAS8opB80s4087hrbLBPPXKO6ZvJzFV/nHyDx7m3c+rmXDDJOT6/dSrFtwtFpLtLSjt/K6pOnxZJZBsCcxeBUUlVSHVoayyhoxBo+glDlHnEWQmgtzOl+9TYddhiZJaCYSM45wJ3Pu3YjZ8/EVIdWiPiC0vVFZWcvVd8/nUPxqrqzt1PoMdlQ5qfWdOub9Gwq9J7NNHsG1XcN3NyTy/8B18fabS2Az729k8XemGj/KhpkFCtrqoyJrO+CfX8E3Bt2HV4Ux0yL6dEZdewO9vTaO5cC1CCHrFCfom/bAlljbA/moJS/pljH1qhymbmJKTk1j50CCaDm/jwt6CtJMWQA0D8kuhsEJCGODKOpcl+d14/d0Pw87dHhHpdk6mqLicFZ9Ucc3E27A35lPv1anxQrKTE5ftPj98WS6BEscz66wcKTZne3lzs48q0rm0ZwsV1V4yUr7L6W2B7QehvFYCAc5zJ3H3kkNs3bHXlNzt0WG3Ed1uNzfcv4j368fh6H4Obi98+i2UN7QOcnnlEqoKB61XsvXz/abmXrt5B/tixtCiSuwuaM1XVgeb86DeI6M4Ezjaazrjn1zFkaKOe8omKtsFzx00kFd/eR6evOUgQYJdUN8sYc+8hHHPfnH69/CEgaIorHl+Es1fvU2yS3DMIyOEIC7nfBbujmXF2tDemRMOUdur6XA4WPDUbWRVr0D11CNbY5i3pzebPjNn7f9U9M7O5LWpyTSV5CFJYB08hbvmf0RpWUXEcp6JDunzT4Wmabz74ReIjBEMH9iNQwzhleWRbX317gbktCGcn6ZzICGX2597i4aGxojmbA8R7T/ZvTKF3W7rsHwDB/SL+jkDIqpbxH/qdMrX+f5U6JIfRbrkR5Eu+VGkS34U6ZIfRbrkR5Eu+VGkS34U6ZIfRbrkR5H/Bx8z6HmTXnicAAAAAElFTkSuQmCCCg=='); | 48 | this.addLinkTag('apple-touch-icon', 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABfCAYAAACOTBv1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAQC0lEQVR4nO2ce3wU1b3AvzOzz2TzBpKQhIS3CnLxgYoPqAgiQS8igiAqiFprtT571YpKUa9tvVgrVvhc7IXS4lUUvGgR5CWIoiAIYoQgJGDI+0k2yW42szNz7h8pGBHIPmazqeb7+UD4DHt+vzPfPTnnzJkzIwGCLqKCHO0K/JTpkh9FuuRHkS75UaRLfhTpkh9FuuRHkS75UaRLfhTpkh9FLNGuwKnIzc3l9WXLQAIhQILWvwQnjn3vUNtjkoQQ4kSZr77KY+TIkR1/EgHQKeWnp6eTkJiI0P2gqyeOnxD7T+ttxf/wp4SwOOnTp0/UzqM9OqV8oFXygSVIm3/xvePSKf59up/cWfO9z3c2OnmfH646qVMv2XZa+RKtrT8cWruoztv2O6384/15OLSODZ237Xda+W1nMKEiROe+U9Rp5ZtFJ+51Oq/8E/P7MOjE3oFOLL/1Iik8fUJoCF03pT6RoNPKF4Q/2zF0P0J0yQ8aM/pqoesIXQs/UITotPKFYRDuXMXQ/dDV8oNECIShgRGmOKFjGIY5dYoAnVK+QCB0DSNM+Ybmb/0SOylhy8/NzWXYsGFm1OU7hGhd0RThtdrW2Y758kdcdhGLX30h7Dhhr2ouWrSI9PQ0ykrLeHn+fBYsWIDX6w0zqsAwNOQwW77QtbBnTMdJSkzgkfvuZPqkXOJi7SAMLhl2Htt37gk5ZlgtPycnh7TU7oiGo6TH6zz/3DPUVpXz3qp3+Lch54YeWLR2OyLcbkcPf9wY/bNL2fjuMg7uWM09t11PnE1FaSwADB65746wYofV8ufMeQph6MhfvoT09atIWWORBt7GNaOv5urRWyktLeWll//MXxb/FZ/PF3BcgcDQVeRwux1DQxjBz1m7JSfx2IM/Z/J1Y3A5LUiShFK3G3vpWuwVW9Bjs6i/eCGXnjcgrPqF1fJzrxkLuopUuAJJGMhH12LZMA3LG2ej7JxDZmwT//W7uVSVFPDW/y5l4ID+gQUWAmHo4V8g6VrAA64kSYwfM5It//g7+z9Zye2TxxJPDY7CpSRsnUrCzgdwlH2AZPiwNB5CajyMYqjkjhkRcvVCbvnnnzeUBJcDUbIFyVv+/RNprsKSNx/y5mP0uAS53zSuvWoc48duoqi4lD++vIC/vb4cVVVPHVyA0P1hLw0Yhh/EmU8xtXsyv3noHiaMu5xYmwXJ8GMr34ijfB3Wut2nvR3jKN9EU850fnXHNNZs2BpS/UKW/+QTj4GhIxe+fcbPyVXbsVVtR1ifRMueQE7fKbz0u6f5/dzfsGb9JuY8+wJHiopPKmXObAdDwzhFtyPLMhPGjeKRe2cyIDsVCYHiPoCjcB32qi3Imqfd0PaqrTRmTWFw31QURUbXg69ryPKvuOxihN+LXLQ6oM9L/kasBcuwFixDTzwbS+8buf6q8UwYu4bDR8t4cf5/8+bK99C01hmKOfP87/f5PdO6M/vhX3DdmOHYLTKyWo/92zdxlm/A4j0aVGyLrxzFfQDD1ZdpE8exbMX7QdcvJPmjR/2MWJuCVLIBSXUHXV6pz0fZ8yz2vS+gZYymX/ZEXvnDbOY99yjvrd1CwZFiU65wDd0PhsTUieN44O7p9E5PQhI6trrPcJavx1a7E4nQf7uc1Z/gj8nmjptCk39860tQrFu9ksuGDcX+6f1YioNPeir0mEzUrOtQs65FtyYhSWA7uorYr0O/mKm5/C0MJRYhDBRPEc6KjTirNiP7g28wp6yzNZHywfMQsoUBo+7C1+IPqnxILf+ioYMRaj1K2aZQip8SxVuC85uFOA4uwt/9EloyxkOYSwNSyzEcdRtxVm7C2lRoUk2/Q/HXY2vYj881kLumX88ri888/p1M0PKnTr4BRfKjHN2ApAc+dw8USejYqrZhq9qGkJSwYiXv+iVShFc1nXXbaXb2Ydq1VwQtP+h5/r13zUAYOpbiwAbacAhXXKTFA8S492BoPlLjBPGumKDKBiVfURQG9ctCeKuxVH0WVKIfK4rRjLMhD8lQeWDWpKDKBiX/njtngFCxlK7rkFb1r4KrYTeG5ue6kcGtZwUlf8bUCWBo2ErWBZXkx06MJx+hNZFg8dCzR1LA5QKWH+N0kpOeCJ4yLPVfhVTJHyuy0HA17Qeh8+Cs6wMvF+gHH77vTjA0JG85emx2SJX8saLJsaA3I3Q/V52fE3C5gKeaY6+6AmH4UV39qRu2EMVThL1qK47qj7F4S0Kp8780ftlFo3MATc6z8Fp6Ht/ZS0xiMg6bFZ/a/gVXwFe4TqeTqVMmMevm6zk7pwea9xhCGCAEFk8RjpptOGo/xdJcFuZpdV78sotGxwAanQNptvZEIJAkGUtiDnuLmnht+Xo2bNoS8E37kJYXYmNjmXbTjcy8aTwDMpLRmmtb1+CFQPEcIaZuB87a7VhaKoMN3enwy3E0OgfQYO9PsyWt1ZikYEnKIa+oidfe2sj6jZtD2iURkvy2uFwupk+9kRmTc+mT7kLz1CAMAQgsniPEHNtJzLGdWNTqcNJ0KKoST6O9Pw2O/visaQjDQJJlrEl9+KrYy+IVm/hg/YfoYd5vCFt+W+Lj47ll2mRuvWE02d0crV+EECAMbN4iYty7iKnfjcVfa1ZK01CVBBrs/Wi098dnTUUIA0lubeH7in0sXrmZNes2hi28LabKb0tCQgIzpk/h5glXkpko//OLaB0jbM1FxLh3E9uwF6t2LBLpA0JVEmiw9afB3heftUfrLjlZxprUm/wylSXvbOH9DzaiaZHZ+xMx+W1JSkpi5i1TuGn85fSMF2hNVSe6JntzEbGNe3E15WHRzFnqPRMtSiIN9n402Pris3RrHasAW3IfDlT4WfLOVlav3RAx4W3pEPltSUlJYdYtU5g8bjipMS2oDa2DclzDLlJrVkU0twCK4q7DY81AIGFP6UN+ucZfV33M6rUb8PuDW48Plw6X35aZU3J5YvowbGoVWRWvIYvItzZNclIQNxHVlsK4B/5OWXV9xHOejqjt1UzvkcRj04eD5iWtenmHiAewiGYyPZsQ3jqWzp2CIkdvu2pUMsuyxMo/3Y+keehRtxq7Vteh+V16Janql6RY3Lz48IQOzd2WqMh/dc7PSbJ6iG/cSUJzfjSqQKq2D5dWyuV9YPKYoVGpQ4fLv/Ga4YwY6MTmKyO1YUtHpz+BBORon2PVm3h0Yj/6ZAS+FGwWHSo/My2FObMuR9K8ZLjfRya6N2SsqPQWu8DvZsmjY3DYwrtnHCwdJl+WJd78w+2gNtKzaSN2I/Jz+kCI4xgZ4iBOo4ZFj4/v0NwdJn/h0zOJl9wkN+8lQT0cdjyBRAtOE2oGaVIRcUYF/WJr+NVkkx/0OAMdIn/KuEu4OBuc/nLSmneYErNc6k8hF2CY8KizJEFfy0FseJk2zMqFZ6WaUMP2ibj8XunJzJ42FFn3kOXdjBzG9rzjeIinzMjBI2IpNQLcdt4OVkljgO0QQvXw4syBxDkj3/9HVL4iyyx75iaMlnqyfNuwi/Z3/7aHISQO62cj2eOxxCRTbvTEbSSaUFuIUzxk24qR1RqWPnpFxF8XE1H5C2ZPxWXU0K1lP4lGqSkxS4zeeA0HGwqd/N8+G8IwKFD7429nH36gZDjqSJLrSDaKmDvjfFNino6IyZ86bhgXpHtxalVkGHmmxGw04inX0tESB/HEvGU8+6eluBOGoxoShS05puQAGOiqxI6XKzIqGHdRpmlxTyYi8nN6JvPrCX1QdC+99R2mvGxLFzIFLb2R7XHc+8cNJ54yvPnx17B0P4taNZZyNSXsPAAWWXBOQi3oXv7jaomMFLspcU/GdPkWRWbp7FyE6ibH2IMdczbTFqkZeDWZLSUp7N136MTx2to65r5xGMUWw2FPCh7dZkq+eJtG3zg3oqWEhXenYY3A+Gu6/AWPT8ShVtDDKCBRMue+bb3mosyXgEgewuPz3vjB/7+/8RN2egah6xr57m4YwpyBMivOoLsDnL6jvDjLnFlVW0yVf8v4CxmSXItL1JIlFZgSUxMyhzypWOxxPLjgs9PuEnjouSWQOQqPJlHYGGdKboCzUwQOBAMdBdx2lbn9v2ny+2amcN+YZBTdSz9ln2mv1zrs6YZPk9hWm80XeQdP+zld15n5n+uwJedQ0iRT4zOnn7DIMCQNEIKbB9UwqFesKXHBRPnzf/3vGC1udF3jmBZvSszaFgflXgei+1Aem9f+gwdHior5y45YJFmQX2vQYsK6nRBQ3dT6eJhQVZ672bzuxzT5D/75I6SMK9ENQaEvk2+8vdBE6OH9hsQ37ngUu5NH/+frgLdsLF6+nrKECbSosK86vDcUtmiwq0jiYIWEoUnY++by9HvhXygexzT5hwoOM+L2F9mnjES2u6huiWFPQ28aNEdI8Q7Wx9Ki+dnlGcyOPQeCKnvnb9/Gnn0NtR6ZohBv0dY0wceHJKobQFJiqO11K7lPbSRv/6H2CweIAvzWrGCGYfCPjds5ZhvAqGF98R4roaI5BgmDeKsa8DhQ6VU44jawpF3ILXM3BL0VT9M08sqtjD03luraerq7wB7gBbAQcLAS8opB80s4087hrbLBPPXKO6ZvJzFV/nHyDx7m3c+rmXDDJOT6/dSrFtwtFpLtLSjt/K6pOnxZJZBsCcxeBUUlVSHVoayyhoxBo+glDlHnEWQmgtzOl+9TYddhiZJaCYSM45wJ3Pu3YjZ8/EVIdWiPiC0vVFZWcvVd8/nUPxqrqzt1PoMdlQ5qfWdOub9Gwq9J7NNHsG1XcN3NyTy/8B18fabS2Az729k8XemGj/KhpkFCtrqoyJrO+CfX8E3Bt2HV4Ux0yL6dEZdewO9vTaO5cC1CCHrFCfom/bAlljbA/moJS/pljH1qhymbmJKTk1j50CCaDm/jwt6CtJMWQA0D8kuhsEJCGODKOpcl+d14/d0Pw87dHhHpdk6mqLicFZ9Ucc3E27A35lPv1anxQrKTE5ftPj98WS6BEscz66wcKTZne3lzs48q0rm0ZwsV1V4yUr7L6W2B7QehvFYCAc5zJ3H3kkNs3bHXlNzt0WG3Ed1uNzfcv4j368fh6H4Obi98+i2UN7QOcnnlEqoKB61XsvXz/abmXrt5B/tixtCiSuwuaM1XVgeb86DeI6M4Ezjaazrjn1zFkaKOe8omKtsFzx00kFd/eR6evOUgQYJdUN8sYc+8hHHPfnH69/CEgaIorHl+Es1fvU2yS3DMIyOEIC7nfBbujmXF2tDemRMOUdur6XA4WPDUbWRVr0D11CNbY5i3pzebPjNn7f9U9M7O5LWpyTSV5CFJYB08hbvmf0RpWUXEcp6JDunzT4Wmabz74ReIjBEMH9iNQwzhleWRbX317gbktCGcn6ZzICGX2597i4aGxojmbA8R7T/ZvTKF3W7rsHwDB/SL+jkDIqpbxH/qdMrX+f5U6JIfRbrkR5Eu+VGkS34U6ZIfRbrkR5Eu+VGkS34U6ZIfRbrkR5H/Bx8z6HmTXnicAAAAAElFTkSuQmCCCg=='); |
52 | //this.addLinkTag('apple-touch-startup-image', 'default.png'); | 49 | //this.addLinkTag('apple-touch-startup-image', 'default.png'); |
53 | 50 | ||
54 | // if (!window.navigator.standalone)// not running as an installed app | 51 | // if (!window.navigator.standalone)// not running as an installed app |
55 | 52 | ||
56 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', this, 'selectedDirectLoginHandler'); | 53 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', this, 'selectedDirectLoginHandler'); |
57 | 54 | ||
58 | MochiKit.DOM.addElementClass(document.body, 'iPhone'); | 55 | MochiKit.DOM.addElementClass(document.body, 'iPhone'); |
59 | return this; | 56 | return this; |
60 | } | 57 | } |
61 | 58 | ||
62 | MochiKit.Base.update(Clipperz.PM.UI.iPhone.Controllers.MainController.prototype, { | 59 | MochiKit.Base.update(Clipperz.PM.UI.iPhone.Controllers.MainController.prototype, { |
63 | 60 | ||
64 | 'toString': function () { | 61 | 'toString': function () { |
65 | return "Clipperz.PM.UI.iPhone.Controllers.MainController"; | 62 | return "Clipperz.PM.UI.iPhone.Controllers.MainController"; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //========================================================================= | 65 | //========================================================================= |
69 | 66 | ||
70 | 'user': function () { | 67 | 'user': function () { |
71 | return this._user; | 68 | return this._user; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'setUser': function (aValue) { | 71 | 'setUser': function (aValue) { |
75 | this._user = aValue; | 72 | this._user = aValue; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //========================================================================= | 75 | //========================================================================= |
79 | 76 | ||
80 | 'loginForm': function() { | 77 | 'loginForm': function() { |
81 | if (this._loginForm == null) { | 78 | if (this._loginForm == null) { |
82 | MochiKit.DOM.removeElement('mainDiv'); | 79 | MochiKit.DOM.removeElement('mainDiv'); |
83 | this._loginForm = new Clipperz.PM.UI.iPhone.Components.LoginForm({element:MochiKit.DOM.currentDocument().body}); | 80 | this._loginForm = new Clipperz.PM.UI.iPhone.Components.LoginForm({element:MochiKit.DOM.currentDocument().body}); |
84 | MochiKit.Signal.connect(this._loginForm, 'doLogin', this, 'doLoginHandler') | 81 | MochiKit.Signal.connect(this._loginForm, 'doLogin', this, 'doLoginHandler') |
85 | } | 82 | } |
86 | 83 | ||
87 | return this._loginForm; | 84 | return this._loginForm; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | 'removeLoginForm': function () { | 87 | 'removeLoginForm': function () { |
91 | if (this._loginForm != null) { | 88 | if (this._loginForm != null) { |
92 | this._loginForm.remove(); | 89 | this._loginForm.remove(); |
93 | this._loginForm = null; | 90 | this._loginForm = null; |
94 | } | 91 | } |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //----------------------------------------------------------------------------- | 94 | //----------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'cardList': function () { | 96 | 'cardList': function () { |
100 | if (this._cardList == null) { | 97 | if (this._cardList == null) { |
101 | this._cardList = new Clipperz.PM.UI.iPhone.Components.CardList({element:MochiKit.DOM.currentDocument().body}); | 98 | this._cardList = new Clipperz.PM.UI.iPhone.Components.CardList({element:MochiKit.DOM.currentDocument().body}); |
102 | MochiKit.Signal.connect(this._cardList, 'searchEvent',this, 'searchEventHandler') | 99 | MochiKit.Signal.connect(this._cardList, 'searchEvent',this, 'searchEventHandler') |
103 | MochiKit.Signal.connect(this._cardList, 'selectedCard',this, 'selecetedCardHandler') | 100 | MochiKit.Signal.connect(this._cardList, 'selectedCard',this, 'selecetedCardHandler') |
104 | } | 101 | } |
105 | 102 | ||
106 | return this._cardList; | 103 | return this._cardList; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //========================================================================= | 106 | //========================================================================= |
110 | 107 | ||
111 | 'currentWidth': function () { | 108 | 'currentWidth': function () { |
112 | return this._currentWidth; | 109 | return this._currentWidth; |
113 | }, | 110 | }, |
114 | 111 | ||
115 | 'setCurrentWidth': function (aValue) { | 112 | 'setCurrentWidth': function (aValue) { |
116 | this._currentWidth = aValue; | 113 | this._currentWidth = aValue; |
117 | }, | 114 | }, |
118 | 115 | ||
119 | //========================================================================= | 116 | //========================================================================= |
120 | 117 | ||
121 | 'orientationChangeHandler': function () { | 118 | 'orientationChangeHandler': function () { |
122 | switch(window.orientation) { | 119 | switch(window.orientation) { |
123 | case 0: | 120 | case 0: |
124 | this.setOrientation('portrait'); | 121 | this.setOrientation('portrait'); |
125 | break; | 122 | break; |
126 | case 90: | 123 | case 90: |
127 | case -90: | 124 | case -90: |
128 | this.setOrientation('landscape'); | 125 | this.setOrientation('landscape'); |
129 | break; | 126 | break; |
130 | } | 127 | } |
131 | }, | 128 | }, |
132 | 129 | ||
133 | //------------------------------------------------------------------------- | 130 | //------------------------------------------------------------------------- |
134 | 131 | ||
135 | 'setOrientation': function (anOrientation) { | 132 | 'setOrientation': function (anOrientation) { |
136 | document.body.setAttribute('orientation', anOrientation); | 133 | document.body.setAttribute('orientation', anOrientation); |
137 | setTimeout(scrollTo, 100, 0, 1); | 134 | setTimeout(scrollTo, 100, 0, 1); |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'slidePages': function (fromPage, toPage, backwards) { | 139 | 'slidePages': function (fromPage, toPage, backwards) { |
143 | var axis; | 140 | var axis; |
144 | var slideDone; | 141 | var slideDone; |
145 | 142 | ||
146 | slideDone = function () { | 143 | slideDone = function () { |
147 | // console.log("slideDone"); | 144 | // console.log("slideDone"); |
148 | if (!hasClass(toPage, "dialog")) { | 145 | if (!hasClass(toPage, "dialog")) { |
149 | fromPage.removeAttribute("selected"); | 146 | fromPage.removeAttribute("selected"); |
150 | } | 147 | } |
151 | checkTimer = setInterval(checkOrientAndLocation, 300); | 148 | checkTimer = setInterval(checkOrientAndLocation, 300); |
152 | setTimeout(updatePage, 0, toPage, fromPage); | 149 | setTimeout(updatePage, 0, toPage, fromPage); |
153 | fromPage.removeEventListener('webkitTransitionEnd', slideDone, false); | 150 | fromPage.removeEventListener('webkitTransitionEnd', slideDone, false); |
154 | } | 151 | } |
155 | 152 | ||
156 | axis = (backwards ? fromPage : toPage).getAttribute("axis"); | 153 | axis = (backwards ? fromPage : toPage).getAttribute("axis"); |
157 | 154 | ||
158 | clearInterval(checkTimer); | 155 | clearInterval(checkTimer); |
159 | 156 | ||
160 | if (canDoSlideAnim() && axis != 'y') { | 157 | if (canDoSlideAnim() && axis != 'y') { |
161 | slide2(fromPage, toPage, backwards, slideDone); | 158 | slide2(fromPage, toPage, backwards, slideDone); |
162 | } else { | 159 | } else { |
163 | slide1(fromPage, toPage, backwards, axis, slideDone); | 160 | slide1(fromPage, toPage, backwards, axis, slideDone); |
164 | } | 161 | } |
165 | }, | 162 | }, |
166 | 163 | ||
167 | //------------------------------------------------------------------------- | 164 | //------------------------------------------------------------------------- |
168 | 165 | ||
169 | 'getCachedValues': function () { | 166 | 'getCachedValues': function () { |
170 | var deferredResult; | 167 | var deferredResult; |
171 | 168 | ||
172 | if (this._cachedObjects != null) { | 169 | if (this._cachedObjects != null) { |
173 | deferredResult = MochiKit.Async.succeed(this._cachedObjects); | 170 | deferredResult = MochiKit.Async.succeed(this._cachedObjects); |
174 | } else { | 171 | } else { |
175 | deferredResult = new Clipperz.Async.Deferred("MainController.getCachedValues", {trace:false}); | 172 | deferredResult = new Clipperz.Async.Deferred("MainController.getCachedValues", {trace:false}); |
176 | deferredResult.addMethod(this.user(), 'getRecords'); | 173 | deferredResult.addMethod(this.user(), 'getRecords'); |
177 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("MainController.getCachedValues - collectResults", { | 174 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("MainController.getCachedValues - collectResults", { |
178 | '_rowObject': MochiKit.Async.succeed, | 175 | '_rowObject': MochiKit.Async.succeed, |
179 | '_reference': MochiKit.Base.methodcaller('reference'), | 176 | '_reference': MochiKit.Base.methodcaller('reference'), |
180 | 'label': MochiKit.Base.methodcaller('label'), | 177 | 'label': MochiKit.Base.methodcaller('label'), |
181 | 'favicon': MochiKit.Base.methodcaller('favicon'), | 178 | 'favicon': MochiKit.Base.methodcaller('favicon'), |
182 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent') | 179 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent') |
183 | }, {trace:false})); | 180 | }, {trace:false})); |
184 | deferredResult.addCallback(Clipperz.Async.collectAll); | 181 | deferredResult.addCallback(Clipperz.Async.collectAll); |
185 | deferredResult.addCallback(MochiKit.Base.bind(function (someRows) { | 182 | deferredResult.addCallback(MochiKit.Base.bind(function (someRows) { |
186 | this._cachedObjects = someRows; | 183 | this._cachedObjects = someRows; |
187 | return this._cachedObjects; | 184 | return this._cachedObjects; |
188 | }, this)); | 185 | }, this)); |
189 | deferredResult.callback(); | 186 | deferredResult.callback(); |
190 | } | 187 | } |
191 | 188 | ||
192 | return deferredResult; | 189 | return deferredResult; |
193 | }, | 190 | }, |
194 | //========================================================================= | 191 | //========================================================================= |
195 | 192 | ||
196 | 'run': function(shouldShowRegistrationForm) { | 193 | 'run': function(shouldShowRegistrationForm) { |
197 | this.loginForm().render(); | 194 | this.loginForm().render(); |
198 | MochiKit.Async.callLater(1, MochiKit.Base.method(this.loginForm(), 'focusOnUsername')); | 195 | MochiKit.Async.callLater(1, MochiKit.Base.method(this.loginForm(), 'focusOnUsername')); |
199 | }, | 196 | }, |
200 | 197 | ||
201 | //========================================================================= | 198 | //========================================================================= |
202 | 199 | ||
203 | 'doLoginHandler': function (someArgs) { | 200 | 'doLoginHandler': function (someArgs) { |
204 | var deferredResult; | 201 | var deferredResult; |
205 | varparameters; | 202 | varparameters; |
206 | varshouldUseOTP; | 203 | varshouldUseOTP; |
207 | // var loginProgress; | 204 | // var loginProgress; |
208 | varuser; | 205 | varuser; |
209 | var getPassphraseDelegate; | 206 | var getPassphraseDelegate; |
210 | 207 | ||
211 | parameters = someArgs; | 208 | parameters = someArgs; |
212 | shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); | 209 | shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); |
213 | 210 | ||
214 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); | 211 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); |
215 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':getPassphraseDelegate}); | 212 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':getPassphraseDelegate}); |
216 | 213 | ||
diff --git a/frontend/gamma/js/Clipperz/Set.js b/frontend/gamma/js/Clipperz/Set.js index 61e0769..7023888 100644 --- a/frontend/gamma/js/Clipperz/Set.js +++ b/frontend/gamma/js/Clipperz/Set.js | |||
@@ -1,167 +1,164 @@ | |||
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 | 26 | ||
30 | if (typeof(Clipperz) == 'undefined') { | 27 | if (typeof(Clipperz) == 'undefined') { |
31 | Clipperz = {}; | 28 | Clipperz = {}; |
32 | } | 29 | } |
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.Set = function(args) { | 33 | Clipperz.Set = function(args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | //MochiKit.Base.bindMethods(this); | 35 | //MochiKit.Base.bindMethods(this); |
39 | 36 | ||
40 | if (args.items != null) { | 37 | if (args.items != null) { |
41 | this._items = args.items.slice(); | 38 | this._items = args.items.slice(); |
42 | } else { | 39 | } else { |
43 | this._items = []; | 40 | this._items = []; |
44 | } | 41 | } |
45 | 42 | ||
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | //============================================================================= | 46 | //============================================================================= |
50 | 47 | ||
51 | Clipperz.Set.prototype = MochiKit.Base.update(null, { | 48 | Clipperz.Set.prototype = MochiKit.Base.update(null, { |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'toString': function() { | 52 | 'toString': function() { |
56 | return "Clipperz.Set"; | 53 | return "Clipperz.Set"; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'items': function() { | 58 | 'items': function() { |
62 | return this._items; | 59 | return this._items; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'popAnItem': function() { | 64 | 'popAnItem': function() { |
68 | var result; | 65 | var result; |
69 | 66 | ||
70 | if (this.size() > 0) { | 67 | if (this.size() > 0) { |
71 | result = this.items().pop(); | 68 | result = this.items().pop(); |
72 | } else { | 69 | } else { |
73 | result = null; | 70 | result = null; |
74 | } | 71 | } |
75 | 72 | ||
76 | return result; | 73 | return result; |
77 | }, | 74 | }, |
78 | 75 | ||
79 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
80 | 77 | ||
81 | 'allItems': function() { | 78 | 'allItems': function() { |
82 | return this.items(); | 79 | return this.items(); |
83 | }, | 80 | }, |
84 | 81 | ||
85 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
86 | 83 | ||
87 | 'contains': function(anItem) { | 84 | 'contains': function(anItem) { |
88 | return (this.indexOf(anItem) != -1); | 85 | return (this.indexOf(anItem) != -1); |
89 | }, | 86 | }, |
90 | 87 | ||
91 | //------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------- |
92 | 89 | ||
93 | 'indexOf': function(anItem) { | 90 | 'indexOf': function(anItem) { |
94 | varresult; | 91 | varresult; |
95 | vari, c; | 92 | vari, c; |
96 | 93 | ||
97 | result = -1; | 94 | result = -1; |
98 | 95 | ||
99 | c = this.items().length; | 96 | c = this.items().length; |
100 | for (i=0; (i<c) && (result == -1); i++) { | 97 | for (i=0; (i<c) && (result == -1); i++) { |
101 | if (this.items()[i] === anItem) { | 98 | if (this.items()[i] === anItem) { |
102 | result = i; | 99 | result = i; |
103 | } | 100 | } |
104 | } | 101 | } |
105 | 102 | ||
106 | return result; | 103 | return result; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'add': function(anItem) { | 108 | 'add': function(anItem) { |
112 | if (anItem.constructor == Array) { | 109 | if (anItem.constructor == Array) { |
113 | MochiKit.Base.map(MochiKit.Base.bind(this,add, this), anItem); | 110 | MochiKit.Base.map(MochiKit.Base.bind(this,add, this), anItem); |
114 | } else { | 111 | } else { |
115 | if (! this.contains(anItem)) { | 112 | if (! this.contains(anItem)) { |
116 | this.items().push(anItem); | 113 | this.items().push(anItem); |
117 | } | 114 | } |
118 | } | 115 | } |
119 | }, | 116 | }, |
120 | 117 | ||
121 | //------------------------------------------------------------------------- | 118 | //------------------------------------------------------------------------- |
122 | 119 | ||
123 | 'debug': function() { | 120 | 'debug': function() { |
124 | vari, c; | 121 | vari, c; |
125 | 122 | ||
126 | result = -1; | 123 | result = -1; |
127 | 124 | ||
128 | c = this.items().length; | 125 | c = this.items().length; |
129 | for (i=0; i<c; i++) { | 126 | for (i=0; i<c; i++) { |
130 | alert("[" + i + "] " + this.items()[i].label); | 127 | alert("[" + i + "] " + this.items()[i].label); |
131 | } | 128 | } |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //------------------------------------------------------------------------- | 131 | //------------------------------------------------------------------------- |
135 | 132 | ||
136 | 'remove': function(anItem) { | 133 | 'remove': function(anItem) { |
137 | if (anItem.constructor == Array) { | 134 | if (anItem.constructor == Array) { |
138 | MochiKit.Base.map(MochiKit.Base.bind(this.remove, this), anItem); | 135 | MochiKit.Base.map(MochiKit.Base.bind(this.remove, this), anItem); |
139 | } else { | 136 | } else { |
140 | varitemIndex; | 137 | varitemIndex; |
141 | 138 | ||
142 | itemIndex = this.indexOf(anItem); | 139 | itemIndex = this.indexOf(anItem); |
143 | if (itemIndex != -1) { | 140 | if (itemIndex != -1) { |
144 | this.items().splice(itemIndex, 1); | 141 | this.items().splice(itemIndex, 1); |
145 | } | 142 | } |
146 | } | 143 | } |
147 | }, | 144 | }, |
148 | 145 | ||
149 | //------------------------------------------------------------------------- | 146 | //------------------------------------------------------------------------- |
150 | 147 | ||
151 | 'size': function() { | 148 | 'size': function() { |
152 | return this.items().length; | 149 | return this.items().length; |
153 | }, | 150 | }, |
154 | 151 | ||
155 | //------------------------------------------------------------------------- | 152 | //------------------------------------------------------------------------- |
156 | 153 | ||
157 | 'empty': function() { | 154 | 'empty': function() { |
158 | this.items().splice(0, this.items().length); | 155 | this.items().splice(0, this.items().length); |
159 | }, | 156 | }, |
160 | 157 | ||
161 | //------------------------------------------------------------------------- | 158 | //------------------------------------------------------------------------- |
162 | 159 | ||
163 | __syntaxFix__: "syntax fix" | 160 | __syntaxFix__: "syntax fix" |
164 | 161 | ||
165 | //------------------------------------------------------------------------- | 162 | //------------------------------------------------------------------------- |
166 | }); | 163 | }); |
167 | 164 | ||
diff --git a/frontend/gamma/js/Clipperz/Signal.js b/frontend/gamma/js/Clipperz/Signal.js index b82499a..ca3e322 100644 --- a/frontend/gamma/js/Clipperz/Signal.js +++ b/frontend/gamma/js/Clipperz/Signal.js | |||
@@ -1,71 +1,68 @@ | |||
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.Signal) == 'undefined') { Clipperz.Signal = {}; } | 27 | if (typeof(Clipperz.Signal) == 'undefined') { Clipperz.Signal = {}; } |
31 | 28 | ||
32 | Clipperz.Signal.VERSION = "0.1"; | 29 | Clipperz.Signal.VERSION = "0.1"; |
33 | Clipperz.Signal.NAME = "Clipperz.Signal"; | 30 | Clipperz.Signal.NAME = "Clipperz.Signal"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Signal, { | 32 | MochiKit.Base.update(Clipperz.Signal, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'fireNativeEvent': function(element, eventName) { | 48 | 'fireNativeEvent': function(element, eventName) { |
52 | if (element.fireEvent) { | 49 | if (element.fireEvent) { |
53 | // MSIE | 50 | // MSIE |
54 | element.fireEvent(eventName); | 51 | element.fireEvent(eventName); |
55 | } else { | 52 | } else { |
56 | // W3C | 53 | // W3C |
57 | var event; | 54 | var event; |
58 | 55 | ||
59 | event = document.createEvent("HTMLEvents"); | 56 | event = document.createEvent("HTMLEvents"); |
60 | event.initEvent(eventName.replace(/^on/, ""), true, true); | 57 | event.initEvent(eventName.replace(/^on/, ""), true, true); |
61 | element.dispatchEvent(event); | 58 | element.dispatchEvent(event); |
62 | } | 59 | } |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | __syntaxFix__: "syntax fix" | 63 | __syntaxFix__: "syntax fix" |
67 | 64 | ||
68 | }); | 65 | }); |
69 | 66 | ||
70 | Clipperz.Signal.NotificationCenter = {}; | 67 | Clipperz.Signal.NotificationCenter = {}; |
71 | 68 | ||
diff --git a/frontend/gamma/js/Clipperz/Style.js b/frontend/gamma/js/Clipperz/Style.js index 3717f61..d377893 100644 --- a/frontend/gamma/js/Clipperz/Style.js +++ b/frontend/gamma/js/Clipperz/Style.js | |||
@@ -1,94 +1,91 @@ | |||
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.Style) == 'undefined') { Clipperz.Style = {}; } | 27 | if (typeof(Clipperz.Style) == 'undefined') { Clipperz.Style = {}; } |
31 | 28 | ||
32 | Clipperz.Style.VERSION = "0.1"; | 29 | Clipperz.Style.VERSION = "0.1"; |
33 | Clipperz.Style.NAME = "Clipperz.DOM"; | 30 | Clipperz.Style.NAME = "Clipperz.DOM"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Style, { | 32 | MochiKit.Base.update(Clipperz.Style, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'applyZebraStylesToTable': function(aTable) { | 48 | 'applyZebraStylesToTable': function(aTable) { |
52 | var tbody; | 49 | var tbody; |
53 | var tbodyRows; | 50 | var tbodyRows; |
54 | var i,c; | 51 | var i,c; |
55 | 52 | ||
56 | tbody = MochiKit.DOM.getFirstElementByTagAndClassName('tbody', null, aTable); | 53 | tbody = MochiKit.DOM.getFirstElementByTagAndClassName('tbody', null, aTable); |
57 | tbodyRows = tbody.childNodes; | 54 | tbodyRows = tbody.childNodes; |
58 | // tbodyRows = MochiKit.DOM.getElementsByTagAndClassName('tr', null, tbody) | 55 | // tbodyRows = MochiKit.DOM.getElementsByTagAndClassName('tr', null, tbody) |
59 | c = tbodyRows.length; | 56 | c = tbodyRows.length; |
60 | for (i=0; i<c; i++) { | 57 | for (i=0; i<c; i++) { |
61 | var element; | 58 | var element; |
62 | 59 | ||
63 | element = YAHOO.Element.get(tbodyRows[i]); | 60 | element = YAHOO.Element.get(tbodyRows[i]); |
64 | element.addClass(((i%2 == 0) ? "zebra_odd": "zebra_even")); | 61 | element.addClass(((i%2 == 0) ? "zebra_odd": "zebra_even")); |
65 | element.removeClass(((i%2 == 1) ? "zebra_odd": "zebra_even")); | 62 | element.removeClass(((i%2 == 1) ? "zebra_odd": "zebra_even")); |
66 | } | 63 | } |
67 | }, | 64 | }, |
68 | 65 | ||
69 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
70 | 67 | ||
71 | 'getSizeAndPosition': function (anElement) { | 68 | 'getSizeAndPosition': function (anElement) { |
72 | var result; | 69 | var result; |
73 | 70 | ||
74 | if (anElement != null) { | 71 | if (anElement != null) { |
75 | result ={ dimensions:MochiKit.Style.getElementDimensions(anElement), position:MochiKit.Style.getElementPosition(anElement)}; | 72 | result ={ dimensions:MochiKit.Style.getElementDimensions(anElement), position:MochiKit.Style.getElementPosition(anElement)}; |
76 | } else { | 73 | } else { |
77 | result ={ dimensions:MochiKit.Style.getViewportDimensions(), position:MochiKit.Style.getViewportPosition()}; | 74 | result ={ dimensions:MochiKit.Style.getViewportDimensions(), position:MochiKit.Style.getViewportPosition()}; |
78 | } | 75 | } |
79 | 76 | ||
80 | return result; | 77 | return result; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | 'setBackgroundGradient': function (anElement, someParameters) { | 80 | 'setBackgroundGradient': function (anElement, someParameters) { |
84 | // background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff9955), to(#ff6622), color-stop(1,#333333)); | 81 | // background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff9955), to(#ff6622), color-stop(1,#333333)); |
85 | // background: -moz-linear-gradient(0% 100% 90deg,#ff6622, #ff9955); | 82 | // background: -moz-linear-gradient(0% 100% 90deg,#ff6622, #ff9955); |
86 | MochiKit.Style.setStyle(anElement, {'background': '-webkit-gradient(linear, 0% 0%, 0% 100%, from(' + someParameters['from'] + '), to(' + someParameters['to'] + '), color-stop(1,#333333))'}); | 83 | MochiKit.Style.setStyle(anElement, {'background': '-webkit-gradient(linear, 0% 0%, 0% 100%, from(' + someParameters['from'] + '), to(' + someParameters['to'] + '), color-stop(1,#333333))'}); |
87 | MochiKit.Style.setStyle(anElement, {'background': '-moz-linear-gradient(0% 100% 90deg,' + someParameters['to'] + ', ' + someParameters['from'] + ')'}); | 84 | MochiKit.Style.setStyle(anElement, {'background': '-moz-linear-gradient(0% 100% 90deg,' + someParameters['to'] + ', ' + someParameters['from'] + ')'}); |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
91 | __syntaxFix__: "syntax fix" | 88 | __syntaxFix__: "syntax fix" |
92 | 89 | ||
93 | }); | 90 | }); |
94 | 91 | ||
diff --git a/frontend/gamma/js/Clipperz/Visual.js b/frontend/gamma/js/Clipperz/Visual.js index b907d5c..c2da3b7 100644 --- a/frontend/gamma/js/Clipperz/Visual.js +++ b/frontend/gamma/js/Clipperz/Visual.js | |||
@@ -1,216 +1,213 @@ | |||
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.Visual) == 'undefined') { Clipperz.Visual = {}; } | 27 | if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } |
31 | 28 | ||
32 | Clipperz.Visual.VERSION = "0.1"; | 29 | Clipperz.Visual.VERSION = "0.1"; |
33 | Clipperz.Visual.NAME = "Clipperz.Visual"; | 30 | Clipperz.Visual.NAME = "Clipperz.Visual"; |
34 | 31 | ||
35 | MochiKit.Base.update(Clipperz.Visual, { | 32 | MochiKit.Base.update(Clipperz.Visual, { |
36 | 33 | ||
37 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
38 | 35 | ||
39 | '__repr__': function () { | 36 | '__repr__': function () { |
40 | return "[" + this.NAME + " " + this.VERSION + "]"; | 37 | return "[" + this.NAME + " " + this.VERSION + "]"; |
41 | }, | 38 | }, |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return this.__repr__(); | 43 | return this.__repr__(); |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'deferredResize': function (anElement, someOptions) { | 48 | 'deferredResize': function (anElement, someOptions) { |
52 | var deferredResult; | 49 | var deferredResult; |
53 | var moveTransition; | 50 | var moveTransition; |
54 | var scaleTransition; | 51 | var scaleTransition; |
55 | var duration; | 52 | var duration; |
56 | 53 | ||
57 | duration = someOptions.duration || 0.5; | 54 | duration = someOptions.duration || 0.5; |
58 | 55 | ||
59 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); | 56 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredResize", {trace:false}); |
60 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 57 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
61 | 58 | ||
62 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 59 | moveTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
63 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; | 60 | scaleTransition = MochiKit.Visual.Transitions.linear;//MochiKit.Visual.Transitions.sinoidal; |
64 | 61 | ||
65 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); | 62 | MochiKit.Style.setElementPosition(anElement, {x:someOptions.from.position.x, y:someOptions.from.position.y }, 'px'); |
66 | 63 | ||
67 | new MochiKit.Visual.Parallel([ | 64 | new MochiKit.Visual.Parallel([ |
68 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}), | 65 | new MochiKit.Visual.Move(anElement, {x:someOptions.to.position.x, y:someOptions.to.position.y, mode:'absolute', transition:moveTransition, sync:true}), |
69 | new Clipperz.Visual.Resize(anElement, {fromSize:{h:someOptions.from.dimensions.h, w:someOptions.from.dimensions.w}, toSize:{h:someOptions.to.dimensions.h, w:someOptions.to.dimensions.w}, transition:scaleTransition, scaleContent:false, scaleFromCenter:false, restoreAfterFinish:true, sync:true}) | 66 | new Clipperz.Visual.Resize(anElement, {fromSize:{h:someOptions.from.dimensions.h, w:someOptions.from.dimensions.w}, toSize:{h:someOptions.to.dimensions.h, w:someOptions.to.dimensions.w}, transition:scaleTransition, scaleContent:false, scaleFromCenter:false, restoreAfterFinish:true, sync:true}) |
70 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) | 67 | ], {duration:duration, afterFinish:MochiKit.Base.method(deferredResult, 'callback')}) |
71 | 68 | ||
72 | return deferredResult; | 69 | return deferredResult; |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { | 74 | 'deferredAnimation': function (anAnimation, someParameters, someOptions) { |
78 | vardeferredResult; | 75 | vardeferredResult; |
79 | var afterFinishCallback; | 76 | var afterFinishCallback; |
80 | var options; | 77 | var options; |
81 | 78 | ||
82 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); | 79 | deferredResult = new Clipperz.Async.Deferred("Clipperz.Visual.deferredAnimation", {trace:false}); |
83 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 80 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
84 | 81 | ||
85 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { | 82 | if (MochiKit.Base.isUndefinedOrNull(someOptions)) { |
86 | options = {} | 83 | options = {} |
87 | } else { | 84 | } else { |
88 | options = someOptions; | 85 | options = someOptions; |
89 | } | 86 | } |
90 | 87 | ||
91 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { | 88 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { |
92 | options['afterFinish'] = MochiKit.Base.noop; | 89 | options['afterFinish'] = MochiKit.Base.noop; |
93 | } | 90 | } |
94 | 91 | ||
95 | MochiKit.Base.update(options, { | 92 | MochiKit.Base.update(options, { |
96 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) | 93 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) |
97 | }); | 94 | }); |
98 | 95 | ||
99 | new anAnimation(someParameters, options); | 96 | new anAnimation(someParameters, options); |
100 | 97 | ||
101 | return deferredResult; | 98 | return deferredResult; |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //------------------------------------------------------------------------- | 101 | //------------------------------------------------------------------------- |
105 | 102 | ||
106 | 'deferredAnimations': function (aSinchronizationType, someAnimations, someOptions) { | 103 | 'deferredAnimations': function (aSinchronizationType, someAnimations, someOptions) { |
107 | var deferredResult; | 104 | var deferredResult; |
108 | varoptions; | 105 | varoptions; |
109 | 106 | ||
110 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredParallelAnimations", {trace:false}); | 107 | deferredResult = new Clipperz.Async.Deferred("Visual.deferredParallelAnimations", {trace:false}); |
111 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | 108 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); |
112 | 109 | ||
113 | options = someOptions; | 110 | options = someOptions; |
114 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { | 111 | if (MochiKit.Base.isUndefinedOrNull(someOptions['afterFinish'])) { |
115 | options['afterFinish'] = MochiKit.Base.noop; | 112 | options['afterFinish'] = MochiKit.Base.noop; |
116 | } | 113 | } |
117 | MochiKit.Base.update(options, { | 114 | MochiKit.Base.update(options, { |
118 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) | 115 | 'afterFinish': MochiKit.Base.compose(options['afterFinish'], MochiKit.Base.method(deferredResult, 'callback')) |
119 | }); | 116 | }); |
120 | 117 | ||
121 | new aSinchronizationType(someAnimations, options) | 118 | new aSinchronizationType(someAnimations, options) |
122 | 119 | ||
123 | return deferredResult; | 120 | return deferredResult; |
124 | }, | 121 | }, |
125 | 122 | ||
126 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
127 | __syntaxFix__: "syntax fix" | 124 | __syntaxFix__: "syntax fix" |
128 | 125 | ||
129 | }); | 126 | }); |
130 | 127 | ||
131 | //############################################################################# | 128 | //############################################################################# |
132 | 129 | ||
133 | /** @id Clipperz.Visual.Resize */ | 130 | /** @id Clipperz.Visual.Resize */ |
134 | Clipperz.Visual.Resize = function (element, percent, options) { | 131 | Clipperz.Visual.Resize = function (element, percent, options) { |
135 | var cls = arguments.callee; | 132 | var cls = arguments.callee; |
136 | if (!(this instanceof cls)) { | 133 | if (!(this instanceof cls)) { |
137 | return new cls(element, percent, options); | 134 | return new cls(element, percent, options); |
138 | } | 135 | } |
139 | this.__init__(element, percent, options); | 136 | this.__init__(element, percent, options); |
140 | }; | 137 | }; |
141 | 138 | ||
142 | Clipperz.Visual.Resize.prototype = new MochiKit.Visual.Base(); | 139 | Clipperz.Visual.Resize.prototype = new MochiKit.Visual.Base(); |
143 | 140 | ||
144 | MochiKit.Base.update(Clipperz.Visual.Resize.prototype, { | 141 | MochiKit.Base.update(Clipperz.Visual.Resize.prototype, { |
145 | __class__ : Clipperz.Visual.Resize, | 142 | __class__ : Clipperz.Visual.Resize, |
146 | 143 | ||
147 | __init__: function (element, options) { | 144 | __init__: function (element, options) { |
148 | this.element = MochiKit.DOM.getElement(element); | 145 | this.element = MochiKit.DOM.getElement(element); |
149 | options = MochiKit.Base.update({ | 146 | options = MochiKit.Base.update({ |
150 | scaleX: true, | 147 | scaleX: true, |
151 | scaleY: true, | 148 | scaleY: true, |
152 | scaleContent: true, | 149 | scaleContent: true, |
153 | scaleFromCenter: false, | 150 | scaleFromCenter: false, |
154 | scaleMode: 'box', // 'box' or 'contents' or {} with provided values | 151 | scaleMode: 'box', // 'box' or 'contents' or {} with provided values |
155 | syntax_fix: 'syntax fix' | 152 | syntax_fix: 'syntax fix' |
156 | }, options); | 153 | }, options); |
157 | 154 | ||
158 | this.start(options); | 155 | this.start(options); |
159 | }, | 156 | }, |
160 | 157 | ||
161 | setup: function () { | 158 | setup: function () { |
162 | this.restoreAfterFinish = this.options.restoreAfterFinish || false; | 159 | this.restoreAfterFinish = this.options.restoreAfterFinish || false; |
163 | this.elementPositioning = MochiKit.Style.getStyle(this.element, 'position'); | 160 | this.elementPositioning = MochiKit.Style.getStyle(this.element, 'position'); |
164 | 161 | ||
165 | var ma = MochiKit.Base.map; | 162 | var ma = MochiKit.Base.map; |
166 | var b = MochiKit.Base.bind; | 163 | var b = MochiKit.Base.bind; |
167 | this.originalStyle = {}; | 164 | this.originalStyle = {}; |
168 | ma(b(function (k) { this.originalStyle[k] = this.element.style[k]; }, this), ['top', 'left', 'width', 'height', 'fontSize']); | 165 | ma(b(function (k) { this.originalStyle[k] = this.element.style[k]; }, this), ['top', 'left', 'width', 'height', 'fontSize']); |
169 | 166 | ||
170 | this.originalTop = this.element.offsetTop; | 167 | this.originalTop = this.element.offsetTop; |
171 | this.originalLeft = this.element.offsetLeft; | 168 | this.originalLeft = this.element.offsetLeft; |
172 | 169 | ||
173 | var fontSize = MochiKit.Style.getStyle(this.element, 'font-size') || '100%'; | 170 | var fontSize = MochiKit.Style.getStyle(this.element, 'font-size') || '100%'; |
174 | ma(b(function (fontSizeType) { | 171 | ma(b(function (fontSizeType) { |
175 | if (fontSize.indexOf(fontSizeType) > 0) { | 172 | if (fontSize.indexOf(fontSizeType) > 0) { |
176 | this.fontSize = parseFloat(fontSize); | 173 | this.fontSize = parseFloat(fontSize); |
177 | this.fontSizeType = fontSizeType; | 174 | this.fontSizeType = fontSizeType; |
178 | } | 175 | } |
179 | }, this), ['em', 'px', '%']); | 176 | }, this), ['em', 'px', '%']); |
180 | 177 | ||
181 | this.factor = 1; | 178 | this.factor = 1; |
182 | 179 | ||
183 | this.dims = [this.options.fromSize.h, this.options.fromSize.w]; | 180 | this.dims = [this.options.fromSize.h, this.options.fromSize.w]; |
184 | }, | 181 | }, |
185 | 182 | ||
186 | update: function (position) { | 183 | update: function (position) { |
187 | this.setDimensions((this.options.toSize.h - this.options.fromSize.h) * position + this.options.fromSize.h, | 184 | this.setDimensions((this.options.toSize.h - this.options.fromSize.h) * position + this.options.fromSize.h, |
188 | (this.options.toSize.w - this.options.fromSize.w) * position + this.options.fromSize.w); | 185 | (this.options.toSize.w - this.options.fromSize.w) * position + this.options.fromSize.w); |
189 | }, | 186 | }, |
190 | 187 | ||
191 | finish: function () { | 188 | finish: function () { |
192 | if (this.restoreAfterFinish) { | 189 | if (this.restoreAfterFinish) { |
193 | MochiKit.Style.setStyle(this.element, this.originalStyle); | 190 | MochiKit.Style.setStyle(this.element, this.originalStyle); |
194 | } | 191 | } |
195 | }, | 192 | }, |
196 | 193 | ||
197 | setDimensions: function (height, width) { | 194 | setDimensions: function (height, width) { |
198 | var d = {}; | 195 | var d = {}; |
199 | var r = Math.round; | 196 | var r = Math.round; |
200 | if (/MSIE/.test(navigator.userAgent)) { | 197 | if (/MSIE/.test(navigator.userAgent)) { |
201 | r = Math.ceil; | 198 | r = Math.ceil; |
202 | } | 199 | } |
203 | if (this.options.scaleX) { | 200 | if (this.options.scaleX) { |
204 | d.width = r(width) + 'px'; | 201 | d.width = r(width) + 'px'; |
205 | } | 202 | } |
206 | if (this.options.scaleY) { | 203 | if (this.options.scaleY) { |
207 | d.height = r(height) + 'px'; | 204 | d.height = r(height) + 'px'; |
208 | } | 205 | } |
209 | if (this.options.scaleFromCenter) { | 206 | if (this.options.scaleFromCenter) { |
210 | var topd = (height - this.dims[0])/2; | 207 | var topd = (height - this.dims[0])/2; |
211 | var leftd = (width - this.dims[1])/2; | 208 | var leftd = (width - this.dims[1])/2; |
212 | if (this.elementPositioning == 'absolute') { | 209 | if (this.elementPositioning == 'absolute') { |
213 | if (this.options.scaleY) { | 210 | if (this.options.scaleY) { |
214 | d.top = this.originalTop - topd + 'px'; | 211 | d.top = this.originalTop - topd + 'px'; |
215 | } | 212 | } |
216 | if (this.options.scaleX) { | 213 | if (this.options.scaleX) { |
diff --git a/frontend/gamma/js/Clipperz/YUI/DomHelper.js b/frontend/gamma/js/Clipperz/YUI/DomHelper.js index dbd8c93..87c74f5 100644 --- a/frontend/gamma/js/Clipperz/YUI/DomHelper.js +++ b/frontend/gamma/js/Clipperz/YUI/DomHelper.js | |||
@@ -1,216 +1,213 @@ | |||
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.YUI) == 'undefined') { Clipperz.YUI = {}; } | 27 | if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } |
31 | 28 | ||
32 | 29 | ||
33 | /** | 30 | /** |
34 | * @class Clipperz.ext.DomHelper | 31 | * @class Clipperz.ext.DomHelper |
35 | * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM. | 32 | * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM. |
36 | * For more information see <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">this blog post with examples</a>. | 33 | * For more information see <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">this blog post with examples</a>. |
37 | * @singleton | 34 | * @singleton |
38 | */ | 35 | */ |
39 | Clipperz.YUI.DomHelper = new function(){ | 36 | Clipperz.YUI.DomHelper = new function(){ |
40 | /**@private*/ | 37 | /**@private*/ |
41 | var d = document; | 38 | var d = document; |
42 | var tempTableEl = null; | 39 | var tempTableEl = null; |
43 | /** True to force the use of DOM instead of html fragments @type Boolean */ | 40 | /** True to force the use of DOM instead of html fragments @type Boolean */ |
44 | this.useDom = false; | 41 | this.useDom = false; |
45 | var emptyTags = /^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i; | 42 | var emptyTags = /^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i; |
46 | /** | 43 | /** |
47 | * Applies a style specification to an element | 44 | * Applies a style specification to an element |
48 | * @param {String/HTMLElement} el The element to apply styles to | 45 | * @param {String/HTMLElement} el The element to apply styles to |
49 | * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or | 46 | * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or |
50 | * a function which returns such a specification. | 47 | * a function which returns such a specification. |
51 | */ | 48 | */ |
52 | this.applyStyles = function(el, styles){ | 49 | this.applyStyles = function(el, styles){ |
53 | if(styles){ | 50 | if(styles){ |
54 | var D = YAHOO.util.Dom; | 51 | var D = YAHOO.util.Dom; |
55 | if (typeof styles == "string"){ | 52 | if (typeof styles == "string"){ |
56 | var re = /\s?([a-z\-]*)\:([^;]*);?/gi; | 53 | var re = /\s?([a-z\-]*)\:([^;]*);?/gi; |
57 | var matches; | 54 | var matches; |
58 | while ((matches = re.exec(styles)) != null){ | 55 | while ((matches = re.exec(styles)) != null){ |
59 | D.setStyle(el, matches[1], matches[2]); | 56 | D.setStyle(el, matches[1], matches[2]); |
60 | } | 57 | } |
61 | }else if (typeof styles == "object"){ | 58 | }else if (typeof styles == "object"){ |
62 | for (var style in styles){ | 59 | for (var style in styles){ |
63 | D.setStyle(el, style, styles[style]); | 60 | D.setStyle(el, style, styles[style]); |
64 | } | 61 | } |
65 | }else if (typeof styles == "function"){ | 62 | }else if (typeof styles == "function"){ |
66 | Clipperz.YUI.DomHelper.applyStyles(el, styles.call()); | 63 | Clipperz.YUI.DomHelper.applyStyles(el, styles.call()); |
67 | } | 64 | } |
68 | } | 65 | } |
69 | }; | 66 | }; |
70 | 67 | ||
71 | // build as innerHTML where available | 68 | // build as innerHTML where available |
72 | /** @ignore */ | 69 | /** @ignore */ |
73 | var createHtml = function(o){ | 70 | var createHtml = function(o){ |
74 | var b = ''; | 71 | var b = ''; |
75 | 72 | ||
76 | if(typeof(o['html']) != 'undefined') { | 73 | if(typeof(o['html']) != 'undefined') { |
77 | o['html'] = Clipperz.Base.sanitizeString(o['html']); | 74 | o['html'] = Clipperz.Base.sanitizeString(o['html']); |
78 | } else if (typeof(o['htmlString']) != 'undefined') { | 75 | } else if (typeof(o['htmlString']) != 'undefined') { |
79 | o['html'] = o['htmlString']; | 76 | o['html'] = o['htmlString']; |
80 | delete o.htmlString; | 77 | delete o.htmlString; |
81 | } | 78 | } |
82 | 79 | ||
83 | if (MochiKit.Base.isArrayLike(o)) { | 80 | if (MochiKit.Base.isArrayLike(o)) { |
84 | for (var i = 0, l = o.length; i < l; i++) { | 81 | for (var i = 0, l = o.length; i < l; i++) { |
85 | b += createHtml(o[i]); | 82 | b += createHtml(o[i]); |
86 | } | 83 | } |
87 | return b; | 84 | return b; |
88 | } | 85 | } |
89 | 86 | ||
90 | b += '<' + o.tag; | 87 | b += '<' + o.tag; |
91 | for(var attr in o){ | 88 | for(var attr in o){ |
92 | if(attr == 'tag' || attr == 'children' || attr == 'html' || typeof o[attr] == 'function') continue; | 89 | if(attr == 'tag' || attr == 'children' || attr == 'html' || typeof o[attr] == 'function') continue; |
93 | if(attr == 'style'){ | 90 | if(attr == 'style'){ |
94 | var s = o['style']; | 91 | var s = o['style']; |
95 | if(typeof s == 'function'){ | 92 | if(typeof s == 'function'){ |
96 | s = s.call(); | 93 | s = s.call(); |
97 | } | 94 | } |
98 | if(typeof s == 'string'){ | 95 | if(typeof s == 'string'){ |
99 | b += ' style="' + s + '"'; | 96 | b += ' style="' + s + '"'; |
100 | }else if(typeof s == 'object'){ | 97 | }else if(typeof s == 'object'){ |
101 | b += ' style="'; | 98 | b += ' style="'; |
102 | for(var key in s){ | 99 | for(var key in s){ |
103 | if(typeof s[key] != 'function'){ | 100 | if(typeof s[key] != 'function'){ |
104 | b += key + ':' + s[key] + ';'; | 101 | b += key + ':' + s[key] + ';'; |
105 | } | 102 | } |
106 | } | 103 | } |
107 | b += '"'; | 104 | b += '"'; |
108 | } | 105 | } |
109 | }else{ | 106 | }else{ |
110 | if(attr == 'cls'){ | 107 | if(attr == 'cls'){ |
111 | b += ' class="' + o['cls'] + '"'; | 108 | b += ' class="' + o['cls'] + '"'; |
112 | }else if(attr == 'htmlFor'){ | 109 | }else if(attr == 'htmlFor'){ |
113 | b += ' for="' + o['htmlFor'] + '"'; | 110 | b += ' for="' + o['htmlFor'] + '"'; |
114 | }else{ | 111 | }else{ |
115 | b += ' ' + attr + '="' + o[attr] + '"'; | 112 | b += ' ' + attr + '="' + o[attr] + '"'; |
116 | } | 113 | } |
117 | } | 114 | } |
118 | } | 115 | } |
119 | if(emptyTags.test(o.tag)){ | 116 | if(emptyTags.test(o.tag)){ |
120 | b += ' />'; | 117 | b += ' />'; |
121 | }else{ | 118 | }else{ |
122 | b += '>'; | 119 | b += '>'; |
123 | if(o.children){ | 120 | if(o.children){ |
124 | for(var i = 0, len = o.children.length; i < len; i++) { | 121 | for(var i = 0, len = o.children.length; i < len; i++) { |
125 | b += createHtml(o.children[i], b); | 122 | b += createHtml(o.children[i], b); |
126 | } | 123 | } |
127 | } | 124 | } |
128 | if(o.html){ | 125 | if(o.html){ |
129 | b += o.html; | 126 | b += o.html; |
130 | } | 127 | } |
131 | b += '</' + o.tag + '>'; | 128 | b += '</' + o.tag + '>'; |
132 | } | 129 | } |
133 | return b; | 130 | return b; |
134 | } | 131 | } |
135 | 132 | ||
136 | // build as dom | 133 | // build as dom |
137 | /** @ignore */ | 134 | /** @ignore */ |
138 | var createDom = function(o, parentNode){ | 135 | var createDom = function(o, parentNode){ |
139 | var el = d.createElement(o.tag); | 136 | var el = d.createElement(o.tag); |
140 | var useSet = el.setAttribute ? true : false; // In IE some elements don't have setAttribute | 137 | var useSet = el.setAttribute ? true : false; // In IE some elements don't have setAttribute |
141 | for(var attr in o){ | 138 | for(var attr in o){ |
142 | if(attr == 'tag' || attr == 'children' || attr == 'html' || attr == 'style' || typeof o[attr] == 'function') continue; | 139 | if(attr == 'tag' || attr == 'children' || attr == 'html' || attr == 'style' || typeof o[attr] == 'function') continue; |
143 | if(attr=='cls'){ | 140 | if(attr=='cls'){ |
144 | el.className = o['cls']; | 141 | el.className = o['cls']; |
145 | }else{ | 142 | }else{ |
146 | if(useSet) el.setAttribute(attr, o[attr]); | 143 | if(useSet) el.setAttribute(attr, o[attr]); |
147 | else el[attr] = o[attr]; | 144 | else el[attr] = o[attr]; |
148 | } | 145 | } |
149 | } | 146 | } |
150 | Clipperz.YUI.DomHelper.applyStyles(el, o.style); | 147 | Clipperz.YUI.DomHelper.applyStyles(el, o.style); |
151 | if(o.children){ | 148 | if(o.children){ |
152 | for(var i = 0, len = o.children.length; i < len; i++) { | 149 | for(var i = 0, len = o.children.length; i < len; i++) { |
153 | createDom(o.children[i], el); | 150 | createDom(o.children[i], el); |
154 | } | 151 | } |
155 | } | 152 | } |
156 | if(o.html){ | 153 | if(o.html){ |
157 | el.innerHTML = o.html; | 154 | el.innerHTML = o.html; |
158 | } | 155 | } |
159 | if(parentNode){ | 156 | if(parentNode){ |
160 | parentNode.appendChild(el); | 157 | parentNode.appendChild(el); |
161 | } | 158 | } |
162 | return el; | 159 | return el; |
163 | }; | 160 | }; |
164 | 161 | ||
165 | /** | 162 | /** |
166 | * @ignore | 163 | * @ignore |
167 | * Nasty code for IE's broken table implementation | 164 | * Nasty code for IE's broken table implementation |
168 | */ | 165 | */ |
169 | var insertIntoTable = function(tag, where, el, html){ | 166 | var insertIntoTable = function(tag, where, el, html){ |
170 | if(!tempTableEl){ | 167 | if(!tempTableEl){ |
171 | tempTableEl = document.createElement('div'); | 168 | tempTableEl = document.createElement('div'); |
172 | } | 169 | } |
173 | var nodes; | 170 | var nodes; |
174 | if(tag == 'table' || tag == 'tbody'){ | 171 | if(tag == 'table' || tag == 'tbody'){ |
175 | tempTableEl.innerHTML = '<table><tbody>'+html+'</tbody></table>'; | 172 | tempTableEl.innerHTML = '<table><tbody>'+html+'</tbody></table>'; |
176 | nodes = tempTableEl.firstChild.firstChild.childNodes; | 173 | nodes = tempTableEl.firstChild.firstChild.childNodes; |
177 | }else{ | 174 | }else{ |
178 | tempTableEl.innerHTML = '<table><tbody><tr>'+html+'</tr></tbody></table>'; | 175 | tempTableEl.innerHTML = '<table><tbody><tr>'+html+'</tr></tbody></table>'; |
179 | nodes = tempTableEl.firstChild.firstChild.firstChild.childNodes; | 176 | nodes = tempTableEl.firstChild.firstChild.firstChild.childNodes; |
180 | } | 177 | } |
181 | if (where == 'beforebegin') { | 178 | if (where == 'beforebegin') { |
182 | nodes.reverse(); | 179 | nodes.reverse(); |
183 | // el.parentNode.insertBefore(node, el); | 180 | // el.parentNode.insertBefore(node, el); |
184 | MochiKit.Base.map(function(aNode) {el.parentNode.insertBefore(aNode, el)}, nodes); | 181 | MochiKit.Base.map(function(aNode) {el.parentNode.insertBefore(aNode, el)}, nodes); |
185 | } else if (where == 'afterbegin') { | 182 | } else if (where == 'afterbegin') { |
186 | nodes.reverse(); | 183 | nodes.reverse(); |
187 | // el.insertBefore(node, el.firstChild); | 184 | // el.insertBefore(node, el.firstChild); |
188 | MochiKit.Base.map(function(aNode) {el.insertBefore(aNode, el.firstChild)}, nodes); | 185 | MochiKit.Base.map(function(aNode) {el.insertBefore(aNode, el.firstChild)}, nodes); |
189 | } else if (where == 'beforeend') { | 186 | } else if (where == 'beforeend') { |
190 | // el.appendChild(node); | 187 | // el.appendChild(node); |
191 | MochiKit.Base.map(function(aNode) {el.appendChild(aNode)}, nodes); | 188 | MochiKit.Base.map(function(aNode) {el.appendChild(aNode)}, nodes); |
192 | } else if (where == 'afterend') { | 189 | } else if (where == 'afterend') { |
193 | // el.parentNode.insertBefore(node, el.nextSibling); | 190 | // el.parentNode.insertBefore(node, el.nextSibling); |
194 | MochiKit.Base.map(function(aNode) {el.parentNode.insertBefore(aNode, el.nextSibling)}, nodes); | 191 | MochiKit.Base.map(function(aNode) {el.parentNode.insertBefore(aNode, el.nextSibling)}, nodes); |
195 | } | 192 | } |
196 | 193 | ||
197 | return nodes; | 194 | return nodes; |
198 | } | 195 | } |
199 | 196 | ||
200 | /** | 197 | /** |
201 | * Inserts an HTML fragment into the Dom | 198 | * Inserts an HTML fragment into the Dom |
202 | * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd. | 199 | * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd. |
203 | * @param {HTMLElement} el The context element | 200 | * @param {HTMLElement} el The context element |
204 | * @param {String} html The HTML fragmenet | 201 | * @param {String} html The HTML fragmenet |
205 | * @return {HTMLElement} The new node | 202 | * @return {HTMLElement} The new node |
206 | */ | 203 | */ |
207 | this.insertHtml = function(where, el, html){ | 204 | this.insertHtml = function(where, el, html){ |
208 | where = where.toLowerCase(); | 205 | where = where.toLowerCase(); |
209 | // if(el.insertAdjacentHTML){ | 206 | // if(el.insertAdjacentHTML){ |
210 | if(Clipperz_IEisBroken){ | 207 | if(Clipperz_IEisBroken){ |
211 | var tag = el.tagName.toLowerCase(); | 208 | var tag = el.tagName.toLowerCase(); |
212 | if(tag == 'table' || tag == 'tbody' || tag == 'tr'){ | 209 | if(tag == 'table' || tag == 'tbody' || tag == 'tr'){ |
213 | return insertIntoTable(tag, where, el, html); | 210 | return insertIntoTable(tag, where, el, html); |
214 | } | 211 | } |
215 | switch(where){ | 212 | switch(where){ |
216 | case 'beforebegin': | 213 | case 'beforebegin': |
diff --git a/frontend/gamma/js/Clipperz/YUI/DomQuery.js b/frontend/gamma/js/Clipperz/YUI/DomQuery.js index 4a143ab..76d0fae 100644 --- a/frontend/gamma/js/Clipperz/YUI/DomQuery.js +++ b/frontend/gamma/js/Clipperz/YUI/DomQuery.js | |||
@@ -1,216 +1,213 @@ | |||
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.YUI) == 'undefined') { Clipperz.YUI = {}; } | 27 | if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } |
31 | 28 | ||
32 | 29 | ||
33 | /* | 30 | /* |
34 | * yui-ext 0.40 | 31 | * yui-ext 0.40 |
35 | * Copyright(c) 2006, Jack Slocum. | 32 | * Copyright(c) 2006, Jack Slocum. |
36 | */ | 33 | */ |
37 | 34 | ||
38 | /** | 35 | /** |
39 | * @class Clipperz.YUI.DomQuery | 36 | * @class Clipperz.YUI.DomQuery |
40 | * Provides high performance selector/xpath processing by compiling queries into reusable functions. | 37 | * Provides high performance selector/xpath processing by compiling queries into reusable functions. |
41 | * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in). | 38 | * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in). |
42 | * @singleton | 39 | * @singleton |
43 | */ | 40 | */ |
44 | Clipperz.YUI.DomQuery = function(){ | 41 | Clipperz.YUI.DomQuery = function(){ |
45 | var cache = {}, simpleCache = {}, valueCache = {}; | 42 | var cache = {}, simpleCache = {}, valueCache = {}; |
46 | var nonSpace = /\S/; | 43 | var nonSpace = /\S/; |
47 | var trimRe = /^\s*(.*?)\s*$/; | 44 | var trimRe = /^\s*(.*?)\s*$/; |
48 | var tplRe = /\{(\d+)\}/g; | 45 | var tplRe = /\{(\d+)\}/g; |
49 | var modeRe = /^(\s?[\/>]\s?|\s|$)/; | 46 | var modeRe = /^(\s?[\/>]\s?|\s|$)/; |
50 | var clsRes = {}; | 47 | var clsRes = {}; |
51 | 48 | ||
52 | function child(p, index){ | 49 | function child(p, index){ |
53 | var i = 0; | 50 | var i = 0; |
54 | var n = p.firstChild; | 51 | var n = p.firstChild; |
55 | while(n){ | 52 | while(n){ |
56 | if(n.nodeType == 1){ | 53 | if(n.nodeType == 1){ |
57 | i++; | 54 | i++; |
58 | if(i == index){ | 55 | if(i == index){ |
59 | return n; | 56 | return n; |
60 | } | 57 | } |
61 | } | 58 | } |
62 | n = n.nextSibling; | 59 | n = n.nextSibling; |
63 | } | 60 | } |
64 | return null; | 61 | return null; |
65 | }; | 62 | }; |
66 | 63 | ||
67 | function next(d){ | 64 | function next(d){ |
68 | var n = d.nextSibling; | 65 | var n = d.nextSibling; |
69 | while(n && n.nodeType != 1){ | 66 | while(n && n.nodeType != 1){ |
70 | n = n.nextSibling; | 67 | n = n.nextSibling; |
71 | } | 68 | } |
72 | return n; | 69 | return n; |
73 | }; | 70 | }; |
74 | 71 | ||
75 | function prev(d){ | 72 | function prev(d){ |
76 | var n = d.previousSibling; | 73 | var n = d.previousSibling; |
77 | while(n && n.nodeType != 1){ | 74 | while(n && n.nodeType != 1){ |
78 | n = n.previousSibling; | 75 | n = n.previousSibling; |
79 | } | 76 | } |
80 | return n; | 77 | return n; |
81 | }; | 78 | }; |
82 | 79 | ||
83 | function clean(d){ | 80 | function clean(d){ |
84 | var n = d.firstChild, ni = -1; | 81 | var n = d.firstChild, ni = -1; |
85 | while(n){ | 82 | while(n){ |
86 | var nx = n.nextSibling; | 83 | var nx = n.nextSibling; |
87 | if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ | 84 | if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ |
88 | d.removeChild(n); | 85 | d.removeChild(n); |
89 | }else{ | 86 | }else{ |
90 | n.nodeIndex = ++ni; | 87 | n.nodeIndex = ++ni; |
91 | } | 88 | } |
92 | n = nx; | 89 | n = nx; |
93 | } | 90 | } |
94 | return this; | 91 | return this; |
95 | }; | 92 | }; |
96 | 93 | ||
97 | function byClassName(c, a, v){ | 94 | function byClassName(c, a, v){ |
98 | if(!v){ | 95 | if(!v){ |
99 | return c; | 96 | return c; |
100 | } | 97 | } |
101 | var re = clsRes[v]; | 98 | var re = clsRes[v]; |
102 | if(!re){ | 99 | if(!re){ |
103 | re = new RegExp('(?:^|\\s)(?:' + v + ')(?:\\s|$)'); | 100 | re = new RegExp('(?:^|\\s)(?:' + v + ')(?:\\s|$)'); |
104 | clsRes[v] = re; | 101 | clsRes[v] = re; |
105 | } | 102 | } |
106 | var r = []; | 103 | var r = []; |
107 | for(var i = 0, ci; ci = c[i]; i++){ | 104 | for(var i = 0, ci; ci = c[i]; i++){ |
108 | if(re.test(ci.className)){ | 105 | if(re.test(ci.className)){ |
109 | r[r.length] = ci; | 106 | r[r.length] = ci; |
110 | } | 107 | } |
111 | } | 108 | } |
112 | return r; | 109 | return r; |
113 | }; | 110 | }; |
114 | 111 | ||
115 | function convert(c){ | 112 | function convert(c){ |
116 | if(c.slice){ | 113 | if(c.slice){ |
117 | return c; | 114 | return c; |
118 | } | 115 | } |
119 | var r = []; | 116 | var r = []; |
120 | for(var i = 0, l = c.length; i < l; i++){ | 117 | for(var i = 0, l = c.length; i < l; i++){ |
121 | r[r.length] = c[i]; | 118 | r[r.length] = c[i]; |
122 | } | 119 | } |
123 | return r; | 120 | return r; |
124 | }; | 121 | }; |
125 | 122 | ||
126 | function attrValue(n, attr){ | 123 | function attrValue(n, attr){ |
127 | if(!n.tagName && typeof n.length != 'undefined'){ | 124 | if(!n.tagName && typeof n.length != 'undefined'){ |
128 | n = n[0]; | 125 | n = n[0]; |
129 | } | 126 | } |
130 | if(!n){ | 127 | if(!n){ |
131 | return null; | 128 | return null; |
132 | } | 129 | } |
133 | if(attr == 'for'){ | 130 | if(attr == 'for'){ |
134 | return n.htmlFor; | 131 | return n.htmlFor; |
135 | } | 132 | } |
136 | if(attr == 'class' || attr == 'className'){ | 133 | if(attr == 'class' || attr == 'className'){ |
137 | return n.className; | 134 | return n.className; |
138 | } | 135 | } |
139 | return n.getAttribute(attr) || n[attr]; | 136 | return n.getAttribute(attr) || n[attr]; |
140 | 137 | ||
141 | }; | 138 | }; |
142 | 139 | ||
143 | function getNodes(ns, mode, tagName){ | 140 | function getNodes(ns, mode, tagName){ |
144 | var result = [], cs; | 141 | var result = [], cs; |
145 | if(!ns){ | 142 | if(!ns){ |
146 | return result; | 143 | return result; |
147 | } | 144 | } |
148 | mode = mode ? mode.replace(trimRe, '$1') : ''; | 145 | mode = mode ? mode.replace(trimRe, '$1') : ''; |
149 | tagName = tagName || '*'; | 146 | tagName = tagName || '*'; |
150 | if(ns.tagName || ns == document){ | 147 | if(ns.tagName || ns == document){ |
151 | ns = [ns]; | 148 | ns = [ns]; |
152 | } | 149 | } |
153 | if(mode != '/' && mode != '>'){ | 150 | if(mode != '/' && mode != '>'){ |
154 | for(var i = 0, ni; ni = ns[i]; i++){ | 151 | for(var i = 0, ni; ni = ns[i]; i++){ |
155 | cs = ni.getElementsByTagName(tagName); | 152 | cs = ni.getElementsByTagName(tagName); |
156 | result = concat(result, cs); | 153 | result = concat(result, cs); |
157 | } | 154 | } |
158 | }else{ | 155 | }else{ |
159 | for(var i = 0, ni; ni = ns[i]; i++){ | 156 | for(var i = 0, ni; ni = ns[i]; i++){ |
160 | var cn = ni.getElementsByTagName(tagName); | 157 | var cn = ni.getElementsByTagName(tagName); |
161 | for(var j = 0, cj; cj = cn[j]; j++){ | 158 | for(var j = 0, cj; cj = cn[j]; j++){ |
162 | if(cj.parentNode == ni){ | 159 | if(cj.parentNode == ni){ |
163 | result[result.length] = cj; | 160 | result[result.length] = cj; |
164 | } | 161 | } |
165 | } | 162 | } |
166 | } | 163 | } |
167 | 164 | ||
168 | } | 165 | } |
169 | return result; | 166 | return result; |
170 | }; | 167 | }; |
171 | 168 | ||
172 | function concat(a, b){ | 169 | function concat(a, b){ |
173 | if(b.slice){ | 170 | if(b.slice){ |
174 | return a.concat(b); | 171 | return a.concat(b); |
175 | } | 172 | } |
176 | for(var i = 0, l = b.length; i < l; i++){ | 173 | for(var i = 0, l = b.length; i < l; i++){ |
177 | a[a.length] = b[i]; | 174 | a[a.length] = b[i]; |
178 | } | 175 | } |
179 | return a; | 176 | return a; |
180 | } | 177 | } |
181 | 178 | ||
182 | function byTag(cs, tagName){ | 179 | function byTag(cs, tagName){ |
183 | if(cs.tagName || cs == document){ | 180 | if(cs.tagName || cs == document){ |
184 | cs = [cs]; | 181 | cs = [cs]; |
185 | } | 182 | } |
186 | if(!tagName){ | 183 | if(!tagName){ |
187 | return cs; | 184 | return cs; |
188 | } | 185 | } |
189 | var r = []; tagName = tagName.toLowerCase(); | 186 | var r = []; tagName = tagName.toLowerCase(); |
190 | for(var i = 0, ci; ci = cs[i]; i++){ | 187 | for(var i = 0, ci; ci = cs[i]; i++){ |
191 | if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){ | 188 | if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){ |
192 | r[r.length] = ci; | 189 | r[r.length] = ci; |
193 | } | 190 | } |
194 | } | 191 | } |
195 | return r; | 192 | return r; |
196 | }; | 193 | }; |
197 | 194 | ||
198 | function byId(cs, attr, id){ | 195 | function byId(cs, attr, id){ |
199 | if(cs.tagName || cs == document){ | 196 | if(cs.tagName || cs == document){ |
200 | cs = [cs]; | 197 | cs = [cs]; |
201 | } | 198 | } |
202 | if(!id){ | 199 | if(!id){ |
203 | return cs; | 200 | return cs; |
204 | } | 201 | } |
205 | var r = []; | 202 | var r = []; |
206 | for(var i = 0, l = cs.length; i < l; i++){ | 203 | for(var i = 0, l = cs.length; i < l; i++){ |
207 | var ci = cs[i]; | 204 | var ci = cs[i]; |
208 | if(ci && ci.id == id){ | 205 | if(ci && ci.id == id){ |
209 | r[r.length] = ci; | 206 | r[r.length] = ci; |
210 | } | 207 | } |
211 | } | 208 | } |
212 | return r; | 209 | return r; |
213 | }; | 210 | }; |
214 | 211 | ||
215 | function byAttribute(cs, attr, value, op, custom){ | 212 | function byAttribute(cs, attr, value, op, custom){ |
216 | var r = [], st = custom=='{'; | 213 | var r = [], st = custom=='{'; |
diff --git a/frontend/gamma/js/Clipperz/YUI/Utils.js b/frontend/gamma/js/Clipperz/YUI/Utils.js index 4d4a5f9..e9929fc 100644 --- a/frontend/gamma/js/Clipperz/YUI/Utils.js +++ b/frontend/gamma/js/Clipperz/YUI/Utils.js | |||
@@ -1,98 +1,95 @@ | |||
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 YAHOO == 'undefined') { YAHOO = {}; }; | 26 | if (typeof YAHOO == 'undefined') { YAHOO = {}; }; |
30 | if (typeof YAHOO.util == 'undefined') { YAHOO.util = {}; }; | 27 | if (typeof YAHOO.util == 'undefined') { YAHOO.util = {}; }; |
31 | if (typeof YAHOO.util.Dom == 'undefined') { YAHOO.util.Dom = {}; }; | 28 | if (typeof YAHOO.util.Dom == 'undefined') { YAHOO.util.Dom = {}; }; |
32 | 29 | ||
33 | YAHOO.extend = function(subc, superc, overrides) { | 30 | YAHOO.extend = function(subc, superc, overrides) { |
34 | var F = function() {}; | 31 | var F = function() {}; |
35 | F.prototype=superc.prototype; | 32 | F.prototype=superc.prototype; |
36 | subc.prototype=new F(); | 33 | subc.prototype=new F(); |
37 | subc.prototype.constructor=subc; | 34 | subc.prototype.constructor=subc; |
38 | subc.superclass=superc.prototype; | 35 | subc.superclass=superc.prototype; |
39 | if (superc.prototype.constructor == Object.prototype.constructor) { | 36 | if (superc.prototype.constructor == Object.prototype.constructor) { |
40 | superc.prototype.constructor=superc; | 37 | superc.prototype.constructor=superc; |
41 | } | 38 | } |
42 | 39 | ||
43 | if (overrides) { | 40 | if (overrides) { |
44 | for (var i in overrides) { | 41 | for (var i in overrides) { |
45 | subc.prototype[i]=overrides[i]; | 42 | subc.prototype[i]=overrides[i]; |
46 | } | 43 | } |
47 | } | 44 | } |
48 | }; | 45 | }; |
49 | 46 | ||
50 | YAHOO.override = function(origclass, overrides){ | 47 | YAHOO.override = function(origclass, overrides){ |
51 | if(overrides){ | 48 | if(overrides){ |
52 | var p = origclass.prototype; | 49 | var p = origclass.prototype; |
53 | for(var method in overrides){ | 50 | for(var method in overrides){ |
54 | p[method] = overrides[method]; | 51 | p[method] = overrides[method]; |
55 | } | 52 | } |
56 | } | 53 | } |
57 | }; | 54 | }; |
58 | 55 | ||
59 | YAHOO.extendX = function(subclass, superclass, overrides){ | 56 | YAHOO.extendX = function(subclass, superclass, overrides){ |
60 | YAHOO.extend(subclass, superclass); | 57 | YAHOO.extend(subclass, superclass); |
61 | subclass.override = function(o){ | 58 | subclass.override = function(o){ |
62 | YAHOO.override(subclass, o); | 59 | YAHOO.override(subclass, o); |
63 | }; | 60 | }; |
64 | if(!subclass.prototype.override){ | 61 | if(!subclass.prototype.override){ |
65 | subclass.prototype.override = function(o){ | 62 | subclass.prototype.override = function(o){ |
66 | for(var method in o){ | 63 | for(var method in o){ |
67 | this[method] = o[method]; | 64 | this[method] = o[method]; |
68 | } | 65 | } |
69 | }; | 66 | }; |
70 | } | 67 | } |
71 | if(overrides){ | 68 | if(overrides){ |
72 | subclass.override(overrides); | 69 | subclass.override(overrides); |
73 | }; | 70 | }; |
74 | 71 | ||
75 | }; | 72 | }; |
76 | 73 | ||
77 | YAHOO.util.Dom.get = function(el) { | 74 | YAHOO.util.Dom.get = function(el) { |
78 | if (!el) { return null; } // nothing to work with | 75 | if (!el) { return null; } // nothing to work with |
79 | 76 | ||
80 | if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is | 77 | if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is |
81 | return el; | 78 | return el; |
82 | } | 79 | } |
83 | 80 | ||
84 | if (typeof el == 'string') { // ID | 81 | if (typeof el == 'string') { // ID |
85 | return document.getElementById(el); | 82 | return document.getElementById(el); |
86 | } | 83 | } |
87 | else { // array of ID's and/or elements | 84 | else { // array of ID's and/or elements |
88 | var collection = []; | 85 | var collection = []; |
89 | for (var i = 0, len = el.length; i < len; ++i) { | 86 | for (var i = 0, len = el.length; i < len; ++i) { |
90 | collection[collection.length] = YAHOO.util.Dom.get(el[i]); | 87 | collection[collection.length] = YAHOO.util.Dom.get(el[i]); |
91 | } | 88 | } |
92 | 89 | ||
93 | return collection; | 90 | return collection; |
94 | } | 91 | } |
95 | 92 | ||
96 | return null; // safety, should never happen | 93 | return null; // safety, should never happen |
97 | }; | 94 | }; |
98 | 95 | ||