summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz
authorClipperz <info@clipperz.com>2013-01-31 13:42:04 (UTC)
committer Clipperz <info@clipperz.com>2013-01-31 13:42:04 (UTC)
commit07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff)
treef7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz
parent767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff)
downloadclipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip
clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz
clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2
Updated Copyright claims
- updated reference dates; - removed reference to Community Edition; - normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Async.js50
-rw-r--r--frontend/gamma/js/Clipperz/Base.js41
-rw-r--r--frontend/gamma/js/Clipperz/ByteArray.js71
-rw-r--r--frontend/gamma/js/Clipperz/CSVProcessor.js78
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/AES.js29
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/Base.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/BigInt.js23
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js83
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js26
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js24
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js31
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/PRNG.js33
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/RSA.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/SHA.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/SRP.js36
-rw-r--r--frontend/gamma/js/Clipperz/DOM.js24
-rw-r--r--frontend/gamma/js/Clipperz/Date.js25
-rw-r--r--frontend/gamma/js/Clipperz/KeePassExportProcessor.js22
-rw-r--r--frontend/gamma/js/Clipperz/KeyValueObjectStore.js27
-rw-r--r--frontend/gamma/js/Clipperz/Logging.js41
-rw-r--r--frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Connection.js33
-rw-r--r--frontend/gamma/js/Clipperz/PM/Crypto.js48
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js34
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js30
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js66
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js25
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.js44
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js39
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/Date.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/PIN.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy.js30
-rwxr-xr-xfrontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js48
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings.js27
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Toll.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js35
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js30
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js29
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js29
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js54
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js27
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js25
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js28
-rw-r--r--frontend/gamma/js/Clipperz/Set.js22
-rw-r--r--frontend/gamma/js/Clipperz/Signal.js22
-rw-r--r--frontend/gamma/js/Clipperz/Style.js22
-rw-r--r--frontend/gamma/js/Clipperz/Visual.js22
-rw-r--r--frontend/gamma/js/Clipperz/YUI/DomHelper.js29
-rw-r--r--frontend/gamma/js/Clipperz/YUI/DomQuery.js22
-rw-r--r--frontend/gamma/js/Clipperz/YUI/Utils.js22
138 files changed, 1512 insertions, 2169 deletions
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js
index f7a9517..d525453 100644
--- a/frontend/gamma/js/Clipperz/Async.js
+++ b/frontend/gamma/js/Clipperz/Async.js
@@ -1,150 +1,141 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//Clipperz.Async = MochiKit.Async; 24//Clipperz.Async = MochiKit.Async;
27 25
28 26
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 27if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; } 28if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; }
31 29
32Clipperz.Async.VERSION = "0.1"; 30Clipperz.Async.VERSION = "0.1";
33Clipperz.Async.NAME = "Clipperz.Async"; 31Clipperz.Async.NAME = "Clipperz.Async";
34 32
35Clipperz.Async.Deferred = function(aName, args) { 33Clipperz.Async.Deferred = function(aName, args) {
36 args = args || {}; 34 args = args || {};
37 35
38 Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller); 36 Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller);
39 37
40 this._args = args; 38 this._args = args;
41 this._name = aName || "Anonymous deferred"; 39 this._name = aName || "Anonymous deferred";
42 this._count = 0; 40 this._count = 0;
43 this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true)); 41 this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true));
44 this._vars = null; 42 this._vars = null;
45 43
46 return this; 44 return this;
47} 45}
48 46
49//============================================================================= 47//=============================================================================
50 48
51Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, { 49Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
52 50
53 'name': function () { 51 'name': function () {
54 return this._name; 52 return this._name;
55 }, 53 },
56 54
57 'args': function () { 55 'args': function () {
58 return this._args; 56 return this._args;
59 }, 57 },
60 58
61 //----------------------------------------------------------------------------- 59 //-----------------------------------------------------------------------------
62 60
63 'callback': function (aValue) { 61 'callback': function (aValue) {
64 if (this._shouldTrace) { 62 if (this._shouldTrace) {
65 //Clipperz.log("CALLBACK " + this._name, aValue); 63 Clipperz.log("CALLBACK " + this._name, aValue);
66 console.log("CALLBACK " + this._name, aValue);
67 } 64 }
68 65
69 if (this.chained == false) { 66 if (this.chained == false) {
70 var message; 67 var message;
71 68
72 message = "ERROR [" + this._name + "]"; 69 message = "ERROR [" + this._name + "]";
73 this.addErrback(function(aResult) { 70 this.addErrback(function(aResult) {
74 if (! (aResult instanceof MochiKit.Async.CancelledError)) { 71 if (! (aResult instanceof MochiKit.Async.CancelledError)) {
75 Clipperz.log(message, aResult); 72 Clipperz.log(message, aResult);
76 } 73 }
77 return aResult; 74 return aResult;
78 }); 75 });
79 76
80 if (this._shouldTrace) { 77 if (this._shouldTrace) {
81 var resultMessage; 78 var resultMessage;
82 79
83 resultMessage = "RESULT " + this._name + " <=="; 80 resultMessage = "RESULT " + this._name + " <==";
84 // this.addCallback(function(aResult) { 81 // this.addCallback(function(aResult) {
85 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) { 82 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
86 //Clipperz.log(resultMessage, aResult); 83 Clipperz.log(resultMessage, aResult);
87 console.log(resultMessage, aResult);
88
89 return aResult; 84 return aResult;
90 }); 85 });
91 } 86 }
92 } 87 }
93 88
94 if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) { 89 if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) {
95 Clipperz.log("callback " + this._name, this); 90 Clipperz.log("callback " + this._name, this);
96 } 91 }
97 92
98 return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments); 93 return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments);
99 }, 94 },
100 95
101 //----------------------------------------------------------------------------- 96 //-----------------------------------------------------------------------------
102 97
103 'addCallback': function () { 98 'addCallback': function () {
104 var message; 99 var message;
105 100
106 if (this._shouldTrace) { 101 if (this._shouldTrace) {
107 this._count ++; 102 this._count ++;
108 message = "[" + this._count + "] " + this._name + " "; 103 message = "[" + this._count + "] " + this._name + " ";
109 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;}); 104 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
110 this.addCallbacks( 105 this.addCallbacks(
111 //function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, 106 function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
112 function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, 107 function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
113 //function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
114 function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
115 ); 108 );
116 } 109 }
117 110
118 Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments); 111 Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments);
119 112
120 if (this._shouldTrace) { 113 if (this._shouldTrace) {
121 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;}); 114 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
122 this.addCallbacks( 115 this.addCallbacks(
123 //function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;}, 116 function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
124 function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;}, 117 function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
125 //function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
126 function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
127 ); 118 );
128 } 119 }
129 }, 120 },
130 121
131 //============================================================================= 122 //=============================================================================
132 123
133 'addCallbackPass': function() { 124 'addCallbackPass': function() {
134 var passFunction; 125 var passFunction;
135 126
136 passFunction = MochiKit.Base.partial.apply(null, arguments); 127 passFunction = MochiKit.Base.partial.apply(null, arguments);
137 128
138 this.addCallback(function() { 129 this.addCallback(function() {
139 var result; 130 var result;
140 131
141 result = arguments[arguments.length -1]; 132 result = arguments[arguments.length -1];
142 passFunction(); 133 passFunction();
143 134
144 return result; 135 return result;
145 }); 136 });
146 }, 137 },
147 138
148 //----------------------------------------------------------------------------- 139 //-----------------------------------------------------------------------------
149 140
150 'addErrbackPass': function() { 141 'addErrbackPass': function() {
@@ -191,74 +182,73 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
191 deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue); 182 deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue);
192 } 183 }
193 184
194 return deferredResult; 185 return deferredResult;
195 })) 186 }))
196 }, 187 },
197 188
198 //----------------------------------------------------------------------------- 189 //-----------------------------------------------------------------------------
199 190
200 'addMethod': function () { 191 'addMethod': function () {
201 this.addCallback(MochiKit.Base.method.apply(this, arguments)); 192 this.addCallback(MochiKit.Base.method.apply(this, arguments));
202 }, 193 },
203 194
204 //----------------------------------------------------------------------------- 195 //-----------------------------------------------------------------------------
205 196
206 'addMethodcaller': function () { 197 'addMethodcaller': function () {
207 this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments)); 198 this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments));
208 }, 199 },
209 200
210 //============================================================================= 201 //=============================================================================
211 202
212 'addLog': function (aLog) { 203 'addLog': function (aLog) {
213 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { 204 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) {
214 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);}); 205 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);});
215 // this.addBothPass(function(res) {console.log(aLog + " ", res);});
216 } 206 }
217 }, 207 },
218 208
219 //============================================================================= 209 //=============================================================================
220 210
221 'acquireLock': function (aLock) { 211 'acquireLock': function (aLock) {
222 // this.addCallback(function (aResult) { 212 // this.addCallback(function (aResult) {
223 // return Clipperz.Async.callbacks("Clipperz.Async.acquireLock", [ 213 // return Clipperz.Async.callbacks("Clipperz.Async.acquireLock", [
224 // MochiKit.Base.method(aLock, 'acquire'), 214 // MochiKit.Base.method(aLock, 'acquire'),
225 // MochiKit.Base.partial(MochiKit.Async.succeed, aResult) 215 // MochiKit.Base.partial(MochiKit.Async.succeed, aResult)
226 // ], {trace:false}); 216 // ], {trace:false});
227 // }); 217 // });
228 218
229 this.addCallback(MochiKit.Base.method(aLock, 'acquire')); 219 this.addCallback(MochiKit.Base.method(aLock, 'acquire'));
230 }, 220 },
231 221
232 'releaseLock': function (aLock) { 222 'releaseLock': function (aLock) {
233 // this.addCallback(function (aResult) { 223 // this.addCallback(function (aResult) {
234 // return Clipperz.Async.callbacks("Clipperz.Async.release <ok>", [ 224 // return Clipperz.Async.callbacks("Clipperz.Async.release <ok>", [
235 // MochiKit.Base.method(aLock, 'release'), 225 // MochiKit.Base.method(aLock, 'release'),
236 // MochiKit.Base.partial(MochiKit.Async.succeed, aResult) 226 // MochiKit.Base.partial(MochiKit.Async.succeed, aResult)
237 // ], {trace:false}); 227 // ], {trace:false});
238 // }); 228 // });
239 // this.addErrback(function (aResult) { 229 // this.addErrback(function (aResult) {
240///console.log("releaseLock.addErrback:", aResult); 230///Clipperz.log("releaseLock.addErrback:", aResult);
241 // return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [ 231 // return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [
242 // MochiKit.Base.method(aLock, 'release'), 232 // MochiKit.Base.method(aLock, 'release'),
243 // MochiKit.Base.partial(MochiKit.Async.fail, aResult) 233 // MochiKit.Base.partial(MochiKit.Async.fail, aResult)
244 // ], {trace:false}); 234 // ], {trace:false});
245 // }); 235 // });
246 236
247 // this.addBothPass(MochiKit.Base.method(aLock, 'release')); 237 // this.addBothPass(MochiKit.Base.method(aLock, 'release'));
248 this.addCallbackPass(MochiKit.Base.method(aLock, 'release')); 238 this.addCallbackPass(MochiKit.Base.method(aLock, 'release'));
249 this.addErrback(function (anError) { 239 this.addErrback(function (anError) {
250 aLock.release(); 240 aLock.release();
251 241
252 return anError; 242 return anError;
253 }); 243 });
254 }, 244 },
255 245
256 //============================================================================= 246 //=============================================================================
257 247
258 'collectResults': function (someRequests) { 248 'collectResults': function (someRequests) {
259 this.addCallback(Clipperz.Async.collectResults(this._name + " <collect results>", someRequests, this._args)); 249 this.addCallback(Clipperz.Async.collectResults(this._name + " <collect results>", someRequests, this._args));
260 }, 250 },
261 251
262 'addCallbackList': function (aRequestList) { 252 'addCallbackList': function (aRequestList) {
263 this.addCallback(Clipperz.Async.callbacks, this._name + " <callback list>", aRequestList, this._args); 253 this.addCallback(Clipperz.Async.callbacks, this._name + " <callback list>", aRequestList, this._args);
264 }, 254 },
@@ -356,49 +346,49 @@ MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
356 346
357 'numberOfMethodsDone':function() { 347 'numberOfMethodsDone':function() {
358 return this._numberOfMethodsDone; 348 return this._numberOfMethodsDone;
359 }, 349 },
360 350
361 'incrementNumberOfMethodsDone': function() { 351 'incrementNumberOfMethodsDone': function() {
362 this._numberOfMethodsDone ++; 352 this._numberOfMethodsDone ++;
363 }, 353 },
364 354
365 //----------------------------------------------------------------------------- 355 //-----------------------------------------------------------------------------
366 356
367 'run': function(args, aValue) { 357 'run': function(args, aValue) {
368 var deferredResults; 358 var deferredResults;
369 var i, c; 359 var i, c;
370 360
371 deferredResults = []; 361 deferredResults = [];
372 args = args || {}; 362 args = args || {};
373 363
374 c = this.methods().length; 364 c = this.methods().length;
375 for (i=0; i<c; i++) { 365 for (i=0; i<c; i++) {
376 var deferredResult; 366 var deferredResult;
377 varmethodCalls; 367 varmethodCalls;
378 var ii, cc; 368 var ii, cc;
379 369
380//console.log("TYPEOF", typeof(this.methods()[i])); 370//Clipperz.log("TYPEOF", typeof(this.methods()[i]));
381 if (typeof(this.methods()[i]) == 'function') { 371 if (typeof(this.methods()[i]) == 'function') {
382 methodCalls = [ this.methods()[i] ]; 372 methodCalls = [ this.methods()[i] ];
383 } else { 373 } else {
384 methodCalls = this.methods()[i]; 374 methodCalls = this.methods()[i];
385 } 375 }
386 376
387 cc = methodCalls.length; 377 cc = methodCalls.length;
388 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.DeferredSynchronizer.run => " + this.name() + "[" + i + "]", args); 378 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.DeferredSynchronizer.run => " + this.name() + "[" + i + "]", args);
389 for (ii=0; ii<cc; ii++) { 379 for (ii=0; ii<cc; ii++) {
390 deferredResult.addCallback(methodCalls[ii]); 380 deferredResult.addCallback(methodCalls[ii]);
391 } 381 }
392 deferredResult.addBoth(MochiKit.Base.method(this, 'handleMethodCallDone', i)); 382 deferredResult.addBoth(MochiKit.Base.method(this, 'handleMethodCallDone', i));
393 383
394 deferredResults.push(deferredResult); 384 deferredResults.push(deferredResult);
395 } 385 }
396 386
397 for (i=0; i<c; i++) { 387 for (i=0; i<c; i++) {
398 deferredResults[i].callback(aValue); 388 deferredResults[i].callback(aValue);
399 } 389 }
400 390
401 return this.result(); 391 return this.result();
402 }, 392 },
403 393
404 //----------------------------------------------------------------------------- 394 //-----------------------------------------------------------------------------
@@ -616,49 +606,49 @@ MochiKit.Base.update(Clipperz.Async, {
616 }, aDeferredComparator, anObject, aSortedResult[i], i); 606 }, aDeferredComparator, anObject, aSortedResult[i], i);
617 } 607 }
618 deferredResult.addMethod(aSortedResult, 'push', anObject); 608 deferredResult.addMethod(aSortedResult, 'push', anObject);
619 deferredResult.addErrback(function (anError) { 609 deferredResult.addErrback(function (anError) {
620 aSortedResult.splice(anError.message, 0, anObject); 610 aSortedResult.splice(anError.message, 0, anObject);
621 }) 611 })
622 deferredResult.addBoth(MochiKit.Async.succeed, aSortedResult); 612 deferredResult.addBoth(MochiKit.Async.succeed, aSortedResult);
623 deferredResult.callback(); 613 deferredResult.callback();
624 } 614 }
625 615
626 return deferredResult; 616 return deferredResult;
627 }, 617 },
628 618
629 //------------------------------------------------------------------------- 619 //-------------------------------------------------------------------------
630 620
631 'deferredSort': function (aDeferredComparator, someObjects) { 621 'deferredSort': function (aDeferredComparator, someObjects) {
632 var deferredResult; 622 var deferredResult;
633 var i, c; 623 var i, c;
634 624
635 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredSort", {trace:false}); 625 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredSort", {trace:false});
636 c = someObjects.length; 626 c = someObjects.length;
637 for (i=0; i<c; i++) { 627 for (i=0; i<c; i++) {
638 deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator); 628 deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator);
639 if ((i % 50) == 0) { 629 if ((i % 50) == 0) {
640 //console.log("######### sort wait ##########"); 630 //Clipperz.log("######### sort wait ##########");
641 deferredResult.addCallback(MochiKit.Async.wait, 0.5); 631 deferredResult.addCallback(MochiKit.Async.wait, 0.5);
642 } 632 }
643 } 633 }
644 deferredResult.callback([]); 634 deferredResult.callback([]);
645 635
646 return deferredResult; 636 return deferredResult;
647 }, 637 },
648 638
649 //========================================================================= 639 //=========================================================================
650 640
651 'deferredFilter': function (aFunction, someObjects) { 641 'deferredFilter': function (aFunction, someObjects) {
652 vardeferredResult; 642 vardeferredResult;
653 vari, c; 643 vari, c;
654 644
655 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredFilter", {trace:false}); 645 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredFilter", {trace:false});
656 c = someObjects.length; 646 c = someObjects.length;
657 for (i=0; i<c; i++) { 647 for (i=0; i<c; i++) {
658 deferredResult.addCallback(function (aFunction, anObject, anIndex, aResult) { 648 deferredResult.addCallback(function (aFunction, anObject, anIndex, aResult) {
659 var innerDeferredResult; 649 var innerDeferredResult;
660 650
661 innerDeferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredFilter <inner - " + anIndex + ">", {trace:false}); 651 innerDeferredResult = new Clipperz.Async.Deferred("Clipperz.Async.deferredFilter <inner - " + anIndex + ">", {trace:false});
662 innerDeferredResult.addCallback(aFunction, anObject); 652 innerDeferredResult.addCallback(aFunction, anObject);
663 innerDeferredResult.addCallback(function (aFilterResult) { 653 innerDeferredResult.addCallback(function (aFilterResult) {
664 if (aFilterResult) { 654 if (aFilterResult) {
@@ -667,45 +657,45 @@ MochiKit.Base.update(Clipperz.Async, {
667 }); 657 });
668 innerDeferredResult.addBoth(MochiKit.Async.succeed, aResult); 658 innerDeferredResult.addBoth(MochiKit.Async.succeed, aResult);
669 innerDeferredResult.callback(); 659 innerDeferredResult.callback();
670 660
671 return innerDeferredResult; 661 return innerDeferredResult;
672 }, aFunction, someObjects[i], i); 662 }, aFunction, someObjects[i], i);
673 } 663 }
674 deferredResult.callback([]); 664 deferredResult.callback([]);
675 665
676 return deferredResult; 666 return deferredResult;
677 }, 667 },
678 668
679 'forEach': function (aFunction) { 669 'forEach': function (aFunction) {
680 return MochiKit.Base.partial(function (aFunction, anIterable) { 670 return MochiKit.Base.partial(function (aFunction, anIterable) {
681 MochiKit.Iter.forEach(anIterable, aFunction); 671 MochiKit.Iter.forEach(anIterable, aFunction);
682 }, aFunction); 672 }, aFunction);
683 }, 673 },
684 674
685 //========================================================================= 675 //=========================================================================
686 676
687 'or': function (someValues) { 677 'or': function (someValues) {
688 return Clipperz.Async.callbacks("Clipperz.Async.or", [ 678 return Clipperz.Async.callbacks("Clipperz.Async.or", [
689 MochiKit.Base.values, 679 MochiKit.Base.values,
690 MochiKit.Base.flattenArguments, 680 MochiKit.Base.flattenArguments,
691//function (aValue) { console.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; }, 681//function (aValue) { Clipperz.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
692 function(someInnerValues) { 682 function(someInnerValues) {
693 return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity); 683 return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity);
694 } 684 }
695 ], {trace:false}, someValues); 685 ], {trace:false}, someValues);
696 }, 686 },
697 687
698 //========================================================================= 688 //=========================================================================
699 689
700 'clearResult': function () {}, 690 'clearResult': function () {},
701 691
702 //========================================================================= 692 //=========================================================================
703 __syntaxFix__: "syntax fix" 693 __syntaxFix__: "syntax fix"
704}); 694});
705 695
706 696
707//############################################################################# 697//#############################################################################
708 698
709CLIPPERZ_DEFERRED_LOGGING_ENABLED = true; 699CLIPPERZ_DEFERRED_LOGGING_ENABLED = true;
710CLIPPERZ_DEFERRED_TRACING_ENABLED = false; 700CLIPPERZ_DEFERRED_TRACING_ENABLED = false;
711CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED = false; 701CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED = false;
diff --git a/frontend/gamma/js/Clipperz/Base.js b/frontend/gamma/js/Clipperz/Base.js
index 9d399d9..84b2172 100644
--- a/frontend/gamma/js/Clipperz/Base.js
+++ b/frontend/gamma/js/Clipperz/Base.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Base) == 'undefined') { Clipperz.Base = {}; } 25if (typeof(Clipperz.Base) == 'undefined') { Clipperz.Base = {}; }
28 26
29Clipperz.Base.VERSION = "0.2"; 27Clipperz.Base.VERSION = "0.2";
30Clipperz.Base.NAME = "Clipperz.Base"; 28Clipperz.Base.NAME = "Clipperz.Base";
31 29
32MochiKit.Base.update(Clipperz.Base, { 30MochiKit.Base.update(Clipperz.Base, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
@@ -420,114 +418,97 @@ MochiKit.Base.update(Clipperz.Base, {
420 418
421 'sanitizeString': function(aValue) { 419 'sanitizeString': function(aValue) {
422 var result; 420 var result;
423 421
424 if (Clipperz.Base.objectType(aValue) == 'string') { 422 if (Clipperz.Base.objectType(aValue) == 'string') {
425 result = aValue; 423 result = aValue;
426 result = result.replace(/</img,"&lt;"); 424 result = result.replace(/</img,"&lt;");
427 result = result.replace(/>/img,"&gt;"); 425 result = result.replace(/>/img,"&gt;");
428 } else { 426 } else {
429 result = aValue; 427 result = aValue;
430 } 428 }
431 429
432 return result; 430 return result;
433 }, 431 },
434 432
435 //------------------------------------------------------------------------- 433 //-------------------------------------------------------------------------
436 434
437 'module': function(aValue) { 435 'module': function(aValue) {
438 // aValue = 'Clipperz.PM.Compact' 436 // aValue = 'Clipperz.PM.Compact'
439// 437//
440 // if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 438 // if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
441 // if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 439 // if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
442 // if (typeof(Clipperz.PM.UI.Common.Components) == 'undefined') { Clipperz.PM.UI.Common.Components = {}; } 440 // if (typeof(Clipperz.PM.UI.Common.Components) == 'undefined') { Clipperz.PM.UI.Common.Components = {}; }
443 441
444//console.log(">>> module: " + aValue);
445 var currentScope; 442 var currentScope;
446 var pathElements; 443 var pathElements;
447 var i,c; 444 var i,c;
448 445
449 currentScope = window; 446 currentScope = window;
450 pathElements = aValue.split('.'); 447 pathElements = aValue.split('.');
451 c = pathElements.length; 448 c = pathElements.length;
452 for (i=0; i<c; i++) { 449 for (i=0; i<c; i++) {
453//console.log("--- current path element: " + pathElements[i]);
454//console.log("--- current scope", currentScope);
455 if (typeof(currentScope[pathElements[i]]) == 'undefined') { 450 if (typeof(currentScope[pathElements[i]]) == 'undefined') {
456 currentScope[pathElements[i]] = {}; 451 currentScope[pathElements[i]] = {};
457 } 452 }
458 453
459 currentScope = currentScope[pathElements[i]]; 454 currentScope = currentScope[pathElements[i]];
460 } 455 }
461 }, 456 },
462 457
463 //------------------------------------------------------------------------- 458 //-------------------------------------------------------------------------
464 459
465 'exception': { 460 'exception': {
466 'AbstractMethod': new MochiKit.Base.NamedError("Clipperz.Base.exception.AbstractMethod"), 461 'AbstractMethod': new MochiKit.Base.NamedError("Clipperz.Base.exception.AbstractMethod"),
467 'UnknownType': new MochiKit.Base.NamedError("Clipperz.Base.exception.UnknownType"), 462 'UnknownType': new MochiKit.Base.NamedError("Clipperz.Base.exception.UnknownType"),
468 'VulnerabilityIssue':new MochiKit.Base.NamedError("Clipperz.Base.exception.VulnerabilityIssue"), 463 'VulnerabilityIssue':new MochiKit.Base.NamedError("Clipperz.Base.exception.VulnerabilityIssue"),
469 'MandatoryParameter':new MochiKit.Base.NamedError("Clipperz.Base.exception.MandatoryParameter"), 464 'MandatoryParameter':new MochiKit.Base.NamedError("Clipperz.Base.exception.MandatoryParameter"),
470 'ObjectNotFound': new MochiKit.Base.NamedError("Clipperz.Base.exception.ObjectNotFound"), 465 'ObjectNotFound': new MochiKit.Base.NamedError("Clipperz.Base.exception.ObjectNotFound"),
471 'raise': function (aName) { 466 'raise': function (aName) {
472 throw Clipperz.Base.exception[aName]; 467 throw Clipperz.Base.exception[aName];
473 } 468 }
474 }, 469 },
475 470
476 //------------------------------------------------------------------------- 471 //-------------------------------------------------------------------------
477 472
478 'extend': YAHOO.extendX, 473 'extend': YAHOO.extendX,
479 474
480 //------------------------------------------------------------------------- 475 //-------------------------------------------------------------------------
481 __syntaxFix__: "syntax fix" 476 __syntaxFix__: "syntax fix"
482 477
483}); 478});
484 479
485 //Original regExp courtesy of John Gruber: http://daringfireball.net/2009/11/liberal_regex_for_matching_urls 480 //Original regExp courtesy of John Gruber: http://daringfireball.net/2009/11/liberal_regex_for_matching_urls
486 //Updated to match Clipperz usage pattern. 481 //Updated to match Clipperz usage pattern.
487//MochiKit.Base.urlRegExp = new RegExp(/\b(([\w-]+:\/\/?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/); 482//MochiKit.Base.urlRegExp = new RegExp(/\b(([\w-]+:\/\/?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/);
488MochiKit.Base.urlRegExp = new RegExp(/^((([\w-]+:\/\/?)|(www\.))[^\s()<>]+((?:\([\w\d]+\)|([^[:punct:]\s]|\/)))?)/); 483MochiKit.Base.urlRegExp = new RegExp(/^((([\w-]+:\/\/?)|(www\.))[^\s()<>]+((?:\([\w\d]+\)|([^[:punct:]\s]|\/)))?)/);
489 484
490 //RegExp found here: http://www.tipsntracks.com/117/validate-an-email-address-using-regular-expressions.html 485 //RegExp found here: http://www.tipsntracks.com/117/validate-an-email-address-using-regular-expressions.html
491MochiKit.Base.emailRegExp = new RegExp(/^([a-zA-Z0-9_\-\.]+)@(([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))|(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|25[0-5]|2[0-4]\d))$/); 486MochiKit.Base.emailRegExp = new RegExp(/^([a-zA-Z0-9_\-\.]+)@(([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))|(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|25[0-5]|2[0-4]\d))$/);
492 487
493 488
494MochiKit.Base.registerComparator('Object dummy comparator', 489MochiKit.Base.registerComparator('Object dummy comparator',
495 function(a, b) { 490 function(a, b) {
496 return ((a.constructor == Object) && (b.constructor == Object)); 491 return ((a.constructor == Object) && (b.constructor == Object));
497 }, 492 },
498 function(a, b) { 493 function(a, b) {
499 var result; 494 var result;
500 var aKeys; 495 var aKeys;
501 var bKeys; 496 var bKeys;
502 497
503//MochiKit.Logging.logDebug(">>> comparator");
504//MochiKit.Logging.logDebug("- a: " + Clipperz.Base.serializeJSON(a));
505//MochiKit.Logging.logDebug("- b: " + Clipperz.Base.serializeJSON(a));
506 aKeys = MochiKit.Base.keys(a).sort(); 498 aKeys = MochiKit.Base.keys(a).sort();
507 bKeys = MochiKit.Base.keys(b).sort(); 499 bKeys = MochiKit.Base.keys(b).sort();
508
509 result = MochiKit.Base.compare(aKeys, bKeys); 500 result = MochiKit.Base.compare(aKeys, bKeys);
510//if (result != 0) { 501
511 //MochiKit.Logging.logDebug("- comparator 'keys':");
512 //MochiKit.Logging.logDebug("- comparator aKeys: " + Clipperz.Base.serializeJSON(aKeys));
513 //MochiKit.Logging.logDebug("- comparator bKeys: " + Clipperz.Base.serializeJSON(bKeys));
514//}
515 if (result == 0) { 502 if (result == 0) {
516 vari, c; 503 vari, c;
517 504
518 c = aKeys.length; 505 c = aKeys.length;
519 for (i=0; (i<c) && (result == 0); i++) { 506 for (i=0; (i<c) && (result == 0); i++) {
520 result = MochiKit.Base.compare(a[aKeys[i]], b[bKeys[i]]); 507 result = MochiKit.Base.compare(a[aKeys[i]], b[bKeys[i]]);
521//if (result != 0) {
522 //MochiKit.Logging.logDebug("- comparator 'values':");
523 //MochiKit.Logging.logDebug("- comparator a[aKeys[i]]: " + Clipperz.Base.serializeJSON(a[aKeys[i]]));
524 //MochiKit.Logging.logDebug("- comparator b[bKeys[i]]: " + Clipperz.Base.serializeJSON(b[bKeys[i]]));
525//}
526 } 508 }
527 } 509 }
528 510
529//MochiKit.Logging.logDebug("<<< comparator - result: " + result);
530 return result; 511 return result;
531 }, 512 },
532 true 513 true
533); 514);
diff --git a/frontend/gamma/js/Clipperz/ByteArray.js b/frontend/gamma/js/Clipperz/ByteArray.js
index ae586e7..22c7c6e 100644
--- a/frontend/gamma/js/Clipperz/ByteArray.js
+++ b/frontend/gamma/js/Clipperz/ByteArray.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27 25
28//============================================================================= 26//=============================================================================
29 27
30Clipperz.ByteArray_abstract = function(args) { 28Clipperz.ByteArray_abstract = function(args) {
31 return this; 29 return this;
32} 30}
33 31
34Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, { 32Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
35 33
36 //------------------------------------------------------------------------- 34 //-------------------------------------------------------------------------
37 35
38 'toString': function() { 36 'toString': function() {
39 return "Clipperz.ByteArray_abstract"; 37 return "Clipperz.ByteArray_abstract";
40 }, 38 },
41 39
42 //------------------------------------------------------------------------- 40 //-------------------------------------------------------------------------
43 41
44 'equals': function(aValue) { 42 'equals': function(aValue) {
45 return (this.compare(aValue) == 0); 43 return (this.compare(aValue) == 0);
46 }, 44 },
@@ -68,53 +66,50 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
68 throw Clipperz.Base.exception.AbstractMethod; 66 throw Clipperz.Base.exception.AbstractMethod;
69 }, 67 },
70 68
71 //------------------------------------------------------------------------- 69 //-------------------------------------------------------------------------
72 70
73 'newInstance': function() { 71 'newInstance': function() {
74 throw Clipperz.Base.exception.AbstractMethod; 72 throw Clipperz.Base.exception.AbstractMethod;
75 }, 73 },
76 74
77 //------------------------------------------------------------------------- 75 //-------------------------------------------------------------------------
78 76
79 'reset': function() { 77 'reset': function() {
80 throw Clipperz.Base.exception.AbstractMethod; 78 throw Clipperz.Base.exception.AbstractMethod;
81 }, 79 },
82 80
83 //------------------------------------------------------------------------- 81 //-------------------------------------------------------------------------
84 82
85 'length': function() { 83 'length': function() {
86 throw Clipperz.Base.exception.AbstractMethod; 84 throw Clipperz.Base.exception.AbstractMethod;
87 }, 85 },
88 86
89 //------------------------------------------------------------------------- 87 //-------------------------------------------------------------------------
90 88
91 'checkByteValue': function(aValue) { 89 'checkByteValue': function(aValue) {
92//Clipperz.log("aValue", aValue.toString(16));
93//Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16));
94
95 if ((aValue & 0xff) != aValue) { 90 if ((aValue & 0xff) != aValue) {
96 MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value."); 91 Clipperz.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
97 throw Clipperz.ByteArray.exception.InvalidValue; 92 throw Clipperz.ByteArray.exception.InvalidValue;
98 } 93 }
99 }, 94 },
100 95
101 //------------------------------------------------------------------------- 96 //-------------------------------------------------------------------------
102 97
103 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) { 98 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) {
104 var result; 99 var result;
105 var a, b; 100 var a, b;
106 var aLength; 101 var aLength;
107 var bLength; 102 var bLength;
108 var i, c; 103 var i, c;
109 104
110 if (this.length() > aBlock.length()) { 105 if (this.length() > aBlock.length()) {
111 a = this; 106 a = this;
112 b = aBlock; 107 b = aBlock;
113 } else { 108 } else {
114 a = aBlock; 109 a = aBlock;
115 b = this; 110 b = this;
116 } 111 }
117 112
118 aLength = a.length(); 113 aLength = a.length();
119 bLength = b.length(); 114 bLength = b.length();
120 115
@@ -123,70 +118,58 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
123 if (anAllignment == 'left') { 118 if (anAllignment == 'left') {
124 a = a.split(0, bLength); 119 a = a.split(0, bLength);
125 } else { 120 } else {
126 a = a.split(aLength - bLength); 121 a = a.split(aLength - bLength);
127 } 122 }
128 } else { 123 } else {
129 var ii, cc; 124 var ii, cc;
130 var padding; 125 var padding;
131 126
132 // padding = new Clipperz.ByteArray(); 127 // padding = new Clipperz.ByteArray();
133 padding = this.newInstance(); 128 padding = this.newInstance();
134 cc = aLength - bLength; 129 cc = aLength - bLength;
135 for (ii=0; ii<cc; ii++) { 130 for (ii=0; ii<cc; ii++) {
136 padding.appendByte(0); 131 padding.appendByte(0);
137 } 132 }
138 133
139 if (anAllignment == 'left') { 134 if (anAllignment == 'left') {
140 b = b.appendBlock(padding); 135 b = b.appendBlock(padding);
141 } else { 136 } else {
142 b = padding.appendBlock(b); 137 b = padding.appendBlock(b);
143 } 138 }
144 } 139 }
145 } 140 }
146 141
147
148 // result = new Clipperz.ByteArray();
149 result = this.newInstance(); 142 result = this.newInstance();
150 c = a.length(); 143 c = a.length();
151 for (i=0; i<c; i++) { 144 for (i=0; i<c; i++) {
152 result.appendByte(a.byteAtIndex(i) ^ b.byteAtIndex(i)); 145 result.appendByte(a.byteAtIndex(i) ^ b.byteAtIndex(i));
153 } 146 }
154 147
155 return result; 148 return result;
156 }, 149 },
157 150
158 //------------------------------------------------------------------------- 151 //-------------------------------------------------------------------------
159/*
160 'shiftLeft': function(aNumberOfBitsToShift) {
161 var result;
162
163 result = this.clone(); //???????????
164
165 return result;
166 },
167 */
168 //-------------------------------------------------------------------------
169 152
170 'appendBlock': function(aBlock) { 153 'appendBlock': function(aBlock) {
171 throw Clipperz.Base.exception.AbstractMethod; 154 throw Clipperz.Base.exception.AbstractMethod;
172 }, 155 },
173 156
174 //------------------------------------------------------------------------- 157 //-------------------------------------------------------------------------
175 158
176 'appendByte': function(aValue) { 159 'appendByte': function(aValue) {
177 throw Clipperz.Base.exception.AbstractMethod; 160 throw Clipperz.Base.exception.AbstractMethod;
178 }, 161 },
179 162
180 'appendBytes': function(args) { 163 'appendBytes': function(args) {
181 varvalues; 164 varvalues;
182 vari,c; 165 vari,c;
183 166
184 if (args.constructor == Array) { 167 if (args.constructor == Array) {
185 values = args; 168 values = args;
186 } else { 169 } else {
187 values = arguments; 170 values = arguments;
188 } 171 }
189 172
190 c = values.length; 173 c = values.length;
191 for (i=0; i<c; i++) { 174 for (i=0; i<c; i++) {
192 this.appendByte(values[i]); 175 this.appendByte(values[i]);
@@ -271,180 +254,158 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
271 254
272 'setByteAtIndex': function(aValue, anIndex) { 255 'setByteAtIndex': function(aValue, anIndex) {
273 throw Clipperz.Base.exception.AbstractMethod; 256 throw Clipperz.Base.exception.AbstractMethod;
274 }, 257 },
275 258
276 //------------------------------------------------------------------------- 259 //-------------------------------------------------------------------------
277 260
278 'bitAtIndex': function(aBitPosition) { 261 'bitAtIndex': function(aBitPosition) {
279 var result; 262 var result;
280 varbytePosition; 263 varbytePosition;
281 var bitPositionInSelectedByte; 264 var bitPositionInSelectedByte;
282 var selectedByte; 265 var selectedByte;
283 var selectedByteMask; 266 var selectedByteMask;
284 267
285 bytePosition = this.length() - Math.ceil((aBitPosition + 1)/ 8); 268 bytePosition = this.length() - Math.ceil((aBitPosition + 1)/ 8);
286 bitPositionInSelectedByte = aBitPosition % 8; 269 bitPositionInSelectedByte = aBitPosition % 8;
287 selectedByte = this.byteAtIndex(bytePosition); 270 selectedByte = this.byteAtIndex(bytePosition);
288 271
289 if (bitPositionInSelectedByte > 0) { 272 if (bitPositionInSelectedByte > 0) {
290 selectedByteMask = (1 << bitPositionInSelectedByte); 273 selectedByteMask = (1 << bitPositionInSelectedByte);
291 } else { 274 } else {
292 selectedByteMask = 1; 275 selectedByteMask = 1;
293 } 276 }
294 result = selectedByte & selectedByteMask ? 1 : 0; 277 result = selectedByte & selectedByteMask ? 1 : 0;
295//console.log("aBitPosition: " + aBitPosition + ", length: " + this.length() + ", bytePosition: " + bytePosition + ", bitPositionInSelectedByte: " + bitPositionInSelectedByte + ", selectedByteMask: " + selectedByteMask);
296 278
297 return result; 279 return result;
298 }, 280 },
299 281
300 //------------------------------------------------------------------------- 282 //-------------------------------------------------------------------------
301 283
302 'bitBlockAtIndexWithSize': function(aBitPosition, aSize) { 284 'bitBlockAtIndexWithSize': function(aBitPosition, aSize) {
303 var result; 285 var result;
304 var bitValue; 286 var bitValue;
305 var i,c; 287 var i,c;
306 288
307 result = 0; 289 result = 0;
308 c = aSize; 290 c = aSize;
309 for (i=0; i<c; i++) { 291 for (i=0; i<c; i++) {
310 bitValue = this.bitAtIndex(aBitPosition + i); 292 bitValue = this.bitAtIndex(aBitPosition + i);
311 result = result | bitValue << i; 293 result = result | bitValue << i;
312 } 294 }
313 295
314 return result; 296 return result;
315 }, 297 },
316 298
317 //------------------------------------------------------------------------- 299 //-------------------------------------------------------------------------
318 300
319 'asString': function() { 301 'asString': function() {
320 varresult; 302 varresult;
321 varlength; 303 varlength;
322 vari; 304 vari;
323 305
324//var startTime = new Date();
325
326 //# result = "";
327 result = []; 306 result = [];
328 307
329 i = 0; 308 i = 0;
330 length = this.length(); 309 length = this.length();
331 310
332 while (i < length) { 311 while (i < length) {
333 varcurrentCharacter; 312 varcurrentCharacter;
334 varcurrentByte; 313 varcurrentByte;
335 varunicode; 314 varunicode;
336 315
337 currentByte = this.byteAtIndex(i); 316 currentByte = this.byteAtIndex(i);
338 317
339 if ((currentByte & 0x80) == 0x00 ) { //0xxxxxxx 318 if ((currentByte & 0x80) == 0x00 ) { //0xxxxxxx
340 unicode = currentByte; 319 unicode = currentByte;
341 currentCharacter = String.fromCharCode(unicode); 320 currentCharacter = String.fromCharCode(unicode);
342 } else if ((currentByte & 0xe0) == 0xc0 ) { //110xxxxx 10xxxxxx 321 } else if ((currentByte & 0xe0) == 0xc0 ) { //110xxxxx 10xxxxxx
343 unicode = (currentByte & 0x1f) << 6; 322 unicode = (currentByte & 0x1f) << 6;
344 i++; currentByte = this.byteAtIndex(i); 323 i++; currentByte = this.byteAtIndex(i);
345 unicode = unicode | (currentByte & 0x3f); 324 unicode = unicode | (currentByte & 0x3f);
346 325
347 currentCharacter = String.fromCharCode(unicode); 326 currentCharacter = String.fromCharCode(unicode);
348 } else if ((currentByte & 0xf0) == 0xe0 ) { //1110xxxx 10xxxxxx 10xxxxxx 327 } else if ((currentByte & 0xf0) == 0xe0 ) { //1110xxxx 10xxxxxx 10xxxxxx
349 unicode = (currentByte & 0x0f) << (6+6); 328 unicode = (currentByte & 0x0f) << (6+6);
350 i++; currentByte = this.byteAtIndex(i); 329 i++; currentByte = this.byteAtIndex(i);
351 unicode = unicode | ((currentByte & 0x3f) << 6); 330 unicode = unicode | ((currentByte & 0x3f) << 6);
352 i++; currentByte = this.byteAtIndex(i); 331 i++; currentByte = this.byteAtIndex(i);
353 unicode = unicode | (currentByte & 0x3f); 332 unicode = unicode | (currentByte & 0x3f);
354 333
355 currentCharacter = String.fromCharCode(unicode); 334 currentCharacter = String.fromCharCode(unicode);
356 } else { //11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 335 } else { //11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
357 unicode = (currentByte & 0x07) << (6+6+6); 336 unicode = (currentByte & 0x07) << (6+6+6);
358 i++; currentByte = this.byteAtIndex(i); 337 i++; currentByte = this.byteAtIndex(i);
359 unicode = unicode | ((currentByte & 0x3f) << (6+6)); 338 unicode = unicode | ((currentByte & 0x3f) << (6+6));
360 i++; currentByte = this.byteAtIndex(i); 339 i++; currentByte = this.byteAtIndex(i);
361 unicode = unicode | ((currentByte & 0x3f) << 6); 340 unicode = unicode | ((currentByte & 0x3f) << 6);
362 i++; currentByte = this.byteAtIndex(i); 341 i++; currentByte = this.byteAtIndex(i);
363 unicode = unicode | (currentByte & 0x3f); 342 unicode = unicode | (currentByte & 0x3f);
364 343
365 currentCharacter = String.fromCharCode(unicode); 344 currentCharacter = String.fromCharCode(unicode);
366 } 345 }
367 346
368 // result += currentCharacter;
369 result.push(currentCharacter); 347 result.push(currentCharacter);
370 i++; 348 i++;
371 } 349 }
372 350
373//MochiKit.Logging.logDebug("[" + (new Date() - startTime) + "] ByteArray.asString");
374
375 // return result;
376 return result.join(""); 351 return result.join("");
377 }, 352 },
378 353
379 //------------------------------------------------------------------------- 354 //-------------------------------------------------------------------------
380 355
381 'toHexString': function() { 356 'toHexString': function() {
382 throw Clipperz.Base.exception.AbstractMethod; 357 throw Clipperz.Base.exception.AbstractMethod;
383 }, 358 },
384 359
385 //------------------------------------------------------------------------- 360 //-------------------------------------------------------------------------
386 361
387 'base64map': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", 362 'base64map': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
388 'base64mapIndex': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(''), 363 'base64mapIndex': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(''),
389 //'base64mapInvertedIndex': {
390 // 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9,
391 // 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19,
392 // 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25, 'a': 26, 'b': 27, 'c': 28, 'd': 29,
393 // 'e': 30, 'f': 31, 'g': 32, 'h': 33, 'i': 34, 'j': 35, 'k': 36, 'l': 37, 'm': 38, 'n': 39,
394 // 'o': 40, 'p': 41, 'q': 42, 'r': 43, 's': 44, 't': 45, 'u': 46, 'v': 47, 'w': 48, 'x': 49,
395 // 'y': 50, 'z': 51, '0': 52, '1': 53, '2': 54, '3': 55, '4': 56, '5': 57, '6': 58, '7': 59,
396 // '8': 60, '9': 61, '+': 62, '/': 63,
397 // "=": -1},
398 364
399 //------------------------------------------------------------------------- 365 //-------------------------------------------------------------------------
400 366
401 'appendBase64String': function(aValue) { 367 'appendBase64String': function(aValue) {
402 var i; 368 var i;
403 var length; 369 var length;
404 370
405 length = aValue.length; 371 length = aValue.length;
406 372
407 if ((length % 4) != 0) { 373 if ((length % 4) != 0) {
408 MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase64Value' is not correct"); 374 Clipperz.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
409 throw Clipperz.ByteArray.exception.InvalidValue; 375 throw Clipperz.ByteArray.exception.InvalidValue;
410 } 376 }
411 377
412 i = 0; 378 i = 0;
413 while (i<length) { 379 while (i<length) {
414 var value1, value2, value3, value4; 380 var value1, value2, value3, value4;
415 var byte1, byte2, byte3; 381 var byte1, byte2, byte3;
416 382
417 value1 = this.base64map.indexOf(aValue.charAt(i)); 383 value1 = this.base64map.indexOf(aValue.charAt(i));
418 value2 = this.base64map.indexOf(aValue.charAt(i+1)); 384 value2 = this.base64map.indexOf(aValue.charAt(i+1));
419 value3 = this.base64map.indexOf(aValue.charAt(i+2)); 385 value3 = this.base64map.indexOf(aValue.charAt(i+2));
420 value4 = this.base64map.indexOf(aValue.charAt(i+3)); 386 value4 = this.base64map.indexOf(aValue.charAt(i+3));
421 387
422 // value1 = this.base64mapInvertedIndex[aValue.charAt(i)];
423 // value2 = this.base64mapInvertedIndex[aValue.charAt(i+1)];
424 // value3 = this.base64mapInvertedIndex[aValue.charAt(i+2)];
425 // value4 = this.base64mapInvertedIndex[aValue.charAt(i+3)];
426
427 byte1 = (value1 << 2) | ((value2 & 0x30) >> 4); 388 byte1 = (value1 << 2) | ((value2 & 0x30) >> 4);
428 if (value3 != -1) { 389 if (value3 != -1) {
429 byte2 = ((value2 & 0x0f) << 4) | ((value3 & 0x3c) >> 2); 390 byte2 = ((value2 & 0x0f) << 4) | ((value3 & 0x3c) >> 2);
430 391
431 if (value4 != -1) { 392 if (value4 != -1) {
432 byte3 = ((value3 & 0x03) << 6) | (value4); 393 byte3 = ((value3 & 0x03) << 6) | (value4);
433 } else { 394 } else {
434 byte3 = null; 395 byte3 = null;
435 } 396 }
436 } else { 397 } else {
437 byte2 = null; 398 byte2 = null;
438 byte3 = null; 399 byte3 = null;
439 } 400 }
440 401
441 this.appendByte(byte1); 402 this.appendByte(byte1);
442 this.appendByte(byte2); 403 this.appendByte(byte2);
443 this.appendByte(byte3); 404 this.appendByte(byte3);
444 405
445 i += 4; 406 i += 4;
446 } 407 }
447 408
448 return this; 409 return this;
449 }, 410 },
450 411
@@ -499,49 +460,49 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
499 }, 460 },
500 461
501 //------------------------------------------------------------------------- 462 //-------------------------------------------------------------------------
502 463
503 'base32map': "0123456789abcdefghjkmnpqrstvwxyz", 464 'base32map': "0123456789abcdefghjkmnpqrstvwxyz",
504 'base32mapIndex': "0123456789abcdefghjkmnpqrstvwxyz".split(''), 465 'base32mapIndex': "0123456789abcdefghjkmnpqrstvwxyz".split(''),
505 466
506 //------------------------------------------------------------------------- 467 //-------------------------------------------------------------------------
507 468
508 'appendBase32String': function(aValue) { 469 'appendBase32String': function(aValue) {
509 var value; 470 var value;
510 var i; 471 var i;
511 var length; 472 var length;
512 var value1, value2, value3, value4, value5, value6, value7, value8; 473 var value1, value2, value3, value4, value5, value6, value7, value8;
513 var byte1, byte2, byte3, byte4, byte5; 474 var byte1, byte2, byte3, byte4, byte5;
514 475
515 value = aValue.toLowerCase(); 476 value = aValue.toLowerCase();
516 value = value.replace(/[\s\-]/g, ''); 477 value = value.replace(/[\s\-]/g, '');
517 value = value.replace(/[0o]/g, '0'); 478 value = value.replace(/[0o]/g, '0');
518 value = value.replace(/[1il]/g, '1'); 479 value = value.replace(/[1il]/g, '1');
519 480
520 length = value.length; 481 length = value.length;
521 482
522 if ((length % 8) != 0) { 483 if ((length % 8) != 0) {
523 MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase32Value' is not correct"); 484 Clipperz.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
524 throw Clipperz.ByteArray.exception.InvalidValue; 485 throw Clipperz.ByteArray.exception.InvalidValue;
525 } 486 }
526 487
527 i = 0; 488 i = 0;
528 while (i<length) { 489 while (i<length) {
529 value1 = this.base32map.indexOf(value.charAt(i)); 490 value1 = this.base32map.indexOf(value.charAt(i));
530 value2 = this.base32map.indexOf(value.charAt(i+1)); 491 value2 = this.base32map.indexOf(value.charAt(i+1));
531 value3 = this.base32map.indexOf(value.charAt(i+2)); 492 value3 = this.base32map.indexOf(value.charAt(i+2));
532 value4 = this.base32map.indexOf(value.charAt(i+3)); 493 value4 = this.base32map.indexOf(value.charAt(i+3));
533 value5 = this.base32map.indexOf(value.charAt(i+4)); 494 value5 = this.base32map.indexOf(value.charAt(i+4));
534 value6 = this.base32map.indexOf(value.charAt(i+5)); 495 value6 = this.base32map.indexOf(value.charAt(i+5));
535 value7 = this.base32map.indexOf(value.charAt(i+6)); 496 value7 = this.base32map.indexOf(value.charAt(i+6));
536 value8 = this.base32map.indexOf(value.charAt(i+7)); 497 value8 = this.base32map.indexOf(value.charAt(i+7));
537 498
538 byte1 = byte2 = byte3 = byte4 = byte5 = null; 499 byte1 = byte2 = byte3 = byte4 = byte5 = null;
539 500
540 byte1 = (value1 << 3) | ((value2 & 0x1c) >> 2); 501 byte1 = (value1 << 3) | ((value2 & 0x1c) >> 2);
541 if (value3 != -1) { 502 if (value3 != -1) {
542 byte2 = ((value2 & 0x03) << 6) | (value3 << 1) | ((value4 & 0x10) >> 4); 503 byte2 = ((value2 & 0x03) << 6) | (value3 << 1) | ((value4 & 0x10) >> 4);
543 if (value5 != -1) { 504 if (value5 != -1) {
544 byte3 = ((value4 & 0x0f) << 4) | ((value5 & 0x1e) >> 1); 505 byte3 = ((value4 & 0x0f) << 4) | ((value5 & 0x1e) >> 1);
545 if (value6 != -1) { 506 if (value6 != -1) {
546 byte4 = ((value5 & 0x01) << 7) | (value6 << 2) | ((value7 & 0x18) >> 3); 507 byte4 = ((value5 & 0x01) << 7) | (value6 << 2) | ((value7 & 0x18) >> 3);
547 if (value8 != -1) { 508 if (value8 != -1) {
@@ -707,49 +668,49 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
707//============================================================================= 668//=============================================================================
708// 669//
709 //Clipperz.ByteArray_hex 670 //Clipperz.ByteArray_hex
710// 671//
711//============================================================================= 672//=============================================================================
712/* 673/*
713Clipperz.ByteArray_hex = function (args) { 674Clipperz.ByteArray_hex = function (args) {
714 this._value = ""; 675 this._value = "";
715 676
716 if (typeof(args) != 'undefined') { 677 if (typeof(args) != 'undefined') {
717 if (args.constructor == Array) { 678 if (args.constructor == Array) {
718 this.appendBytes(args); 679 this.appendBytes(args);
719 } else if (args.constructor == String) { 680 } else if (args.constructor == String) {
720 if (args.indexOf("0x") == 0) { 681 if (args.indexOf("0x") == 0) {
721 varvalue; 682 varvalue;
722 683
723 value = args.substring(2).toLowerCase(); 684 value = args.substring(2).toLowerCase();
724 if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activate 685 if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activate
725 if ((value.length % 2) == 0) { 686 if ((value.length % 2) == 0) {
726 this._value = value; 687 this._value = value;
727 } else { 688 } else {
728 this._value = "0" + value; 689 this._value = "0" + value;
729 } 690 }
730 } else { 691 } else {
731MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string."); 692Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
732 throw Clipperz.ByteArray.exception.InvalidValue; 693 throw Clipperz.ByteArray.exception.InvalidValue;
733 } 694 }
734 } else { 695 } else {
735 varvalue; 696 varvalue;
736 vari,c; 697 vari,c;
737 698
738 c = args.length; 699 c = args.length;
739 value = new Array(c); 700 value = new Array(c);
740 for (i=0; i<c; i++) { 701 for (i=0; i<c; i++) {
741 value.push(Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i))); 702 value.push(Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i)));
742 } 703 }
743 704
744 this._value = value.join(""); 705 this._value = value.join("");
745 } 706 }
746 } else { 707 } else {
747 this.appendBytes(MochiKit.Base.extend(null, arguments)); 708 this.appendBytes(MochiKit.Base.extend(null, arguments));
748 } 709 }
749 } 710 }
750 return this; 711 return this;
751} 712}
752 713
753Clipperz.ByteArray_hex.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), { 714Clipperz.ByteArray_hex.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), {
754 715
755 //------------------------------------------------------------------------- 716 //-------------------------------------------------------------------------
@@ -893,49 +854,49 @@ Clipperz.ByteArray_hex.prototype = MochiKit.Base.update(new Clipperz.ByteArray_a
893 854
894//============================================================================= 855//=============================================================================
895// 856//
896 //Clipperz.ByteArray_array 857 //Clipperz.ByteArray_array
897// 858//
898//============================================================================= 859//=============================================================================
899 860
900Clipperz.ByteArray_array = function (args) { 861Clipperz.ByteArray_array = function (args) {
901 if (typeof(args) != 'undefined') { 862 if (typeof(args) != 'undefined') {
902 if (args.constructor == Array) { 863 if (args.constructor == Array) {
903 this._value = args.slice(0); 864 this._value = args.slice(0);
904 } else if (args.constructor == String) { 865 } else if (args.constructor == String) {
905 var result; 866 var result;
906 varvalue; 867 varvalue;
907 var i, c; 868 var i, c;
908 869
909 if (args.indexOf("0x") == 0) { 870 if (args.indexOf("0x") == 0) {
910 871
911 value = args.substring(2).toLowerCase(); 872 value = args.substring(2).toLowerCase();
912 if (/[0123456789abcdef]*/.test(value)) { 873 if (/[0123456789abcdef]*/.test(value)) {
913 if ((value.length % 2) != 0) { 874 if ((value.length % 2) != 0) {
914 value = "0" + value; 875 value = "0" + value;
915 } 876 }
916 } else { 877 } else {
917MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string."); 878 Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
918 throw Clipperz.ByteArray.exception.InvalidValue; 879 throw Clipperz.ByteArray.exception.InvalidValue;
919 } 880 }
920 881
921 c = value.length / 2 882 c = value.length / 2
922 result = new Array(c); 883 result = new Array(c);
923 for (i=0; i<c; i++) { 884 for (i=0; i<c; i++) {
924 result[i] = parseInt(value.substr(i*2, 2), 16); 885 result[i] = parseInt(value.substr(i*2, 2), 16);
925 } 886 }
926 887
927 } else { 888 } else {
928 var unicode; 889 var unicode;
929 result = []; 890 result = [];
930 c = args.length; 891 c = args.length;
931 for (i=0; i<c; i++) { 892 for (i=0; i<c; i++) {
932 // Clipperz.ByteArray.pushUtf8BytesOfUnicodeChar(result, args.charCodeAt(i)); 893 // Clipperz.ByteArray.pushUtf8BytesOfUnicodeChar(result, args.charCodeAt(i));
933 894
934 unicode = args.charCodeAt(i); 895 unicode = args.charCodeAt(i);
935 if (unicode <= 0x7f) { //0x00000000 - 0x0000007f -> 0xxxxxxx 896 if (unicode <= 0x7f) { //0x00000000 - 0x0000007f -> 0xxxxxxx
936 result.push(unicode); 897 result.push(unicode);
937 // } else if ((unicode >= 0x80) && (unicode <= 0x7ff)) { //0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx 898 // } else if ((unicode >= 0x80) && (unicode <= 0x7ff)) { //0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
938 } else if (unicode <= 0x7ff) { //0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx 899 } else if (unicode <= 0x7ff) { //0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
939 result.push((unicode >> 6) | 0xc0); 900 result.push((unicode >> 6) | 0xc0);
940 result.push((unicode & 0x3F) | 0x80); 901 result.push((unicode & 0x3F) | 0x80);
941 // } else if ((unicode >= 0x0800) && (unicode <= 0xffff)) { //0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx 902 // } else if ((unicode >= 0x0800) && (unicode <= 0xffff)) { //0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
@@ -1094,49 +1055,49 @@ Clipperz.ByteArray_array.prototype = MochiKit.Base.update(new Clipperz.ByteArray
1094// 1055//
1095 //Clipperz.ByteArray_string 1056 //Clipperz.ByteArray_string
1096// 1057//
1097//============================================================================= 1058//=============================================================================
1098/* 1059/*
1099Clipperz.ByteArray_string = function (args) { 1060Clipperz.ByteArray_string = function (args) {
1100 this._value = ""; 1061 this._value = "";
1101 1062
1102 if (typeof(args) != 'undefined') { 1063 if (typeof(args) != 'undefined') {
1103 if (args.constructor == Array) { 1064 if (args.constructor == Array) {
1104 this.appendBytes(args); 1065 this.appendBytes(args);
1105 } else if (args.constructor == String) { 1066 } else if (args.constructor == String) {
1106 var result; 1067 var result;
1107 varvalue; 1068 varvalue;
1108 var i, c; 1069 var i, c;
1109 1070
1110 if (args.indexOf("0x") == 0) { 1071 if (args.indexOf("0x") == 0) {
1111 1072
1112 value = args.substring(2).toLowerCase(); 1073 value = args.substring(2).toLowerCase();
1113 if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activated 1074 if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activated
1114 if ((value.length % 2) != 0) { 1075 if ((value.length % 2) != 0) {
1115 value = "0" + value; 1076 value = "0" + value;
1116 } 1077 }
1117 } else { 1078 } else {
1118MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string."); 1079Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
1119 throw Clipperz.ByteArray.exception.InvalidValue; 1080 throw Clipperz.ByteArray.exception.InvalidValue;
1120 } 1081 }
1121 } else { 1082 } else {
1122 value = ""; 1083 value = "";
1123 c = args.length; 1084 c = args.length;
1124 for (i=0; i<c; i++) { 1085 for (i=0; i<c; i++) {
1125 value += Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i)); 1086 value += Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i));
1126 } 1087 }
1127 } 1088 }
1128 1089
1129 c = value.length / 2 1090 c = value.length / 2
1130 for (i=0; i<c; i++) { 1091 for (i=0; i<c; i++) {
1131 this.appendByte(parseInt(value.substr(i*2, 2), 16)); 1092 this.appendByte(parseInt(value.substr(i*2, 2), 16));
1132 } 1093 }
1133 } else { 1094 } else {
1134 this.appendBytes(MochiKit.Base.extend(null, arguments)); 1095 this.appendBytes(MochiKit.Base.extend(null, arguments));
1135 } 1096 }
1136 } 1097 }
1137 1098
1138 return this; 1099 return this;
1139} 1100}
1140 1101
1141Clipperz.ByteArray_string.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), { 1102Clipperz.ByteArray_string.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), {
1142 1103
diff --git a/frontend/gamma/js/Clipperz/CSVProcessor.js b/frontend/gamma/js/Clipperz/CSVProcessor.js
index 0b18731..1288ed7 100644
--- a/frontend/gamma/js/Clipperz/CSVProcessor.js
+++ b/frontend/gamma/js/Clipperz/CSVProcessor.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27 25
28 26
29Clipperz.CSVProcessor = function(args) { 27Clipperz.CSVProcessor = function(args) {
30 args = args || {}; 28 args = args || {};
31 29
32 // this._status = undefined; 30 // this._status = undefined;
33 // this._error_input= undefined; 31 // this._error_input= undefined;
34 // this._string = undefined; 32 // this._string = undefined;
35 // this._fields = undefined; 33 // this._fields = undefined;
36 34
37 this._quoteChar = args['quoteChar'] ||"\042"; 35 this._quoteChar = args['quoteChar'] ||"\042";
38 this._eol = args['eol'] ||""; 36 this._eol = args['eol'] ||"";
39 this._escapeChar = args['escapeChar'] ||"\042"; 37 this._escapeChar = args['escapeChar'] ||"\042";
40 this._separatorChar = args['separatorChar'] ||","; 38 this._separatorChar = args['separatorChar'] ||",";
41 this._binary = args['binary'] ||false; 39 this._binary = args['binary'] ||false;
42 this._alwaysQuote = args['alwaysQuote'] ||false; 40 this._alwaysQuote = args['alwaysQuote'] ||false;
43 41
44 return this; 42 return this;
45} 43}
46 44
@@ -74,71 +72,71 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
74 72
75 'setSeparatorChar': function(aValue) { 73 'setSeparatorChar': function(aValue) {
76 this._separatorChar = aValue; 74 this._separatorChar = aValue;
77 }, 75 },
78 76
79 //------------------------------------------------------------------------- 77 //-------------------------------------------------------------------------
80 78
81 'binary': function() { 79 'binary': function() {
82 return this._binary; 80 return this._binary;
83 }, 81 },
84 82
85 //------------------------------------------------------------------------- 83 //-------------------------------------------------------------------------
86 84
87 'alwaysQuote': function() { 85 'alwaysQuote': function() {
88 return this._alwaysQuote; 86 return this._alwaysQuote;
89 }, 87 },
90 88
91 //------------------------------------------------------------------------- 89 //-------------------------------------------------------------------------
92/* 90/*
93 'parse': function(aValue) { 91 'parse': function(aValue) {
94 var result; 92 var result;
95 var lines; 93 var lines;
96 var parameter; 94 var parameter;
97 95
98//MochiKit.Logging.logDebug(">>> CSVProcessor.parse"); 96//Clipperz.logDebug(">>> CSVProcessor.parse");
99 result = []; 97 result = [];
100 98
101 lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");; 99 lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");;
102 parameter = { 100 parameter = {
103 line: lines 101 line: lines
104 } 102 }
105 103
106 do { 104 do {
107 var fields; 105 var fields;
108 106
109 fields = this.parseLine(parameter); 107 fields = this.parseLine(parameter);
110 108
111 if (fields != null) { 109 if (fields != null) {
112 result.push(fields); 110 result.push(fields);
113 } 111 }
114 112
115 parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, ""); 113 parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, "");
116 114
117//MochiKit.Logging.logDebug("line: '" + parameter.line + "'"); 115//Clipperz.logDebug("line: '" + parameter.line + "'");
118 } while (parameter.line != ""); 116 } while (parameter.line != "");
119//MochiKit.Logging.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result)); 117//Clipperz.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result));
120//MochiKit.Logging.logDebug("<<< CSVProcessor.parse"); 118//Clipperz.logDebug("<<< CSVProcessor.parse");
121 119
122 return result; 120 return result;
123 }, 121 },
124*/ 122*/
125 //------------------------------------------------------------------------- 123 //-------------------------------------------------------------------------
126 124
127 'deferredParse_core': function(aContext) { 125 'deferredParse_core': function(aContext) {
128 var deferredResult; 126 var deferredResult;
129 127
130 if (aContext.line == "") { 128 if (aContext.line == "") {
131 deferredResult = MochiKit.Async.succeed(aContext.result); 129 deferredResult = MochiKit.Async.succeed(aContext.result);
132 } else { 130 } else {
133 var fields; 131 var fields;
134 132
135 fields = this.parseLine(aContext); 133 fields = this.parseLine(aContext);
136 if (fields != null) { 134 if (fields != null) {
137 aContext.result.push(fields); 135 aContext.result.push(fields);
138 } 136 }
139 137
140 aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, ""); 138 aContext.line = aContext.line.replace(/^\n*/g, "").replace(/\n$/g, "");
141 139
142 deferredResult = new Clipperz.Async.Deferred("CVSProcessor.deferredParse_core"); 140 deferredResult = new Clipperz.Async.Deferred("CVSProcessor.deferredParse_core");
143 // deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)}); 141 // deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, 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)}); 142 deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'importProcessorProgressUpdate', {status:'processing', size:aContext.size, progress:(aContext.size - aContext.line.length)});
@@ -195,152 +193,152 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
195 //------------------------------------------------------------------------- 193 //-------------------------------------------------------------------------
196 194
197 'parseField': function(aParameter) { 195 'parseField': function(aParameter) {
198 var result; 196 var result;
199 197
200 var inQuotes; 198 var inQuotes;
201 var validRegExp; 199 var validRegExp;
202 var singleQuoteBeginRegexp; 200 var singleQuoteBeginRegexp;
203 var escapedQuoteBeginRegexp; 201 var escapedQuoteBeginRegexp;
204 var singleQuoteCommaEndRegexp; 202 var singleQuoteCommaEndRegexp;
205 var singleQuoteNewLineEndRegexp; 203 var singleQuoteNewLineEndRegexp;
206 var commaBeginRegexp; 204 var commaBeginRegexp;
207 var newlineRegexp; 205 var newlineRegexp;
208 206
209 207
210 singleQuoteBeginRegexp = new RegExp("^" + '\\' + this.quoteChar()); 208 singleQuoteBeginRegexp = new RegExp("^" + '\\' + this.quoteChar());
211 escapedQuoteBeginRegexp = new RegExp("^" + '\\' + this.escapeChar() + '\\' + this.quoteChar()); 209 escapedQuoteBeginRegexp = new RegExp("^" + '\\' + this.escapeChar() + '\\' + this.quoteChar());
212 singleQuoteCommaEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + '\\' + this.separatorChar()); 210 singleQuoteCommaEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + '\\' + this.separatorChar());
213 singleQuoteNewLineEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + "\n"); 211 singleQuoteNewLineEndRegexp= new RegExp("^" + '\\' + this.quoteChar() + "\n");
214 commaBeginRegexp = new RegExp("^" + '\\' + this.separatorChar()); 212 commaBeginRegexp = new RegExp("^" + '\\' + this.separatorChar());
215 newlineRegexp = new RegExp("^\n"); 213 newlineRegexp = new RegExp("^\n");
216 214
217 inQuotes = false; 215 inQuotes = false;
218 216
219//MochiKit.Logging.logDebug("#################################### '" + aParameter.line + "'"); 217//Clipperz.logDebug("#################################### '" + aParameter.line + "'");
220 if (aParameter.line == "") { 218 if (aParameter.line == "") {
221 if (aParameter.isThereAnEmptyFinalField == true) { 219 if (aParameter.isThereAnEmptyFinalField == true) {
222 aParameter.isThereAnEmptyFinalField = false; 220 aParameter.isThereAnEmptyFinalField = false;
223 result = ""; 221 result = "";
224 } else { 222 } else {
225 result = null; 223 result = null;
226 } 224 }
227 } else { 225 } else {
228 if (this.binary()) { 226 if (this.binary()) {
229 validRegexp = /^./; 227 validRegexp = /^./;
230 // validRegexp = /^[^\\]/; 228 // validRegexp = /^[^\\]/;
231 } else { 229 } else {
232 validRegexp = /^[\t\040-\176]/; 230 validRegexp = /^[\t\040-\176]/;
233 } 231 }
234 232
235 try { 233 try {
236 var done; 234 var done;
237 235
238 done = false; 236 done = false;
239 result = ""; 237 result = "";
240 238
241 while (!done) { 239 while (!done) {
242 if (aParameter.line.length < 1) { 240 if (aParameter.line.length < 1) {
243//MochiKit.Logging.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 241//Clipperz.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
244 if (inQuotes == true) { 242 if (inQuotes == true) {
245//MochiKit.Logging.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 243//Clipperz.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
246 throw new Error("CSV Parsing error; end of string, missing closing double-quote..."); 244 throw new Error("CSV Parsing error; end of string, missing closing double-quote...");
247 } else { 245 } else {
248//MochiKit.Logging.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 246//Clipperz.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
249 done = true; 247 done = true;
250 } 248 }
251 } else if (escapedQuoteBeginRegexp.test(aParameter.line)) { 249 } else if (escapedQuoteBeginRegexp.test(aParameter.line)) {
252//MochiKit.Logging.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 250//Clipperz.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
253 result += this.quoteChar(); 251 result += this.quoteChar();
254 aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); 252 aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1);
255//MochiKit.Logging.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 253//Clipperz.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
256 } else if (singleQuoteBeginRegexp.test(aParameter.line)) { 254 } else if (singleQuoteBeginRegexp.test(aParameter.line)) {
257//MochiKit.Logging.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 255//Clipperz.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
258 if (inQuotes == true) { 256 if (inQuotes == true) {
259 if (aParameter.line.length == 1) { 257 if (aParameter.line.length == 1) {
260//MochiKit.Logging.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 258//Clipperz.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
261 aParameter.line = ''; 259 aParameter.line = '';
262 done = true; 260 done = true;
263 } else if (singleQuoteCommaEndRegexp.test(aParameter.line)) { 261 } else if (singleQuoteCommaEndRegexp.test(aParameter.line)) {
264//MochiKit.Logging.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 262//Clipperz.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
265 aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1); 263 aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1);
266 done = true; 264 done = true;
267//MochiKit.Logging.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 265//Clipperz.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
268 } else if (singleQuoteNewLineEndRegexp.test(aParameter.line)) { 266 } else if (singleQuoteNewLineEndRegexp.test(aParameter.line)) {
269 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 267 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
270 done = true; 268 done = true;
271 } else { 269 } else {
272 throw new Error("CSV Parsing error; double-quote, followed by undesirable character (bad character sequence)... " + aParameter.line); 270 throw new Error("CSV Parsing error; double-quote, followed by undesirable character (bad character sequence)... " + aParameter.line);
273 } 271 }
274 } else { 272 } else {
275//MochiKit.Logging.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 273//Clipperz.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
276 if (result == "") { 274 if (result == "") {
277//MochiKit.Logging.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 275//Clipperz.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
278 inQuotes = true; 276 inQuotes = true;
279 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 277 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
280//MochiKit.Logging.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 278//Clipperz.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
281 } else { 279 } else {
282 throw new Error("CSV Parsing error; double-quote, outside of double-quotes (bad character sequence)..."); 280 throw new Error("CSV Parsing error; double-quote, outside of double-quotes (bad character sequence)...");
283 } 281 }
284 } 282 }
285 } else if (commaBeginRegexp.test(aParameter.line)) { 283 } else if (commaBeginRegexp.test(aParameter.line)) {
286//MochiKit.Logging.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 284//Clipperz.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
287 if (inQuotes) { 285 if (inQuotes) {
288//MochiKit.Logging.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 286//Clipperz.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
289 result += aParameter.line.substr(0 ,1); 287 result += aParameter.line.substr(0 ,1);
290 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 288 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
291//MochiKit.Logging.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 289//Clipperz.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
292 } else { 290 } else {
293//MochiKit.Logging.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 291//Clipperz.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
294 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 292 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
295 if (newlineRegexp.test(aParameter.line) || aParameter.line == "") { 293 if (newlineRegexp.test(aParameter.line) || aParameter.line == "") {
296//MochiKit.Logging.logDebug("######"); 294//Clipperz.logDebug("######");
297 aParameter.isThereAnEmptyFinalField = true; 295 aParameter.isThereAnEmptyFinalField = true;
298 }; 296 };
299 done = true; 297 done = true;
300//MochiKit.Logging.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 298//Clipperz.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
301 } 299 }
302 } else if (validRegexp.test(aParameter.line)) { 300 } else if (validRegexp.test(aParameter.line)) {
303//MochiKit.Logging.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 301//Clipperz.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
304 result += aParameter.line.substr(0, 1); 302 result += aParameter.line.substr(0, 1);
305 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 303 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
306//MochiKit.Logging.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'"); 304//Clipperz.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
307 } else if (newlineRegexp.test(aParameter.line)) { 305 } else if (newlineRegexp.test(aParameter.line)) {
308 if (inQuotes == true) { 306 if (inQuotes == true) {
309 result += aParameter.line.substr(0 ,1); 307 result += aParameter.line.substr(0 ,1);
310 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1); 308 aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
311 } else { 309 } else {
312 if (result == "") { 310 if (result == "") {
313 if (aParameter.isThereAnEmptyFinalField == true) { 311 if (aParameter.isThereAnEmptyFinalField == true) {
314 aParameter.isThereAnEmptyFinalField = false; 312 aParameter.isThereAnEmptyFinalField = false;
315 } else { 313 } else {
316 result = null; 314 result = null;
317 } 315 }
318 } 316 }
319 317
320 done = true; 318 done = true;
321 } 319 }
322 } else { 320 } else {
323 throw new Error("CSV Parsing error; an undesirable character... '" + aParameter.line.substr(0,1) + "'"); 321 throw new Error("CSV Parsing error; an undesirable character... '" + aParameter.line.substr(0,1) + "'");
324 } 322 }
325 } 323 }
326 } catch(exception) { 324 } catch(exception) {
327 MochiKit.Logging.logError(exception.message); 325 Clipperz.logError(exception.message);
328 // result = null; 326 // result = null;
329 throw exception; 327 throw exception;
330 } 328 }
331 } 329 }
332 330
333//if (result != null) { 331//if (result != null) {
334 //MochiKit.Logging.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'"); 332 //Clipperz.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'");
335//} else { 333//} else {
336 //MochiKit.Logging.logDebug("<=== result: NULL"); 334 //Clipperz.logDebug("<=== result: NULL");
337//} 335//}
338 336
339 return result; 337 return result;
340 }, 338 },
341 339
342 //------------------------------------------------------------------------- 340 //-------------------------------------------------------------------------
343 __syntaxFix__: "syntax fix" 341 __syntaxFix__: "syntax fix"
344}); 342});
345 343
346 344
diff --git a/frontend/gamma/js/Clipperz/Crypto/AES.js b/frontend/gamma/js/Clipperz/Crypto/AES.js
index c811f1c..cb56f11 100644
--- a/frontend/gamma/js/Clipperz/Crypto/AES.js
+++ b/frontend/gamma/js/Clipperz/Crypto/AES.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.AES depends on Clipperz.ByteArray!"; 25 throw "Clipperz.Crypto.AES depends on Clipperz.ByteArray!";
28} 26}
29 27
30 //Dependency commented to avoid a circular reference 28 //Dependency commented to avoid a circular reference
31//try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { 29//try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) {
32 //throw "Clipperz.Crypto.AES depends on Clipperz.Crypto.PRNG!"; 30 //throw "Clipperz.Crypto.AES depends on Clipperz.Crypto.PRNG!";
33//} 31//}
34 32
35if (typeof(Clipperz.Crypto.AES) == 'undefined') { Clipperz.Crypto.AES = {}; } 33if (typeof(Clipperz.Crypto.AES) == 'undefined') { Clipperz.Crypto.AES = {}; }
36 34
37//############################################################################# 35//#############################################################################
38 36
39Clipperz.Crypto.AES.DeferredExecutionContext = function(args) { 37Clipperz.Crypto.AES.DeferredExecutionContext = function(args) {
40 args = args || {}; 38 args = args || {};
41 39
42 this._key = args.key; 40 this._key = args.key;
43 this._message = args.message; 41 this._message = args.message;
44 this._result = args.message.clone(); 42 this._result = args.message.clone();
45 this._nonce = args.nonce; 43 this._nonce = args.nonce;
46 this._messageLength = this._message.length(); 44 this._messageLength = this._message.length();
@@ -99,73 +97,72 @@ Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(nu
99 }, 97 },
100 98
101 'executionStep': function() { 99 'executionStep': function() {
102 return this._executionStep; 100 return this._executionStep;
103 }, 101 },
104 102
105 'setExecutionStep': function(aValue) { 103 'setExecutionStep': function(aValue) {
106 this._executionStep = aValue; 104 this._executionStep = aValue;
107 }, 105 },
108 106
109 'tuneExecutionParameters': function (anElapsedTime) { 107 'tuneExecutionParameters': function (anElapsedTime) {
110//var originalChunks = this._elaborationChunks; 108//var originalChunks = this._elaborationChunks;
111 if (anElapsedTime > 0) { 109 if (anElapsedTime > 0) {
112 this._elaborationChunks = Math.round(this._elaborationChunks * ((anElapsedTime + 1000)/(anElapsedTime * 2))); 110 this._elaborationChunks = Math.round(this._elaborationChunks * ((anElapsedTime + 1000)/(anElapsedTime * 2)));
113 } 111 }
114//Clipperz.log("tuneExecutionParameters - elapsedTime: " + anElapsedTime + /*originalChunks,*/ " chunks # " + this._elaborationChunks + " [" + this._executionStep + " / " + this._messageLength + "]"); 112//Clipperz.log("tuneExecutionParameters - elapsedTime: " + anElapsedTime + /*originalChunks,*/ " chunks # " + this._elaborationChunks + " [" + this._executionStep + " / " + this._messageLength + "]");
115 }, 113 },
116 114
117 'pause': function(aValue) { 115 'pause': function(aValue) {
118 // return MochiKit.Async.wait(Clipperz.Crypto.AES.DeferredExecution.pauseTime, aValue); 116 // return MochiKit.Async.wait(Clipperz.Crypto.AES.DeferredExecution.pauseTime, aValue);
119 return MochiKit.Async.wait(this._pauseTime, aValue); 117 return MochiKit.Async.wait(this._pauseTime, aValue);
120 }, 118 },
121 119
122 'isDone': function () { 120 'isDone': function () {
123//console.log("isDone", this.executionStep(), this.messageLength());
124 return (this._executionStep >= this._messageLength); 121 return (this._executionStep >= this._messageLength);
125 }, 122 },
126 123
127 //----------------------------------------------------------------------------- 124 //-----------------------------------------------------------------------------
128 __syntaxFix__: "syntax fix" 125 __syntaxFix__: "syntax fix"
129 126
130}); 127});
131 128
132//############################################################################# 129//#############################################################################
133 130
134Clipperz.Crypto.AES.Key = function(args) { 131Clipperz.Crypto.AES.Key = function(args) {
135 args = args || {}; 132 args = args || {};
136 133
137 this._key = args.key; 134 this._key = args.key;
138 this._keySize = args.keySize || this.key().length(); 135 this._keySize = args.keySize || this.key().length();
139 136
140 if (this.keySize() == 128/8) { 137 if (this.keySize() == 128/8) {
141 this._b = 176; 138 this._b = 176;
142 this._numberOfRounds = 10; 139 this._numberOfRounds = 10;
143 } else if (this.keySize() == 256/8) { 140 } else if (this.keySize() == 256/8) {
144 this._b = 240; 141 this._b = 240;
145 this._numberOfRounds = 14; 142 this._numberOfRounds = 14;
146 } else { 143 } else {
147 MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits"); 144 Clipperz.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits");
148 throw Clipperz.Crypto.AES.exception.UnsupportedKeySize; 145 throw Clipperz.Crypto.AES.exception.UnsupportedKeySize;
149 } 146 }
150 147
151 this._stretchedKey = null; 148 this._stretchedKey = null;
152 149
153 return this; 150 return this;
154} 151}
155 152
156Clipperz.Crypto.AES.Key.prototype = MochiKit.Base.update(null, { 153Clipperz.Crypto.AES.Key.prototype = MochiKit.Base.update(null, {
157 154
158 'asString': function() { 155 'asString': function() {
159 return "Clipperz.Crypto.AES.Key (" + this.key().toHexString() + ")"; 156 return "Clipperz.Crypto.AES.Key (" + this.key().toHexString() + ")";
160 }, 157 },
161 158
162 //----------------------------------------------------------------------------- 159 //-----------------------------------------------------------------------------
163 160
164 'key': function() { 161 'key': function() {
165 return this._key; 162 return this._key;
166 }, 163 },
167 164
168 'keySize': function() { 165 'keySize': function() {
169 return this._keySize; 166 return this._keySize;
170 }, 167 },
171 168
@@ -787,80 +784,76 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
787 Clipperz.Crypto.AES.deferredEncryptBlocks 784 Clipperz.Crypto.AES.deferredEncryptBlocks
788 ], {trace:false}, anExecutionContext); 785 ], {trace:false}, anExecutionContext);
789 } else { 786 } else {
790 deferredResult = MochiKit.Async.succeed(anExecutionContext); 787 deferredResult = MochiKit.Async.succeed(anExecutionContext);
791 } 788 }
792 789
793 return deferredResult; 790 return deferredResult;
794 }, 791 },
795 792
796 //----------------------------------------------------------------------------- 793 //-----------------------------------------------------------------------------
797 794
798 'deferredEncrypt': function(aKey, someData, aNonce) { 795 'deferredEncrypt': function(aKey, someData, aNonce) {
799 var deferredResult; 796 var deferredResult;
800 varexecutionContext; 797 varexecutionContext;
801 var result; 798 var result;
802 var nonce; 799 var nonce;
803 var key; 800 var key;
804 801
805 key = new Clipperz.Crypto.AES.Key({key:aKey}); 802 key = new Clipperz.Crypto.AES.Key({key:aKey});
806 nonce = aNonce ? aNonce.clone() : Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(128/8); 803 nonce = aNonce ? aNonce.clone() : Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(128/8);
807 804
808 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce}); 805 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce});
809 806
810 deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt"); 807 deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt");
811//deferredResult.addCallback(function (aValue) { console.log(">>> deferredEncrypt"); return aValue; });
812 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks); 808 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
813 deferredResult.addCallback(function(anExecutionContext) { 809 deferredResult.addCallback(function(anExecutionContext) {
814 var result; 810 var result;
815 811
816 result = anExecutionContext.nonce().clone(); 812 result = anExecutionContext.nonce().clone();
817 result.appendBytes(anExecutionContext.resultArray()); 813 result.appendBytes(anExecutionContext.resultArray());
818 814
819 return result; 815 return result;
820 }); 816 });
821//deferredResult.addCallback(function (aValue) { console.log("<<< deferredEncrypt"); return aValue; });
822 deferredResult.callback(executionContext) 817 deferredResult.callback(executionContext)
823 818
824 return deferredResult; 819 return deferredResult;
825 }, 820 },
826 821
827 //----------------------------------------------------------------------------- 822 //-----------------------------------------------------------------------------
828 823
829 'deferredDecrypt': function(aKey, someData) { 824 'deferredDecrypt': function(aKey, someData) {
830 var deferredResult 825 var deferredResult
831 var nonce; 826 var nonce;
832 var message; 827 var message;
833 var key; 828 var key;
834 829
835 key = new Clipperz.Crypto.AES.Key({key:aKey}); 830 key = new Clipperz.Crypto.AES.Key({key:aKey});
836 nonce = someData.split(0, (128/8)); 831 nonce = someData.split(0, (128/8));
837 message = someData.split(128/8); 832 message = someData.split(128/8);
838 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce}); 833 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce});
839 834
840 deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt"); 835 deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt");
841//deferredResult.addCallback(function (aValue) { console.log(">>> deferredDecrypt"); return aValue; });
842 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks); 836 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
843 deferredResult.addCallback(function(anExecutionContext) { 837 deferredResult.addCallback(function(anExecutionContext) {
844 return anExecutionContext.result(); 838 return anExecutionContext.result();
845 }); 839 });
846//deferredResult.addCallback(function (aValue) { console.log("<<< deferredDecrypt"); return aValue; });
847 deferredResult.callback(executionContext); 840 deferredResult.callback(executionContext);
848 841
849 return deferredResult; 842 return deferredResult;
850 }, 843 },
851 844
852 //----------------------------------------------------------------------------- 845 //-----------------------------------------------------------------------------
853 __syntaxFix__: "syntax fix" 846 __syntaxFix__: "syntax fix"
854 847
855}); 848});
856 849
857//############################################################################# 850//#############################################################################
858 851
859//Clipperz.Crypto.AES.DeferredExecution = { 852//Clipperz.Crypto.AES.DeferredExecution = {
860 // 'chunkSize': 16384, // 4096, // 1024 4096 8192 1638432768; 853 // 'chunkSize': 16384, // 4096, // 1024 4096 8192 1638432768;
861 // 'pauseTime': 0.02 //0.2 854 // 'pauseTime': 0.02 //0.2
862//} 855//}
863 856
864Clipperz.Crypto.AES.exception = { 857Clipperz.Crypto.AES.exception = {
865 'UnsupportedKeySize': new MochiKit.Base.NamedError("Clipperz.Crypto.AES.exception.UnsupportedKeySize") 858 'UnsupportedKeySize': new MochiKit.Base.NamedError("Clipperz.Crypto.AES.exception.UnsupportedKeySize")
866}; 859};
diff --git a/frontend/gamma/js/Clipperz/Crypto/Base.js b/frontend/gamma/js/Clipperz/Crypto/Base.js
index d3a8e36..9acfc49 100644
--- a/frontend/gamma/js/Clipperz/Crypto/Base.js
+++ b/frontend/gamma/js/Clipperz/Crypto/Base.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.Base) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.Base) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.Base depends on Clipperz.Base!"; 25 throw "Clipperz.Crypto.Base depends on Clipperz.Base!";
28} 26}
29 27
30if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } 28if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
31if (typeof(Clipperz.Crypto.Base) == 'undefined') { Clipperz.Crypto.Base = {}; } 29if (typeof(Clipperz.Crypto.Base) == 'undefined') { Clipperz.Crypto.Base = {}; }
32 30
33Clipperz.Crypto.Base.VERSION = "0.1"; 31Clipperz.Crypto.Base.VERSION = "0.1";
34Clipperz.Crypto.Base.NAME = "Clipperz.Crypto.Base"; 32Clipperz.Crypto.Base.NAME = "Clipperz.Crypto.Base";
35 33
36//############################################################################# 34//#############################################################################
37 //Downloaded on March 30, 2006 from http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip (jsSha2/sha256.js) 35 //Downloaded on March 30, 2006 from http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip (jsSha2/sha256.js)
38//############################################################################# 36//#############################################################################
39 37
40/* A JavaScript implementation of the Secure Hash Algorithm, SHA-256 38/* A JavaScript implementation of the Secure Hash Algorithm, SHA-256
41 * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/ 39 * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/
42 * Distributed under the BSD License 40 * Distributed under the BSD License
43 * Some bits taken from Paul Johnston's SHA-1 implementation 41 * Some bits taken from Paul Johnston's SHA-1 implementation
44 */ 42 */
45var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ 43var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
46function safe_add (x, y) { 44function safe_add (x, y) {
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt.js b/frontend/gamma/js/Clipperz/Crypto/BigInt.js
index 41483a3..031ed30 100644
--- a/frontend/gamma/js/Clipperz/Crypto/BigInt.js
+++ b/frontend/gamma/js/Clipperz/Crypto/BigInt.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } 25if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
28 26
29//############################################################################# 27//#############################################################################
30 //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js 28 //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js
31//############################################################################# 29//#############################################################################
32 30
33 31
34//////////////////////////////////////////////////////////////////////////////////////// 32////////////////////////////////////////////////////////////////////////////////////////
35// Big Integer Library v. 5.0 33// Big Integer Library v. 5.0
36// Created 2000, last modified 2006 34// Created 2000, last modified 2006
37// Leemon Baird 35// Leemon Baird
38// www.leemon.com 36// www.leemon.com
39// 37//
40// This file is public domain. You can use it for any purpose without restriction. 38// This file is public domain. You can use it for any purpose without restriction.
41// I do not guarantee that it is correct, so use it at your own risk. If you use 39// I do not guarantee that it is correct, so use it at your own risk. If you use
42// it for something interesting, I'd appreciate hearing about it. If you find 40// it for something interesting, I'd appreciate hearing about it. If you find
43// any bugs or make any improvements, I'd appreciate hearing about those too. 41// any bugs or make any improvements, I'd appreciate hearing about those too.
44// It would also be nice if my name and address were left in the comments. 42// It would also be nice if my name and address were left in the comments.
45// But none of that is required. 43// But none of that is required.
46// 44//
@@ -1456,49 +1454,48 @@ MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
1456 'isBigInt': true, 1454 'isBigInt': true,
1457 1455
1458 //------------------------------------------------------------------------- 1456 //-------------------------------------------------------------------------
1459 1457
1460 'toString': function(aBase) { 1458 'toString': function(aBase) {
1461 return this.asString(aBase); 1459 return this.asString(aBase);
1462 }, 1460 },
1463 1461
1464 //------------------------------------------------------------------------- 1462 //-------------------------------------------------------------------------
1465 1463
1466 'asString': function (aBase, minimumLength) { 1464 'asString': function (aBase, minimumLength) {
1467 varresult; 1465 varresult;
1468 varbase; 1466 varbase;
1469 1467
1470 if (typeof(aBase) == 'undefined') { 1468 if (typeof(aBase) == 'undefined') {
1471 base = 10; 1469 base = 10;
1472 } else { 1470 } else {
1473 base = aBase; 1471 base = aBase;
1474 } 1472 }
1475 1473
1476 result = bigInt2str(this.internalValue(), base).toLowerCase(); 1474 result = bigInt2str(this.internalValue(), base).toLowerCase();
1477 1475
1478 if ((typeof(minimumLength) != 'undefined') && (result.length < minimumLength)) { 1476 if ((typeof(minimumLength) != 'undefined') && (result.length < minimumLength)) {
1479 var i, c; 1477 var i, c;
1480 //MochiKit.Logging.logDebug(">>> FIXING BigInt.asString length issue")
1481 c = (minimumLength - result.length); 1478 c = (minimumLength - result.length);
1482 for (i=0; i<c; i++) { 1479 for (i=0; i<c; i++) {
1483 result = '0' + result; 1480 result = '0' + result;
1484 } 1481 }
1485 } 1482 }
1486 1483
1487 return result; 1484 return result;
1488 }, 1485 },
1489 1486
1490 //------------------------------------------------------------------------- 1487 //-------------------------------------------------------------------------
1491 1488
1492 'asByteArray': function() { 1489 'asByteArray': function() {
1493 return new Clipperz.ByteArray("0x" + this.asString(16), 16); 1490 return new Clipperz.ByteArray("0x" + this.asString(16), 16);
1494 }, 1491 },
1495 1492
1496 //------------------------------------------------------------------------- 1493 //-------------------------------------------------------------------------
1497 1494
1498 'equals': function (aValue) { 1495 'equals': function (aValue) {
1499 var result; 1496 var result;
1500 1497
1501 if (aValue.isBigInt) { 1498 if (aValue.isBigInt) {
1502 result = equals(this.internalValue(), aValue.internalValue()); 1499 result = equals(this.internalValue(), aValue.internalValue());
1503 } else if (typeof(aValue) == "number") { 1500 } else if (typeof(aValue) == "number") {
1504 result = equalsInt(this.internalValue(), aValue); 1501 result = equalsInt(this.internalValue(), aValue);
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js
index f91c7e9..bc60330 100644
--- a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js
+++ b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } 25if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
28 26
29if (typeof(Leemon) == 'undefined') { Leemon = {}; } 27if (typeof(Leemon) == 'undefined') { Leemon = {}; }
30if (typeof(Baird.Crypto) == 'undefined') { Baird.Crypto = {}; } 28if (typeof(Baird.Crypto) == 'undefined') { Baird.Crypto = {}; }
31if (typeof(Baird.Crypto.BigInt) == 'undefined') { Baird.Crypto.BigInt = {}; } 29if (typeof(Baird.Crypto.BigInt) == 'undefined') { Baird.Crypto.BigInt = {}; }
32 30
33 31
34//############################################################################# 32//#############################################################################
35 //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js 33 //Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js
36//############################################################################# 34//#############################################################################
37 35
38//////////////////////////////////////////////////////////////////////////////////////// 36////////////////////////////////////////////////////////////////////////////////////////
39// Big Integer Library v. 5.0 37// Big Integer Library v. 5.0
40// Created 2000, last modified 2006 38// Created 2000, last modified 2006
41// Leemon Baird 39// Leemon Baird
42// www.leemon.com 40// www.leemon.com
43// 41//
44// This file is public domain. You can use it for any purpose without restriction. 42// This file is public domain. You can use it for any purpose without restriction.
45// I do not guarantee that it is correct, so use it at your own risk. If you use 43// I do not guarantee that it is correct, so use it at your own risk. If you use
46// it for something interesting, I'd appreciate hearing about it. If you find 44// it for something interesting, I'd appreciate hearing about it. If you find
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
index 19f19c2..0d76b9c 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; 25 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
28//} 26//}
29if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } 27if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
30if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } 28if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
31 29
32Clipperz.Crypto.ECC.BinaryField.Curve = function(args) { 30Clipperz.Crypto.ECC.BinaryField.Curve = function(args) {
33 args = args || {}; 31 args = args || {};
34 32
35 this._modulus = args.modulus; 33 this._modulus = args.modulus;
36 34
37 this._a = args.a; 35 this._a = args.a;
38 this._b = args.b; 36 this._b = args.b;
39 this._G = args.G; 37 this._G = args.G;
40 this._r = args.r; 38 this._r = args.r;
41 this._h = args.h; 39 this._h = args.h;
42 40
43 this._finiteField = null; 41 this._finiteField = null;
44 42
45 return this; 43 return this;
46} 44}
@@ -81,274 +79,234 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
81 79
82 'finiteField': function() { 80 'finiteField': function() {
83 if (this._finiteField == null) { 81 if (this._finiteField == null) {
84 this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()}) 82 this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()})
85 } 83 }
86 84
87 return this._finiteField; 85 return this._finiteField;
88 }, 86 },
89 87
90 //----------------------------------------------------------------------------- 88 //-----------------------------------------------------------------------------
91 89
92 'negate': function(aPointA) { 90 'negate': function(aPointA) {
93 var result; 91 var result;
94 92
95 result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())}) 93 result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())})
96 94
97 return result; 95 return result;
98 }, 96 },
99 97
100 //----------------------------------------------------------------------------- 98 //-----------------------------------------------------------------------------
101 99
102 'add': function(aPointA, aPointB) { 100 'add': function(aPointA, aPointB) {
103 var result; 101 var result;
104 102
105//console.log(">>> ECC.BinaryField.Curve.add");
106 if (aPointA.isZero()) { 103 if (aPointA.isZero()) {
107//console.log("--- pointA == zero");
108 result = aPointB; 104 result = aPointB;
109 } else if (aPointB.isZero()) { 105 } else if (aPointB.isZero()) {
110//console.log("--- pointB == zero");
111 result = aPointA; 106 result = aPointA;
112 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { 107 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
113//console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x()));
114//console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0));
115//console.log("compare B.x.isZero(): ", aPointB.x().isZero());
116
117//console.log("--- result = zero");
118 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 108 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
119 } else { 109 } else {
120//console.log("--- result = ELSE");
121 varf2m; 110 varf2m;
122 var x, y; 111 var x, y;
123 var lambda; 112 var lambda;
124 var aX, aY, bX, bY; 113 var aX, aY, bX, bY;
125 114
126 aX = aPointA.x()._value; 115 aX = aPointA.x()._value;
127 aY = aPointA.y()._value; 116 aY = aPointA.y()._value;
128 bX = aPointB.x()._value; 117 bX = aPointB.x()._value;
129 bY = aPointB.y()._value; 118 bY = aPointB.y()._value;
130 119
131 f2m = this.finiteField(); 120 f2m = this.finiteField();
132 121
133 if (aPointA.x().compare(aPointB.x()) != 0) { 122 if (aPointA.x().compare(aPointB.x()) != 0) {
134//console.log(" a.x != b.x");
135 lambda =f2m._fastMultiply( 123 lambda =f2m._fastMultiply(
136 f2m._add(aY, bY), 124 f2m._add(aY, bY),
137 f2m._inverse(f2m._add(aX, bX)) 125 f2m._inverse(f2m._add(aX, bX))
138 ); 126 );
139 x = f2m._add(this.a()._value, f2m._square(lambda)); 127 x = f2m._add(this.a()._value, f2m._square(lambda));
140 f2m._overwriteAdd(x, lambda); 128 f2m._overwriteAdd(x, lambda);
141 f2m._overwriteAdd(x, aX); 129 f2m._overwriteAdd(x, aX);
142 f2m._overwriteAdd(x, bX); 130 f2m._overwriteAdd(x, bX);
143 } else { 131 } else {
144//console.log(" a.x == b.x");
145 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); 132 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
146//console.log(" lambda: " + lambda.asString(16));
147 x = f2m._add(this.a()._value, f2m._square(lambda)); 133 x = f2m._add(this.a()._value, f2m._square(lambda));
148//console.log(" x (step 1): " + x.asString(16));
149 f2m._overwriteAdd(x, lambda); 134 f2m._overwriteAdd(x, lambda);
150//console.log(" x (step 2): " + x.asString(16));
151 } 135 }
152 136
153 y = f2m._fastMultiply(f2m._add(bX, x), lambda); 137 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
154//console.log(" y (step 1): " + y.asString(16));
155 f2m._overwriteAdd(y, x); 138 f2m._overwriteAdd(y, x);
156//console.log(" y (step 2): " + y.asString(16));
157 f2m._overwriteAdd(y, bY); 139 f2m._overwriteAdd(y, bY);
158//console.log(" y (step 3): " + y.asString(16));
159 140
160 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) 141 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
161 } 142 }
162//console.log("<<< ECC.BinaryField.Curve.add");
163 143
164 return result; 144 return result;
165 }, 145 },
166 146
167 //----------------------------------------------------------------------------- 147 //-----------------------------------------------------------------------------
168 148
169 'addTwice': function(aPointA) { 149 'addTwice': function(aPointA) {
170 return this.add(aPointA, aPointA); 150 return this.add(aPointA, aPointA);
171 }, 151 },
172 152
173 //----------------------------------------------------------------------------- 153 //-----------------------------------------------------------------------------
174 154
175 'overwriteAdd': function(aPointA, aPointB) { 155 'overwriteAdd': function(aPointA, aPointB) {
176 if (aPointA.isZero()) { 156 if (aPointA.isZero()) {
177 // result = aPointB; 157 // result = aPointB;
178 aPointA._x._value = aPointB._x._value; 158 aPointA._x._value = aPointB._x._value;
179 aPointA._y._value = aPointB._y._value; 159 aPointA._y._value = aPointB._y._value;
180 } else if (aPointB.isZero()) { 160 } else if (aPointB.isZero()) {
181 // result = aPointA; 161 // result = aPointA;
182 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { 162 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
183 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 163 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
184 aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O; 164 aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O;
185 aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O; 165 aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O;
186 } else { 166 } else {
187 varf2m; 167 varf2m;
188 var x, y; 168 var x, y;
189 var lambda; 169 var lambda;
190 var aX, aY, bX, bY; 170 var aX, aY, bX, bY;
191 171
192 aX = aPointA.x()._value; 172 aX = aPointA.x()._value;
193 aY = aPointA.y()._value; 173 aY = aPointA.y()._value;
194 bX = aPointB.x()._value; 174 bX = aPointB.x()._value;
195 bY = aPointB.y()._value; 175 bY = aPointB.y()._value;
196 176
197 f2m = this.finiteField(); 177 f2m = this.finiteField();
198 178
199 if (aPointA.x().compare(aPointB.x()) != 0) { 179 if (aPointA.x().compare(aPointB.x()) != 0) {
200//console.log(" a.x != b.x");
201 lambda =f2m._fastMultiply( 180 lambda =f2m._fastMultiply(
202 f2m._add(aY, bY), 181 f2m._add(aY, bY),
203 f2m._inverse(f2m._add(aX, bX)) 182 f2m._inverse(f2m._add(aX, bX))
204 ); 183 );
205 x = f2m._add(this.a()._value, f2m._square(lambda)); 184 x = f2m._add(this.a()._value, f2m._square(lambda));
206 f2m._overwriteAdd(x, lambda); 185 f2m._overwriteAdd(x, lambda);
207 f2m._overwriteAdd(x, aX); 186 f2m._overwriteAdd(x, aX);
208 f2m._overwriteAdd(x, bX); 187 f2m._overwriteAdd(x, bX);
209 } else { 188 } else {
210//console.log(" a.x == b.x");
211 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); 189 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
212//console.log(" lambda: " + lambda.asString(16));
213 x = f2m._add(this.a()._value, f2m._square(lambda)); 190 x = f2m._add(this.a()._value, f2m._square(lambda));
214//console.log(" x (step 1): " + x.asString(16));
215 f2m._overwriteAdd(x, lambda); 191 f2m._overwriteAdd(x, lambda);
216//console.log(" x (step 2): " + x.asString(16));
217 } 192 }
218 193
219 y = f2m._fastMultiply(f2m._add(bX, x), lambda); 194 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
220//console.log(" y (step 1): " + y.asString(16));
221 f2m._overwriteAdd(y, x); 195 f2m._overwriteAdd(y, x);
222//console.log(" y (step 2): " + y.asString(16));
223 f2m._overwriteAdd(y, bY); 196 f2m._overwriteAdd(y, bY);
224//console.log(" y (step 3): " + y.asString(16));
225 197
226 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) 198 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
227 aPointA._x._value = x; 199 aPointA._x._value = x;
228 aPointA._y._value = y; 200 aPointA._y._value = y;
229 201
230 } 202 }
231//console.log("<<< ECC.BinaryField.Curve.add");
232 203
233 return result; 204 return result;
234 }, 205 },
235 206
236 //----------------------------------------------------------------------------- 207 //-----------------------------------------------------------------------------
237 208
238 'multiply': function(aValue, aPoint) { 209 'multiply': function(aValue, aPoint) {
239 var result; 210 var result;
240 211
241//console.profile(); 212//console.profile();
242 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 213 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
243 214
244 if (aValue.isZero() == false) { 215 if (aValue.isZero() == false) {
245 var k, Q; 216 var k, Q;
246 var i; 217 var i;
247 var countIndex; countIndex = 0; 218 var countIndex; countIndex = 0;
248 219
249 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) { 220 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
250 k = aValue; 221 k = aValue;
251 Q = aPoint; 222 Q = aPoint;
252 } else { 223 } else {
253MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!"); 224 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
254 k = aValue.negate(); 225 k = aValue.negate();
255 Q = this.negate(aPoint); 226 Q = this.negate(aPoint);
256 } 227 }
257 228
258//console.log("k: " + k.toString(16));
259//console.log("k.bitSize: " + k.bitSize());
260 for (i=k.bitSize()-1; i>=0; i--) { 229 for (i=k.bitSize()-1; i>=0; i--) {
261 result = this.add(result, result); 230 result = this.add(result, result);
262 // this.overwriteAdd(result, result); 231 // this.overwriteAdd(result, result);
263 if (k.isBitSet(i)) { 232 if (k.isBitSet(i)) {
264 result = this.add(result, Q); 233 result = this.add(result, Q);
265 // this.overwriteAdd(result, Q); 234 // this.overwriteAdd(result, Q);
266 } 235 }
267 236
268 // if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++; 237 // if (countIndex==100) {Clipperz.log("multiply.break"); break;} else countIndex++;
269 } 238 }
270 } 239 }
271//console.profileEnd(); 240//console.profileEnd();
272 241
273 return result; 242 return result;
274 }, 243 },
275 244
276 //----------------------------------------------------------------------------- 245 //-----------------------------------------------------------------------------
277 246
278 'deferredMultiply': function(aValue, aPoint) { 247 'deferredMultiply': function(aValue, aPoint) {
279 var deferredResult; 248 var deferredResult;
280 var result; 249 var result;
281 250
282MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint); 251Clipperz.log(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
283//console.profile("ECC.Curve.multiply"); 252//console.profile("ECC.Curve.multiply");
284 deferredResult = new MochiKit.Async.Deferred(); 253 deferredResult = new MochiKit.Async.Deferred();
285//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} ); 254//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} );
286//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 1: " + res); return res;}); 255//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 1: " + res); return res;});
287 256
288 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 257 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
289//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 2: " + res); return res;}); 258//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 2: " + res); return res;});
290 259
291 if (aValue.isZero() == false) { 260 if (aValue.isZero() == false) {
292 var k, Q; 261 var k, Q;
293 var i; 262 var i;
294 var countIndex; countIndex = 0; 263 var countIndex; countIndex = 0;
295 264
296 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) { 265 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
297 k = aValue; 266 k = aValue;
298 Q = aPoint; 267 Q = aPoint;
299 } else { 268 } else {
300MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!"); 269 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
301 k = aValue.negate(); 270 k = aValue.negate();
302 Q = this.negate(aPoint); 271 Q = this.negate(aPoint);
303 } 272 }
304 273
305//console.log("k: " + k.toString(16));
306//console.log("k.bitSize: " + k.bitSize());
307 274
308//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 3: " + res); return res;});
309 for (i=k.bitSize()-1; i>=0; i--) { 275 for (i=k.bitSize()-1; i>=0; i--) {
310//MochiKit.Logging.logDebug("====> " + i);
311//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 > i = " + i + ": " + res); return res;});
312 deferredResult.addMethod(this, "addTwice"); 276 deferredResult.addMethod(this, "addTwice");
313 //# result = this.add(result, result); 277 //# result = this.add(result, result);
314 // this.overwriteAdd(result, result); 278 // this.overwriteAdd(result, result);
315 if (k.isBitSet(i)) { 279 if (k.isBitSet(i)) {
316 deferredResult.addMethod(this, "add", Q); 280 deferredResult.addMethod(this, "add", Q);
317 //# result = this.add(result, Q); 281 //# result = this.add(result, Q);
318 // this.overwriteAdd(result, Q); 282 // this.overwriteAdd(result, Q);
319 } 283 }
320 if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);} 284 if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);}
321
322 // if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
323//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 < i = " + i + ": " + res); return res;});
324 } 285 }
325//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4: " + res); return res;});
326 } 286 }
327//#console.profileEnd(); 287//#console.profileEnd();
328//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 5: " + res); return res;});
329//deferredResult.addBoth(function(res) {console.profileEnd(); return res;}); 288//deferredResult.addBoth(function(res) {console.profileEnd(); return res;});
330//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 6: " + res); return res;});
331 deferredResult.callback(result); 289 deferredResult.callback(result);
332 290
333 //# return result; 291 //# return result;
334 return deferredResult; 292 return deferredResult;
335 }, 293 },
336 294
337 //----------------------------------------------------------------------------- 295 //-----------------------------------------------------------------------------
338 __syntaxFix__: "syntax fix" 296 __syntaxFix__: "syntax fix"
339}); 297});
340 298
341 299
342//############################################################################# 300//#############################################################################
343 301
344Clipperz.Crypto.ECC.StandardCurves = {}; 302Clipperz.Crypto.ECC.StandardCurves = {};
345 303
346MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, { 304MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
347/* 305/*
348 '_K571': null, 306 '_K571': null,
349 'K571': function() { 307 'K571': function() {
350 if (Clipperz.Crypto.ECC.StandardCurves._K571 == null) { 308 if (Clipperz.Crypto.ECC.StandardCurves._K571 == null) {
351 Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.BinaryField.Curve({ 309 Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
352 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), 310 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),
353 a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16), 311 a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16),
354 b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), 312 b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
@@ -420,128 +378,123 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
420 // ------------------------------------------------------------------------- 378 // -------------------------------------------------------------------------
421 // 379 //
422 // Input: Polynomial p(x) of degree 1140 or less, stored as 380 // Input: Polynomial p(x) of degree 1140 or less, stored as
423 // an array of 2T machinewords. 381 // an array of 2T machinewords.
424 // Output: p(x) mod f571(x) 382 // Output: p(x) mod f571(x)
425 // 383 //
426 // FOR i = T-1, ..., 0 DO 384 // FOR i = T-1, ..., 0 DO
427 // SET X := P[i+T] 385 // SET X := P[i+T]
428 // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15) 386 // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15)
429 // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27) 387 // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27)
430 // 388 //
431 // SET X := P[T-1] >> 27 389 // SET X := P[T-1] >> 27
432 // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10) 390 // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10)
433 // P[T-1] := P[T-1] & 0x07ffffff 391 // P[T-1] := P[T-1] & 0x07ffffff
434 // 392 //
435 // RETURN P[T-1],...,P[0] 393 // RETURN P[T-1],...,P[0]
436 // 394 //
437 // ------------------------------------------------------------------------- 395 // -------------------------------------------------------------------------
438 // 396 //
439 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module; 397 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module;
440 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) { 398 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) {
441 varresult; 399 varresult;
442 400
443 if (aValue.bitSize() > 1140) { 401 if (aValue.bitSize() > 1140) {
444 MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); 402 Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
445 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); 403 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
446 } else { 404 } else {
447 varC, T; 405 varC, T;
448 var i; 406 var i;
449 407
450//console.log(">>> binaryField.finiteField.(improved)module");
451 // C = aValue.value().slice(0);
452 C = aValue._value.slice(0); 408 C = aValue._value.slice(0);
453 for (i=35; i>=18; i--) { 409 for (i=35; i>=18; i--) {
454 T = C[i]; 410 T = C[i];
455 C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0); 411 C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0);
456 C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0); 412 C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0);
457 } 413 }
458 T = (C[17] >>> 27); 414 T = (C[17] >>> 27);
459 C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0); 415 C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0);
460 C[17] = (C[17] & 0x07ffffff); 416 C[17] = (C[17] & 0x07ffffff);
461 417
462 for(i=18; i<=35; i++) { 418 for(i=18; i<=35; i++) {
463 C[i] = 0; 419 C[i] = 0;
464 } 420 }
465 421
466 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 422 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
467//console.log("<<< binaryField.finiteField.(improved)module");
468 } 423 }
469 424
470 return result; 425 return result;
471 }; 426 };
472 } 427 }
473 428
474 return Clipperz.Crypto.ECC.StandardCurves._B571; 429 return Clipperz.Crypto.ECC.StandardCurves._B571;
475 }, 430 },
476 431
477 //----------------------------------------------------------------------------- 432 //-----------------------------------------------------------------------------
478 433
479 '_B283': null, 434 '_B283': null,
480 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 435 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1
481 if (Clipperz.Crypto.ECC.StandardCurves._B283 == null) { 436 if (Clipperz.Crypto.ECC.StandardCurves._B283 == null) {
482 Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({ 437 Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
483 // modulus: new Clipperz.Crypto.ECC.BinaryField.Value('10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), 438 // modulus: new Clipperz.Crypto.ECC.BinaryField.Value('10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
484 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), 439 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
485 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), 440 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
486 b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16), 441 b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16),
487 G: new Clipperz.Crypto.ECC.BinaryField.Point({ 442 G: new Clipperz.Crypto.ECC.BinaryField.Point({
488 x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16), 443 x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16),
489 y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16) 444 y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16)
490 }), 445 }),
491 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16), 446 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16),
492 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) 447 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
493 448
494 // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10), 449 // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
495 // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16) 450 // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
496 }); 451 });
497 452
498 //----------------------------------------------------------------------------- 453 //-----------------------------------------------------------------------------
499 // 454 //
500 //Guide to Elliptic Curve Cryptography 455 //Guide to Elliptic Curve Cryptography
501 //Darrel Hankerson, Alfred Menezes, Scott Vanstone 456 //Darrel Hankerson, Alfred Menezes, Scott Vanstone
502 //- Pag: 56, Alorithm 2.43 457 //- Pag: 56, Alorithm 2.43
503 // 458 //
504 //----------------------------------------------------------------------------- 459 //-----------------------------------------------------------------------------
505 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module; 460 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module;
506 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) { 461 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) {
507 varresult; 462 varresult;
508 463
509 if (aValue.bitSize() > 564) { 464 if (aValue.bitSize() > 564) {
510 MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); 465 Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
511 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); 466 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
512 } else { 467 } else {
513 varC, T; 468 varC, T;
514 var i; 469 var i;
515 470
516//console.log(">>> binaryField.finiteField.(improved)module");
517 C = aValue._value.slice(0); 471 C = aValue._value.slice(0);
518 for (i=17; i>=9; i--) { 472 for (i=17; i>=9; i--) {
519 T = C[i]; 473 T = C[i];
520 C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0); 474 C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0);
521 C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0); 475 C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0);
522 } 476 }
523 T = (C[8] >>> 27); 477 T = (C[8] >>> 27);
524 C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0); 478 C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0);
525 C[8] = (C[8] & 0x07ffffff); 479 C[8] = (C[8] & 0x07ffffff);
526 480
527 for(i=9; i<=17; i++) { 481 for(i=9; i<=17; i++) {
528 C[i] = 0; 482 C[i] = 0;
529 } 483 }
530 484
531 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 485 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
532//console.log("<<< binaryField.finiteField.(improved)module");
533 } 486 }
534 487
535 return result; 488 return result;
536 }; 489 };
537 } 490 }
538 491
539 return Clipperz.Crypto.ECC.StandardCurves._B283; 492 return Clipperz.Crypto.ECC.StandardCurves._B283;
540 }, 493 },
541 494
542 //----------------------------------------------------------------------------- 495 //-----------------------------------------------------------------------------
543 __syntaxFix__: "syntax fix" 496 __syntaxFix__: "syntax fix"
544}); 497});
545 498
546//############################################################################# 499//#############################################################################
547 500
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js
index 56f257a..7b7c2c6 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js
@@ -1,102 +1,98 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; 25 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
28//} 26//}
29if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } 27if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
30if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } 28if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
31 29
32Clipperz.Crypto.ECC.BinaryField.FiniteField = function(args) { 30Clipperz.Crypto.ECC.BinaryField.FiniteField = function(args) {
33 args = args || {}; 31 args = args || {};
34 this._modulus = args.modulus; 32 this._modulus = args.modulus;
35 33
36 return this; 34 return this;
37} 35}
38 36
39Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(null, { 37Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(null, {
40 38
41 'asString': function() { 39 'asString': function() {
42 return "Clipperz.Crypto.ECC.BinaryField.FiniteField (" + this.modulus().asString() + ")"; 40 return "Clipperz.Crypto.ECC.BinaryField.FiniteField (" + this.modulus().asString() + ")";
43 }, 41 },
44 42
45 //----------------------------------------------------------------------------- 43 //-----------------------------------------------------------------------------
46 44
47 'modulus': function() { 45 'modulus': function() {
48 return this._modulus; 46 return this._modulus;
49 }, 47 },
50 48
51 //----------------------------------------------------------------------------- 49 //-----------------------------------------------------------------------------
52 50
53 '_module': function(aValue) { 51 '_module': function(aValue) {
54 varresult; 52 varresult;
55 var modulusComparison; 53 var modulusComparison;
56//console.log(">>> binaryField.finiteField.(standard)module");
57 54
58 modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value); 55 modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value);
59 56
60 if (modulusComparison < 0) { 57 if (modulusComparison < 0) {
61 result = aValue; 58 result = aValue;
62 } else if (modulusComparison == 0) { 59 } else if (modulusComparison == 0) {
63 result = [0]; 60 result = [0];
64 } else { 61 } else {
65 var modulusBitSize; 62 var modulusBitSize;
66 var resultBitSize; 63 var resultBitSize;
67 64
68 result = aValue; 65 result = aValue;
69 66
70 modulusBitSize = this.modulus().bitSize(); 67 modulusBitSize = this.modulus().bitSize();
71 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); 68 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
72 while (resultBitSize >= modulusBitSize) { 69 while (resultBitSize >= modulusBitSize) {
73 Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this.modulus()._value, resultBitSize - modulusBitSize)); 70 Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this.modulus()._value, resultBitSize - modulusBitSize));
74 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); 71 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
75 } 72 }
76 } 73 }
77//console.log("<<< binaryField.finiteField.(standard)module"); 74
78
79 return result; 75 return result;
80 }, 76 },
81 77
82 'module': function(aValue) { 78 'module': function(aValue) {
83 return new Clipperz.Crypto.ECC.BinaryField.Value(this._module(aValue._value.slice(0))); 79 return new Clipperz.Crypto.ECC.BinaryField.Value(this._module(aValue._value.slice(0)));
84 }, 80 },
85 81
86 //----------------------------------------------------------------------------- 82 //-----------------------------------------------------------------------------
87 83
88 '_add': function(a, b) { 84 '_add': function(a, b) {
89 return Clipperz.Crypto.ECC.BinaryField.Value._xor(a, b); 85 return Clipperz.Crypto.ECC.BinaryField.Value._xor(a, b);
90 }, 86 },
91 87
92 '_overwriteAdd': function(a, b) { 88 '_overwriteAdd': function(a, b) {
93 Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(a, b); 89 Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(a, b);
94 }, 90 },
95 91
96 'add': function(a, b) { 92 'add': function(a, b) {
97 return new Clipperz.Crypto.ECC.BinaryField.Value(this._add(a._value, b._value)); 93 return new Clipperz.Crypto.ECC.BinaryField.Value(this._add(a._value, b._value));
98 }, 94 },
99 95
100 //----------------------------------------------------------------------------- 96 //-----------------------------------------------------------------------------
101 97
102 'negate': function(aValue) { 98 'negate': function(aValue) {
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js
index ffe287b..fef3220 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; 25 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
28//} 26//}
29if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } 27if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
30if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } 28if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
31 29
32Clipperz.Crypto.ECC.BinaryField.Point = function(args) { 30Clipperz.Crypto.ECC.BinaryField.Point = function(args) {
33 args = args || {}; 31 args = args || {};
34 this._x = args.x; 32 this._x = args.x;
35 this._y = args.y; 33 this._y = args.y;
36 34
37 return this; 35 return this;
38} 36}
39 37
40Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, { 38Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, {
41 39
42 'asString': function() { 40 'asString': function() {
43 return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")"; 41 return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")";
44 }, 42 },
45 43
46 //----------------------------------------------------------------------------- 44 //-----------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js
index b705a20..634772a 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!"; 25 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
28//} 26//}
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 27if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } 28if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
31if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } 29if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
32if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } 30if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
33 31
34Clipperz.Crypto.ECC.BinaryField.Value = function(aValue, aBase, aBitSize) { 32Clipperz.Crypto.ECC.BinaryField.Value = function(aValue, aBase, aBitSize) {
35 if (aValue.constructor == String) { 33 if (aValue.constructor == String) {
36 varvalue; 34 varvalue;
37 varstringLength; 35 varstringLength;
38 var numberOfWords; 36 var numberOfWords;
39 vari,c; 37 vari,c;
40 38
41 if (aBase != 16) { 39 if (aBase != 16) {
42 throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase; 40 throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase;
43 } 41 }
44 42
45 value = aValue.replace(/ /g, ''); 43 value = aValue.replace(/ /g, '');
46 stringLength = value.length; 44 stringLength = value.length;
@@ -347,37 +345,35 @@ Clipperz.Crypto.ECC.BinaryField.Value._isBitSet = function(aWordArray, aBitPosit
347 var result; 345 var result;
348 varbyteIndex; 346 varbyteIndex;
349 var bitIndexInSelectedByte; 347 var bitIndexInSelectedByte;
350 348
351 byteIndex = Math.floor(aBitPosition / 32); 349 byteIndex = Math.floor(aBitPosition / 32);
352 bitIndexInSelectedByte = aBitPosition % 32; 350 bitIndexInSelectedByte = aBitPosition % 32;
353 351
354 if (byteIndex <= aWordArray.length) { 352 if (byteIndex <= aWordArray.length) {
355 result = ((aWordArray[byteIndex] & (1 << bitIndexInSelectedByte)) != 0); 353 result = ((aWordArray[byteIndex] & (1 << bitIndexInSelectedByte)) != 0);
356 } else { 354 } else {
357 result = false; 355 result = false;
358 } 356 }
359 357
360 return result; 358 return result;
361}; 359};
362 360
363Clipperz.Crypto.ECC.BinaryField.Value._compare = function(a,b) { 361Clipperz.Crypto.ECC.BinaryField.Value._compare = function(a,b) {
364 varresult; 362 varresult;
365 var i,c; 363 var i,c;
366 364
367 result = MochiKit.Base.compare(a.length, b.length); 365 result = MochiKit.Base.compare(a.length, b.length);
368 366
369 c = a.length; 367 c = a.length;
370 for (i=0; (i<c) && (result==0); i++) { 368 for (i=0; (i<c) && (result==0); i++) {
371//console.log("compare[" + c + " - " + i + " - 1] " + this.value()[c-i-1] + ", " + aValue.value()[c-i-1]);
372 // result = MochiKit.Base.compare(this.value()[c-i-1], aValue.value()[c-i-1]);
373 result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]); 369 result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]);
374 } 370 }
375 371
376 return result; 372 return result;
377}; 373};
378 374
379 375
380Clipperz.Crypto.ECC.BinaryField.Value['exception']= { 376Clipperz.Crypto.ECC.BinaryField.Value['exception']= {
381 'UnsupportedBase': new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase"), 377 'UnsupportedBase': new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase"),
382 'UnsupportedConstructorValueType':new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType") 378 'UnsupportedConstructorValueType':new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType")
383}; 379};
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
index be197e3..239e264 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//try { if (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) == 'undefined') { throw ""; }} catch (e) { 24//try { if (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) == 'undefined') { throw ""; }} catch (e) {
27 //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.BinaryField.Curve!"; 25 //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.BinaryField.Curve!";
28//} 26//}
29//try { if (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) == 'undefined') { throw ""; }} catch (e) { 27//try { if (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) == 'undefined') { throw ""; }} catch (e) {
30 //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.Koblitz.Curve!"; 28 //throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.Koblitz.Curve!";
31//} 29//}
32 30
33Clipperz.Crypto.ECC.StandardCurves = {}; 31Clipperz.Crypto.ECC.StandardCurves = {};
34 32
35MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, { 33MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
36 34
37 //============================================================================== 35 //==============================================================================
38 36
39 '_K571': null, 37 '_K571': null,
40 'K571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1 38 'K571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1
41 if ((Clipperz.Crypto.ECC.StandardCurves._K571 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) { 39 if ((Clipperz.Crypto.ECC.StandardCurves._K571 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) {
42 Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.Koblitz.Curve({ 40 Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.Koblitz.Curve({
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), 41 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),
44 a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16), 42 a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16),
45 b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16), 43 b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16),
46 G: new Clipperz.Crypto.ECC.Koblitz.Point({ 44 G: new Clipperz.Crypto.ECC.Koblitz.Point({
@@ -113,124 +111,119 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
113 // ------------------------------------------------------------------------- 111 // -------------------------------------------------------------------------
114 // 112 //
115 // Input: Polynomial p(x) of degree 1140 or less, stored as 113 // Input: Polynomial p(x) of degree 1140 or less, stored as
116 // an array of 2T machinewords. 114 // an array of 2T machinewords.
117 // Output: p(x) mod f571(x) 115 // Output: p(x) mod f571(x)
118 // 116 //
119 // FOR i = T-1, ..., 0 DO 117 // FOR i = T-1, ..., 0 DO
120 // SET X := P[i+T] 118 // SET X := P[i+T]
121 // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15) 119 // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15)
122 // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27) 120 // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27)
123 // 121 //
124 // SET X := P[T-1] >> 27 122 // SET X := P[T-1] >> 27
125 // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10) 123 // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10)
126 // P[T-1] := P[T-1] & 0x07ffffff 124 // P[T-1] := P[T-1] & 0x07ffffff
127 // 125 //
128 // RETURN P[T-1],...,P[0] 126 // RETURN P[T-1],...,P[0]
129 // 127 //
130 // ------------------------------------------------------------------------- 128 // -------------------------------------------------------------------------
131 // 129 //
132 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module; 130 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module;
133 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) { 131 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) {
134 varresult; 132 varresult;
135 133
136 if (aValue.bitSize() > 1140) { 134 if (aValue.bitSize() > 1140) {
137 MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); 135 Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
138 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); 136 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
139 } else { 137 } else {
140 varC, T; 138 varC, T;
141 var i; 139 var i;
142 140
143//console.log(">>> binaryField.finiteField.(improved)module");
144 // C = aValue.value().slice(0);
145 C = aValue._value.slice(0); 141 C = aValue._value.slice(0);
146 for (i=35; i>=18; i--) { 142 for (i=35; i>=18; i--) {
147 T = C[i]; 143 T = C[i];
148 C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0); 144 C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0);
149 C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0); 145 C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0);
150 } 146 }
151 T = (C[17] >>> 27); 147 T = (C[17] >>> 27);
152 C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0); 148 C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0);
153 C[17] = (C[17] & 0x07ffffff); 149 C[17] = (C[17] & 0x07ffffff);
154 150
155 for(i=18; i<=35; i++) { 151 for(i=18; i<=35; i++) {
156 C[i] = 0; 152 C[i] = 0;
157 } 153 }
158 154
159 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 155 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
160//console.log("<<< binaryField.finiteField.(improved)module");
161 } 156 }
162 157
163 return result; 158 return result;
164 }; 159 };
165 } 160 }
166 161
167 return Clipperz.Crypto.ECC.StandardCurves._B571; 162 return Clipperz.Crypto.ECC.StandardCurves._B571;
168 }, 163 },
169 164
170 //----------------------------------------------------------------------------- 165 //-----------------------------------------------------------------------------
171 166
172 '_B283': null, 167 '_B283': null,
173 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1 168 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1
174 if ((Clipperz.Crypto.ECC.StandardCurves._B283 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) { 169 if ((Clipperz.Crypto.ECC.StandardCurves._B283 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) {
175 Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({ 170 Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
176 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16), 171 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
177 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16), 172 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
178 b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16), 173 b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16),
179 G: new Clipperz.Crypto.ECC.BinaryField.Point({ 174 G: new Clipperz.Crypto.ECC.BinaryField.Point({
180 x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16), 175 x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16),
181 y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16) 176 y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16)
182 }), 177 }),
183 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16), 178 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16),
184 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16) 179 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
185 }); 180 });
186 181
187 //----------------------------------------------------------------------------- 182 //-----------------------------------------------------------------------------
188 // 183 //
189 //Guide to Elliptic Curve Cryptography 184 //Guide to Elliptic Curve Cryptography
190 //Darrel Hankerson, Alfred Menezes, Scott Vanstone 185 //Darrel Hankerson, Alfred Menezes, Scott Vanstone
191 //- Pag: 56, Alorithm 2.43 186 //- Pag: 56, Alorithm 2.43
192 // 187 //
193 //----------------------------------------------------------------------------- 188 //-----------------------------------------------------------------------------
194 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module; 189 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module;
195 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) { 190 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) {
196 varresult; 191 varresult;
197 192
198 if (aValue.bitSize() > 564) { 193 if (aValue.bitSize() > 564) {
199 MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); 194 Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
200 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); 195 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
201 } else { 196 } else {
202 varC, T; 197 varC, T;
203 var i; 198 var i;
204 199
205//console.log(">>> binaryField.finiteField.(improved)module");
206 C = aValue._value.slice(0); 200 C = aValue._value.slice(0);
207 for (i=17; i>=9; i--) { 201 for (i=17; i>=9; i--) {
208 T = C[i]; 202 T = C[i];
209 C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0); 203 C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0);
210 C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0); 204 C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0);
211 } 205 }
212 T = (C[8] >>> 27); 206 T = (C[8] >>> 27);
213 C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0); 207 C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0);
214 C[8] = (C[8] & 0x07ffffff); 208 C[8] = (C[8] & 0x07ffffff);
215 209
216 for(i=9; i<=17; i++) { 210 for(i=9; i<=17; i++) {
217 C[i] = 0; 211 C[i] = 0;
218 } 212 }
219 213
220 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 214 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
221//console.log("<<< binaryField.finiteField.(improved)module");
222 } 215 }
223 216
224 return result; 217 return result;
225 }; 218 };
226 } 219 }
227 220
228 return Clipperz.Crypto.ECC.StandardCurves._B283; 221 return Clipperz.Crypto.ECC.StandardCurves._B283;
229 }, 222 },
230 223
231 //============================================================================== 224 //==============================================================================
232 __syntaxFix__: "syntax fix" 225 __syntaxFix__: "syntax fix"
233}); 226});
234 227
235 228
236 229
diff --git a/frontend/gamma/js/Clipperz/Crypto/PRNG.js b/frontend/gamma/js/Clipperz/Crypto/PRNG.js
index adfdb16..c539f06 100644
--- a/frontend/gamma/js/Clipperz/Crypto/PRNG.js
+++ b/frontend/gamma/js/Clipperz/Crypto/PRNG.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; 25 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
28} 26}
29 27
30try { if (typeof(Clipperz.Crypto.SHA) == 'undefined') { throw ""; }} catch (e) { 28try { if (typeof(Clipperz.Crypto.SHA) == 'undefined') { throw ""; }} catch (e) {
31 throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.SHA!"; 29 throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.SHA!";
32} 30}
33 31
34try { if (typeof(Clipperz.Crypto.AES) == 'undefined') { throw ""; }} catch (e) { 32try { if (typeof(Clipperz.Crypto.AES) == 'undefined') { throw ""; }} catch (e) {
35 throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.AES!"; 33 throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.AES!";
36} 34}
37 35
38if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { Clipperz.Crypto.PRNG = {}; } 36if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { Clipperz.Crypto.PRNG = {}; }
39 37
40//############################################################################# 38//#############################################################################
41 39
42Clipperz.Crypto.PRNG.EntropyAccumulator = function(args) { 40Clipperz.Crypto.PRNG.EntropyAccumulator = function(args) {
43 args = args || {}; 41 args = args || {};
44 //MochiKit.Base.bindMethods(this); 42 //MochiKit.Base.bindMethods(this);
45 43
46 this._stack = new Clipperz.ByteArray(); 44 this._stack = new Clipperz.ByteArray();
@@ -468,49 +466,48 @@ Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, {
468 var i, c; 466 var i, c;
469 467
470 newKeySeed = this.key(); 468 newKeySeed = this.key();
471 this.incrementReseedCounter(); 469 this.incrementReseedCounter();
472 reseedCounter = this.reseedCounter(); 470 reseedCounter = this.reseedCounter();
473 471
474 c = this.numberOfEntropyAccumulators(); 472 c = this.numberOfEntropyAccumulators();
475 reseedCounterMask = 0xffffffff >>> (32 - c); 473 reseedCounterMask = 0xffffffff >>> (32 - c);
476 for (i=0; i<c; i++) { 474 for (i=0; i<c; i++) {
477 if ((i == 0) || ((reseedCounter & (reseedCounterMask >>> (c - i))) == 0)) { 475 if ((i == 0) || ((reseedCounter & (reseedCounterMask >>> (c - i))) == 0)) {
478 newKeySeed.appendBlock(this.accumulators()[i].stack()); 476 newKeySeed.appendBlock(this.accumulators()[i].stack());
479 this.accumulators()[i].resetStack(); 477 this.accumulators()[i].resetStack();
480 } 478 }
481 } 479 }
482 480
483 if (reseedCounter == 1) { 481 if (reseedCounter == 1) {
484 c = this.randomnessSources().length; 482 c = this.randomnessSources().length;
485 for (i=0; i<c; i++) { 483 for (i=0; i<c; i++) {
486 this.randomnessSources()[i].setBoostMode(false); 484 this.randomnessSources()[i].setBoostMode(false);
487 } 485 }
488 } 486 }
489 487
490 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed)); 488 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed));
491 if (reseedCounter == 1) { 489 if (reseedCounter == 1) {
492//MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes");
493Clipperz.log("### PRNG.readyToGenerateRandomBytes"); 490Clipperz.log("### PRNG.readyToGenerateRandomBytes");
494 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes'); 491 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes');
495 } 492 }
496 MochiKit.Signal.signal(this, 'reseeded'); 493 MochiKit.Signal.signal(this, 'reseeded');
497 }, 494 },
498 495
499 //------------------------------------------------------------------------- 496 //-------------------------------------------------------------------------
500 497
501 'isReadyToGenerateRandomValues': function() { 498 'isReadyToGenerateRandomValues': function() {
502 return this.reseedCounter() != 0; 499 return this.reseedCounter() != 0;
503 }, 500 },
504 501
505 //------------------------------------------------------------------------- 502 //-------------------------------------------------------------------------
506 503
507 'entropyLevel': function() { 504 'entropyLevel': function() {
508 return this.accumulators()[0].stack().length() + (this.reseedCounter() * this.firstPoolReseedLevel()); 505 return this.accumulators()[0].stack().length() + (this.reseedCounter() * this.firstPoolReseedLevel());
509 }, 506 },
510 507
511 //------------------------------------------------------------------------- 508 //-------------------------------------------------------------------------
512 509
513 'counter': function() { 510 'counter': function() {
514 return this._counter; 511 return this._counter;
515 }, 512 },
516 513
@@ -539,49 +536,49 @@ Clipperz.log("### PRNG.readyToGenerateRandomBytes");
539 536
540 //------------------------------------------------------------------------- 537 //-------------------------------------------------------------------------
541 538
542 'getRandomBytes': function(aSize) { 539 'getRandomBytes': function(aSize) {
543 var result; 540 var result;
544 541
545 if (this.isReadyToGenerateRandomValues()) { 542 if (this.isReadyToGenerateRandomValues()) {
546 var i,c; 543 var i,c;
547 var newKey; 544 var newKey;
548 545
549 result = new Clipperz.ByteArray(); 546 result = new Clipperz.ByteArray();
550 547
551 c = Math.ceil(aSize / (128 / 8)); 548 c = Math.ceil(aSize / (128 / 8));
552 for (i=0; i<c; i++) { 549 for (i=0; i<c; i++) {
553 result.appendBlock(this.getRandomBlock()); 550 result.appendBlock(this.getRandomBlock());
554 } 551 }
555 552
556 if (result.length() != aSize) { 553 if (result.length() != aSize) {
557 result = result.split(0, aSize); 554 result = result.split(0, aSize);
558 } 555 }
559 556
560 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock()); 557 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock());
561 this.setKey(newKey); 558 this.setKey(newKey);
562 } else { 559 } else {
563MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!"); 560Clipperz.logWarning("Fortuna generator has not enough entropy, yet!");
564 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy; 561 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy;
565 } 562 }
566 563
567 return result; 564 return result;
568 }, 565 },
569 566
570 //------------------------------------------------------------------------- 567 //-------------------------------------------------------------------------
571 568
572 'addRandomByte': function(aSourceId, aPoolId, aRandomValue) { 569 'addRandomByte': function(aSourceId, aPoolId, aRandomValue) {
573 varselectedAccumulator; 570 varselectedAccumulator;
574 571
575 selectedAccumulator = this.accumulators()[aPoolId]; 572 selectedAccumulator = this.accumulators()[aPoolId];
576 selectedAccumulator.addRandomByte(aRandomValue); 573 selectedAccumulator.addRandomByte(aRandomValue);
577 574
578 if (aPoolId == 0) { 575 if (aPoolId == 0) {
579 MochiKit.Signal.signal(this, 'addedRandomByte') 576 MochiKit.Signal.signal(this, 'addedRandomByte')
580 if (selectedAccumulator.stack().length() > this.firstPoolReseedLevel()) { 577 if (selectedAccumulator.stack().length() > this.firstPoolReseedLevel()) {
581 this.reseed(); 578 this.reseed();
582 } 579 }
583 } 580 }
584 }, 581 },
585 582
586 //------------------------------------------------------------------------- 583 //-------------------------------------------------------------------------
587 584
@@ -589,71 +586,63 @@ MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
589 return this._numberOfEntropyAccumulators; 586 return this._numberOfEntropyAccumulators;
590 }, 587 },
591 588
592 //------------------------------------------------------------------------- 589 //-------------------------------------------------------------------------
593 590
594 'randomnessSources': function() { 591 'randomnessSources': function() {
595 return this._randomnessSources; 592 return this._randomnessSources;
596 }, 593 },
597 594
598 'addRandomnessSource': function(aRandomnessSource) { 595 'addRandomnessSource': function(aRandomnessSource) {
599 aRandomnessSource.setGenerator(this); 596 aRandomnessSource.setGenerator(this);
600 aRandomnessSource.setSourceId(this.randomnessSources().length); 597 aRandomnessSource.setSourceId(this.randomnessSources().length);
601 this.randomnessSources().push(aRandomnessSource); 598 this.randomnessSources().push(aRandomnessSource);
602 599
603 if (this.isReadyToGenerateRandomValues() == false) { 600 if (this.isReadyToGenerateRandomValues() == false) {
604 aRandomnessSource.setBoostMode(true); 601 aRandomnessSource.setBoostMode(true);
605 } 602 }
606 }, 603 },
607 604
608 //------------------------------------------------------------------------- 605 //-------------------------------------------------------------------------
609 606
610 'deferredEntropyCollection': function(aValue) { 607 'deferredEntropyCollection': function(aValue) {
611 var result; 608 var result;
612 609
613//MochiKit.Logging.logDebug(">>> PRNG.deferredEntropyCollection");
614 610
615 if (this.isReadyToGenerateRandomValues()) { 611 if (this.isReadyToGenerateRandomValues()) {
616//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 1");
617 result = aValue; 612 result = aValue;
618 } else { 613 } else {
619//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 2");
620 var deferredResult; 614 var deferredResult;
621 615
622 // Clipperz.NotificationCenter.notify(this, 'updatedProgressState', 'collectingEntropy', true);
623
624 deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection"); 616 deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection");
625 // deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.1 - PRNG.deferredEntropyCollection - 1: " + res); return res;});
626 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue)); 617 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue));
627 // deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.2 - PRNG.deferredEntropyCollection - 2: " + res); return res;});
628 MochiKit.Signal.connect(this, 618 MochiKit.Signal.connect(this,
629 'readyToGenerateRandomBytes', 619 'readyToGenerateRandomBytes',
630 deferredResult, 620 deferredResult,
631 'callback'); 621 'callback');
632 622
633 result = deferredResult; 623 result = deferredResult;
634 } 624 }
635//MochiKit.Logging.logDebug("<<< PRNG.deferredEntropyCollection - result: " + result);
636 625
637 return result; 626 return result;
638 }, 627 },
639 628
640 //------------------------------------------------------------------------- 629 //-------------------------------------------------------------------------
641 630
642 'fastEntropyAccumulationForTestingPurpose': function() { 631 'fastEntropyAccumulationForTestingPurpose': function() {
643 while (! this.isReadyToGenerateRandomValues()) { 632 while (! this.isReadyToGenerateRandomValues()) {
644 this.addRandomByte(Math.floor(Math.random() * 32), Math.floor(Math.random() * 32), Math.floor(Math.random() * 256)); 633 this.addRandomByte(Math.floor(Math.random() * 32), Math.floor(Math.random() * 32), Math.floor(Math.random() * 256));
645 } 634 }
646 }, 635 },
647 636
648 //------------------------------------------------------------------------- 637 //-------------------------------------------------------------------------
649 638
650 'dump': function(appendToDoc) { 639 'dump': function(appendToDoc) {
651 var tbl; 640 var tbl;
652 var i,c; 641 var i,c;
653 642
654 tbl = document.createElement("table"); 643 tbl = document.createElement("table");
655 tbl.border = 0; 644 tbl.border = 0;
656 with (tbl.style) { 645 with (tbl.style) {
657 border = "1px solid lightgrey"; 646 border = "1px solid lightgrey";
658 fontFamily = 'Helvetica, Arial, sans-serif'; 647 fontFamily = 'Helvetica, Arial, sans-serif';
659 fontSize = '8pt'; 648 fontSize = '8pt';
diff --git a/frontend/gamma/js/Clipperz/Crypto/RSA.js b/frontend/gamma/js/Clipperz/Crypto/RSA.js
index 6844dba..5a480f1 100644
--- a/frontend/gamma/js/Clipperz/Crypto/RSA.js
+++ b/frontend/gamma/js/Clipperz/Crypto/RSA.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.RSA depends on Clipperz.Crypto.BigInt!"; 25 throw "Clipperz.Crypto.RSA depends on Clipperz.Crypto.BigInt!";
28} 26}
29 27
30if (typeof(Clipperz.Crypto.RSA) == 'undefined') { Clipperz.Crypto.RSA = {}; } 28if (typeof(Clipperz.Crypto.RSA) == 'undefined') { Clipperz.Crypto.RSA = {}; }
31 29
32Clipperz.Crypto.RSA.VERSION = "0.1"; 30Clipperz.Crypto.RSA.VERSION = "0.1";
33Clipperz.Crypto.RSA.NAME = "Clipperz.RSA"; 31Clipperz.Crypto.RSA.NAME = "Clipperz.RSA";
34 32
35//############################################################################# 33//#############################################################################
36 34
37MochiKit.Base.update(Clipperz.Crypto.RSA, { 35MochiKit.Base.update(Clipperz.Crypto.RSA, {
38 36
39 //------------------------------------------------------------------------- 37 //-------------------------------------------------------------------------
40 38
41 'publicKeyWithValues': function (e, d, n) { 39 'publicKeyWithValues': function (e, d, n) {
42 varresult; 40 varresult;
43 41
44 result = {}; 42 result = {};
45 43
46 if (e.isBigInt) { 44 if (e.isBigInt) {
diff --git a/frontend/gamma/js/Clipperz/Crypto/SHA.js b/frontend/gamma/js/Clipperz/Crypto/SHA.js
index b07fa85..f8bfe6e 100644
--- a/frontend/gamma/js/Clipperz/Crypto/SHA.js
+++ b/frontend/gamma/js/Clipperz/Crypto/SHA.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; 25 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
28} 26}
29 27
30if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; } 28if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
31if (typeof(Clipperz.Crypto.SHA) == 'undefined') { Clipperz.Crypto.SHA = {}; } 29if (typeof(Clipperz.Crypto.SHA) == 'undefined') { Clipperz.Crypto.SHA = {}; }
32 30
33Clipperz.Crypto.SHA.VERSION = "0.3"; 31Clipperz.Crypto.SHA.VERSION = "0.3";
34Clipperz.Crypto.SHA.NAME = "Clipperz.Crypto.SHA"; 32Clipperz.Crypto.SHA.NAME = "Clipperz.Crypto.SHA";
35 33
36MochiKit.Base.update(Clipperz.Crypto.SHA, { 34MochiKit.Base.update(Clipperz.Crypto.SHA, {
37 35
38 '__repr__': function () { 36 '__repr__': function () {
39 return "[" + this.NAME + " " + this.VERSION + "]"; 37 return "[" + this.NAME + " " + this.VERSION + "]";
40 }, 38 },
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //----------------------------------------------------------------------------- 44 //-----------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/Crypto/SRP.js b/frontend/gamma/js/Clipperz/Crypto/SRP.js
index 3b25275..597e72d 100644
--- a/frontend/gamma/js/Clipperz/Crypto/SRP.js
+++ b/frontend/gamma/js/Clipperz/Crypto/SRP.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!"; 25 throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
28} 26}
29 27
30try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) { 28try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) {
31 throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.BigInt!"; 29 throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.BigInt!";
32} 30}
33 31
34try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) { 32try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) {
35 throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.PRNG!"; 33 throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.PRNG!";
36} 34}
37 35
38if (typeof(Clipperz.Crypto.SRP) == 'undefined') { Clipperz.Crypto.SRP = {}; } 36if (typeof(Clipperz.Crypto.SRP) == 'undefined') { Clipperz.Crypto.SRP = {}; }
39 37
40Clipperz.Crypto.SRP.VERSION = "0.1"; 38Clipperz.Crypto.SRP.VERSION = "0.1";
41Clipperz.Crypto.SRP.NAME = "Clipperz.Crypto.SRP"; 39Clipperz.Crypto.SRP.NAME = "Clipperz.Crypto.SRP";
42 40
43//############################################################################# 41//#############################################################################
44 42
45MochiKit.Base.update(Clipperz.Crypto.SRP, { 43MochiKit.Base.update(Clipperz.Crypto.SRP, {
46 44
@@ -110,170 +108,160 @@ Clipperz.Crypto.SRP.Connection = function (args) {
110Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, { 108Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
111 109
112 'toString': function () { 110 'toString': function () {
113 return "Clipperz.Crypto.SRP.Connection (username: " + this.username() + "). Status: " + this.statusDescription(); 111 return "Clipperz.Crypto.SRP.Connection (username: " + this.username() + "). Status: " + this.statusDescription();
114 }, 112 },
115 113
116 //------------------------------------------------------------------------- 114 //-------------------------------------------------------------------------
117 115
118 'C': function () { 116 'C': function () {
119 return this._C; 117 return this._C;
120 }, 118 },
121 119
122 //------------------------------------------------------------------------- 120 //-------------------------------------------------------------------------
123 121
124 'P': function () { 122 'P': function () {
125 return this._P; 123 return this._P;
126 }, 124 },
127 125
128 //------------------------------------------------------------------------- 126 //-------------------------------------------------------------------------
129 127
130 'a': function () { 128 'a': function () {
131 if (this._a == null) { 129 if (this._a == null) {
132 this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16); 130 this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16);
133 // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10); 131 // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10);
134//MochiKit.Logging.logDebug("SRP a: " + this._a);
135 } 132 }
136 133
137 return this._a; 134 return this._a;
138 }, 135 },
139 136
140 //------------------------------------------------------------------------- 137 //-------------------------------------------------------------------------
141 138
142 'A': function () { 139 'A': function () {
143 if (this._A == null) { 140 if (this._A == null) {
144 //Warning: this value should be strictly greater than zero: how should we perform this check? 141 //Warning: this value should be strictly greater than zero: how should we perform this check?
145 this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n()); 142 this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
146 143
147 if (this._A.equals(0)) { 144 if (this._A.equals(0)) {
148MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0."); 145 Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
149 throw Clipperz.Crypto.SRP.exception.InvalidValue; 146 throw Clipperz.Crypto.SRP.exception.InvalidValue;
150 } 147 }
151//MochiKit.Logging.logDebug("SRP A: " + this._A);
152 } 148 }
153 149
154 return this._A; 150 return this._A;
155 }, 151 },
156 152
157 //------------------------------------------------------------------------- 153 //-------------------------------------------------------------------------
158 154
159 's': function () { 155 's': function () {
160 return this._s; 156 return this._s;
161//MochiKit.Logging.logDebug("SRP s: " + this._S);
162 }, 157 },
163 158
164 'set_s': function(aValue) { 159 'set_s': function(aValue) {
165 this._s = aValue; 160 this._s = aValue;
166 }, 161 },
167 162
168 //------------------------------------------------------------------------- 163 //-------------------------------------------------------------------------
169 164
170 'B': function () { 165 'B': function () {
171 return this._B; 166 return this._B;
172 }, 167 },
173 168
174 'set_B': function(aValue) { 169 'set_B': function(aValue) {
175 //Warning: this value should be strictly greater than zero: how should we perform this check? 170 //Warning: this value should be strictly greater than zero: how should we perform this check?
176 if (! aValue.equals(0)) { 171 if (! aValue.equals(0)) {
177 this._B = aValue; 172 this._B = aValue;
178//MochiKit.Logging.logDebug("SRP B: " + this._B);
179 } else { 173 } else {
180MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0."); 174 Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
181 throw Clipperz.Crypto.SRP.exception.InvalidValue; 175 throw Clipperz.Crypto.SRP.exception.InvalidValue;
182 } 176 }
183 }, 177 },
184 178
185 //------------------------------------------------------------------------- 179 //-------------------------------------------------------------------------
186 180
187 'x': function () { 181 'x': function () {
188 if (this._x == null) { 182 if (this._x == null) {
189 this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16); 183 this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16);
190//MochiKit.Logging.logDebug("SRP x: " + this._x);
191 } 184 }
192 185
193 return this._x; 186 return this._x;
194 }, 187 },
195 188
196 //------------------------------------------------------------------------- 189 //-------------------------------------------------------------------------
197 190
198 'u': function () { 191 'u': function () {
199 if (this._u == null) { 192 if (this._u == null) {
200 this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16); 193 this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16);
201//MochiKit.Logging.logDebug("SRP u: " + this._u);
202 } 194 }
203 195
204 return this._u; 196 return this._u;
205 }, 197 },
206 198
207 //------------------------------------------------------------------------- 199 //-------------------------------------------------------------------------
208 200
209 'S': function () { 201 'S': function () {
210 if (this._S == null) { 202 if (this._S == null) {
211 var bigint; 203 var bigint;
212 varsrp; 204 varsrp;
213 205
214 bigint = Clipperz.Crypto.BigInt; 206 bigint = Clipperz.Crypto.BigInt;
215 srp = Clipperz.Crypto.SRP; 207 srp = Clipperz.Crypto.SRP;
216 208
217 this._S =bigint.powerModule( 209 this._S =bigint.powerModule(
218 bigint.subtract(this.B(), bigint.powerModule(srp.g(), this.x(), srp.n())), 210 bigint.subtract(this.B(), bigint.powerModule(srp.g(), this.x(), srp.n())),
219 bigint.add(this.a(), bigint.multiply(this.u(), this.x())), 211 bigint.add(this.a(), bigint.multiply(this.u(), this.x())),
220 srp.n() 212 srp.n()
221 ) 213 )
222//MochiKit.Logging.logDebug("SRP S: " + this._S);
223 } 214 }
224 215
225 return this._S; 216 return this._S;
226 }, 217 },
227 218
228 //------------------------------------------------------------------------- 219 //-------------------------------------------------------------------------
229 220
230 'K': function () { 221 'K': function () {
231 if (this._K == null) { 222 if (this._K == null) {
232 this._K = this.stringHash(this.S().asString()); 223 this._K = this.stringHash(this.S().asString());
233//MochiKit.Logging.logDebug("SRP K: " + this._K);
234 } 224 }
235 225
236 return this._K; 226 return this._K;
237 }, 227 },
238 228
239 //------------------------------------------------------------------------- 229 //-------------------------------------------------------------------------
240 230
241 'M1': function () { 231 'M1': function () {
242 if (this._M1 == null) { 232 if (this._M1 == null) {
243 this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K()); 233 this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K());
244//MochiKit.Logging.logDebug("SRP M1: " + this._M1);
245 } 234 }
246 235
247 return this._M1; 236 return this._M1;
248 }, 237 },
249 238
250 //------------------------------------------------------------------------- 239 //-------------------------------------------------------------------------
251 240
252 'M2': function () { 241 'M2': function () {
253 if (this._M2 == null) { 242 if (this._M2 == null) {
254 this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K()); 243 this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K());
255//MochiKit.Logging.logDebug("SRP M2: " + this._M2);
256 } 244 }
257 245
258 return this._M2; 246 return this._M2;
259 }, 247 },
260 248
261 //========================================================================= 249 //=========================================================================
262 250
263 'serverSideCredentialsWithSalt': function(aSalt) { 251 'serverSideCredentialsWithSalt': function(aSalt) {
264 var result; 252 var result;
265 var s, x, v; 253 var s, x, v;
266 254
267 s = aSalt; 255 s = aSalt;
268 x = this.stringHash(s + this.P()); 256 x = this.stringHash(s + this.P());
269 v = Clipperz.Crypto.SRP.g().powerModule(new Clipperz.Crypto.BigInt(x, 16), Clipperz.Crypto.SRP.n()); 257 v = Clipperz.Crypto.SRP.g().powerModule(new Clipperz.Crypto.BigInt(x, 16), Clipperz.Crypto.SRP.n());
270 258
271 result = {}; 259 result = {};
272 result['C'] = this.C(); 260 result['C'] = this.C();
273 result['s'] = s; 261 result['s'] = s;
274 result['v'] = v.asString(16); 262 result['v'] = v.asString(16);
275 263
276 return result; 264 return result;
277 }, 265 },
278 266
279 'serverSideCredentials': function() { 267 'serverSideCredentials': function() {
diff --git a/frontend/gamma/js/Clipperz/DOM.js b/frontend/gamma/js/Clipperz/DOM.js
index 8f24653..1d52a4b 100644
--- a/frontend/gamma/js/Clipperz/DOM.js
+++ b/frontend/gamma/js/Clipperz/DOM.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.DOM) == 'undefined') { Clipperz.DOM = {}; } 25if (typeof(Clipperz.DOM) == 'undefined') { Clipperz.DOM = {}; }
28 26
29Clipperz.DOM.VERSION = "0.1"; 27Clipperz.DOM.VERSION = "0.1";
30Clipperz.DOM.NAME = "Clipperz.DOM"; 28Clipperz.DOM.NAME = "Clipperz.DOM";
31 29
32MochiKit.Base.update(Clipperz.DOM, { 30MochiKit.Base.update(Clipperz.DOM, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
@@ -85,49 +83,49 @@ MochiKit.Base.update(Clipperz.DOM, {
85 // var m = MochiKit.Base; 83 // var m = MochiKit.Base;
86 // var self = MochiKit.DOM; 84 // var self = MochiKit.DOM;
87 if (typeof(aNode) == "undefined" || aNode === null) { 85 if (typeof(aNode) == "undefined" || aNode === null) {
88 node = MochiKit.DOM._document.body; 86 node = MochiKit.DOM._document.body;
89 } else { 87 } else {
90 node = MochiKit.DOM.getElement(aNode); 88 node = MochiKit.DOM.getElement(aNode);
91 } 89 }
92 90
93 MochiKit.Base.nodeWalk(node, function(aNode) { 91 MochiKit.Base.nodeWalk(node, function(aNode) {
94 var result; 92 var result;
95 var name; 93 var name;
96 94
97 result = null; 95 result = null;
98 name = aNode.name; 96 name = aNode.name;
99 if (MochiKit.Base.isNotEmpty(name) && (typeof(values[name]) != 'undefined')) { 97 if (MochiKit.Base.isNotEmpty(name) && (typeof(values[name]) != 'undefined')) {
100 var tagName; 98 var tagName;
101 99
102 tagName = aNode.tagName.toUpperCase(); 100 tagName = aNode.tagName.toUpperCase();
103 if (tagName === "INPUT" && (aNode.type == "radio" || aNode.type == "checkbox")) { 101 if (tagName === "INPUT" && (aNode.type == "radio" || aNode.type == "checkbox")) {
104 aNode.checked = values[name]; 102 aNode.checked = values[name];
105 } else if (tagName === "SELECT") { 103 } else if (tagName === "SELECT") {
106 if (aNode.type == "select-one") { 104 if (aNode.type == "select-one") {
107 Clipperz.DOM.selectOptionMatchingValue(aNode, values[name]); 105 Clipperz.DOM.selectOptionMatchingValue(aNode, values[name]);
108 } else { //aNode.type == "select-multiple" 106 } else { //aNode.type == "select-multiple"
109MochiKit.Logging.logWarning("### unhandled Select.type = 'select-multiple' condition"); 107 Clipperz.logWarning("### unhandled Select.type = 'select-multiple' condition");
110 } 108 }
111 } else if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") { 109 } else if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") {
112 result = aNode.childNodes; 110 result = aNode.childNodes;
113 } else { 111 } else {
114 aNode.value = values[name] 112 aNode.value = values[name]
115 } 113 }
116 } else { 114 } else {
117 result = aNode.childNodes; 115 result = aNode.childNodes;
118 } 116 }
119 117
120 return result; 118 return result;
121 }); 119 });
122 }, 120 },
123 121
124 //------------------------------------------------------------------------- 122 //-------------------------------------------------------------------------
125 123
126 'get': MochiKit.DOM.getElement, 124 'get': MochiKit.DOM.getElement,
127 125
128 //------------------------------------------------------------------------- 126 //-------------------------------------------------------------------------
129 127
130 'Helper': Clipperz.YUI.DomHelper, 128 'Helper': Clipperz.YUI.DomHelper,
131 129
132 //------------------------------------------------------------------------- 130 //-------------------------------------------------------------------------
133 __syntaxFix__: "syntax fix" 131 __syntaxFix__: "syntax fix"
diff --git a/frontend/gamma/js/Clipperz/Date.js b/frontend/gamma/js/Clipperz/Date.js
index 020d77b..163790e 100644
--- a/frontend/gamma/js/Clipperz/Date.js
+++ b/frontend/gamma/js/Clipperz/Date.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Date) == 'undefined') { Clipperz.Date = {}; } 25if (typeof(Clipperz.Date) == 'undefined') { Clipperz.Date = {}; }
28 26
29Clipperz.Date.VERSION = "0.1"; 27Clipperz.Date.VERSION = "0.1";
30Clipperz.Date.NAME = "Clipperz.Date"; 28Clipperz.Date.NAME = "Clipperz.Date";
31 29
32MochiKit.Base.update(Clipperz.Date, { 30MochiKit.Base.update(Clipperz.Date, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
@@ -218,76 +216,73 @@ MochiKit.Base.update(Clipperz.Date, {
218 result = " + aDate.getGMTOffset()"; 216 result = " + aDate.getGMTOffset()";
219 break; 217 break;
220 case "T": 218 case "T":
221 result = " + Clipperz.Date.getTimezone(aDate)"; 219 result = " + Clipperz.Date.getTimezone(aDate)";
222 break; 220 break;
223 case "Z": 221 case "Z":
224 result = " + ( + aDate.getTimezoneOffset() * -60)"; 222 result = " + ( + aDate.getTimezoneOffset() * -60)";
225 break; 223 break;
226 default: 224 default:
227 result = " + '" + aCharacter + "'"; 225 result = " + '" + aCharacter + "'";
228 break; 226 break;
229 }; 227 };
230 228
231 return result; 229 return result;
232 }, 230 },
233 231
234 //========================================================================= 232 //=========================================================================
235 233
236 'formatDateWithPHPLikeTemplateAndLocale': function(aDate, aFormat, aLocale) { 234 'formatDateWithPHPLikeTemplateAndLocale': function(aDate, aFormat, aLocale) {
237 var result; 235 var result;
238 var formatterCode; 236 var formatterCode;
239 var formatter; 237 var formatter;
240 var i,c; 238 var i,c;
241 239
242//MochiKit.Logging.logDebug(">>> Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
243 formatterCode = "Clipperz.Date.__scratchFormatter = function(aDate, aLocale){return ''"; 240 formatterCode = "Clipperz.Date.__scratchFormatter = function(aDate, aLocale){return ''";
244 241
245 c = aFormat.length; 242 c = aFormat.length;
246 i = 0; 243 i = 0;
247 244
248 while (i<c) { 245 while (i<c) {
249 var character; 246 var character;
250 247
251 character = aFormat.charAt(i); 248 character = aFormat.charAt(i);
252 if (character == "\\") { 249 if (character == "\\") {
253 i++; 250 i++;
254 character = aFormat.charAt(i); 251 character = aFormat.charAt(i);
255 formatterCode += " + '" + character + "'" 252 formatterCode += " + '" + character + "'"
256 } else { 253 } else {
257 formatterCode += Clipperz.Date.getPHPLikeFormatCode(character); 254 formatterCode += Clipperz.Date.getPHPLikeFormatCode(character);
258 } 255 }
259 256
260 i++; 257 i++;
261 } 258 }
262 259
263 formatterCode += ";}"; 260 formatterCode += ";}";
264//MochiKit.Logging.logDebug("--- Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale - formatterCode: " + formatterCode);
265 eval(formatterCode); 261 eval(formatterCode);
266 262
267 result = Clipperz.Date.__scratchFormatter.call(this, aDate, aLocale); 263 result = Clipperz.Date.__scratchFormatter.call(this, aDate, aLocale);
268 delete Clipperz.Date.__scratchFormatter; 264 delete Clipperz.Date.__scratchFormatter;
269//MochiKit.Logging.logDebug("<<< Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
270 265
271 return result; 266 return result;
272 }, 267 },
273 268
274 //------------------------------------------------------------------------- 269 //-------------------------------------------------------------------------
275 270
276 'parseDateWithPHPLikeTemplateAndLocale': function(aString, aFormat, aLocale) { 271 'parseDateWithPHPLikeTemplateAndLocale': function(aString, aFormat, aLocale) {
277 return new Date(); 272 return new Date();
278 }, 273 },
279 274
280 //========================================================================= 275 //=========================================================================
281 276
282 'formatDateWithUTCFormatAndLocale': function(aDate, aLocale) { 277 'formatDateWithUTCFormatAndLocale': function(aDate, aLocale) {
283 // return Clipperz.Date.formatWithJavaLikeTemplateAndLocale(aDate, "EEE, dd MMMM yyyy HH:mm:ss zzz", aLocale); 278 // return Clipperz.Date.formatWithJavaLikeTemplateAndLocale(aDate, "EEE, dd MMMM yyyy HH:mm:ss zzz", aLocale);
284 return aDate.toString(); 279 return aDate.toString();
285 }, 280 },
286 281
287 'parseDateWithUTCFormatAndLocale': function(aValue, aLocale) { 282 'parseDateWithUTCFormatAndLocale': function(aValue, aLocale) {
288 return new Date(Date.parse(aValue)); 283 return new Date(Date.parse(aValue));
289 }, 284 },
290 285
291 //========================================================================= 286 //=========================================================================
292 287
293 'exception': { 288 'exception': {
diff --git a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
index a3c10c8..e35d729 100644
--- a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
+++ b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27 25
28 26
29Clipperz.KeePassExportProcessor = function(args) { 27Clipperz.KeePassExportProcessor = function(args) {
30 args = args || {}; 28 args = args || {};
31 29
32 return this; 30 return this;
33} 31}
34 32
35//============================================================================= 33//=============================================================================
36 34
37Clipperz.KeePassExportProcessor.prototype = MochiKit.Base.update(null, { 35Clipperz.KeePassExportProcessor.prototype = MochiKit.Base.update(null, {
38 36
39 //------------------------------------------------------------------------- 37 //-------------------------------------------------------------------------
40 38
41 'deferredParse_core': function(aContext) { 39 'deferredParse_core': function(aContext) {
42 var deferredResult; 40 var deferredResult;
43 41
44 if (aContext.line == "") { 42 if (aContext.line == "") {
45 deferredResult = MochiKit.Async.succeed(aContext.result); 43 deferredResult = MochiKit.Async.succeed(aContext.result);
46 } else { 44 } else {
diff --git a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
index 36cda88..8bc125b 100644
--- a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
+++ b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
@@ -1,137 +1,130 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.KeyValueObjectStore = function(args) { 28Clipperz.KeyValueObjectStore = function(args) {
31 args = args || {}; 29 args = args || {};
32 30
33 //this._name = args['name'] || "unnamed KeyValueObjectStore"; 31 //this._name = args['name'] || "unnamed KeyValueObjectStore";
34 this._values = args['values'] || {}; 32 this._values = args['values'] || {};
35 //this._referenceObjectStore = null; 33 //this._referenceObjectStore = null;
36//console.log("new KeyValueObjectStore", args, this._values);
37 34
38 return this; 35 return this;
39} 36}
40 37
41Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, { 38Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, {
42 39
43 'values': function() { 40 'values': function() {
44 return this._values; 41 return this._values;
45 }, 42 },
46 43
47 'initWithValues': function (someValues) { 44 'initWithValues': function (someValues) {
48 this._values = Clipperz.Base.deepClone(someValues) || {}; 45 this._values = Clipperz.Base.deepClone(someValues) || {};
49 return this; 46 return this;
50 }, 47 },
51 48
52 'setValues': function (someValues) { 49 'setValues': function (someValues) {
53//console.log("KeyValueObjectStore.setValues", someValues);
54 this._values = someValues; 50 this._values = someValues;
55 return this; 51 return this;
56 }, 52 },
57 53
58 //'initWithObjectStore': function (anObjectStore) { 54 //'initWithObjectStore': function (anObjectStore) {
59 // this._referenceObjectStore = anObjectStore; 55 // this._referenceObjectStore = anObjectStore;
60 //}, 56 //},
61 57
62 'removeAllData': function () { 58 'removeAllData': function () {
63 this._values = {}; 59 this._values = {};
64 }, 60 },
65 61
66 //------------------------------------------------------------------------- 62 //-------------------------------------------------------------------------
67 63
68 'getValue': function(aKeyPath) { 64 'getValue': function(aKeyPath) {
69 var result; 65 var result;
70 var keys; 66 var keys;
71 var i,c; 67 var i,c;
72 68
73 result = this.values(); 69 result = this.values();
74 70
75 keys = (aKeyPath + '').split('.'); 71 keys = (aKeyPath + '').split('.');
76 c = keys.length; 72 c = keys.length;
77 i = 0; 73 i = 0;
78 74
79 while ((i<c) && (result != null)) { 75 while ((i<c) && (result != null)) {
80 if (typeof result[keys[i]] != 'undefined') { 76 if (typeof result[keys[i]] != 'undefined') {
81 result = result[keys[i]]; 77 result = result[keys[i]];
82 } else { 78 } else {
83 result = null; 79 result = null;
84 } 80 }
85 81
86 i++; 82 i++;
87 } 83 }
88 84
89 return result; 85 return result;
90 }, 86 },
91 87
92 //------------------------------------------------------------------------- 88 //-------------------------------------------------------------------------
93 89
94 'setValue': function(aKeyPath, aValue) { 90 'setValue': function(aKeyPath, aValue) {
95 var targetObject; 91 var targetObject;
96 var keys; 92 var keys;
97 var i,c; 93 var i,c;
98 94
99//console.log(">>> KeyValueObjectStore.setValue", this, this.values(), aKeyPath, aValue);
100 targetObject = this.values(); 95 targetObject = this.values();
101 keys = (aKeyPath + '').split('.'); 96 keys = (aKeyPath + '').split('.');
102 c = keys.length - 1; 97 c = keys.length - 1;
103 for (i=0; i<c; i++) { 98 for (i=0; i<c; i++) {
104//console.log("--- KeyValueObjectStore.setValue", i, targetObject, keys[i]);
105 if (typeof targetObject[keys[i]] == 'undefined') { 99 if (typeof targetObject[keys[i]] == 'undefined') {
106 targetObject[keys[i]] = {} 100 targetObject[keys[i]] = {}
107 } 101 }
108 102
109 targetObject = targetObject[keys[i]]; 103 targetObject = targetObject[keys[i]];
110 } 104 }
111 105
112 targetObject[keys[c]] = aValue; 106 targetObject[keys[c]] = aValue;
113//console.log("<<< KeyValueObjectStore.setValue");
114 107
115 return aValue; 108 return aValue;
116 }, 109 },
117 110
118 //------------------------------------------------------------------------- 111 //-------------------------------------------------------------------------
119 112
120 'removeValue': function (aKeyPath) { 113 'removeValue': function (aKeyPath) {
121 // this.setValue(aKeyPath, null); 114 // this.setValue(aKeyPath, null);
122 115
123 var targetObject; 116 var targetObject;
124 var keys; 117 var keys;
125 var i,c; 118 var i,c;
126 119
127 targetObject = this.values(); 120 targetObject = this.values();
128 keys = ('' + aKeyPath).split('.'); 121 keys = ('' + aKeyPath).split('.');
129 c = keys.length - 1; 122 c = keys.length - 1;
130 for (i=0; i<c; i++) { 123 for (i=0; i<c; i++) {
131 if (typeof targetObject[keys[i]] == 'undefined') { 124 if (typeof targetObject[keys[i]] == 'undefined') {
132 targetObject[keys[i]] = {} 125 targetObject[keys[i]] = {}
133 } 126 }
134 127
135 targetObject = targetObject[keys[i]]; 128 targetObject = targetObject[keys[i]];
136 } 129 }
137 130
diff --git a/frontend/gamma/js/Clipperz/Logging.js b/frontend/gamma/js/Clipperz/Logging.js
index 77a0896..b6b806a 100644
--- a/frontend/gamma/js/Clipperz/Logging.js
+++ b/frontend/gamma/js/Clipperz/Logging.js
@@ -1,39 +1,32 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz'); 24Clipperz.Base.module('Clipperz');
27 25
28if (typeof console == 'undefined') { 26Clipperz.log = function () {
29 Clipperz.log = MochiKit.Logging.logDebug; 27 console.log.apply(console, arguments);
30// Safari/WebKit 4 28}
31} else if (navigator.userAgent.match(/WebKit/)) { 29
32 //Clipperz.log = console.log; 30 Clipperz.logError= Clipperz.log;
33 Clipperz.log = MochiKit.Logging.logDebug; 31 Clipperz.logWarning= Clipperz.log;
34} else if (navigator.userAgent.match(/Gecko/)) { 32 Clipperz.logDebug= Clipperz.log; \ No newline at end of file
35 Clipperz.log = function () {
36 // firebug 1.3 bug see http://code.google.com/p/fbug/issues/detail?id=1347
37 console.log.apply(window._firebug, arguments);
38 };
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 897beed..4818b76 100644
--- a/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js
+++ b/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26/* 24/*
27if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 25if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
28if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 26if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
29 27
30Clipperz.PM.BookmarkletProcessor = function(aConfiguration) { 28Clipperz.PM.BookmarkletProcessor = function(aConfiguration) {
31 this._configuration = aConfiguration; 29 this._configuration = aConfiguration;
32 30
33 this._editableFields = null; 31 this._editableFields = null;
34 this._favicon = null; 32 this._favicon = null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39Clipperz.PM.BookmarkletProcessor.prototype = MochiKit.Base.update(null, { 37Clipperz.PM.BookmarkletProcessor.prototype = MochiKit.Base.update(null, {
40 38
41 'toString': function() { 39 'toString': function() {
42 return "Clipperz.PM.BookmarkletProcessor"; 40 return "Clipperz.PM.BookmarkletProcessor";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
diff --git a/frontend/gamma/js/Clipperz/PM/Connection.js b/frontend/gamma/js/Clipperz/PM/Connection.js
index a05a310..6a8f15e 100644
--- a/frontend/gamma/js/Clipperz/PM/Connection.js
+++ b/frontend/gamma/js/Clipperz/PM/Connection.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//----------------------------------------------------------------------------- 27//-----------------------------------------------------------------------------
30// 28//
31 // Abstract C O N N E C T I O N class 29 // Abstract C O N N E C T I O N class
32// 30//
33//----------------------------------------------------------------------------- 31//-----------------------------------------------------------------------------
34 32
35Clipperz.PM.Connection = function (args) { 33Clipperz.PM.Connection = function (args) {
36 args = args || {}; 34 args = args || {};
37 35
38 this._proxy = args.proxy || Clipperz.PM.Proxy.defaultProxy; 36 this._proxy = args.proxy || Clipperz.PM.Proxy.defaultProxy;
39 this._getCredentialsFunction = args.getCredentialsFunction; 37 this._getCredentialsFunction = args.getCredentialsFunction;
40 38
41 this._clipperz_pm_crypto_version = null; 39 this._clipperz_pm_crypto_version = null;
42 this._connectionId = null; 40 this._connectionId = null;
43 this._sharedSecret = null; 41 this._sharedSecret = null;
44 this._serverLockValue = null; 42 this._serverLockValue = null;
45 43
46 return this; 44 return this;
@@ -65,49 +63,50 @@ Clipperz.PM.Connection.prototype = MochiKit.Base.update(null, {
65 varversion; 63 varversion;
66 var i, c; 64 var i, c;
67 65
68 version = null; 66 version = null;
69 connectionVersions = Clipperz.PM.Connection.communicationProtocol.versions; 67 connectionVersions = Clipperz.PM.Connection.communicationProtocol.versions;
70 versions = MochiKit.Base.keys(connectionVersions); 68 versions = MochiKit.Base.keys(connectionVersions);
71 c = versions.length; 69 c = versions.length;
72 for (i=0; i<c; i++) { 70 for (i=0; i<c; i++) {
73 if (! (versions[i] == 'current')) { 71 if (! (versions[i] == 'current')) {
74 if (this instanceof connectionVersions[versions[i]]) { 72 if (this instanceof connectionVersions[versions[i]]) {
75 version = versions[i]; 73 version = versions[i];
76 }; 74 };
77 } 75 }
78 } 76 }
79 77
80 this._clipperz_pm_crypto_version = version; 78 this._clipperz_pm_crypto_version = version;
81 } 79 }
82 80
83 return this._clipperz_pm_crypto_version; 81 return this._clipperz_pm_crypto_version;
84 }, 82 },
85 83
86 //------------------------------------------------------------------------- 84 //-------------------------------------------------------------------------
87 85
88 'defaultErrorHandler': function(anErrorString, anException) { 86 'defaultErrorHandler': function(anErrorString, anException) {
89MochiKit.Logging.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")"); 87 // Clipperz.logError("### Connection.defaultErrorHandler: " + anErrorString, anException);
88 Clipperz.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")");
90 }, 89 },
91 90
92 //------------------------------------------------------------------------- 91 //-------------------------------------------------------------------------
93 92
94 'getCredentialsFunction': function () { 93 'getCredentialsFunction': function () {
95 return this._getCredentialsFunction; 94 return this._getCredentialsFunction;
96 }, 95 },
97 96
98 'normalizedCredentials': function(someValues) { 97 'normalizedCredentials': function(someValues) {
99 throw Clipperz.Base.exception.AbstractMethod; 98 throw Clipperz.Base.exception.AbstractMethod;
100 }, 99 },
101 100
102 //========================================================================= 101 //=========================================================================
103 102
104 'proxy': function () { 103 'proxy': function () {
105 return this._proxy; 104 return this._proxy;
106 }, 105 },
107 106
108 //========================================================================= 107 //=========================================================================
109 108
110 'register': function () { 109 'register': function () {
111 throw Clipperz.Base.exception.AbstractMethod; 110 throw Clipperz.Base.exception.AbstractMethod;
112 }, 111 },
113 112
@@ -252,49 +251,48 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.
252 var srpConnection; 251 var srpConnection;
253 var result; 252 var result;
254 253
255 srpConnection = new Clipperz.Crypto.SRP.Connection({ C:someCredentials['username'], P:someCredentials['password'], hash:this.hash() }); 254 srpConnection = new Clipperz.Crypto.SRP.Connection({ C:someCredentials['username'], P:someCredentials['password'], hash:this.hash() });
256 result = srpConnection.serverSideCredentials(); 255 result = srpConnection.serverSideCredentials();
257 result['version'] = Clipperz.PM.Connection.communicationProtocol.currentVersion; 256 result['version'] = Clipperz.PM.Connection.communicationProtocol.currentVersion;
258 257
259 return result; 258 return result;
260 }, this) 259 }, this)
261 ], 260 ],
262 'user': MochiKit.Base.partial(MochiKit.Async.succeed, someUserData) 261 'user': MochiKit.Base.partial(MochiKit.Async.succeed, someUserData)
263 }); 262 });
264 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); 263 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress');
265 deferredResult.addMethod(this, 'message', 'upgradeUserCredentials'); 264 deferredResult.addMethod(this, 'message', 'upgradeUserCredentials');
266 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); 265 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress');
267 deferredResult.callback(); 266 deferredResult.callback();
268 267
269 return deferredResult; 268 return deferredResult;
270 269
271 }, 270 },
272 271
273 //========================================================================= 272 //=========================================================================
274 273
275 'redeemOneTimePassword': function (someParameters) { 274 'redeemOneTimePassword': function (someParameters) {
276//console.log("Connections.redeemOneTimePassword", someParameters['username'], someParameters['password']);
277/* 275/*
278 //========================================================================= 276 //=========================================================================
279 //LOGIN WITH PASSPHRASE, extracted from the TRUNK version (LoginPanel.js) 277 //LOGIN WITH PASSPHRASE, extracted from the TRUNK version (LoginPanel.js)
280 deferredResult.addCallback(function(anUsername, aOneTimePassword) { 278 deferredResult.addCallback(function(anUsername, aOneTimePassword) {
281 var args; 279 var args;
282 280
283 args = { 281 args = {
284 'message': 'oneTimePassword', 282 'message': 'oneTimePassword',
285 'version': Clipperz.PM.Crypto.communicationProtocol.currentVersion, 283 'version': Clipperz.PM.Crypto.communicationProtocol.currentVersion,
286 'parameters': { 284 'parameters': {
287 'oneTimePasswordKey': Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword(anUsername, aOneTimePassword), 285 'oneTimePasswordKey': Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword(anUsername, aOneTimePassword),
288 'oneTimePasswordKeyChecksum': Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword(anUsername, aOneTimePassword) 286 'oneTimePasswordKeyChecksum': Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword(anUsername, aOneTimePassword)
289 } 287 }
290 } 288 }
291 289
292 return args; 290 return args;
293 }, anUsername, oneTimePassword); 291 }, anUsername, oneTimePassword);
294 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'OTP_login_loadingOTP'); 292 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'OTP_login_loadingOTP');
295 deferredResult.addCallback(MochiKit.Base.method(Clipperz.PM.Proxy.defaultProxy, 'handshake')); 293 deferredResult.addCallback(MochiKit.Base.method(Clipperz.PM.Proxy.defaultProxy, 'handshake'));
296 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'OTP_login_extractingPassphrase'); 294 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'OTP_login_extractingPassphrase');
297 deferredResult.addCallback(function(aResult) { 295 deferredResult.addCallback(function(aResult) {
298 return Clipperz.PM.Crypto.deferredDecrypt(oneTimePassword, aResult['data'], aResult['version']); 296 return Clipperz.PM.Crypto.deferredDecrypt(oneTimePassword, aResult['data'], aResult['version']);
299 }); 297 });
300 deferredResult.addCallback(function(aResult) { 298 deferredResult.addCallback(function(aResult) {
@@ -432,100 +430,99 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.
432 'logout': function() { 430 'logout': function() {
433 return Clipperz.Async.callbacks("Connection.logout", [ 431 return Clipperz.Async.callbacks("Connection.logout", [
434 MochiKit.Base.method(this, 'setSharedSecret'), 432 MochiKit.Base.method(this, 'setSharedSecret'),
435 MochiKit.Base.method(this.proxy(), 'logout', {}) 433 MochiKit.Base.method(this.proxy(), 'logout', {})
436 ], {trace:false}); 434 ], {trace:false});
437 }, 435 },
438 436
439 //========================================================================= 437 //=========================================================================
440 438
441 'ping': function () { 439 'ping': function () {
442 //TODO: ping the server in order to have a valid session 440 //TODO: ping the server in order to have a valid session
443 }, 441 },
444 442
445 //========================================================================= 443 //=========================================================================
446 444
447 'message': function(aMessageName, someParameters) { 445 'message': function(aMessageName, someParameters) {
448 var args; 446 var args;
449 var parameters; 447 var parameters;
450 448
451 parameters = someParameters || {}; 449 parameters = someParameters || {};
452 if (typeof(parameters['user']) != 'undefined') { 450 if (typeof(parameters['user']) != 'undefined') {
453 parameters['user']['lock'] = this.serverLockValue(); 451 parameters['user']['lock'] = this.serverLockValue();
454 } 452 }
455 453
456//console.log(">>> Connection.message", aMessageName, someParameters);
457 args = { 454 args = {
458 message: aMessageName, 455 message: aMessageName,
459 srpSharedSecret: this.sharedSecret(), 456 srpSharedSecret: this.sharedSecret(),
460 // parameters: (someParameters || {}) 457 // parameters: (someParameters || {})
461 parameters: parameters 458 parameters: parameters
462 } 459 }
463 460
464 return this.sendMessage(args); 461 return this.sendMessage(args);
465 }, 462 },
466 463
467 //------------------------------------------------------------------------- 464 //-------------------------------------------------------------------------
468 465
469 'sendMessage': function(someArguments) { 466 'sendMessage': function(someArguments) {
470 vardeferredResult; 467 vardeferredResult;
471 468
472 deferredResult = new Clipperz.Async.Deferred("Connection.sendMessage", {trace:false}); 469 deferredResult = new Clipperz.Async.Deferred("Connection.sendMessage", {trace:false});
473 deferredResult.addMethod(this.proxy(), 'message', someArguments); 470 deferredResult.addMethod(this.proxy(), 'message', someArguments);
474 deferredResult.addCallback(MochiKit.Base.bind(function(res) { 471 deferredResult.addCallback(MochiKit.Base.bind(function(res) {
475 if (typeof(res['lock']) != 'undefined') { 472 if (typeof(res['lock']) != 'undefined') {
476 this.setServerLockValue(res['lock']); 473 this.setServerLockValue(res['lock']);
477 } 474 }
478 return res; 475 return res;
479 }, this)); 476 }, this));
480 477
481 deferredResult.addErrback(MochiKit.Base.method(this, 'messageExceptionHandler'), someArguments); 478 deferredResult.addErrback(MochiKit.Base.method(this, 'messageExceptionHandler'), someArguments);
482 deferredResult.callback(); 479 deferredResult.callback();
483 480
484 return deferredResult 481 return deferredResult
485 }, 482 },
486 483
487 //------------------------------------------------------------------------- 484 //-------------------------------------------------------------------------
488 485
489 'messageExceptionHandler': function(anOriginalMessageArguments, anError) { 486 'messageExceptionHandler': function(anOriginalMessageArguments, anError) {
490 var result; 487 var result;
491 488
492console.log(">>> Connection.messageExceptionHandler", anError, anError.message); 489Clipperz.log(">>> Connection.messageExceptionHandler: " + anError.message, anError);
493 if (anError instanceof MochiKit.Async.CancelledError) { 490 if (anError instanceof MochiKit.Async.CancelledError) {
494 result = anError; 491 result = anError;
495 } else { 492 } else {
496 if ((anError.message == 'Trying to communicate without an active connection')|| 493 if ((anError.message == 'Trying to communicate without an active connection')||
497 (anError.message == 'No tollManager available for current session') 494 (anError.message == 'No tollManager available for current session')
498 ) { 495 ) {
499 result = this.reestablishConnection(anOriginalMessageArguments); 496 result = this.reestablishConnection(anOriginalMessageArguments);
500 } else if (anError.message == 'Session with stale data') { 497 } else if (anError.message == 'Session with stale data') {
501 MochiKit.Signal.signal(this, 'EXCEPTION'); 498 MochiKit.Signal.signal(this, 'EXCEPTION');
502 } else { 499 } else {
503 result = anError; 500 result = anError;
504 } 501 }
505 } 502 }
506console.log("<<< Connection.messageExceptionHandler", anError) 503Clipperz.log("<<< Connection.messageExceptionHandler")
507 504
508 return result;; 505 return result;;
509 }, 506 },
510 507
511 //========================================================================= 508 //=========================================================================
512 509
513 'reestablishConnection': function(anOriginalMessageArguments) { 510 'reestablishConnection': function(anOriginalMessageArguments) {
514 var deferredResult; 511 var deferredResult;
515 512
516 deferredResult = new Clipperz.Async.Deferred("Connection.reestablishConnection"); 513 deferredResult = new Clipperz.Async.Deferred("Connection.reestablishConnection");
517 deferredResult.addMethod(this, 'reset'); 514 deferredResult.addMethod(this, 'reset');
518 deferredResult.addMethod(this, 'login', true); 515 deferredResult.addMethod(this, 'login', true);
519 deferredResult.addCallback(MochiKit.Base.bind(function(aMessage) { 516 deferredResult.addCallback(MochiKit.Base.bind(function(aMessage) {
520 aMessage['srpSharedSecret'] = this.sharedSecret(); 517 aMessage['srpSharedSecret'] = this.sharedSecret();
521 return aMessage; 518 return aMessage;
522 }, this), anOriginalMessageArguments); 519 }, this), anOriginalMessageArguments);
523 deferredResult.addMethod(this, 'sendMessage'); 520 deferredResult.addMethod(this, 'sendMessage');
524 deferredResult.addErrback(MochiKit.Signal.signal, this, 'EXCEPTION', null); 521 deferredResult.addErrback(MochiKit.Signal.signal, this, 'EXCEPTION', null);
525 deferredResult.callback(); 522 deferredResult.callback();
526 523
527 return deferredResult; 524 return deferredResult;
528 }, 525 },
529 526
530 //========================================================================= 527 //=========================================================================
531 528
diff --git a/frontend/gamma/js/Clipperz/PM/Crypto.js b/frontend/gamma/js/Clipperz/PM/Crypto.js
index 31fe349..cd10e33 100644
--- a/frontend/gamma/js/Clipperz/PM/Crypto.js
+++ b/frontend/gamma/js/Clipperz/PM/Crypto.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Crypto) == 'undefined') { Clipperz.PM.Crypto = {}; } 26if (typeof(Clipperz.PM.Crypto) == 'undefined') { Clipperz.PM.Crypto = {}; }
29 27
30Clipperz.PM.Crypto.VERSION = "0.2"; 28Clipperz.PM.Crypto.VERSION = "0.2";
31Clipperz.PM.Crypto.NAME = "Clipperz.PM.Crypto"; 29Clipperz.PM.Crypto.NAME = "Clipperz.PM.Crypto";
32 30
33Clipperz.PM.Crypto.encryptingFunctions = {}; 31Clipperz.PM.Crypto.encryptingFunctions = {};
34 32
35MochiKit.Base.update(Clipperz.PM.Crypto, { 33MochiKit.Base.update(Clipperz.PM.Crypto, {
36 34
37 '__repr__': function () { 35 '__repr__': function () {
38 return "[" + this.NAME + " " + this.VERSION + "]"; 36 return "[" + this.NAME + " " + this.VERSION + "]";
39 }, 37 },
40 38
41 //------------------------------------------------------------------------- 39 //-------------------------------------------------------------------------
42 40
43 'toString': function () { 41 'toString': function () {
44 return this.__repr__(); 42 return this.__repr__();
45 }, 43 },
46 44
@@ -153,81 +151,81 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
153 return aResult.toBase64String(); 151 return aResult.toBase64String();
154 }) 152 })
155 deferredResult.callback(); 153 deferredResult.callback();
156 154
157 return deferredResult; 155 return deferredResult;
158 }, 156 },
159 157
160 'decrypt': function(aKey, aValue) { 158 'decrypt': function(aKey, aValue) {
161 var result; 159 var result;
162 160
163 if (aValue != null) { 161 if (aValue != null) {
164 var key, value; 162 var key, value;
165 var decryptedData; 163 var decryptedData;
166 var decryptedValue; 164 var decryptedValue;
167 165
168 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 166 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
169 value = new Clipperz.ByteArray().appendBase64String(aValue); 167 value = new Clipperz.ByteArray().appendBase64String(aValue);
170 168
171 decryptedData = Clipperz.Crypto.AES.decrypt(key, value); 169 decryptedData = Clipperz.Crypto.AES.decrypt(key, value);
172 decryptedValue = decryptedData.split((256/8)); 170 decryptedValue = decryptedData.split((256/8));
173 171
174 try { 172 try {
175 result = Clipperz.Base.evalJSON(decryptedValue.asString()); 173 result = Clipperz.Base.evalJSON(decryptedValue.asString());
176 } catch (exception) { 174 } catch (exception) {
177 MochiKit.Logging.logError("Error while decrypting data [1]"); 175 Clipperz.logError("Error while decrypting data [1]");
178 throw Clipperz.Crypto.Base.exception.CorruptedMessage; 176 throw Clipperz.Crypto.Base.exception.CorruptedMessage;
179 } 177 }
180 } else { 178 } else {
181 result = null; 179 result = null;
182 } 180 }
183 181
184 return result; 182 return result;
185 }, 183 },
186 184
187 'deferredDecrypt': function(aKey, aValue) { 185 'deferredDecrypt': function(aKey, aValue) {
188 var result; 186 var result;
189 187
190 if (aValue != null) { 188 if (aValue != null) {
191 var deferredResult; 189 var deferredResult;
192 var key, value; 190 var key, value;
193 // var decryptedData; 191 // var decryptedData;
194 192
195 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 193 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
196 value = new Clipperz.ByteArray().appendBase64String(aValue); 194 value = new Clipperz.ByteArray().appendBase64String(aValue);
197 195
198 deferredResult = new Clipperz.Async.Deferred("Crypto.[0.2].deferredDecrypt"); 196 deferredResult = new Clipperz.Async.Deferred("Crypto.[0.2].deferredDecrypt");
199 deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value); 197 deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value);
200 deferredResult.addCallback(function(aResult) { 198 deferredResult.addCallback(function(aResult) {
201 var result; 199 var result;
202 var decryptedData; 200 var decryptedData;
203 201
204 decryptedData = aResult.split((256/8)); 202 decryptedData = aResult.split((256/8));
205 203
206 try { 204 try {
207 result = Clipperz.Base.evalJSON(decryptedData.asString()); 205 result = Clipperz.Base.evalJSON(decryptedData.asString());
208 } catch (exception) { 206 } catch (exception) {
209 MochiKit.Logging.logError("Error while decrypting data [2]"); 207 Clipperz.logError("Error while decrypting data [2]");
210 throw Clipperz.Crypto.Base.exception.CorruptedMessage; 208 throw Clipperz.Crypto.Base.exception.CorruptedMessage;
211 } 209 }
212 210
213 return result; 211 return result;
214 }) 212 })
215 deferredResult.callback(); 213 deferredResult.callback();
216 214
217 result = deferredResult; 215 result = deferredResult;
218 } else { 216 } else {
219 result = MochiKit.Async.succeed(null); 217 result = MochiKit.Async.succeed(null);
220 } 218 }
221 219
222 return result; 220 return result;
223 }, 221 },
224 222
225 'hash': Clipperz.Crypto.SHA.sha_d256, 223 'hash': Clipperz.Crypto.SHA.sha_d256,
226 224
227 'deriveKey': function(aStringValue) { 225 'deriveKey': function(aStringValue) {
228 varbyteData; 226 varbyteData;
229 var result; 227 var result;
230 228
231 byteData = new Clipperz.ByteArray(aStringValue); 229 byteData = new Clipperz.ByteArray(aStringValue);
232 result = Clipperz.Crypto.SHA.sha_d256(byteData); 230 result = Clipperz.Crypto.SHA.sha_d256(byteData);
233 231
@@ -270,166 +268,166 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
270 deferredResult.addCallback(function(aResult) { 268 deferredResult.addCallback(function(aResult) {
271 return aResult.toBase64String(); 269 return aResult.toBase64String();
272 }) 270 })
273 deferredResult.callback(); 271 deferredResult.callback();
274 272
275 return deferredResult; 273 return deferredResult;
276 }, 274 },
277 275
278 'decrypt': function(aKey, aValue) { 276 'decrypt': function(aKey, aValue) {
279 var result; 277 var result;
280 278
281 if (aValue != null) { 279 if (aValue != null) {
282 var key, value; 280 var key, value;
283 var decryptedData; 281 var decryptedData;
284 282
285 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 283 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
286 value = new Clipperz.ByteArray().appendBase64String(aValue); 284 value = new Clipperz.ByteArray().appendBase64String(aValue);
287 285
288 decryptedData = Clipperz.Crypto.AES.decrypt(key, value); 286 decryptedData = Clipperz.Crypto.AES.decrypt(key, value);
289 287
290 value = decryptedData.asString(); 288 value = decryptedData.asString();
291 try { 289 try {
292 result = Clipperz.Base.evalJSON(value); 290 result = Clipperz.Base.evalJSON(value);
293 } catch (exception) { 291 } catch (exception) {
294 MochiKit.Logging.logError("Error while decrypting data [3]"); 292 Clipperz.logError("Error while decrypting data [3]");
295 throw Clipperz.Crypto.Base.exception.CorruptedMessage; 293 throw Clipperz.Crypto.Base.exception.CorruptedMessage;
296 } 294 }
297 } else { 295 } else {
298 result = null; 296 result = null;
299 } 297 }
300 298
301 return result; 299 return result;
302 }, 300 },
303 301
304 'deferredDecrypt': function(aKey, aValue) { 302 'deferredDecrypt': function(aKey, aValue) {
305 var deferredResult; 303 var deferredResult;
306 304
307 deferredResult = new Clipperz.Async.Deferred("Crypto[0.3].deferredDecrypt", {trace: false}); 305 deferredResult = new Clipperz.Async.Deferred("Crypto[0.3].deferredDecrypt", {trace: false});
308 // now = new Date; 306 // now = new Date;
309 307
310 if (aValue != null) { 308 if (aValue != null) {
311 var key, value; 309 var key, value;
312 // var decryptedData; 310 // var decryptedData;
313 311
314 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 312 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
315 value = new Clipperz.ByteArray().appendBase64String(aValue); 313 value = new Clipperz.ByteArray().appendBase64String(aValue);
316 314
317 deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value); 315 deferredResult.addCallback(Clipperz.Crypto.AES.deferredDecrypt, key, value);
318 deferredResult.addCallback(MochiKit.Async.wait, 0.1); 316 deferredResult.addCallback(MochiKit.Async.wait, 0.1);
319 deferredResult.addCallback(function(aResult) { 317 deferredResult.addCallback(function(aResult) {
320 return aResult.asString(); 318 return aResult.asString();
321 }); 319 });
322 deferredResult.addCallback(MochiKit.Async.wait, 0.1); 320 deferredResult.addCallback(MochiKit.Async.wait, 0.1);
323 deferredResult.addCallback(Clipperz.Base.evalJSON); 321 deferredResult.addCallback(Clipperz.Base.evalJSON);
324 deferredResult.addErrback(function(anError) { 322 deferredResult.addErrback(function(anError) {
325 MochiKit.Logging.logError("Error while decrypting data [4]"); 323 Clipperz.logError("Error while decrypting data [4]");
326 throw Clipperz.Crypto.Base.exception.CorruptedMessage; 324 throw Clipperz.Crypto.Base.exception.CorruptedMessage;
327 }) 325 })
328 } else { 326 } else {
329 deferredResult.addCallback(function() { 327 deferredResult.addCallback(function() {
330 return null; 328 return null;
331 }); 329 });
332 } 330 }
333 deferredResult.callback(); 331 deferredResult.callback();
334 332
335 return deferredResult; 333 return deferredResult;
336 }, 334 },
337 335
338 'hash': Clipperz.Crypto.SHA.sha_d256, 336 'hash': Clipperz.Crypto.SHA.sha_d256,
339 337
340 'deriveKey': function(aStringValue) { 338 'deriveKey': function(aStringValue) {
341 varbyteData; 339 varbyteData;
342 var result; 340 var result;
343 341
344 byteData = new Clipperz.ByteArray(aStringValue); 342 byteData = new Clipperz.ByteArray(aStringValue);
345 result = Clipperz.Crypto.SHA.sha_d256(byteData); 343 result = Clipperz.Crypto.SHA.sha_d256(byteData);
346 344
347 return result; 345 return result;
348 } 346 }
349 347
350 }, 348 },
351 349
352 //##################################################################### 350 //#####################################################################
353/* 351/*
354 '0.4': { 352 '0.4': {
355 'encrypt': function(aKey, aValue, aNonce) { 353 'encrypt': function(aKey, aValue, aNonce) {
356 var result; 354 var result;
357 varkey, value; 355 varkey, value;
358 var data; 356 var data;
359 var dataToEncrypt; 357 var dataToEncrypt;
360 var encryptedData; 358 var encryptedData;
361 359
362//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt"); 360//Clipperz.logDebug(">>> [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
363 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 361 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
364//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 1"); 362//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 1");
365 value = Clipperz.Base.serializeJSON(aValue); 363 value = Clipperz.Base.serializeJSON(aValue);
366//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 2"); 364//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 2");
367/ * 365/ *
368//MochiKit.Logging.logDebug("--> encrypt.fullSize: " + value.length); 366//Clipperz.logDebug("--> encrypt.fullSize: " + value.length);
369 value = value.replace(/":{"label":"/g, '":{l:"'); 367 value = value.replace(/":{"label":"/g, '":{l:"');
370 value = value.replace(/":{"key":"/g, '":{k:"'); 368 value = value.replace(/":{"key":"/g, '":{k:"');
371 value = value.replace(/":{"notes":"/g, '":{n:"'); 369 value = value.replace(/":{"notes":"/g, '":{n:"');
372 value = value.replace(/":{"record":"/g, '":{r:"'); 370 value = value.replace(/":{"record":"/g, '":{r:"');
373 value = value.replace(/", "label":"/g, '",l:"'); 371 value = value.replace(/", "label":"/g, '",l:"');
374 value = value.replace(/", "favicon":"/g,'",f:"'); 372 value = value.replace(/", "favicon":"/g,'",f:"');
375//MochiKit.Logging.logDebug("<-- encrypt.compressed: " + value.length); 373//Clipperz.logDebug("<-- encrypt.compressed: " + value.length);
376* / 374* /
377 data = new Clipperz.ByteArray(value); 375 data = new Clipperz.ByteArray(value);
378//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 3"); 376//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 3");
379 encryptedData = Clipperz.Crypto.AES.encrypt(key, data, aNonce); 377 encryptedData = Clipperz.Crypto.AES.encrypt(key, data, aNonce);
380//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 4"); 378//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 4");
381 result = encryptedData.toBase64String(); 379 result = encryptedData.toBase64String();
382//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt"); 380//Clipperz.logDebug("<<< [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
383 381
384 return result; 382 return result;
385 }, 383 },
386 384
387 'decrypt': function(aKey, aValue) { 385 'decrypt': function(aKey, aValue) {
388 var result; 386 var result;
389 387
390 if (aValue != null) { 388 if (aValue != null) {
391 var key, value; 389 var key, value;
392 var decryptedData; 390 var decryptedData;
393 391
394 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey)); 392 key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
395 value = new Clipperz.ByteArray().appendBase64String(aValue); 393 value = new Clipperz.ByteArray().appendBase64String(aValue);
396 394
397 decryptedData = Clipperz.Crypto.AES.decrypt(key, value); 395 decryptedData = Clipperz.Crypto.AES.decrypt(key, value);
398 396
399 value = decryptedData.asString(); 397 value = decryptedData.asString();
400/ * 398/ *
401 value = value.replace(/":{l:"/g,'":{"label":"'); 399 value = value.replace(/":{l:"/g,'":{"label":"');
402 value = value.replace(/":{k:"/g,'":{"key":"'); 400 value = value.replace(/":{k:"/g,'":{"key":"');
403 value = value.replace(/":{n:"/g,'":{"notes":"'); 401 value = value.replace(/":{n:"/g,'":{"notes":"');
404 value = value.replace(/":{r:"/g,'":{"record":"'); 402 value = value.replace(/":{r:"/g,'":{"record":"');
405 value = value.replace(/",l:"/g, '", "label":"'); 403 value = value.replace(/",l:"/g, '", "label":"');
406 value = value.replace(/",f:"/g, '", "favicon":"'); 404 value = value.replace(/",f:"/g, '", "favicon":"');
407* / 405* /
408 try { 406 try {
409 result = Clipperz.Base.evalJSON(value); 407 result = Clipperz.Base.evalJSON(value);
410 } catch (exception) { 408 } catch (exception) {
411 MochiKit.Logging.logError("Error while decrypting data"); 409 Clipperz.logError("Error while decrypting data");
412 throw Clipperz.Crypto.Base.exception.CorruptedMessage; 410 throw Clipperz.Crypto.Base.exception.CorruptedMessage;
413 } 411 }
414 412
415 413
416 } else { 414 } else {
417 result = null; 415 result = null;
418 } 416 }
419 417
420 return result; 418 return result;
421 }, 419 },
422 420
423 'hash': Clipperz.Crypto.SHA.sha_d256 421 'hash': Clipperz.Crypto.SHA.sha_d256
424 }, 422 },
425*/ 423*/
426 //##################################################################### 424 //#####################################################################
427 __syntaxFix__: "syntax fix" 425 __syntaxFix__: "syntax fix"
428 } 426 }
429 }, 427 },
430 428
431 //------------------------------------------------------------------------- 429 //-------------------------------------------------------------------------
432 430
433 'encrypt': function(aKey, aValue, aVersion) { 431 'encrypt': function(aKey, aValue, aVersion) {
434 return Clipperz.PM.Crypto.encryptingFunctions.versions[aVersion].encrypt(aKey, aValue); 432 return Clipperz.PM.Crypto.encryptingFunctions.versions[aVersion].encrypt(aKey, aValue);
435 }, 433 },
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
index 8f8696d..507ee31 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.DataModel'); 24Clipperz.Base.module('Clipperz.PM.DataModel');
27 25
28Clipperz.PM.DataModel.DirectLogin = function(args) { 26Clipperz.PM.DataModel.DirectLogin = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.DataModel.DirectLogin.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.DataModel.DirectLogin.superclass.constructor.apply(this, arguments);
32 30
33 this._reference =args.reference 31 this._reference =args.reference
34 ||Clipperz.PM.Crypto.randomKey(); 32 ||Clipperz.PM.Crypto.randomKey();
35 this._record =args.record 33 this._record =args.record
36 ||Clipperz.Base.exception.raise('MandatoryParameter'); 34 ||Clipperz.Base.exception.raise('MandatoryParameter');
37 35
38 this._retrieveIndexDataFunction = args.retrieveIndexDataFunction 36 this._retrieveIndexDataFunction = args.retrieveIndexDataFunction
39 ||this.record().retrieveDirectLoginIndexDataFunction() 37 ||this.record().retrieveDirectLoginIndexDataFunction()
40 ||Clipperz.Base.exception.raise('MandatoryParameter'); 38 ||Clipperz.Base.exception.raise('MandatoryParameter');
41 this._setIndexDataFunction = args.setIndexDataFunction 39 this._setIndexDataFunction = args.setIndexDataFunction
42 ||this.record().setDirectLoginIndexDataFunction() 40 ||this.record().setDirectLoginIndexDataFunction()
43 ||Clipperz.Base.exception.raise('MandatoryParameter'); 41 ||Clipperz.Base.exception.raise('MandatoryParameter');
44 this._removeIndexDataFunction =args.removeIndexDataFunction 42 this._removeIndexDataFunction =args.removeIndexDataFunction
45 ||this.record().removeDirectLoginIndexDataFunction() 43 ||this.record().removeDirectLoginIndexDataFunction()
46 ||Clipperz.Base.exception.raise('MandatoryParameter'); 44 ||Clipperz.Base.exception.raise('MandatoryParameter');
@@ -308,49 +306,49 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
308 306
309 //TODO: shoud remove the 'formValues' call, as it is now deferred 307 //TODO: shoud remove the 'formValues' call, as it is now deferred
310 // if ((aRadio['checked'] == true) && (this.formValues()[aRadio['name']] == null)) { 308 // if ((aRadio['checked'] == true) && (this.formValues()[aRadio['name']] == null)) {
311 // this.formValues()[aRadio['name']] = aRadio['value']; 309 // this.formValues()[aRadio['name']] = aRadio['value'];
312 // } 310 // }
313 }, this)) 311 }, this))
314 312
315 updatedInputs = MochiKit.Base.concat(updatedInputs, MochiKit.Base.values(updatedRadios)); 313 updatedInputs = MochiKit.Base.concat(updatedInputs, MochiKit.Base.values(updatedRadios));
316 } 314 }
317 315
318 delete result.inputs; 316 delete result.inputs;
319 result.inputs = updatedInputs; 317 result.inputs = updatedInputs;
320 318
321 return result; 319 return result;
322 }, 320 },
323 321
324 '_fixConfiguration': function (aConfiguration) { 322 '_fixConfiguration': function (aConfiguration) {
325 var fixedConfiguration; 323 var fixedConfiguration;
326 // var inputs; 324 // var inputs;
327 // var bindings; 325 // var bindings;
328 // var i,c; 326 // var i,c;
329 327
330 fixedConfiguration = Clipperz.Base.deepClone(aConfiguration); 328 fixedConfiguration = Clipperz.Base.deepClone(aConfiguration);
331 329
332//console.log("PROCESS CONFIGURATION", aConfiguration); 330//Clipperz.log("PROCESS CONFIGURATION", aConfiguration);
333 switch (aConfiguration['bookmarkletVersion']) { 331 switch (aConfiguration['bookmarkletVersion']) {
334 case '0.1': 332 case '0.1':
335 fixedConfiguration['formData'] = this.fixFormDataFromBookmarkletVersion_0_1(aConfiguration['formData']); 333 fixedConfiguration['formData'] = this.fixFormDataFromBookmarkletVersion_0_1(aConfiguration['formData']);
336 break; 334 break;
337 case '0.2': 335 case '0.2':
338 fixedConfiguration['formData'] = aConfiguration['formData']; 336 fixedConfiguration['formData'] = aConfiguration['formData'];
339 break; 337 break;
340 } 338 }
341 339
342 / * 340 / *
343 aConfiguration['_inputs'] = []; 341 aConfiguration['_inputs'] = [];
344 c = formData['inputs'].length; 342 c = formData['inputs'].length;
345 for (i=0; i<c; i++) { 343 for (i=0; i<c; i++) {
346 aConfiguration['_inputs'].push(new Clipperz.PM.DataModel.DirectLoginInput(formData['inputs'][i])); 344 aConfiguration['_inputs'].push(new Clipperz.PM.DataModel.DirectLoginInput(formData['inputs'][i]));
347 } 345 }
348* / 346* /
349/ * 347/ *
350 aConfiguration['_bindings'] = {}; 348 aConfiguration['_bindings'] = {};
351 if (aConfiguration['legacyBindingData'] == null) { 349 if (aConfiguration['legacyBindingData'] == null) {
352 if (aConfiguration['bindingData'] != null) { 350 if (aConfiguration['bindingData'] != null) {
353 var bindingKey; 351 var bindingKey;
354 352
355 for (bindingKey in aConfiguration['bindingData']) { 353 for (bindingKey in aConfiguration['bindingData']) {
356 var newBinding; 354 var newBinding;
@@ -460,52 +458,51 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
460 //'favicon' 458 //'favicon'
461 // 'url' 459 // 'url'
462 }, 460 },
463 'form': someValues['configuration']['formData'], 461 'form': someValues['configuration']['formData'],
464 'version':someValues['configuration']['bookmarkletVersion'] 462 'version':someValues['configuration']['bookmarkletVersion']
465 } 463 }
466 464
467 result = Clipperz.Base.formatJSON(configuration); 465 result = Clipperz.Base.formatJSON(configuration);
468 } else { 466 } else {
469 result = ''; 467 result = '';
470 } 468 }
471 469
472 return result; 470 return result;
473 } 471 }
474 ], {trace:false}); 472 ], {trace:false});
475 473
476 }, 474 },
477 475
478 //------------------------------------------------------------------------- 476 //-------------------------------------------------------------------------
479 477
480 'setBookmarkletConfiguration': function (aValue) { 478 'setBookmarkletConfiguration': function (aValue) {
481 var bookmarkletConfiguration; 479 var bookmarkletConfiguration;
482 480
483 bookmarkletConfiguration = Clipperz.PM.DataModel.DirectLogin.checkBookmarkletConfiguration(aValue); 481 bookmarkletConfiguration = Clipperz.PM.DataModel.DirectLogin.checkBookmarkletConfiguration(aValue);
484//console.log("BOOKMARKLET CONFIGURATION", bookmarkletConfiguration); 482
485 return Clipperz.Async.callbacks("DirectLogin.setBookmarkletConfiguration", [ 483 return Clipperz.Async.callbacks("DirectLogin.setBookmarkletConfiguration", [
486 MochiKit.Base.method(this, 'setValue', 'formData', bookmarkletConfiguration['form']), 484 MochiKit.Base.method(this, 'setValue', 'formData', bookmarkletConfiguration['form']),
487//function (aValue) { console.log("SET VALUE - formData", aValue); return aValue; },
488 MochiKit.Base.method(this, 'setValue', 'bookmarkletVersion', bookmarkletConfiguration['version']), 485 MochiKit.Base.method(this, 'setValue', 'bookmarkletVersion', bookmarkletConfiguration['version']),
489 486
490 MochiKit.Base.method(this, 'favicon'), 487 MochiKit.Base.method(this, 'favicon'),
491 Clipperz.Async.deferredIf("the favicon is not set", [ 488 Clipperz.Async.deferredIf("the favicon is not set", [
492 ], [ 489 ], [
493 MochiKit.Base.method(this, 'faviconUrlWithBookmarkletConfiguration', bookmarkletConfiguration), 490 MochiKit.Base.method(this, 'faviconUrlWithBookmarkletConfiguration', bookmarkletConfiguration),
494 MochiKit.Base.method(this, 'setFavicon') 491 MochiKit.Base.method(this, 'setFavicon')
495 ]), 492 ]),
496 493
497 MochiKit.Base.method(this, 'updateInputsAfterChangingBookmarkletConfiguration'), 494 MochiKit.Base.method(this, 'updateInputsAfterChangingBookmarkletConfiguration'),
498 MochiKit.Base.method(this, 'updateFormValuesAfterChangingBookmarkletConfiguration'), 495 MochiKit.Base.method(this, 'updateFormValuesAfterChangingBookmarkletConfiguration'),
499 MochiKit.Base.method(this, 'updateBindingsAfterChangingBookmarkletConfiguration'), 496 MochiKit.Base.method(this, 'updateBindingsAfterChangingBookmarkletConfiguration'),
500 497
501 MochiKit.Base.noop 498 MochiKit.Base.noop
502 ], {trace:false}); 499 ], {trace:false});
503 }, 500 },
504 501
505 //========================================================================= 502 //=========================================================================
506 503
507 'formAttributes': function () { 504 'formAttributes': function () {
508 return this.getValue('formData.attributes'); 505 return this.getValue('formData.attributes');
509 }, 506 },
510 507
511 //========================================================================= 508 //=========================================================================
@@ -515,63 +512,59 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
515 Clipperz.Async.deferredIf("this._inputs is defined", [ 512 Clipperz.Async.deferredIf("this._inputs is defined", [
516 ], [ 513 ], [
517 MochiKit.Base.method(this, 'updateInputsAfterChangingBookmarkletConfiguration') 514 MochiKit.Base.method(this, 'updateInputsAfterChangingBookmarkletConfiguration')
518 ]) 515 ])
519 ], {trace:false}, this._inputs); 516 ], {trace:false}, this._inputs);
520 }, 517 },
521 518
522 'setInputWithFormDataConfiguration': function (aFormDataConfiguration) { 519 'setInputWithFormDataConfiguration': function (aFormDataConfiguration) {
523 this._inputs = {}; 520 this._inputs = {};
524 521
525 if (aFormDataConfiguration != null) { 522 if (aFormDataConfiguration != null) {
526 MochiKit.Iter.forEach(aFormDataConfiguration['inputs'], MochiKit.Base.bind(function (anInputData) { 523 MochiKit.Iter.forEach(aFormDataConfiguration['inputs'], MochiKit.Base.bind(function (anInputData) {
527 var newInput; 524 var newInput;
528 525
529 newInput = new Clipperz.PM.DataModel.DirectLoginInput(anInputData); 526 newInput = new Clipperz.PM.DataModel.DirectLoginInput(anInputData);
530 this._inputs[newInput.name()] = newInput; 527 this._inputs[newInput.name()] = newInput;
531 }, this)); 528 }, this));
532 } 529 }
533 530
534 return this._inputs; 531 return this._inputs;
535 }, 532 },
536 533
537 'updateInputsAfterChangingBookmarkletConfiguration': function () { 534 'updateInputsAfterChangingBookmarkletConfiguration': function () {
538 return Clipperz.Async.callbacks("DirectLogin.updateInputsAfterChangingBookmarkletConfiguration", [ 535 return Clipperz.Async.callbacks("DirectLogin.updateInputsAfterChangingBookmarkletConfiguration", [
539 // MochiKit.Base.method(this, 'getValue', ''),
540//function (aValue) { console.log("VALUE", aValue); return aValue },
541 MochiKit.Base.method(this, 'getValue', 'formData'), 536 MochiKit.Base.method(this, 'getValue', 'formData'),
542//function (aValue) { console.log("FORM DATA", aValue); return aValue },
543 MochiKit.Base.method(this, 'setInputWithFormDataConfiguration') 537 MochiKit.Base.method(this, 'setInputWithFormDataConfiguration')
544 ], {trace:false}); 538 ], {trace:false});
545 }, 539 },
546 540
547 //========================================================================= 541 //=========================================================================
548 542
549 'inputValues': function () { 543 'inputValues': function () {
550 return Clipperz.Async.callbacks("DirectLogin.inputValues", [ 544 return Clipperz.Async.callbacks("DirectLogin.inputValues", [
551 MochiKit.Base.method(this, 'inputs'), 545 MochiKit.Base.method(this, 'inputs'),
552 MochiKit.Base.values, 546 MochiKit.Base.values,
553 //function (aValue) { console.log("INPUTS", aValue); return aValue; },
554 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.partial(MochiKit.Base.method(this, 'inputValue'))), 547 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.partial(MochiKit.Base.method(this, 'inputValue'))),
555 Clipperz.Async.collectAll, 548 Clipperz.Async.collectAll,
556 Clipperz.Base.mergeItems 549 Clipperz.Base.mergeItems
557 ], {trace:false}); 550 ], {trace:false});
558 }, 551 },
559 552
560 'inputValue': function (anInput) { 553 'inputValue': function (anInput) {
561 vardeferredResult; 554 vardeferredResult;
562 555
563 deferredResult = new Clipperz.Async.Deferred("DirectLogin.inputValue", {trace:false}); 556 deferredResult = new Clipperz.Async.Deferred("DirectLogin.inputValue", {trace:false});
564 557
565 if (anInput.needsFormValue()) { 558 if (anInput.needsFormValue()) {
566 deferredResult.addMethod(this, 'formValues'); 559 deferredResult.addMethod(this, 'formValues');
567 deferredResult.addCallback(MochiKit.Base.itemgetter(anInput.name())); 560 deferredResult.addCallback(MochiKit.Base.itemgetter(anInput.name()));
568 deferredResult.addMethodcaller('value'); 561 deferredResult.addMethodcaller('value');
569 } else if (anInput.needsBinding()) { 562 } else if (anInput.needsBinding()) {
570 deferredResult.addMethod(this, 'bindings'); 563 deferredResult.addMethod(this, 'bindings');
571 deferredResult.addCallback(MochiKit.Base.itemgetter(anInput.name())); 564 deferredResult.addCallback(MochiKit.Base.itemgetter(anInput.name()));
572 deferredResult.addMethodcaller('field'); 565 deferredResult.addMethodcaller('field');
573 deferredResult.addMethodcaller('value'); 566 deferredResult.addMethodcaller('value');
574 } else { 567 } else {
575 deferredResult.addCallback(MochiKit.Async.succeed, anInput.value()); 568 deferredResult.addCallback(MochiKit.Async.succeed, anInput.value());
576 } 569 }
577 deferredResult.addCallback(function (anActualValue) { 570 deferredResult.addCallback(function (anActualValue) {
@@ -653,61 +646,58 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
653 646
654 if (MochiKit.Base.isUndefinedOrNull(someValues['originalValues']) || MochiKit.Base.isUndefinedOrNull(someValues['originalValues']['bindingData'])) { 647 if (MochiKit.Base.isUndefinedOrNull(someValues['originalValues']) || MochiKit.Base.isUndefinedOrNull(someValues['originalValues']['bindingData'])) {
655 availableBindingValues = {}; 648 availableBindingValues = {};
656 } else { 649 } else {
657 availableBindingValues = Clipperz.Base.deepClone(someValues['originalValues']['bindingData']) 650 availableBindingValues = Clipperz.Base.deepClone(someValues['originalValues']['bindingData'])
658 } 651 }
659 652
660 if (someValues['currentValues'] != null) { 653 if (someValues['currentValues'] != null) {
661 MochiKit.Base.update(availableBindingValues, someValues['currentValues']['bindingData']); 654 MochiKit.Base.update(availableBindingValues, someValues['currentValues']['bindingData']);
662 } 655 }
663 656
664 this._bindings = {}; 657 this._bindings = {};
665 newBindingValues = {} 658 newBindingValues = {}
666 MochiKit.Iter.forEach(MochiKit.Base.filter(MochiKit.Base.methodcaller('needsBinding'), MochiKit.Base.values(someValues['inputs'])), MochiKit.Base.bind(function (anInput) { 659 MochiKit.Iter.forEach(MochiKit.Base.filter(MochiKit.Base.methodcaller('needsBinding'), MochiKit.Base.values(someValues['inputs'])), MochiKit.Base.bind(function (anInput) {
667 varnewBinding; 660 varnewBinding;
668 661
669 newBindingValues[anInput.name()] = availableBindingValues[anInput.name()]; 662 newBindingValues[anInput.name()] = availableBindingValues[anInput.name()];
670 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, { 663 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, {
671 'key': anInput.name(), 664 'key': anInput.name(),
672 'field':availableBindingValues[anInput.name()] 665 'field':availableBindingValues[anInput.name()]
673 }); 666 });
674 667
675 this._bindings[anInput.name()] = newBinding; 668 this._bindings[anInput.name()] = newBinding;
676 }, this)) 669 }, this))
677//console.log("THIS._BINDINGS", this._bindings);
678 670
679 return newBindingValues; 671 return newBindingValues;
680 672
681/* 673/*
682 this._bindings = {}; 674 this._bindings = {};
683//console.log("CONFIGURATION", aConfiguration);
684 675
685 if (someValues['currentValues'] != null) { 676 if (someValues['currentValues'] != null) {
686 if (someValues['currentValues']['bindingData'] != null) { 677 if (someValues['currentValues']['bindingData'] != null) {
687 var bindingKey; 678 var bindingKey;
688 679
689//console.log("BINDING DATA", someValues['currentValues']['bindingData']);
690 for (bindingKey in someValues['currentValues']['bindingData']) { 680 for (bindingKey in someValues['currentValues']['bindingData']) {
691 var newBinding; 681 var newBinding;
692 682
693 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, { 683 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, {
694 'key': bindingKey, 684 'key': bindingKey,
695 'field':someValues['currentValues']['bindingData'][bindingKey] 685 'field':someValues['currentValues']['bindingData'][bindingKey]
696 }); 686 });
697 this._bindings[newBinding.key()] = newBinding; 687 this._bindings[newBinding.key()] = newBinding;
698 } 688 }
699 } else if (someValues['currentValues']['legacyBindingData'] == null) { 689 } else if (someValues['currentValues']['legacyBindingData'] == null) {
700 var bindingKey; 690 var bindingKey;
701 691
702 for (bindingKey in someValues['currentValues']['legacyBindingData']) { 692 for (bindingKey in someValues['currentValues']['legacyBindingData']) {
703 var newBinding; 693 var newBinding;
704 694
705 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, { 695 newBinding = new Clipperz.PM.DataModel.DirectLoginBinding(this, {
706 'key': bindingKey, 696 'key': bindingKey,
707 'field':someValues['currentValues']['legacyBindingData'][bindingKey] 697 'field':someValues['currentValues']['legacyBindingData'][bindingKey]
708 }); 698 });
709 this._bindings[newBinding.key()] = newBinding; 699 this._bindings[newBinding.key()] = newBinding;
710 } 700 }
711 } else { 701 } else {
712 WTF = TODO; 702 WTF = TODO;
713 } 703 }
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
index 4377853..a8ebb97 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, args) { 31Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, args) {
34 args = args || {}; 32 args = args || {};
35 33
36 this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); 34 this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter');
37 35
38 this._key = args.key|| Clipperz.Base.exception.raise('MandatoryParameter'); 36 this._key = args.key|| Clipperz.Base.exception.raise('MandatoryParameter');
39 this._fieldKey = args.field || /* this.directLogin().fieldWithName(args.fieldName).reference() || */null; 37 this._fieldKey = args.field || /* this.directLogin().fieldWithName(args.fieldName).reference() || */null;
40 38
41 return this; 39 return this;
42} 40}
43 41
44Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { 42Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, {
45 43
46 'toString': function() { 44 'toString': function() {
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
index a461197..2429f88 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.PM.DataModel.DirectLoginFormValue = function(aDirectLogin, args) { 31Clipperz.PM.DataModel.DirectLoginFormValue = function(aDirectLogin, args) {
34 args = args || {}; 32 args = args || {};
35 33
36 this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter'); 34 this._directLogin = aDirectLogin|| Clipperz.Base.exception.raise('MandatoryParameter');
37 35
38 this._key = args.key || Clipperz.Base.exception.raise('MandatoryParameter'); 36 this._key = args.key || Clipperz.Base.exception.raise('MandatoryParameter');
39 this._fieldOptions = args.fieldOptions|| Clipperz.Base.exception.raise('MandatoryParameter'); 37 this._fieldOptions = args.fieldOptions|| Clipperz.Base.exception.raise('MandatoryParameter');
40 this._value = args.value || null; 38 this._value = args.value || null;
41 39
42 return this; 40 return this;
43} 41}
44 42
45Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null, { 43Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null, {
46 44
@@ -66,39 +64,38 @@ Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null
66 return this._fieldOptions; 64 return this._fieldOptions;
67 }, 65 },
68 66
69 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
70 68
71 'type': function () { 69 'type': function () {
72 return this.fieldOptions()['type']; 70 return this.fieldOptions()['type'];
73 }, 71 },
74 72
75 //------------------------------------------------------------------------- 73 //-------------------------------------------------------------------------
76 74
77 'value': function() { 75 'value': function() {
78 varresult; 76 varresult;
79 77
80 result = this._value; 78 result = this._value;
81 79
82 // if ((result == null) && (this.type() == 'checkbox')) { 80 // if ((result == null) && (this.type() == 'checkbox')) {
83 // result = false; 81 // result = false;
84 // }; 82 // };
85 83
86 return result; 84 return result;
87 }, 85 },
88 86
89 'setValue': function (aValue) { 87 'setValue': function (aValue) {
90//console.log("DirectLoginFormValue.setValue", aValue);
91 this._value = aValue; 88 this._value = aValue;
92 return this.directLogin().setValue('formValues' + '.' + this.key(), aValue); 89 return this.directLogin().setValue('formValues' + '.' + this.key(), aValue);
93 }, 90 },
94 91
95 //------------------------------------------------------------------------- 92 //-------------------------------------------------------------------------
96/* 93/*
97 'serializedData': function() { 94 'serializedData': function() {
98 return this.value(); 95 return this.value();
99 }, 96 },
100*/ 97*/
101 //------------------------------------------------------------------------- 98 //-------------------------------------------------------------------------
102 __syntaxFix__: "syntax fix" 99 __syntaxFix__: "syntax fix"
103}); 100});
104 101
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
index 8188389..d9995fc 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30//############################################################################# 28//#############################################################################
31 29
32Clipperz.PM.DataModel.DirectLoginInput = function(args) { 30Clipperz.PM.DataModel.DirectLoginInput = function(args) {
33 this._args = args; 31 this._args = args;
34 32
35 return this; 33 return this;
36} 34}
37 35
38Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { 36Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
39 37
40 'args': function() { 38 'args': function() {
41 return this._args; 39 return this._args;
42 }, 40 },
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'name': function() { 44 'name': function() {
@@ -55,49 +53,49 @@ Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
55 result = this.args()['type']; 53 result = this.args()['type'];
56 54
57 if (result != null) { 55 if (result != null) {
58 result = result.toLowerCase(); 56 result = result.toLowerCase();
59 } 57 }
60 return result; 58 return result;
61 }, 59 },
62 60
63 //------------------------------------------------------------------------- 61 //-------------------------------------------------------------------------
64 62
65 'options': function() { 63 'options': function() {
66 return this.args()['options']; 64 return this.args()['options'];
67 }, 65 },
68 66
69 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
70 68
71 'value': function() { 69 'value': function() {
72 return this.args()['value']; 70 return this.args()['value'];
73 }, 71 },
74 72
75 //------------------------------------------------------------------------- 73 //-------------------------------------------------------------------------
76 /* 74 /*
77 'formConfiguration': function(someFormValues, someBindings, someFields) { 75 'formConfiguration': function(someFormValues, someBindings, someFields) {
78 var result; 76 var result;
79//console.log("### DirectLoginInput.formConfiguration", someFields); 77
80 if (this.shouldSetValue()) { 78 if (this.shouldSetValue()) {
81 switch (this.type()) { 79 switch (this.type()) {
82 case 'select': 80 case 'select':
83 var currentValue; 81 var currentValue;
84 var options; 82 var options;
85 83
86 // currentValue = this.directLogin()._configuration['formValues'][this.name()]; 84 // currentValue = this.directLogin()._configuration['formValues'][this.name()];
87 currentValue = someFormValues[this.name()]; 85 currentValue = someFormValues[this.name()];
88 options = this.args()['options']; 86 options = this.args()['options'];
89 87
90 result = MochiKit.DOM.SELECT({name:this.name()}, 88 result = MochiKit.DOM.SELECT({name:this.name()},
91 MochiKit.Base.map(function(anOption) { 89 MochiKit.Base.map(function(anOption) {
92 var options; 90 var options;
93 91
94 options = {value:anOption['value']}; 92 options = {value:anOption['value']};
95 if (currentValue == anOption['value']) { 93 if (currentValue == anOption['value']) {
96 options.selected = true; 94 options.selected = true;
97 } 95 }
98 96
99 return MochiKit.DOM.OPTION(options, anOption['label']) 97 return MochiKit.DOM.OPTION(options, anOption['label'])
100 }, options) 98 }, options)
101 ) 99 )
102 break; 100 break;
103 case 'checkbox': 101 case 'checkbox':
@@ -133,54 +131,48 @@ Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
133 if (isChecked) { 131 if (isChecked) {
134 options.checked = true; 132 options.checked = true;
135 } 133 }
136 134
137 if (Clipperz_IEisBroken == true) { 135 if (Clipperz_IEisBroken == true) {
138 var checkedValue; 136 var checkedValue;
139 137
140 checkedValue = (isChecked ? " CHECKED" : ""); 138 checkedValue = (isChecked ? " CHECKED" : "");
141 inputNode = MochiKit.DOM.currentDocument().createElement("<INPUT TYPE='RADIO' NAME='" + currentName + "' VALUE='" + anOption['value'] + "'" + checkedValue + ">"); 139 inputNode = MochiKit.DOM.currentDocument().createElement("<INPUT TYPE='RADIO' NAME='" + currentName + "' VALUE='" + anOption['value'] + "'" + checkedValue + ">");
142 } else { 140 } else {
143 inputNode = MochiKit.DOM.INPUT(options, anOption['value']); 141 inputNode = MochiKit.DOM.INPUT(options, anOption['value']);
144 } 142 }
145 divNode = MochiKit.DOM.DIV(null, inputNode); 143 divNode = MochiKit.DOM.DIV(null, inputNode);
146 144
147 return divNode; 145 return divNode;
148 }, options) 146 }, options)
149 ); 147 );
150 break; 148 break;
151 } 149 }
152 } else { 150 } else {
153 var binding; 151 var binding;
154 // binding = this.directLogin().bindings()[this.name()]; 152 // binding = this.directLogin().bindings()[this.name()];
155 binding = someBindings[this.name()]; 153 binding = someBindings[this.name()];
156 154
157//console.log("### binding", binding);
158//if (binding != null) {
159 ///console.log(" binding.field()", binding.field());
160 ///console.log(" binding.field().value()", binding.field().value());
161 //console.log(" someFields[binding.fieldKey()].value()", someFields[binding.fieldKey()].value());
162//}
163 result = MochiKit.DOM.INPUT({ 155 result = MochiKit.DOM.INPUT({
164 type:((this.type() != 'password') ? this.type() : 'text'), 156 type:((this.type() != 'password') ? this.type() : 'text'),
165 name:this.name(), 157 name:this.name(),
166 // value:((binding != null)? binding.field().value() : this.value()) 158 // value:((binding != null)? binding.field().value() : this.value())
167 value:((binding != null)? someFields[binding.fieldKey()]['value'] : this.value()) 159 value:((binding != null)? someFields[binding.fieldKey()]['value'] : this.value())
168 // value:((binding != null)? someFields[binding.fieldKey()].value() : this.value()) 160 // value:((binding != null)? someFields[binding.fieldKey()].value() : this.value())
169 }, null); 161 }, null);
170 } 162 }
171 163
172 return result; 164 return result;
173 }, 165 },
174 */ 166 */
175 //------------------------------------------------------------------------- 167 //-------------------------------------------------------------------------
176 168
177 'needsFormValue': function() { 169 'needsFormValue': function() {
178 var type; 170 var type;
179 var result; 171 var result;
180 172
181 type = this.type(); 173 type = this.type();
182 result = ((type == 'checkbox') || (type == 'radio') || (type == 'select')); 174 result = ((type == 'checkbox') || (type == 'radio') || (type == 'select'));
183 175
184 return result; 176 return result;
185 }, 177 },
186 178
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
index cdeec8b..1aa7a52 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.KeyValueObjectStore) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.KeyValueObjectStore) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.EncryptedRemoteObject depends on Clipperz.KeyValueObjectStore!"; 25 throw "Clipperz.PM.DataModel.EncryptedRemoteObject depends on Clipperz.KeyValueObjectStore!";
28} 26}
29 27
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 28if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 29if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
32 30
33Clipperz.PM.DataModel.EncryptedRemoteObject = function(args) { 31Clipperz.PM.DataModel.EncryptedRemoteObject = function(args) {
34 args = args || {}; 32 args = args || {};
35 33
36 this._name = args.name || null; 34 this._name = args.name || null;
37 this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); 35 this._reference = args.reference || Clipperz.PM.Crypto.randomKey();
38 this._isBrandNew = ((args.reference == null) && (args.remoteData == null)); 36 this._isBrandNew = ((args.reference == null) && (args.remoteData == null));
39 37
40 if ((this._isBrandNew == false) && (args['retrieveKeyFunction'] == null)) { 38 if ((this._isBrandNew == false) && (args['retrieveKeyFunction'] == null)) {
41 Clipperz.Base.exception.raise('MandatoryParameter'); 39 Clipperz.Base.exception.raise('MandatoryParameter');
42 } else { 40 } else {
43 this._retrieveKeyFunction = args['retrieveKeyFunction']; 41 this._retrieveKeyFunction = args['retrieveKeyFunction'];
44 } 42 }
45 43
46 this._retrieveRemoteDataFunction = args.retrieveRemoteDataFunction|| null; 44 this._retrieveRemoteDataFunction = args.retrieveRemoteDataFunction|| null;
@@ -390,52 +388,48 @@ Clipperz.PM.DataModel.EncryptedRemoteObject.prototype = MochiKit.Base.update(nul
390 388
391 //------------------------------------------------------------------------- 389 //-------------------------------------------------------------------------
392 390
393 'hasPendingChanges': function () { 391 'hasPendingChanges': function () {
394 var deferredResult; 392 var deferredResult;
395 var tempObj = this; 393 var tempObj = this;
396 394
397 if (this.isBrandNew()) { 395 if (this.isBrandNew()) {
398 // deferredResult = MochiKit.Async.succeed(true); 396 // deferredResult = MochiKit.Async.succeed(true);
399 deferredResult = this.hasPendingChangesWhenBrandNew(); 397 deferredResult = this.hasPendingChangesWhenBrandNew();
400 } else if (this.hasInitiatedObjectDataStore()) { 398 } else if (this.hasInitiatedObjectDataStore()) {
401 deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObject.hasPendingChanges", {trace:false}); 399 deferredResult = new Clipperz.Async.Deferred("EncryptedRemoteObject.hasPendingChanges", {trace:false});
402 deferredResult.collectResults({ 400 deferredResult.collectResults({
403 'decryptedData': [ 401 'decryptedData': [
404 MochiKit.Base.method(this, 'getDecryptedData'), 402 MochiKit.Base.method(this, 'getDecryptedData'),
405 Clipperz.Base.serializeJSON 403 Clipperz.Base.serializeJSON
406 ], 404 ],
407 'objectData': [ 405 'objectData': [
408 MochiKit.Base.method(this, '_getObjectDataStore'), 406 MochiKit.Base.method(this, '_getObjectDataStore'),
409 MochiKit.Base.methodcaller('values'), 407 MochiKit.Base.methodcaller('values'),
410 Clipperz.Base.serializeJSON 408 Clipperz.Base.serializeJSON
411 ] 409 ]
412 }); 410 });
413 deferredResult.addCallback(function (someValues) { 411 deferredResult.addCallback(function (someValues) {
414//if (someValues['decryptedData'] != someValues['objectData']) {
415 //console.log("ORIGINAL DATA", '[[[' + someValues['decryptedData'] + ']]]');
416 //console.log("CURRENT DATA", '>>>' + someValues['objectData'] + '<<<');
417//}
418 return (someValues['decryptedData'] != someValues['objectData']); 412 return (someValues['decryptedData'] != someValues['objectData']);
419 }); 413 });
420 deferredResult.callback(); 414 deferredResult.callback();
421 } else { 415 } else {
422 deferredResult = MochiKit.Async.succeed(false); 416 deferredResult = MochiKit.Async.succeed(false);
423 } 417 }
424 418
425 return deferredResult; 419 return deferredResult;
426 }, 420 },
427 421
428 'hasPendingChangesWhenBrandNew': function () { 422 'hasPendingChangesWhenBrandNew': function () {
429 return MochiKit.Async.succeed(true); 423 return MochiKit.Async.succeed(true);
430 }, 424 },
431 425
432 //------------------------------------------------------------------------- 426 //-------------------------------------------------------------------------
433 427
434 'commitTransientState': function () { 428 'commitTransientState': function () {
435 var deferredResult; 429 var deferredResult;
436 430
437 // if (this.transientState().getValue('__prepareRemoteData') == true) { 431 // if (this.transientState().getValue('__prepareRemoteData') == true) {
438 if (this.transientState().getValue('packedRemoteData') != null) { 432 if (this.transientState().getValue('packedRemoteData') != null) {
439 deferredResult = Clipperz.Async.callbacks("EncryptedRemoteObject.commitTransientState - prepareRemoteData", [ 433 deferredResult = Clipperz.Async.callbacks("EncryptedRemoteObject.commitTransientState - prepareRemoteData", [
440 MochiKit.Base.bind(function (someData) { 434 MochiKit.Base.bind(function (someData) {
441 this._remoteData = this.transientState().getValue('packedRemoteData'); 435 this._remoteData = this.transientState().getValue('packedRemoteData');
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
index 834e21b..fbca1ff 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.PM.DataModel.OneTimePassword = function(args) { 31Clipperz.PM.DataModel.OneTimePassword = function(args) {
34 args = args || {}; 32 args = args || {};
35 33
36 //this._user = args['user']; 34 //this._user = args['user'];
37 this._reference = args['reference']|| Clipperz.PM.Crypto.randomKey(); 35 this._reference = args['reference']|| Clipperz.PM.Crypto.randomKey();
38 this._password = args['password']; 36 this._password = args['password'];
39 this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); 37 this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']);
40 this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); 38 this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date();
41 this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; 39 this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null;
42 40
43 this._status = args['status'] || 'ACTIVE'; //'REQUESTED', 'USED', 'DISABLED' 41 this._status = args['status'] || 'ACTIVE'; //'REQUESTED', 'USED', 'DISABLED'
44 this._connectionInfo= null; 42 this._connectionInfo= null;
45 43
46 this._key = null; 44 this._key = null;
@@ -122,145 +120,145 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
122 120
123 result = { 121 result = {
124 'password': this.password(), 122 'password': this.password(),
125 'created': this.creationDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.creationDate()) : null, 123 'created': this.creationDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.creationDate()) : null,
126 'used': this.usageDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.usageDate()) : null, 124 'used': this.usageDate() ? Clipperz.PM.Date.formatDateWithUTCFormat(this.usageDate()) : null,
127 'status': this.status() 125 'status': this.status()
128 }; 126 };
129 127
130 return result; 128 return result;
131 }, 129 },
132 130
133 //------------------------------------------------------------------------- 131 //-------------------------------------------------------------------------
134 132
135 'packedPassphrase': function() { 133 'packedPassphrase': function() {
136 var result; 134 var result;
137 var packedPassphrase; 135 var packedPassphrase;
138 var encodedPassphrase; 136 var encodedPassphrase;
139 varprefixPadding; 137 varprefixPadding;
140 var suffixPadding; 138 var suffixPadding;
141 var getRandomBytes; 139 var getRandomBytes;
142 140
143 getRandomBytes = MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes'); 141 getRandomBytes = MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes');
144 142
145 encodedPassphrase = new Clipperz.ByteArray(this.user().passphrase()).toBase64String(); 143 encodedPassphrase = new Clipperz.ByteArray(this.user().passphrase()).toBase64String();
146//MochiKit.Logging.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length); 144//Clipperz.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length);
147 prefixPadding = getRandomBytes(getRandomBytes(1).byteAtIndex(0)).toBase64String(); 145 prefixPadding = getRandomBytes(getRandomBytes(1).byteAtIndex(0)).toBase64String();
148//MochiKit.Logging.logDebug("--- prefixPadding.length: " + prefixPadding.length); 146//Clipperz.logDebug("--- prefixPadding.length: " + prefixPadding.length);
149 suffixPadding = getRandomBytes((500 - prefixPadding.length - encodedPassphrase.length) * 6 / 8).toBase64String(); 147 suffixPadding = getRandomBytes((500 - prefixPadding.length - encodedPassphrase.length) * 6 / 8).toBase64String();
150//MochiKit.Logging.logDebug("--- suffixPadding.length: " + suffixPadding.length); 148//Clipperz.logDebug("--- suffixPadding.length: " + suffixPadding.length);
151//MochiKit.Logging.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length)); 149//Clipperz.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length));
152 150
153 packedPassphrase = { 151 packedPassphrase = {
154 'prefix': prefixPadding, 152 'prefix': prefixPadding,
155 'passphrase': encodedPassphrase, 153 'passphrase': encodedPassphrase,
156 'suffix': suffixPadding 154 'suffix': suffixPadding
157 }; 155 };
158 156
159 // result = Clipperz.Base.serializeJSON(packedPassphrase); 157 // result = Clipperz.Base.serializeJSON(packedPassphrase);
160 result = packedPassphrase; 158 result = packedPassphrase;
161//MochiKit.Logging.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result); 159//Clipperz.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result);
162//MochiKit.Logging.logDebug("<<< OneTimePassword.packedPassphrase"); 160//Clipperz.logDebug("<<< OneTimePassword.packedPassphrase");
163 161
164 return result; 162 return result;
165 }, 163 },
166 164
167 //------------------------------------------------------------------------- 165 //-------------------------------------------------------------------------
168 166
169 'encryptedPackedPassphrase': function() { 167 'encryptedPackedPassphrase': function() {
170 return Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion(this.passwordValue(), this.packedPassphrase()) 168 return Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion(this.passwordValue(), this.packedPassphrase())
171 }, 169 },
172 170
173 //------------------------------------------------------------------------- 171 //-------------------------------------------------------------------------
174 172
175 'encryptedData': function() { 173 'encryptedData': function() {
176 var deferredResult; 174 var deferredResult;
177 varresult; 175 varresult;
178 176
179//MochiKit.Logging.logDebug(">>> OneTimePassword.encryptedData"); 177//Clipperz.logDebug(">>> OneTimePassword.encryptedData");
180//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference()); 178//Clipperz.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference());
181 result = { 179 result = {
182 'reference': this.reference(), 180 'reference': this.reference(),
183 'key': this.key(), 181 'key': this.key(),
184 'keyChecksum': this.keyChecksum(), 182 'keyChecksum': this.keyChecksum(),
185 'data': "", 183 'data': "",
186 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion 184 'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion
187 } 185 }
188//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result)); 186//Clipperz.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result));
189 deferredResult = new MochiKit.Async.Deferred(); 187 deferredResult = new MochiKit.Async.Deferred();
190//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 3"); 188//Clipperz.logDebug("--- OneTimePassword.encryptedData - 3");
191//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;}); 189//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;});
192 //# deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion, this.passwordValue(), this.packedPassphrase()); 190 //# deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion, this.passwordValue(), this.packedPassphrase());
193 deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedPackedPassphrase')); 191 deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedPackedPassphrase'));
194//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 4"); 192//Clipperz.logDebug("--- OneTimePassword.encryptedData - 4");
195//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;}); 193//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;});
196 deferredResult.addCallback(function(aResult, res) { 194 deferredResult.addCallback(function(aResult, res) {
197 aResult['data'] = res; 195 aResult['data'] = res;
198 return aResult; 196 return aResult;
199 }, result); 197 }, result);
200//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 5"); 198//Clipperz.logDebug("--- OneTimePassword.encryptedData - 5");
201//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;}); 199//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;});
202 deferredResult.callback(); 200 deferredResult.callback();
203//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 6"); 201//Clipperz.logDebug("--- OneTimePassword.encryptedData - 6");
204 202
205 return deferredResult; 203 return deferredResult;
206 }, 204 },
207 205
208 //------------------------------------------------------------------------- 206 //-------------------------------------------------------------------------
209 207
210 'saveChanges': function() { 208 'saveChanges': function() {
211 var deferredResult; 209 var deferredResult;
212 varresult; 210 varresult;
213 211
214//MochiKit.Logging.logDebug(">>> OneTimePassword.saveChanges"); 212//Clipperz.logDebug(">>> OneTimePassword.saveChanges");
215 result = {}; 213 result = {};
216 deferredResult = new MochiKit.Async.Deferred(); 214 deferredResult = new MochiKit.Async.Deferred();
217 215
218 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_encryptUserData'); 216 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_encryptUserData');
219 deferredResult.addCallback(MochiKit.Base.method(this.user(), 'encryptedData')); 217 deferredResult.addCallback(MochiKit.Base.method(this.user(), 'encryptedData'));
220 deferredResult.addCallback(function(aResult, res) { 218 deferredResult.addCallback(function(aResult, res) {
221 aResult['user'] = res; 219 aResult['user'] = res;
222 return aResult; 220 return aResult;
223 }, result); 221 }, result);
224 222
225 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_encryptOTPData'); 223 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_encryptOTPData');
226 deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedData')); 224 deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedData'));
227 deferredResult.addCallback(function(aResult, res) { 225 deferredResult.addCallback(function(aResult, res) {
228 aResult['oneTimePassword'] = res; 226 aResult['oneTimePassword'] = res;
229 return aResult; 227 return aResult;
230 }, result); 228 }, result);
231 229
232 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_sendingData'); 230 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_sendingData');
233//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 1: " + Clipperz.Base.serializeJSON(res)); return res;}); 231//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 1: " + Clipperz.Base.serializeJSON(res)); return res;});
234 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'addNewOneTimePassword'); 232 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'addNewOneTimePassword');
235 233
236 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_updatingInterface'); 234 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_updatingInterface');
237//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;}); 235//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
238 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'OTPUpdated'); 236 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'OTPUpdated');
239 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'oneTimePassword_saveChanges_done', null); 237 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'oneTimePassword_saveChanges_done', null);
240//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;}); 238//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
241 deferredResult.callback(); 239 deferredResult.callback();
242//MochiKit.Logging.logDebug("<<< OneTimePassword.saveChanges"); 240//Clipperz.logDebug("<<< OneTimePassword.saveChanges");
243 241
244 return deferredResult; 242 return deferredResult;
245 }, 243 },
246 244
247 //------------------------------------------------------------------------- 245 //-------------------------------------------------------------------------
248 246
249 'usageDate': function() { 247 'usageDate': function() {
250 return this._usageDate; 248 return this._usageDate;
251 }, 249 },
252 250
253 'setUsageDate': function(aValue) { 251 'setUsageDate': function(aValue) {
254 this._usageDate = aValue; 252 this._usageDate = aValue;
255 }, 253 },
256 254
257 //------------------------------------------------------------------------- 255 //-------------------------------------------------------------------------
258 256
259 'connectionInfo': function() { 257 'connectionInfo': function() {
260 return this._connectionInfo; 258 return this._connectionInfo;
261 }, 259 },
262 260
263 'setConnectionInfo': function(aValue) { 261 'setConnectionInfo': function(aValue) {
264 this._connectionInfo = aValue; 262 this._connectionInfo = aValue;
265 }, 263 },
266 264
@@ -287,68 +285,66 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
287 285
288 return result; 286 return result;
289 }, 287 },
290 */ 288 */
291 //------------------------------------------------------------------------- 289 //-------------------------------------------------------------------------
292 __syntaxFix__: "syntax fix" 290 __syntaxFix__: "syntax fix"
293}); 291});
294 292
295//############################################################################# 293//#############################################################################
296 294
297Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword = function(anUsername, aPassword) { 295Clipperz.PM.DataModel.OneTimePassword.computeKeyWithUsernameAndPassword = function(anUsername, aPassword) {
298 return Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aPassword)).toHexString().substring(2); 296 return Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aPassword)).toHexString().substring(2);
299} 297}
300 298
301Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword = function(anUsername, aPassword) { 299Clipperz.PM.DataModel.OneTimePassword.computeKeyChecksumWithUsernameAndPassword = function(anUsername, aPassword) {
302 return Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(anUsername + aPassword)).toHexString().substring(2); 300 return Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(anUsername + aPassword)).toHexString().substring(2);
303} 301}
304 302
305//============================================================================= 303//=============================================================================
306 304
307Clipperz.PM.DataModel.OneTimePassword.isValidOneTimePasswordValue = function(aPassword) { 305Clipperz.PM.DataModel.OneTimePassword.isValidOneTimePasswordValue = function(aPassword) {
308 var result; 306 var result;
309 307
310 //"yaxx k7ww - f8y6 tqz5 - 58b6 th44 - 9cwv q0fg" 308 //"yaxx k7ww - f8y6 tqz5 - 58b6 th44 - 9cwv q0fg"
311//console.log("Clipperz.PM.DataModel.OneTimePassword.isValidOneTimePasswordValue", aPassword);
312 if (aPassword.replace(/[\s\-]/g, '').length == 32) { 309 if (aPassword.replace(/[\s\-]/g, '').length == 32) {
313 try { 310 try {
314 var passwordByteArray; 311 var passwordByteArray;
315 312
316 passwordByteArray = new Clipperz.ByteArray(); 313 passwordByteArray = new Clipperz.ByteArray();
317 passwordByteArray.appendBase32String(aPassword); 314 passwordByteArray.appendBase32String(aPassword);
318 315
319 result = true; 316 result = true;
320 } catch(exception) { 317 } catch(exception) {
321 result = false; 318 result = false;
322 } 319 }
323 } else { 320 } else {
324 result = false; 321 result = false;
325 } 322 }
326 323
327 return result; 324 return result;
328} 325}
329 326
330//============================================================================= 327//=============================================================================
331 328
332Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword = function(aPassword) { 329Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword = function(aPassword) {
333 varresult; 330 varresult;
334 331
335 if (aPassword.replace(/[\s\-]/g, '').length == 32) { 332 if (aPassword.replace(/[\s\-]/g, '').length == 32) {
336 try { 333 try {
337 var passwordByteArray; 334 var passwordByteArray;
338 335
339 passwordByteArray = new Clipperz.ByteArray(); 336 passwordByteArray = new Clipperz.ByteArray();
340 passwordByteArray.appendBase32String(aPassword); 337 passwordByteArray.appendBase32String(aPassword);
341 338
342 result = passwordByteArray.toBase64String(); 339 result = passwordByteArray.toBase64String();
343 } catch(exception) { 340 } catch(exception) {
344 result = aPassword; 341 result = aPassword;
345 } 342 }
346 } else { 343 } else {
347 result = aPassword; 344 result = aPassword;
348 } 345 }
349 346
350//console.log("Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword", aPassword, result);
351 return result; 347 return result;
352} 348}
353 349
354//############################################################################# 350//#############################################################################
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 f51bbc2..986db40 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.Record.Version) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.Record.Version) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.Record.Version.Field depends on Clipperz.PM.DataModel.Record.Version!"; 25 throw "Clipperz.PM.DataModel.Record.Version.Field depends on Clipperz.PM.DataModel.Record.Version!";
28} 26}
29 27
30Clipperz.PM.DataModel.Record.Version.Field = function(args) { 28Clipperz.PM.DataModel.Record.Version.Field = function(args) {
31 Clipperz.PM.DataModel.Record.Version.Field.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.DataModel.Record.Version.Field.superclass.constructor.apply(this, arguments);
32 30
33 this._recordVersion = args.recordVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._recordVersion = args.recordVersion|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); 32 this._reference = args.reference || Clipperz.PM.Crypto.randomKey();
35 33
36 return this; 34 return this;
37} 35}
38 36
39 37
40Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version.Field, Object, { 38Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version.Field, Object, {
41 39
42 'toString': function() { 40 'toString': function() {
43 return "Record.Version.Field (" + this.reference() + ")"; 41 return "Record.Version.Field (" + this.reference() + ")";
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
index dd35fc9..87b319c 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
@@ -1,55 +1,52 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.Record) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.Record) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.Record.Version depends on Clipperz.PM.DataModel.Record!"; 25 throw "Clipperz.PM.DataModel.Record.Version depends on Clipperz.PM.DataModel.Record!";
28} 26}
29 27
30Clipperz.PM.DataModel.Record.Version = function(args) { 28Clipperz.PM.DataModel.Record.Version = function(args) {
31//console.log(">>> Record.new");
32 Clipperz.PM.DataModel.Record.Version.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.DataModel.Record.Version.superclass.constructor.apply(this, arguments);
33 30
34 this._getVersionFunction = args.getVersion|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._getVersionFunction = args.getVersion|| Clipperz.Base.exception.raise('MandatoryParameter');
35 this._fields = null; 32 this._fields = null;
36 33
37 return this; 34 return this;
38} 35}
39 36
40 37
41Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel.EncryptedRemoteObject, { 38Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel.EncryptedRemoteObject, {
42 39
43 'toString': function() { 40 'toString': function() {
44 return "Record.Version (" + this.reference() + ")"; 41 return "Record.Version (" + this.reference() + ")";
45 }, 42 },
46 43
47 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
48 45
49 'reference': function () { 46 'reference': function () {
50 return this._reference; 47 return this._reference;
51 }, 48 },
52 49
53 //------------------------------------------------------------------------- 50 //-------------------------------------------------------------------------
54/* 51/*
55 'hasPendingChanges': function () { 52 'hasPendingChanges': function () {
@@ -78,49 +75,48 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel
78 }); 75 });
79 deferredResult.addCallback(MochiKit.Base.operator.lognot) 76 deferredResult.addCallback(MochiKit.Base.operator.lognot)
80 deferredResult.callback(); 77 deferredResult.callback();
81 78
82 return deferredResult; 79 return deferredResult;
83 }, 80 },
84 81
85 //========================================================================= 82 //=========================================================================
86 83
87 'commitTransientState': function () { 84 'commitTransientState': function () {
88 var deferredResult; 85 var deferredResult;
89 86
90 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.commitTransientState", {trace:false}); 87 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.Version.commitTransientState", {trace:false});
91 deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.commitTransientState, this)); 88 deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.Version.superclass.commitTransientState, this));
92 deferredResult.callback(); 89 deferredResult.callback();
93 90
94 return deferredResult; 91 return deferredResult;
95 }, 92 },
96 93
97 //========================================================================= 94 //=========================================================================
98 95
99 'unpackData': function (someData) { //++ 96 'unpackData': function (someData) { //++
100 varresult; 97 varresult;
101 98
102//console.log("Record.Version - UNPACK DATA", this, someData);
103 result = someData; 99 result = someData;
104 if ((someData['fields'] != null) && (someData['fields'] instanceof Array)) { 100 if ((someData['fields'] != null) && (someData['fields'] instanceof Array)) {
105 varfields; 101 varfields;
106 var i,c; 102 var i,c;
107 103
108 fields = someData['fields']; 104 fields = someData['fields'];
109 delete someData['fields']; 105 delete someData['fields'];
110 106
111 someData['fields'] = {}; 107 someData['fields'] = {};
112 c = fields.length; 108 c = fields.length;
113 for (i=0; i<c; i++) { 109 for (i=0; i<c; i++) {
114 someData['fields'][i] = fields[i]; 110 someData['fields'][i] = fields[i];
115 } 111 }
116 } 112 }
117 113
118 114
119 115
120 return result; 116 return result;
121 }, 117 },
122 118
123 //========================================================================= 119 //=========================================================================
124 120
125 'fields': function () { 121 'fields': function () {
126 vardeferredResult; 122 vardeferredResult;
@@ -271,49 +267,48 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel
271 267
272 'setPreviousVersionReferenceAndKey': function (aVersionObjectAndKey) { 268 'setPreviousVersionReferenceAndKey': function (aVersionObjectAndKey) {
273 // this._previousVersion = anotherVersion; 269 // this._previousVersion = anotherVersion;
274 return Clipperz.Async.callbacks("Record.Version.setPreviousVersion", [ 270 return Clipperz.Async.callbacks("Record.Version.setPreviousVersion", [
275 MochiKit.Base.method(this, 'setValue', 'previousVersionReference',aVersionObjectAndKey['reference']), 271 MochiKit.Base.method(this, 'setValue', 'previousVersionReference',aVersionObjectAndKey['reference']),
276 MochiKit.Base.method(this, 'setValue', 'previousVersionKey', aVersionObjectAndKey['key']) 272 MochiKit.Base.method(this, 'setValue', 'previousVersionKey', aVersionObjectAndKey['key'])
277 ], {trace:false}); 273 ], {trace:false});
278 }, 274 },
279 275
280 //========================================================================= 276 //=========================================================================
281 277
282 'revertChanges': function () { 278 'revertChanges': function () {
283 this.setReference(this.transientState()['originalReference']); 279 this.setReference(this.transientState()['originalReference']);
284 Clipperz.PM.DataModel.Record.Version.superclass.revertChanges.apply(this, arguments); 280 Clipperz.PM.DataModel.Record.Version.superclass.revertChanges.apply(this, arguments);
285 }, 281 },
286 282
287 //------------------------------------------------------------------------- 283 //-------------------------------------------------------------------------
288 284
289 'prepareRemoteDataWithKey': function (aKey) { 285 'prepareRemoteDataWithKey': function (aKey) {
290 var deferredResult; 286 var deferredResult;
291 var result; 287 var result;
292 288
293 result = {}; 289 result = {};
294 290
295//console.log("prepareRemoteDataWithKey", aKey);
296 deferredResult = new Clipperz.Async.Deferred("Record.Version.prepareRemoteDataWithKey", {trace:false}); 291 deferredResult = new Clipperz.Async.Deferred("Record.Version.prepareRemoteDataWithKey", {trace:false});
297 if (this.isBrandNew() == false) { 292 if (this.isBrandNew() == false) {
298 this.transientState()['originalReference'] = this.reference(); 293 this.transientState()['originalReference'] = this.reference();
299 294
300 deferredResult.collectResults({ 295 deferredResult.collectResults({
301 'key':MochiKit.Base.partial(MochiKit.Async.succeed, aKey), 296 'key':MochiKit.Base.partial(MochiKit.Async.succeed, aKey),
302 'value': MochiKit.Base.method(this, 'getKey'), 297 'value': MochiKit.Base.method(this, 'getKey'),
303 'version': MochiKit.Base.partial(MochiKit.Async.succeed, Clipperz.PM.Crypto.encryptingFunctions.currentVersion) 298 'version': MochiKit.Base.partial(MochiKit.Async.succeed, Clipperz.PM.Crypto.encryptingFunctions.currentVersion)
304 }); 299 });
305 deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncrypt); 300 deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncrypt);
306 deferredResult.addCallback(Clipperz.Async.setItem, result, 'previousVersionKey'); 301 deferredResult.addCallback(Clipperz.Async.setItem, result, 'previousVersionKey');
307 } else { 302 } else {
308 deferredResult.addCallback(Clipperz.Async.setItem, result, 'previousVersionKey', Clipperz.PM.Crypto.nullValue); 303 deferredResult.addCallback(Clipperz.Async.setItem, result, 'previousVersionKey', Clipperz.PM.Crypto.nullValue);
309 } 304 }
310 deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.prepareRemoteDataWithKey, this, aKey)); 305 deferredResult.addCallback(MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.prepareRemoteDataWithKey, this, aKey));
311 deferredResult.addCallback(MochiKit.Base.update, result); 306 deferredResult.addCallback(MochiKit.Base.update, result);
312 deferredResult.addMethod(this, 'setRemoteData'); 307 deferredResult.addMethod(this, 'setRemoteData');
313 308
314 deferredResult.callback(); 309 deferredResult.callback();
315 310
316 return deferredResult; 311 return deferredResult;
317 }, 312 },
318 313
319 //========================================================================= 314 //=========================================================================
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
index b816f80..3fc1813 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
@@ -1,90 +1,85 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30 28
31Clipperz.PM.DataModel.Record = function(args) { 29Clipperz.PM.DataModel.Record = function(args) {
32//console.log(">>> new Clipperz.PM.DataModel.Record", args);
33 Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments); 30 Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments);
34 31
35 this._updateDate = (args.updateDate ? Clipperz.PM.Date.parse(args.updateDate) : Clipperz.Base.exception.raise('MandatoryParameter')); 32 this._updateDate = (args.updateDate ? Clipperz.PM.Date.parse(args.updateDate) : Clipperz.Base.exception.raise('MandatoryParameter'));
36 33
37 this._retrieveIndexDataFunction = args.retrieveIndexDataFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); 34 this._retrieveIndexDataFunction = args.retrieveIndexDataFunction|| Clipperz.Base.exception.raise('MandatoryParameter');
38 this._updateIndexDataFunction = args.updateIndexDataFunction || Clipperz.Base.exception.raise('MandatoryParameter'); 35 this._updateIndexDataFunction = args.updateIndexDataFunction || Clipperz.Base.exception.raise('MandatoryParameter');
39 36
40 this._retrieveDirectLoginIndexDataFunction = args.retrieveDirectLoginIndexDataFunction|| null; 37 this._retrieveDirectLoginIndexDataFunction = args.retrieveDirectLoginIndexDataFunction|| null;
41 this._setDirectLoginIndexDataFunction = args.setDirectLoginIndexDataFunction || null; 38 this._setDirectLoginIndexDataFunction = args.setDirectLoginIndexDataFunction || null;
42 this._removeDirectLoginIndexDataFunction = args.removeDirectLoginIndexDataFunction|| null; 39 this._removeDirectLoginIndexDataFunction = args.removeDirectLoginIndexDataFunction|| null;
43 40
44 this._createNewDirectLoginFunction = args.createNewDirectLoginFunction || null; 41 this._createNewDirectLoginFunction = args.createNewDirectLoginFunction || null;
45 42
46 this._directLogins = {}; 43 this._directLogins = {};
47 44
48 this._versions = {}; 45 this._versions = {};
49 46
50 this._currentRecordVersion = null; 47 this._currentRecordVersion = null;
51 if (this.isBrandNew()) { 48 if (this.isBrandNew()) {
52 var newVersion; 49 var newVersion;
53 50
54 this.setNotes(''); 51 this.setNotes('');
55 newVersion = new Clipperz.PM.DataModel.Record.Version({ 52 newVersion = new Clipperz.PM.DataModel.Record.Version({
56 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'), 53 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'),
57 'getVersion': MochiKit.Base.method(this, 'getVersion') 54 'getVersion': MochiKit.Base.method(this, 'getVersion')
58 55
59 }); 56 });
60 this._versions[newVersion.reference()] = newVersion; 57 this._versions[newVersion.reference()] = newVersion;
61 this._currentVersionReference = newVersion.reference(); 58 this._currentVersionReference = newVersion.reference();
62 // this.setLabel(''); 59 // this.setLabel('');
63 } 60 }
64 61
65//console.log("<<< new Clipperz.PM.DataModel.Record", args);
66
67 return this; 62 return this;
68} 63}
69 64
70 65
71Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.EncryptedRemoteObject, { 66Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.EncryptedRemoteObject, {
72 67
73 'toString': function() { 68 'toString': function() {
74 return "Record (" + this.reference() + ")"; 69 return "Record (" + this.reference() + ")";
75 }, 70 },
76 71
77 //------------------------------------------------------------------------- 72 //-------------------------------------------------------------------------
78 73
79 'reference': function () { 74 'reference': function () {
80 return this._reference; 75 return this._reference;
81 }, 76 },
82 77
83 //========================================================================= 78 //=========================================================================
84 79
85 'getIndexData': function () { 80 'getIndexData': function () {
86 return this._retrieveIndexDataFunction(this.reference()); 81 return this._retrieveIndexDataFunction(this.reference());
87 }, 82 },
88 83
89 //......................................................................... 84 //.........................................................................
90 85
@@ -189,109 +184,106 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
189 }, 184 },
190 185
191 //========================================================================= 186 //=========================================================================
192 187
193 'favicon': function () { 188 'favicon': function () {
194 var result; 189 var result;
195 var directLogins; 190 var directLogins;
196 191
197 directLogins = MochiKit.Base.values(this.directLogins()); 192 directLogins = MochiKit.Base.values(this.directLogins());
198 if (directLogins.length > 0) { 193 if (directLogins.length > 0) {
199 result = directLogins[0].favicon(); 194 result = directLogins[0].favicon();
200 // } else if (/* is there an URL to use for searching a favicon */){ 195 // } else if (/* is there an URL to use for searching a favicon */){
201 } else { 196 } else {
202 result = null; //MochiKit.Async.succeed(Clipperz.PM.Strings['defaultFaviconUrl']); 197 result = null; //MochiKit.Async.succeed(Clipperz.PM.Strings['defaultFaviconUrl']);
203 } 198 }
204 199
205 return result; 200 return result;
206 }, 201 },
207 202
208 //------------------------------------------------------------------------- 203 //-------------------------------------------------------------------------
209 204
210 'searchableContent': function () { 205 'searchableContent': function () {
211 var deferredResult; 206 var deferredResult;
212 207
213//console.log(">>> searchableContent");
214 deferredResult = new Clipperz.Async.Deferred("Record.searchableContent", {trace:false}); 208 deferredResult = new Clipperz.Async.Deferred("Record.searchableContent", {trace:false});
215 209
216 deferredResult.collectResults({ 210 deferredResult.collectResults({
217 'recordLabel': MochiKit.Base.method(this, 'label'), 211 'recordLabel': MochiKit.Base.method(this, 'label'),
218 'directLoginLabels': [ 212 'directLoginLabels': [
219 MochiKit.Base.method(this, 'directLoginReferences'), 213 MochiKit.Base.method(this, 'directLoginReferences'),
220 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.itemgetter('label')) 214 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.itemgetter('label'))
221 ] 215 ]
222 }) 216 })
223 deferredResult.addCallback(function (someValues) { 217 deferredResult.addCallback(function (someValues) {
224 return someValues['recordLabel'] + ' ' + someValues['directLoginLabels'].join(' '); 218 return someValues['recordLabel'] + ' ' + someValues['directLoginLabels'].join(' ');
225 }); 219 });
226 deferredResult.callback(); 220 deferredResult.callback();
227//console.log("<<< searchableContent");
228 221
229 return deferredResult; 222 return deferredResult;
230 }, 223 },
231 224
232 //------------------------------------------------------------------------- 225 //-------------------------------------------------------------------------
233 226
234 'isMatching': function (aRegExp) { 227 'isMatching': function (aRegExp) {
235 return Clipperz.Async.callbacks("deferredFilterFunction", [ 228 return Clipperz.Async.callbacks("deferredFilterFunction", [
236 MochiKit.Base.method(this, 'searchableContent'), 229 MochiKit.Base.method(this, 'searchableContent'),
237 MochiKit.Base.method(aRegExp, 'test'), 230 MochiKit.Base.method(aRegExp, 'test'),
238 function (doesItMatch) { 231 function (doesItMatch) {
239 var result; 232 var result;
240 233
241 if (doesItMatch) { 234 if (doesItMatch) {
242 result = MochiKit.Async.succeed('match'); 235 result = MochiKit.Async.succeed('match');
243 } else { 236 } else {
244 result = MochiKit.Async.fail('miss'); 237 result = MochiKit.Async.fail('miss');
245 } 238 }
246 239
247 return result; 240 return result;
248 } 241 }
249 ], {trace:false}); 242 ], {trace:false});
250 }, 243 },
251 244
252 //========================================================================= 245 //=========================================================================
253 246
254 'directLogins': function () { 247 'directLogins': function () {
255 return this._directLogins; 248 return this._directLogins;
256 }, 249 },
257 250
258 'addDirectLogin': function (aDirectLogin) { 251 'addDirectLogin': function (aDirectLogin) {
259 this._directLogins[aDirectLogin.reference()] = aDirectLogin; 252 this._directLogins[aDirectLogin.reference()] = aDirectLogin;
260 }, 253 },
261 254
262 'directLoginWithReference': function (aDirectLoginReference) { 255 'directLoginWithReference': function (aDirectLoginReference) {
263 return this._directLogins[aDirectLoginReference]; 256 return this._directLogins[aDirectLoginReference];
264 }, 257 },
265 258
266 'createNewDirectLoginFunction': function () { 259 'createNewDirectLoginFunction': function () {
267 return this._createNewDirectLoginFunction; 260 return this._createNewDirectLoginFunction;
268 }, 261 },
269 262
270 'saveOriginalDirectLoginStatusToTransientState': function () { 263 'saveOriginalDirectLoginStatusToTransientState': function () {
271 if (this.transientState().getValue('directLogins') == null) { 264 if (this.transientState().getValue('directLogins') == null) {
272 // this.transientState().setValue('directLogins', this._directLogins) 265 // this.transientState().setValue('directLogins', this._directLogins)
273//console.log("SET TRANSIENT STATE", Clipperz.Base.serializeJSON(MochiKit.Base.keys(this.transientState().getValue('directLogins'))))
274 MochiKit.Iter.forEach(MochiKit.Base.keys(this._directLogins), MochiKit.Base.bind(function(aKey) { 266 MochiKit.Iter.forEach(MochiKit.Base.keys(this._directLogins), MochiKit.Base.bind(function(aKey) {
275 this.transientState().setValue('directLogins' + '.' + aKey, this._directLogins[aKey]) 267 this.transientState().setValue('directLogins' + '.' + aKey, this._directLogins[aKey])
276 }, this)) 268 }, this))
277 } 269 }
278 }, 270 },
279 271
280 'createNewDirectLogin': function () { 272 'createNewDirectLogin': function () {
281 this.saveOriginalDirectLoginStatusToTransientState(); 273 this.saveOriginalDirectLoginStatusToTransientState();
282 274
283 return this.createNewDirectLoginFunction()(this); 275 return this.createNewDirectLoginFunction()(this);
284 }, 276 },
285 277
286 'removeDirectLogin': function(aDirectLogin) { 278 'removeDirectLogin': function(aDirectLogin) {
287 this.saveOriginalDirectLoginStatusToTransientState(); 279 this.saveOriginalDirectLoginStatusToTransientState();
288 280
289 return Clipperz.Async.callbacks("Record.removeDirectLogin", [ 281 return Clipperz.Async.callbacks("Record.removeDirectLogin", [
290 MochiKit.Base.method(this, 'removeValue', 'directLogins' + '.' + aDirectLogin.reference()), 282 MochiKit.Base.method(this, 'removeValue', 'directLogins' + '.' + aDirectLogin.reference()),
291 MochiKit.Base.bind(function () { 283 MochiKit.Base.bind(function () {
292 delete this._directLogins[aDirectLogin.reference()] 284 delete this._directLogins[aDirectLogin.reference()]
293 }, this) 285 }, this)
294 ], {trace:false}); 286 ], {trace:false});
295 287
296 }, 288 },
297 289
@@ -308,71 +300,68 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
308 result = []; 300 result = [];
309 c = someDirectLogins.length; 301 c = someDirectLogins.length;
310 for (i=0; i<c; i++) { 302 for (i=0; i<c; i++) {
311 result.push(Clipperz.Async.collectResults("Record.directLoginReferences - collectResults", { 303 result.push(Clipperz.Async.collectResults("Record.directLoginReferences - collectResults", {
312 '_rowObject': MochiKit.Async.succeed, 304 '_rowObject': MochiKit.Async.succeed,
313 '_reference': MochiKit.Base.methodcaller('reference'), 305 '_reference': MochiKit.Base.methodcaller('reference'),
314 'label': MochiKit.Base.methodcaller('label'), 306 'label': MochiKit.Base.methodcaller('label'),
315 'favicon': MochiKit.Base.methodcaller('favicon') 307 'favicon': MochiKit.Base.methodcaller('favicon')
316 }, {trace:false})(someDirectLogins[i])); 308 }, {trace:false})(someDirectLogins[i]));
317 }; 309 };
318 310
319 return result; 311 return result;
320 }, 312 },
321 Clipperz.Async.collectAll 313 Clipperz.Async.collectAll
322 ], {trace:false}); 314 ], {trace:false});
323 315
324 return result; 316 return result;
325 }, 317 },
326 318
327 //========================================================================= 319 //=========================================================================
328 320
329 'unpackRemoteData': function (someData) { 321 'unpackRemoteData': function (someData) {
330 var result; 322 var result;
331 323
332//console.log("new Clipperz.PM.DataModel.Record.Version [2]");
333/* 324/*
334 this._currentRecordVersion = new Clipperz.PM.DataModel.Record.Version({ 325 this._currentRecordVersion = new Clipperz.PM.DataModel.Record.Version({
335 'reference': someData['currentVersion']['reference'], 326 'reference': someData['currentVersion']['reference'],
336 'retrieveKeyFunction': MochiKit.Base.method(this, 'getCurrentRecordVersionKey'), 327 'retrieveKeyFunction': MochiKit.Base.method(this, 'getCurrentRecordVersionKey'),
337 'remoteData': someData['currentVersion'], 328 'remoteData': someData['currentVersion'],
338 }); 329 });
339*/ 330*/
340 var versionKey; 331 var versionKey;
341 332
342 for (versionKey in someData['versions']) { 333 for (versionKey in someData['versions']) {
343//console.log("### versionKey", versionKey);
344 this._versions[versionKey] = new Clipperz.PM.DataModel.Record.Version({ 334 this._versions[versionKey] = new Clipperz.PM.DataModel.Record.Version({
345 'reference': versionKey, 335 'reference': versionKey,
346 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'), 336 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'),
347 'remoteData': someData['versions'][versionKey], 337 'remoteData': someData['versions'][versionKey],
348 'getVersion': MochiKit.Base.method(this, 'getVersion') 338 'getVersion': MochiKit.Base.method(this, 'getVersion')
349 }) 339 })
350 } 340 }
351 341
352 // this._currentVersionReference = someData['currentVersion']['reference']; 342 // this._currentVersionReference = someData['currentVersion']['reference'];
353 this._currentVersionReference = someData['currentVersion']; 343 this._currentVersionReference = someData['currentVersion'];
354//console.log("=== currentVersionReference", this._currentVersionReference, someData);
355 344
356 result = Clipperz.PM.DataModel.Record.superclass.unpackRemoteData.apply(this, arguments); 345 result = Clipperz.PM.DataModel.Record.superclass.unpackRemoteData.apply(this, arguments);
357 346
358 return result; 347 return result;
359 }, 348 },
360 349
361 //------------------------------------------------------------------------- 350 //-------------------------------------------------------------------------
362 351
363 'unpackData': function (someData) { 352 'unpackData': function (someData) {
364 var result; 353 var result;
365 354
366 result = Clipperz.PM.DataModel.Record.superclass.unpackData.apply(this, arguments); 355 result = Clipperz.PM.DataModel.Record.superclass.unpackData.apply(this, arguments);
367 356
368 if (MochiKit.Base.isUndefinedOrNull(result['notes'])) { 357 if (MochiKit.Base.isUndefinedOrNull(result['notes'])) {
369 result['notes'] = '' 358 result['notes'] = ''
370 } 359 }
371 360
372 return result; 361 return result;
373 }, 362 },
374 363
375 //------------------------------------------------------------------------- 364 //-------------------------------------------------------------------------
376 365
377 'prepareRemoteDataWithKey': function (aKey) { 366 'prepareRemoteDataWithKey': function (aKey) {
378 var deferredResult; 367 var deferredResult;
@@ -515,171 +504,160 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
515 504
516 'getCurrentRecordVersion': function () { 505 'getCurrentRecordVersion': function () {
517 return Clipperz.Async.callbacks("Record.getCurrentRecordVersion", [ 506 return Clipperz.Async.callbacks("Record.getCurrentRecordVersion", [
518 // MochiKit.Base.method(this, 'getValue', 'fakeKey, just to trigger unpackRemoteData'), 507 // MochiKit.Base.method(this, 'getValue', 'fakeKey, just to trigger unpackRemoteData'),
519 // MochiKit.Base.bind(function () { return this._currentRecordVersion; }, this) 508 // MochiKit.Base.bind(function () { return this._currentRecordVersion; }, this)
520 509
521 MochiKit.Base.method(this, 'versions'), 510 MochiKit.Base.method(this, 'versions'),
522 MochiKit.Base.itemgetter(this.currentVersionReference()), 511 MochiKit.Base.itemgetter(this.currentVersionReference()),
523 Clipperz.Async.deferredIf("The current version is available", [ 512 Clipperz.Async.deferredIf("The current version is available", [
524 MochiKit.Async.succeed 513 MochiKit.Async.succeed
525 ], [ 514 ], [
526 MochiKit.Base.method(this, 'getVersions'), 515 MochiKit.Base.method(this, 'getVersions'),
527 MochiKit.Base.bind(function (someVersions) { return someVersions[this.currentVersionReference()]}, this) 516 MochiKit.Base.bind(function (someVersions) { return someVersions[this.currentVersionReference()]}, this)
528 ]) 517 ])
529 ], {trace:false}); 518 ], {trace:false});
530 }, 519 },
531 520
532 'setCurrentRecordVersion': function (aRecordVersion) { 521 'setCurrentRecordVersion': function (aRecordVersion) {
533 this._currentVersionReference = aRecordVersion.reference(); 522 this._currentVersionReference = aRecordVersion.reference();
534 }, 523 },
535 524
536 //......................................................................... 525 //.........................................................................
537 526
538 'currentVersionReference': function () { 527 'currentVersionReference': function () {
539//console.log("currentVersionReference");
540 return this._currentVersionReference; 528 return this._currentVersionReference;
541 }, 529 },
542 530
543 //------------------------------------------------------------------------- 531 //-------------------------------------------------------------------------
544 532
545 'createNewRecordVersion': function () { 533 'createNewRecordVersion': function () {
546 var deferredResult; 534 var deferredResult;
547 535
548 if (this.isBrandNew()) { 536 if (this.isBrandNew()) {
549 deferredResult = this.getCurrentRecordVersion(); 537 deferredResult = this.getCurrentRecordVersion();
550 } else { 538 } else {
551 var newVersion; 539 var newVersion;
552 540
553 newVersion = new Clipperz.PM.DataModel.Record.Version({ 541 newVersion = new Clipperz.PM.DataModel.Record.Version({
554 // 'reference': versionKey, 542 // 'reference': versionKey,
555 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'), 543 'retrieveKeyFunction':MochiKit.Base.method(this, 'getVersionKey'),
556 // 'remoteData': {}, 544 // 'remoteData': {},
557 'getVersion': MochiKit.Base.method(this, 'getVersion') 545 'getVersion': MochiKit.Base.method(this, 'getVersion')
558 }) 546 })
559 this._versions[newVersion.reference()] = newVersion; 547 this._versions[newVersion.reference()] = newVersion;
560 548
561 deferredResult = Clipperz.Async.callbacks("Record.createNewRecordVersion", [ 549 deferredResult = Clipperz.Async.callbacks("Record.createNewRecordVersion", [
562 // MochiKit.Base.method(this, 'getCurrentRecordVersion'), 550 // MochiKit.Base.method(this, 'getCurrentRecordVersion'),
563 // MochiKit.Base.methodcaller('values'), 551 // MochiKit.Base.methodcaller('values'),
564 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'values'), 552 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'values'),
565 MochiKit.Base.method(newVersion, 'setValues'), 553 MochiKit.Base.method(newVersion, 'setValues'),
566 554
567 Clipperz.Async.collectResults("Record.createNewRecordVersion [collect results]", { 555 Clipperz.Async.collectResults("Record.createNewRecordVersion [collect results]", {
568 'reference':MochiKit.Base.method(this, 'currentVersionReference'), 556 'reference':MochiKit.Base.method(this, 'currentVersionReference'),
569 'key': MochiKit.Base.method(this, 'getCurrentRecordVersionKey') 557 'key': MochiKit.Base.method(this, 'getCurrentRecordVersionKey')
570 }, {trace:false}), 558 }, {trace:false}),
571 MochiKit.Base.method(newVersion, 'setPreviousVersionReferenceAndKey'), 559 MochiKit.Base.method(newVersion, 'setPreviousVersionReferenceAndKey'),
572 560
573 // MochiKit.Base.method(this, 'getCurrentRecordVersion'), 561 // MochiKit.Base.method(this, 'getCurrentRecordVersion'),
574 // MochiKit.Base.method(this, 'revertChanges'), 562 // MochiKit.Base.method(this, 'revertChanges'),
575 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'revertChanges'), 563 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'revertChanges'),
576 564
577 MochiKit.Base.method(this, 'setCurrentRecordVersion', newVersion), 565 MochiKit.Base.method(this, 'setCurrentRecordVersion', newVersion),
578 MochiKit.Base.partial(MochiKit.Async.succeed, newVersion) 566 MochiKit.Base.partial(MochiKit.Async.succeed, newVersion)
579 ], {trace:false}); 567 ], {trace:false});
580 } 568 }
581 569
582 return deferredResult; 570 return deferredResult;
583 }, 571 },
584 572
585 //------------------------------------------------------------------------- 573 //-------------------------------------------------------------------------
586 574
587 'getCurrentRecordVersionKey': function () { 575 'getCurrentRecordVersionKey': function () {
588//console.log("getCurrentRecordVersionKey");
589 return Clipperz.Async.callbacks("Record.getCurrentRecordVersionKey", [ 576 return Clipperz.Async.callbacks("Record.getCurrentRecordVersionKey", [
590 MochiKit.Base.method(this, 'getValue', 'currentVersionKey'), 577 MochiKit.Base.method(this, 'getValue', 'currentVersionKey'),
591 Clipperz.Async.deferredIf("currentVersionKey is NOT null", [ 578 Clipperz.Async.deferredIf("currentVersionKey is NOT null", [
592 MochiKit.Async.succeed 579 MochiKit.Async.succeed
593 ], [ 580 ], [
594 MochiKit.Base.method(this, 'getKey') 581 MochiKit.Base.method(this, 'getKey')
595 ]) 582 ])
596 ], {trace:false}); 583 ], {trace:false});
597 }, 584 },
598 585
599 'setCurrentRecordVersionKey': function (aValue) { 586 'setCurrentRecordVersionKey': function (aValue) {
600 //TODO: triple check this method! 587 //TODO: triple check this method!
601 return Clipperz.Async.callbacks("Record.setCurrentRecordVersionKey", [ 588 return Clipperz.Async.callbacks("Record.setCurrentRecordVersionKey", [
602 MochiKit.Base.method(this, 'setValue', 'currentVersionKey', aValue) 589 MochiKit.Base.method(this, 'setValue', 'currentVersionKey', aValue)
603 ], {trace:false}); 590 ], {trace:false});
604 }, 591 },
605 592
606 //------------------------------------------------------------------------- 593 //-------------------------------------------------------------------------
607 594
608 'invokeCurrentRecordVersionMethod': function (aMethodName, someValues) { 595 'invokeCurrentRecordVersionMethod': function (aMethodName, someValues) {
609//console.log(">>> invokeCurrentRecordVersionMethod", aMethodName);
610 return Clipperz.Async.callbacks("Record.invokeCurrentRecordVersionMethod", [ 596 return Clipperz.Async.callbacks("Record.invokeCurrentRecordVersionMethod", [
611 MochiKit.Base.method(this, 'getCurrentRecordVersion'), 597 MochiKit.Base.method(this, 'getCurrentRecordVersion'),
612//function (aValue) { console.log("=== getCurrentRecordVersion", aValue); return aValue},
613 MochiKit.Base.methodcaller(aMethodName, someValues) 598 MochiKit.Base.methodcaller(aMethodName, someValues)
614 ], {trace:false}); 599 ], {trace:false});
615 }, 600 },
616 601
617 602
618 'lazilyinvokeCurrentRecordVersionMethod': function (aMethodName, someValues, defaultResult) { 603 'lazilyinvokeCurrentRecordVersionMethod': function (aMethodName, someValues, defaultResult) {
619 return Clipperz.Async.callbacks("Record.lazilyinvokeCurrentRecordVersionMethod", [ 604 return Clipperz.Async.callbacks("Record.lazilyinvokeCurrentRecordVersionMethod", [
620 MochiKit.Base.method(this, 'currentVersionReference'), 605 MochiKit.Base.method(this, 'currentVersionReference'),
621//function (aValue) { console.log("LAZY -> versions", aValue); return aValue; },
622 Clipperz.Async.deferredIf("versions has been loaded", [ 606 Clipperz.Async.deferredIf("versions has been loaded", [
623//function (aValue) { console.log("LAZY -> then"); return aValue; },
624 MochiKit.Base.method(this, 'getCurrentRecordVersion'), 607 MochiKit.Base.method(this, 'getCurrentRecordVersion'),
625 MochiKit.Base.methodcaller(aMethodName, someValues), 608 MochiKit.Base.methodcaller(aMethodName, someValues),
626//function (aValue) { console.log("LAZY <- then"); return aValue; }
627 ], [ 609 ], [
628//function (aValue) { console.log("LAZY -> else"); return aValue; },
629 MochiKit.Base.partial(MochiKit.Async.succeed, defaultResult), 610 MochiKit.Base.partial(MochiKit.Async.succeed, defaultResult),
630//function (aValue) { console.log("LAZY <- else"); return aValue; }
631 ]) 611 ])
632 ], {trace:false}); 612 ], {trace:false});
633 }, 613 },
634 614
635 //========================================================================= 615 //=========================================================================
636 616
637 'hasPendingChanges': function () { 617 'hasPendingChanges': function () {
638 var deferredResult; 618 var deferredResult;
639 619
640 if (this.hasInitiatedObjectDataStore()) { 620 if (this.hasInitiatedObjectDataStore()) {
641 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.hasPendingChanges", {trace:false}); 621 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.hasPendingChanges", {trace:false});
642 deferredResult.collectResults({ 622 deferredResult.collectResults({
643 'super': MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.hasPendingChanges, this), 623 'super': MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.hasPendingChanges, this),
644 'currentVersion': [ 624 'currentVersion': [
645 // MochiKit.Base.method(this, 'getCurrentRecordVersion'), 625 // MochiKit.Base.method(this, 'getCurrentRecordVersion'),
646 // MochiKit.Base.methodcaller('hasPendingChanges') 626 // MochiKit.Base.methodcaller('hasPendingChanges')
647 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'hasPendingChanges') 627 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'hasPendingChanges')
648 ], 628 ],
649 'directLogins': [ 629 'directLogins': [
650 MochiKit.Base.method(this, 'directLogins'), 630 MochiKit.Base.method(this, 'directLogins'),
651//function (aValue) { console.log("Record.directLogins", aValue); return aValue; },
652 MochiKit.Base.values, 631 MochiKit.Base.values,
653 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')), 632 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')),
654 Clipperz.Async.collectAll, 633 Clipperz.Async.collectAll,
655 Clipperz.Async.or 634 Clipperz.Async.or
656 // function(someValues) { 635 // function(someValues) {
657 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity); 636 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity);
658 // } 637 // }
659 ] 638 ]
660 }); 639 });
661//deferredResult.addCallback(function (aValue) { console.log("Record.hasPendingResults", aValue); return aValue; });
662 deferredResult.addCallback(MochiKit.Base.values); 640 deferredResult.addCallback(MochiKit.Base.values);
663 deferredResult.addCallback(MochiKit.Base.bind(function(someValues) { 641 deferredResult.addCallback(MochiKit.Base.bind(function(someValues) {
664 var result; 642 var result;
665 result = MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity); 643 result = MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity);
666 644
667 if ((result == false) && (this.isBrandNew() == false)) { 645 if ((result == false) && (this.isBrandNew() == false)) {
668 result = MochiKit.Iter.some(MochiKit.Base.values(this.transientState().getValue('hasPendingChanges.indexData')), MochiKit.Base.operator.identity); 646 result = MochiKit.Iter.some(MochiKit.Base.values(this.transientState().getValue('hasPendingChanges.indexData')), MochiKit.Base.operator.identity);
669 } 647 }
670 648
671 return result; 649 return result;
672 }, this)); 650 }, this));
673 651
674 deferredResult.callback(); 652 deferredResult.callback();
675 } else { 653 } else {
676 deferredResult = Clipperz.Async.callbacks("Recrod.hasPendingChanges [hasInitiatedObjectDataStore == false]", [ 654 deferredResult = Clipperz.Async.callbacks("Recrod.hasPendingChanges [hasInitiatedObjectDataStore == false]", [
677 MochiKit.Base.method(this, 'directLogins'), 655 MochiKit.Base.method(this, 'directLogins'),
678 MochiKit.Base.values, 656 MochiKit.Base.values,
679 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')), 657 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')),
680 Clipperz.Async.collectAll, 658 Clipperz.Async.collectAll,
681 Clipperz.Async.or 659 Clipperz.Async.or
682 // function(someValues) { 660 // function(someValues) {
683 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity); 661 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity);
684 // } 662 // }
685 ], {trace:false}) 663 ], {trace:false})
@@ -755,89 +733,87 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
755 ]); 733 ]);
756 deferredResult.callback(); 734 deferredResult.callback();
757 } else { 735 } else {
758 // this.deleteAllCleanTextData(); 736 // this.deleteAllCleanTextData();
759 deferredResult = MochiKit.Async.succeed(); 737 deferredResult = MochiKit.Async.succeed();
760 } 738 }
761 739
762 return deferredResult; 740 return deferredResult;
763 }, 741 },
764 742
765 //------------------------------------------------------------------------- 743 //-------------------------------------------------------------------------
766 744
767 'resetTransientState': function (isCommitting) { 745 'resetTransientState': function (isCommitting) {
768 // if ((isCommitting == false) && (this.transientState().getValue('directLogins') != null)) { 746 // if ((isCommitting == false) && (this.transientState().getValue('directLogins') != null)) {
769 // this._directLogins = this.transientState().getValue('directLogins'); 747 // this._directLogins = this.transientState().getValue('directLogins');
770 // } 748 // }
771 749
772 return Clipperz.Async.callbacks("Record.resetTransientState", [ 750 return Clipperz.Async.callbacks("Record.resetTransientState", [
773 //- MochiKit.Base.method(this, 'getCurrentRecordVersion'), 751 //- MochiKit.Base.method(this, 'getCurrentRecordVersion'),
774 //- MochiKit.Base.methodcaller('resetTransientState'), 752 //- MochiKit.Base.methodcaller('resetTransientState'),
775 // MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'resetTransientState'), 753 // MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'resetTransientState'),
776 MochiKit.Base.method(this, 'lazilyinvokeCurrentRecordVersionMethod', 'resetTransientState'), 754 MochiKit.Base.method(this, 'lazilyinvokeCurrentRecordVersionMethod', 'resetTransientState'),
777 755
778 MochiKit.Base.method(this, 'directLogins'), 756 MochiKit.Base.method(this, 'directLogins'),
779//function (aValue) { console.log("resetTransientState - directLogins", aValue); return aValue; },
780 MochiKit.Base.values, 757 MochiKit.Base.values,
781 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('resetTransientState')), 758 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('resetTransientState')),
782 759
783 MochiKit.Base.bind(function () { 760 MochiKit.Base.bind(function () {
784 if ((isCommitting == false) && (this.transientState().getValue('directLogins') != null)) { 761 if ((isCommitting == false) && (this.transientState().getValue('directLogins') != null)) {
785 this._directLogins = this.transientState().getValue('directLogins'); 762 this._directLogins = this.transientState().getValue('directLogins');
786 } 763 }
787 }, this), 764 }, this),
788 765
789 MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.resetTransientState, this, isCommitting) 766 MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.resetTransientState, this, isCommitting)
790 ], {trace:false}) 767 ], {trace:false})
791 }, 768 },
792 769
793 //------------------------------------------------------------------------- 770 //-------------------------------------------------------------------------
794 771
795 'commitTransientState': function () { 772 'commitTransientState': function () {
796 var deferredResult; 773 var deferredResult;
797 774
798 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.commitTransientState", {trace:false}); 775 deferredResult = new Clipperz.Async.Deferred("Clipperz.PM.DataModel.Record.commitTransientState", {trace:false});
799 deferredResult.addMethod(this, 'hasPendingChanges'); 776 deferredResult.addMethod(this, 'hasPendingChanges');
800 deferredResult.addIf([ 777 deferredResult.addIf([
801 MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.commitTransientState, this), 778 MochiKit.Base.bind(Clipperz.PM.DataModel.Record.superclass.commitTransientState, this),
802 // MochiKit.Base.method(this, 'getCurrentRecordVersion'), 779 // MochiKit.Base.method(this, 'getCurrentRecordVersion'),
803 // MochiKit.Base.methodcaller('commitTransientState'), 780 // MochiKit.Base.methodcaller('commitTransientState'),
804 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'commitTransientState'), 781 MochiKit.Base.method(this, 'invokeCurrentRecordVersionMethod', 'commitTransientState'),
805 MochiKit.Base.method(this, 'directLogins'), 782 MochiKit.Base.method(this, 'directLogins'),
806 MochiKit.Base.values, 783 MochiKit.Base.values,
807 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('commitTransientState')) 784 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('commitTransientState'))
808 ], [ 785 ], [
809 MochiKit.Async.succeed 786 MochiKit.Async.succeed
810 ]); 787 ]);
811 deferredResult.callback(); 788 deferredResult.callback();
812 789
813 return deferredResult; 790 return deferredResult;
814 }, 791 },
815 792
816 //========================================================================= 793 //=========================================================================
817 794
818 'retrieveDirectLoginIndexDataFunction': function () { 795 'retrieveDirectLoginIndexDataFunction': function () {
819//console.log("Record.retrieveDirectLoginIndexDataFunction", this._retrieveDirectLoginIndexDataFunction);
820 return this._retrieveDirectLoginIndexDataFunction; 796 return this._retrieveDirectLoginIndexDataFunction;
821 }, 797 },
822 798
823 'setDirectLoginIndexDataFunction': function () { 799 'setDirectLoginIndexDataFunction': function () {
824 return this._setDirectLoginIndexDataFunction; 800 return this._setDirectLoginIndexDataFunction;
825 }, 801 },
826 802
827 'removeDirectLoginIndexDataFunction': function () { 803 'removeDirectLoginIndexDataFunction': function () {
828 return this._removeDirectLoginIndexDataFunction; 804 return this._removeDirectLoginIndexDataFunction;
829 }, 805 },
830 806
831 //========================================================================= 807 //=========================================================================
832 808
833 'deleteAllCleanTextData': function () { 809 'deleteAllCleanTextData': function () {
834 // return Clipperz.PM.DataModel.Record.superclass.deleteAllCleanTextData.apply(this, arguments); 810 // return Clipperz.PM.DataModel.Record.superclass.deleteAllCleanTextData.apply(this, arguments);
835 811
836 return Clipperz.Async.callbacks("Record.deleteAllCleanTextData", [ 812 return Clipperz.Async.callbacks("Record.deleteAllCleanTextData", [
837 MochiKit.Base.method(this, 'versions'), 813 MochiKit.Base.method(this, 'versions'),
838 MochiKit.Base.values, 814 MochiKit.Base.values,
839 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')), 815 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')),
840 816
841 MochiKit.Base.method(this, 'directLogins'), 817 MochiKit.Base.method(this, 'directLogins'),
842 MochiKit.Base.values, 818 MochiKit.Base.values,
843 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')), 819 MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')),
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 d6202ff..cda5a41 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!"; 25 throw "Clipperz.PM.DataModel.User.Header.Legacy depends on Clipperz.PM.DataModel.User!";
28} 26}
29 27
30if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } 28if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; }
31 29
32Clipperz.PM.DataModel.User.Header.Legacy = function(args) { 30Clipperz.PM.DataModel.User.Header.Legacy = function(args) {
33 //args = args || {}; 31 //args = args || {};
34 Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments); 32 Clipperz.PM.DataModel.User.Header.Legacy.superclass.constructor.apply(this, arguments);
35 33
36 this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter'); 34 this._retrieveRecordDetailFunction = args.retrieveRecordDetailFunction|| Clipperz.Base.exception.raise('MandatoryParameter');
37 this._records = null; 35 this._records = null;
38 //this._directLogins = null; 36 //this._directLogins = null;
39 37
40 return this; 38 return this;
41} 39}
42 40
43 41
44Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, { 42Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Legacy, Clipperz.PM.DataModel.EncryptedRemoteObject, {
45 43
46 'toString': function() { 44 'toString': function() {
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 3528db6..e82da47 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js
@@ -1,104 +1,96 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!"; 25 throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!";
28} 26}
29if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } 27if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; }
30 28
31//----------------------------------------------------------------------------- 29//-----------------------------------------------------------------------------
32 30
33Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) { 31Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) {
34 Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments); 32 Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments);
35 33
36 this._oneTimePasswords = null; 34 this._oneTimePasswords = null;
37 35
38 return this; 36 return this;
39} 37}
40 38
41//----------------------------------------------------------------------------- 39//-----------------------------------------------------------------------------
42 40
43Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, { 41Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, {
44 42
45 'toString': function() { 43 'toString': function() {
46 return "Clipperz.PM.DataModel.User.Header.OneTimePasswords"; 44 return "Clipperz.PM.DataModel.User.Header.OneTimePasswords";
47 }, 45 },
48 46
49 //------------------------------------------------------------------------- 47 //-------------------------------------------------------------------------
50/* 48/*
51 'packData': function (someData) { //++ 49 'packData': function (someData) { //++
52 var result; 50 var result;
53 51
54console.log(">>> OneTimePasswords.packData", someData);
55 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments); 52 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments);
56console.log("<<< OneTimePasswords.packData");
57 53
58 return result; 54 return result;
59 }, 55 },
60*/ 56*/
61 //------------------------------------------------------------------------- 57 //-------------------------------------------------------------------------
62/* 58/*
63 'packRemoteData': function (someData) { 59 'packRemoteData': function (someData) {
64 var result; 60 var result;
65 61
66console.log(">>> OneTimePasswords.packRemoteData", someData);
67 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments); 62 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments);
68console.log("<<< OneTimePasswords.packRemoteData");
69 63
70 return result; 64 return result;
71 }, 65 },
72*/ 66*/
73 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
74/* 68/*
75 'prepareRemoteDataWithKey': function (aKey) { 69 'prepareRemoteDataWithKey': function (aKey) {
76 var result; 70 var result;
77 71
78console.log(">>> OneTimePasswords.prepareRemoteDataWithKey");
79 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments); 72 result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments);
80console.log("<<< OneTimePasswords.prepareRemoteDataWithKey");
81 73
82 return result; 74 return result;
83 }, 75 },
84*/ 76*/
85 //========================================================================= 77 //=========================================================================
86 78
87 'oneTimePasswords': function () { 79 'oneTimePasswords': function () {
88 vardeferredResult; 80 vardeferredResult;
89 81
90 deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false}); 82 deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false});
91 if (this._oneTimePasswords == null) { 83 if (this._oneTimePasswords == null) {
92 deferredResult.addMethod(this, 'values') 84 deferredResult.addMethod(this, 'values')
93 deferredResult.addCallback(MochiKit.Base.bind(function (someData) { 85 deferredResult.addCallback(MochiKit.Base.bind(function (someData) {
94 varotpKey; 86 varotpKey;
95 87
96 this._oneTimePasswords = {}; 88 this._oneTimePasswords = {};
97 89
98 for (otpKey in someData) { 90 for (otpKey in someData) {
99 var otp; 91 var otp;
100 var otpParameters; 92 var otpParameters;
101 93
102 otpParameters = Clipperz.Base.deepClone(someData[otpKey]); 94 otpParameters = Clipperz.Base.deepClone(someData[otpKey]);
103 otpParameters['reference'] = otpKey; 95 otpParameters['reference'] = otpKey;
104 96
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 b164889..f1f95e8 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.User.Header.Preferences depends on Clipperz.PM.DataModel.User!"; 25 throw "Clipperz.PM.DataModel.User.Header.Preferences depends on Clipperz.PM.DataModel.User!";
28} 26}
29 27
30if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } 28if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; }
31 29
32Clipperz.PM.DataModel.User.Header.Preferences = function(args) { 30Clipperz.PM.DataModel.User.Header.Preferences = function(args) {
33 Clipperz.PM.DataModel.User.Header.Preferences.superclass.constructor.apply(this, arguments); 31 Clipperz.PM.DataModel.User.Header.Preferences.superclass.constructor.apply(this, arguments);
34 32
35 return this; 33 return this;
36} 34}
37 35
38 36
39Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Preferences, Clipperz.PM.DataModel.EncryptedRemoteObject, { 37Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.Preferences, Clipperz.PM.DataModel.EncryptedRemoteObject, {
40 38
41 'toString': function() { 39 'toString': function() {
42 return "Clipperz.PM.DataModel.User.Header.Preferences"; 40 return "Clipperz.PM.DataModel.User.Header.Preferences";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 //========================================================================= 44 //=========================================================================
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 f77ea80..5681f70 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
@@ -1,59 +1,56 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.DataModel.User.Header.RecordIndex depends on Clipperz.PM.DataModel.User!"; 25 throw "Clipperz.PM.DataModel.User.Header.RecordIndex depends on Clipperz.PM.DataModel.User!";
28} 26}
29 27
30if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } 28if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; }
31 29
32Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) { 30Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) {
33 Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments); 31 Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments);
34 32
35//console.log("NEW Clipperz.PM.DataModel.User.Header.RecordIndex", args);
36 this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ 33 this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({
37 'name':'recordsData', 34 'name':'recordsData',
38 'retrieveKeyFunction': args.retrieveKeyFunction, 35 'retrieveKeyFunction': args.retrieveKeyFunction,
39 'remoteData': { 36 'remoteData': {
40 'data': args.recordsData['data'], 37 'data': args.recordsData['data'],
41 'version': args.encryptedDataVersion, 38 'version': args.encryptedDataVersion,
42 'recordsStats': args.recordsStats 39 'recordsStats': args.recordsStats
43 }//, 40 }//,
44 // 'encryptedDataKeypath': 'data', 41 // 'encryptedDataKeypath': 'data',
45 // 'encryptedVersionKeypath': 'version' 42 // 'encryptedVersionKeypath': 'version'
46 }); 43 });
47 44
48 this._directLoginsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({ 45 this._directLoginsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({
49 'name':'directLoginsData', 46 'name':'directLoginsData',
50 'retrieveKeyFunction': args.retrieveKeyFunction, 47 'retrieveKeyFunction': args.retrieveKeyFunction,
51 'remoteData': { 48 'remoteData': {
52 'data': args.directLoginsData['data'], 49 'data': args.directLoginsData['data'],
53 'version': args.encryptedDataVersion 50 'version': args.encryptedDataVersion
54 }//, 51 }//,
55 // 'encryptedDataKeypath': 'data', 52 // 'encryptedDataKeypath': 'data',
56 // 'encryptedVersionKeypath': 'version' 53 // 'encryptedVersionKeypath': 'version'
57 }); 54 });
58 55
59 this._lock = new MochiKit.Async.DeferredLock(); 56 this._lock = new MochiKit.Async.DeferredLock();
@@ -97,97 +94,94 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
97 return this._directLoginsIndex; 94 return this._directLoginsIndex;
98 }, 95 },
99 96
100 'directLoginsData': function () { 97 'directLoginsData': function () {
101 return this._directLoginsData; 98 return this._directLoginsData;
102 }, 99 },
103 100
104 //------------------------------------------------------------------------- 101 //-------------------------------------------------------------------------
105 102
106 'lock': function () { 103 'lock': function () {
107 return this._lock; 104 return this._lock;
108 }, 105 },
109 106
110 //------------------------------------------------------------------------- 107 //-------------------------------------------------------------------------
111 108
112 'transientState': function () { 109 'transientState': function () {
113 if (this._transientState == null) { 110 if (this._transientState == null) {
114 this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'User.Header.RecordIndex.transientState [1]'}*/); 111 this._transientState = new Clipperz.KeyValueObjectStore(/*{'name':'User.Header.RecordIndex.transientState [1]'}*/);
115 } 112 }
116 113
117 return this._transientState; 114 return this._transientState;
118 }, 115 },
119 116
120 'resetTransientState': function (isCommitting) { 117 'resetTransientState': function (isCommitting) {
121//console.log("######## UserHeaderRecordIndex - resetTransientState", Clipperz.Base.deepClone(this._transientState));
122 if (this._transientState != null) { 118 if (this._transientState != null) {
123 this._transientState.removeAllData(); 119 this._transientState.removeAllData();
124 } 120 }
125 121
126 this._transientState = null; 122 this._transientState = null;
127 }, 123 },
128 124
129 //------------------------------------------------------------------------- 125 //-------------------------------------------------------------------------
130 126
131 'getRecordKey': function (aRecordReference) { 127 'getRecordKey': function (aRecordReference) {
132 return Clipperz.Async.callbacks("User.Header.RecordIndex.getRecordKey", [ 128 return Clipperz.Async.callbacks("User.Header.RecordIndex.getRecordKey", [
133 MochiKit.Base.method(this, 'getRecordIndexData', aRecordReference), 129 MochiKit.Base.method(this, 'getRecordIndexData', aRecordReference),
134 MochiKit.Base.itemgetter('key') 130 MochiKit.Base.itemgetter('key')
135 ], {trace:false}); 131 ], {trace:false});
136 }, 132 },
137 133
138 'setRecordKey': function (aRecordReference, aValue) { 134 'setRecordKey': function (aRecordReference, aValue) {
139 return this.updateRecordIndexData(aRecordReference, 'key', aValue); 135 return this.updateRecordIndexData(aRecordReference, 'key', aValue);
140 }, 136 },
141 137
142 //------------------------------------------------------------------------- 138 //-------------------------------------------------------------------------
143 139
144 'getRecordIndexData': function (aRecordReference) { 140 'getRecordIndexData': function (aRecordReference) {
145 return this.recordsData().getValue(this.recordsIndex()[aRecordReference]); 141 return this.recordsData().getValue(this.recordsIndex()[aRecordReference]);
146 }, 142 },
147 143
148 //......................................................................... 144 //.........................................................................
149 145
150 'updateRecordIndexData': function (aRecordReference, aKey, aValue) { 146 'updateRecordIndexData': function (aRecordReference, aKey, aValue) {
151 return this.recordsData().setValue(this.recordsIndex()[aRecordReference]+'.'+aKey, aValue); 147 return this.recordsData().setValue(this.recordsIndex()[aRecordReference]+'.'+aKey, aValue);
152 }, 148 },
153 149
154 //------------------------------------------------------------------------- 150 //-------------------------------------------------------------------------
155 151
156 'getDirectLoginIndexData': function (aDirectLoginReference) { 152 'getDirectLoginIndexData': function (aDirectLoginReference) {
157 return this.directLoginsData().getValue(this.directLoginsIndex()[aDirectLoginReference]); 153 return this.directLoginsData().getValue(this.directLoginsIndex()[aDirectLoginReference]);
158 }, 154 },
159 155
160 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) { 156 'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) {
161//console.log("UserHeaderRecordIndex.setDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference], aKey);
162//if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) { 157//if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) {
163 //throw "PIPPO"; 158 //throw "PIPPO";
164//} 159//}
165 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference] + '.' + aKey, aValue); 160 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference] + '.' + aKey, aValue);
166 }, 161 },
167 162
168 'addDirectLoginIndexData': function (aDirectLoginReference) { 163 'addDirectLoginIndexData': function (aDirectLoginReference) {
169//console.log("UserHeaderRecordIndex.addDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference]);
170 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {}); 164 return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {});
171 }, 165 },
172 166
173 'removeDirectLoginIndexData': function (aDirectLoginReference) { 167 'removeDirectLoginIndexData': function (aDirectLoginReference) {
174 return this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLoginReference]) 168 return this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLoginReference])
175 }, 169 },
176 170
177 //------------------------------------------------------------------------- 171 //-------------------------------------------------------------------------
178 172
179 'records': function () { 173 'records': function () {
180 vardeferredResult; 174 vardeferredResult;
181 175
182 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records", {trace:false}); 176 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records", {trace:false});
183 deferredResult.acquireLock(this.lock()); 177 deferredResult.acquireLock(this.lock());
184 deferredResult.addCallback(MochiKit.Base.bind(function () { 178 deferredResult.addCallback(MochiKit.Base.bind(function () {
185 var innerDeferredResult; 179 var innerDeferredResult;
186 180
187 if (this._records == null) { 181 if (this._records == null) {
188 innerDeferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records <inner deferred>", {trace:false}); 182 innerDeferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.records <inner deferred>", {trace:false});
189 innerDeferredResult.collectResults({ 183 innerDeferredResult.collectResults({
190 'records': [ 184 'records': [
191 // MochiKit.Base.method(this.recordsData(), 'getObjectDataStore'), 185 // MochiKit.Base.method(this.recordsData(), 'getObjectDataStore'),
192 // MochiKit.Base.methodcaller('values') 186 // MochiKit.Base.methodcaller('values')
193 MochiKit.Base.method(this.recordsData(), 'values') 187 MochiKit.Base.method(this.recordsData(), 'values')
@@ -240,93 +234,87 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
240 234
241 this._records[reference] = record; 235 this._records[reference] = record;
242 } else { 236 } else {
243Clipperz.log("SKIPPING record " + reference + " as there are no stas associated - " + Clipperz.Base.serializeJSON(someData['records'][reference])); 237Clipperz.log("SKIPPING record " + reference + " as there are no stas associated - " + Clipperz.Base.serializeJSON(someData['records'][reference]));
244 //# skip the record, as it seems it is not present in the DB 238 //# skip the record, as it seems it is not present in the DB
245 //updateDate = Clipperz.PM.Date.formatDateWithUTCFormat(new Date()); 239 //updateDate = Clipperz.PM.Date.formatDateWithUTCFormat(new Date());
246 } 240 }
247 } 241 }
248 242
249 for (indexReference in someData['directLogins']) { 243 for (indexReference in someData['directLogins']) {
250 // vardirectLogin; 244 // vardirectLogin;
251 var reference; 245 var reference;
252 var record; 246 var record;
253 247
254 reference = directLoginsInvertedIndex[indexReference]; 248 reference = directLoginsInvertedIndex[indexReference];
255 record = this._records[recordsInvertedIndex[someData['directLogins'][indexReference]['record']]]; 249 record = this._records[recordsInvertedIndex[someData['directLogins'][indexReference]['record']]];
256 250
257 if (record != null) { 251 if (record != null) {
258 // directLogin = new Clipperz.PM.DataModel.DirectLogin({ 252 // directLogin = new Clipperz.PM.DataModel.DirectLogin({
259 new Clipperz.PM.DataModel.DirectLogin({ 253 new Clipperz.PM.DataModel.DirectLogin({
260 'reference': reference, 254 'reference': reference,
261 'record': record 255 'record': record
262 }); 256 });
263 } else { 257 } else {
264Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!"); 258 Clipperz.logWarning("WARNING: DIRECT LOGIN without a matching RECORD!!");
265//console.log("direct login data", someData['directLogins']);
266//console.log("current direct login data", someData['directLogins'][indexReference])
267//console.log("reference", reference);
268//console.log("record index", this.recordsIndex());
269//console.log("record inverted index", recordsInvertedIndex);
270 } 259 }
271 } 260 }
272 261
273 return this._records; 262 return this._records;
274 }, this)); 263 }, this));
275 innerDeferredResult.callback(); 264 innerDeferredResult.callback();
276 } else { 265 } else {
277 innerDeferredResult = MochiKit.Async.succeed(this._records); 266 innerDeferredResult = MochiKit.Async.succeed(this._records);
278 } 267 }
279 268
280 return innerDeferredResult; 269 return innerDeferredResult;
281 }, this)); 270 }, this));
282 deferredResult.releaseLock(this.lock()); 271 deferredResult.releaseLock(this.lock());
283 deferredResult.callback(); 272 deferredResult.callback();
284 273
285 return deferredResult; 274 return deferredResult;
286 }, 275 },
287 276
288 //------------------------------------------------------------------------- 277 //-------------------------------------------------------------------------
289 278
290 'updateRecordIndexForNewRecord': function (aNewRecord) { 279 'updateRecordIndexForNewRecord': function (aNewRecord) {
291 var newRecordIndex; 280 var newRecordIndex;
292 var recordReference; 281 var recordReference;
293 282
294 recordReference = aNewRecord.reference(); 283 recordReference = aNewRecord.reference();
295 newRecordIndex = (MochiKit.Base.listMax(MochiKit.Base.map(MochiKit.Base.partial(MochiKit.Base.operator.mul, 1), MochiKit.Base.values(this.recordsIndex()))) + 1) + ''; 284 newRecordIndex = (MochiKit.Base.listMax(MochiKit.Base.map(MochiKit.Base.partial(MochiKit.Base.operator.mul, 1), MochiKit.Base.values(this.recordsIndex()))) + 1) + '';
296 this.recordsIndex()[recordReference] = newRecordIndex; 285 this.recordsIndex()[recordReference] = newRecordIndex;
297 286
298 this.transientState().setValue('newlyCreatedRecordsIndex' + '.' + recordReference, newRecordIndex); 287 this.transientState().setValue('newlyCreatedRecordsIndex' + '.' + recordReference, newRecordIndex);
299 this.transientState().setValue('newlyCreatedRecordsReferences'+ '.' + recordReference, aNewRecord); 288 this.transientState().setValue('newlyCreatedRecordsReferences'+ '.' + recordReference, aNewRecord);
300 }, 289 },
301 290
302 //......................................................................... 291 //.........................................................................
303 292
304 'createNewRecord': function () { 293 'createNewRecord': function () {
305 var deferredResult; 294 var deferredResult;
306 var newRecord; 295 var newRecord;
307 296
308//console.log("#### new Clipperz.PM.DataModel.Record [4]");
309 newRecord = new Clipperz.PM.DataModel.Record({ 297 newRecord = new Clipperz.PM.DataModel.Record({
310 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'), 298 'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'),
311 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(), 299 'retrieveRemoteDataFunction':this.retrieveRecordDetailFunction(),
312 300
313 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getRecordIndexData'), 301 'retrieveIndexDataFunction':MochiKit.Base.method(this, 'getRecordIndexData'),
314 'updateIndexDataFunction': MochiKit.Base.method(this, 'updateRecordIndexData'), 302 'updateIndexDataFunction': MochiKit.Base.method(this, 'updateRecordIndexData'),
315 'updateDate': Clipperz.PM.Date.formatDateWithUTCFormat(new Date()), 303 'updateDate': Clipperz.PM.Date.formatDateWithUTCFormat(new Date()),
316 304
317 'retrieveDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'), 305 'retrieveDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'getDirectLoginIndexData'),
318 'setDirectLoginIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'), 306 'setDirectLoginIndexDataFunction': MochiKit.Base.method(this, 'setDirectLoginIndexData'),
319 'removeDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'removeDirectLoginIndexData'), 307 'removeDirectLoginIndexDataFunction':MochiKit.Base.method(this, 'removeDirectLoginIndexData'),
320 308
321 'createNewDirectLoginFunction': MochiKit.Base.method(this, 'createNewDirectLogin') 309 'createNewDirectLoginFunction': MochiKit.Base.method(this, 'createNewDirectLogin')
322 }); 310 });
323 311
324 this.transientState().setValue('newRecordsReferences' + '.' + newRecord.reference(), newRecord); 312 this.transientState().setValue('newRecordsReferences' + '.' + newRecord.reference(), newRecord);
325 this.updateRecordIndexForNewRecord(newRecord); 313 this.updateRecordIndexForNewRecord(newRecord);
326 314
327 deferredResult = Clipperz.Async.callbacks("User.Header.RecordIndex.createNewRecord", [ 315 deferredResult = Clipperz.Async.callbacks("User.Header.RecordIndex.createNewRecord", [
328 MochiKit.Base.method(this, 'records'), 316 MochiKit.Base.method(this, 'records'),
329 MochiKit.Base.partial(Clipperz.Async.setItemOnObject, newRecord.reference(), newRecord), 317 MochiKit.Base.partial(Clipperz.Async.setItemOnObject, newRecord.reference(), newRecord),
330 MochiKit.Base.method(this, 'setRecordKey', newRecord.reference(), Clipperz.PM.Crypto.randomKey()), 318 MochiKit.Base.method(this, 'setRecordKey', newRecord.reference(), Clipperz.PM.Crypto.randomKey()),
331 MochiKit.Base.method(newRecord, 'setLabel', ''), 319 MochiKit.Base.method(newRecord, 'setLabel', ''),
332 MochiKit.Base.partial(MochiKit.Async.succeed, newRecord) 320 MochiKit.Base.partial(MochiKit.Async.succeed, newRecord)
@@ -365,124 +353,120 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
365 delete someRecords[recordReference]; 353 delete someRecords[recordReference];
366 }, this)); 354 }, this));
367 deferredResult.callback(); 355 deferredResult.callback();
368 356
369 return deferredResult; 357 return deferredResult;
370 }, 358 },
371 359
372 //========================================================================= 360 //=========================================================================
373 361
374 'removeDirectLogin': function (aDirectLogin) { 362 'removeDirectLogin': function (aDirectLogin) {
375 this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLogin.reference()]); 363 this.directLoginsData().removeValue(this.directLoginsIndex()[aDirectLogin.reference()]);
376 }, 364 },
377 365
378 //------------------------------------------------------------------------- 366 //-------------------------------------------------------------------------
379 367
380 'createNewDirectLogin': function (aRecord) { 368 'createNewDirectLogin': function (aRecord) {
381 var newDirectLogin; 369 var newDirectLogin;
382 varnewDirectLoginIndexValue; 370 varnewDirectLoginIndexValue;
383 371
384 newDirectLogin = new Clipperz.PM.DataModel.DirectLogin({record:aRecord}); 372 newDirectLogin = new Clipperz.PM.DataModel.DirectLogin({record:aRecord});
385 newDirectLoginIndexValue = MochiKit.Base.listMax(MochiKit.Base.map(function (aValue) { return aValue * 1; }, MochiKit.Base.values(this.directLoginsIndex()))) + 1; 373 newDirectLoginIndexValue = MochiKit.Base.listMax(MochiKit.Base.map(function (aValue) { return aValue * 1; }, MochiKit.Base.values(this.directLoginsIndex()))) + 1;
386 374
387 this.transientState().setValue('newDirectLoginReferences' + '.' + newDirectLogin.reference(), newDirectLogin); 375 this.transientState().setValue('newDirectLoginReferences' + '.' + newDirectLogin.reference(), newDirectLogin);
388 376
389//console.log("UserHeaderRecordIndex.createNewDirectLogin [1]", newDirectLogin.reference(), newDirectLoginIndexValue);
390 this.directLoginsIndex()[newDirectLogin.reference()] = newDirectLoginIndexValue; 377 this.directLoginsIndex()[newDirectLogin.reference()] = newDirectLoginIndexValue;
391//console.log("UserHeaderRecordIndex.createNewDirectLogin [2]", newDirectLogin.reference(), this.directLoginsIndex()[newDirectLogin.reference()]);
392 this.directLoginsData().setValue(this.directLoginsIndex()[newDirectLogin.reference()], {'record': this.recordsIndex()[aRecord.reference()]}); 378 this.directLoginsData().setValue(this.directLoginsIndex()[newDirectLogin.reference()], {'record': this.recordsIndex()[aRecord.reference()]});
393 379
394 return newDirectLogin; 380 return newDirectLogin;
395 }, 381 },
396 382
397 //========================================================================= 383 //=========================================================================
398 384
399 'deleteAllCleanTextData': function () { 385 'deleteAllCleanTextData': function () {
400 return Clipperz.Async.callbacks("User.Header.RecordIndex.deleteAllCleanTextData", [ 386 return Clipperz.Async.callbacks("User.Header.RecordIndex.deleteAllCleanTextData", [
401 // MochiKit.Base.method(this, 'records'), 387 // MochiKit.Base.method(this, 'records'),
402 // MochiKit.Base.values, 388 // MochiKit.Base.values,
403 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')), 389 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('deleteAllCleanTextData')),
404 390
405 MochiKit.Base.method(this, 'recordsData'), 391 MochiKit.Base.method(this, 'recordsData'),
406 MochiKit.Base.methodcaller('deleteAllCleanTextData'), 392 MochiKit.Base.methodcaller('deleteAllCleanTextData'),
407 MochiKit.Base.method(this, 'directLoginsData'), 393 MochiKit.Base.method(this, 'directLoginsData'),
408 MochiKit.Base.methodcaller('deleteAllCleanTextData') 394 MochiKit.Base.methodcaller('deleteAllCleanTextData')
409 ], {trace:false}); 395 ], {trace:false});
410 }, 396 },
411 397
412 //------------------------------------------------------------------------- 398 //-------------------------------------------------------------------------
413 399
414 'hasAnyCleanTextData': function () { 400 'hasAnyCleanTextData': function () {
415 var deferredResult; 401 var deferredResult;
416 402
417 deferredResult = new Clipperz.Async.Deferred({trace:false}); 403 deferredResult = new Clipperz.Async.Deferred({trace:false});
418 deferredResult.collectResults({ 404 deferredResult.collectResults({
419 'recordsData': [ 405 'recordsData': [
420 MochiKit.Base.method(this, 'recordsData'), 406 MochiKit.Base.method(this, 'recordsData'),
421 MochiKit.Base.methodcaller('hasAnyCleanTextData') 407 MochiKit.Base.methodcaller('hasAnyCleanTextData')
422 ], 408 ],
423 'directLoginsData':[ 409 'directLoginsData':[
424 MochiKit.Base.method(this, 'directLoginsData'), 410 MochiKit.Base.method(this, 'directLoginsData'),
425 MochiKit.Base.methodcaller('hasAnyCleanTextData') 411 MochiKit.Base.methodcaller('hasAnyCleanTextData')
426 ], 412 ],
427 // 'records': [ 413 // 'records': [
428 // MochiKit.Base.method(this, 'records'), 414 // MochiKit.Base.method(this, 'records'),
429 // MochiKit.Base.values, 415 // MochiKit.Base.values,
430 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasAnyCleanTextData')), 416 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasAnyCleanTextData')),
431 // Clipperz.Async.collectAll 417 // Clipperz.Async.collectAll
432 // ] 418 // ]
433 }); 419 });
434//deferredResult.addCallback(function (aValue) { console.log("USER.Header.RecordIndex.hasAnyCleanTextData", aValue); return aValue});
435 420
436 // deferredResult.addCallback(MochiKit.Base.values); 421 // deferredResult.addCallback(MochiKit.Base.values);
437 // deferredResult.addCallback(MochiKit.Base.flattenArguments); 422 // deferredResult.addCallback(MochiKit.Base.flattenArguments);
438 // deferredResult.addCallback(function(someValues) { 423 // deferredResult.addCallback(function(someValues) {
439 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity); 424 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity);
440 // }); 425 // });
441 deferredResult.addCallback(Clipperz.Async.or); 426 deferredResult.addCallback(Clipperz.Async.or);
442 427
443 deferredResult.callback(); 428 deferredResult.callback();
444 429
445 return deferredResult; 430 return deferredResult;
446 }, 431 },
447 432
448 //------------------------------------------------------------------------- 433 //-------------------------------------------------------------------------
449 434
450 'hasPendingChanges': function () { 435 'hasPendingChanges': function () {
451 vardeferredResult; 436 vardeferredResult;
452 437
453 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.hasPendingChanges", {trace:false}); 438 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.hasPendingChanges", {trace:false});
454 deferredResult.collectResults({ 439 deferredResult.collectResults({
455 'recordsData': [ 440 'recordsData': [
456 MochiKit.Base.method(this, 'recordsData'), 441 MochiKit.Base.method(this, 'recordsData'),
457 MochiKit.Base.methodcaller('hasPendingChanges') 442 MochiKit.Base.methodcaller('hasPendingChanges')
458 ], 443 ],
459 'directLoginsData': [ 444 'directLoginsData': [
460 MochiKit.Base.method(this, 'directLoginsData'), 445 MochiKit.Base.method(this, 'directLoginsData'),
461 MochiKit.Base.methodcaller('hasPendingChanges') 446 MochiKit.Base.methodcaller('hasPendingChanges')
462 ] 447 ]
463 }); 448 });
464//deferredResult.addCallback(function (aValue) { console.log("UserHeaderIndex.hasPendingResults", aValue); return aValue; });
465 deferredResult.addCallback(Clipperz.Async.or); 449 deferredResult.addCallback(Clipperz.Async.or);
466 // deferredResult.addCallback(MochiKit.Base.values); 450 // deferredResult.addCallback(MochiKit.Base.values);
467 // deferredResult.addCallback(MochiKit.Base.flattenArguments); 451 // deferredResult.addCallback(MochiKit.Base.flattenArguments);
468 // deferredResult.addCallback(function(someValues) { 452 // deferredResult.addCallback(function(someValues) {
469 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity); 453 // return MochiKit.Iter.some(someValues, MochiKit.Base.operator.identity);
470 // }); 454 // });
471 deferredResult.callback(); 455 deferredResult.callback();
472 456
473 return deferredResult; 457 return deferredResult;
474 }, 458 },
475 459
476 //------------------------------------------------------------------------- 460 //-------------------------------------------------------------------------
477 461
478 'commitTransientState': function () { 462 'commitTransientState': function () {
479 var deferredResult; 463 var deferredResult;
480 464
481 deferredResut = Clipperz.Async.callbacks("User.Header.RecordIndex.commitTransientState", [ 465 deferredResut = Clipperz.Async.callbacks("User.Header.RecordIndex.commitTransientState", [
482 MochiKit.Base.method(this, 'recordsData'), 466 MochiKit.Base.method(this, 'recordsData'),
483 MochiKit.Base.methodcaller('commitTransientState'), 467 MochiKit.Base.methodcaller('commitTransientState'),
484 468
485 MochiKit.Base.method(this, 'directLoginsData'), 469 MochiKit.Base.method(this, 'directLoginsData'),
486 MochiKit.Base.methodcaller('commitTransientState'), 470 MochiKit.Base.methodcaller('commitTransientState'),
487 471
488 MochiKit.Base.method(this, 'resetTransientState', true) 472 MochiKit.Base.method(this, 'resetTransientState', true)
@@ -549,49 +533,48 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
549 // "records": { 533 // "records": {
550 // "index": { 534 // "index": {
551 // "eeda70e0392261967bda71c3764da78989c45bbd2bb7be6b941b90f81d9b81b5": "0", 535 // "eeda70e0392261967bda71c3764da78989c45bbd2bb7be6b941b90f81d9b81b5": "0",
552 // "13a5e52976337ab210903cd04872588e1b21fb72bc183e91aa25c494b8138551": "1", 536 // "13a5e52976337ab210903cd04872588e1b21fb72bc183e91aa25c494b8138551": "1",
553 // ... 537 // ...
554 // "465a067a0bd2b470fa834de5397e38494de0c7707938262fae3427932e219744": "18", 538 // "465a067a0bd2b470fa834de5397e38494de0c7707938262fae3427932e219744": "18",
555 // "4fd1dc2ca860b7fb47cef10a84edb3270da05510b0a30a6b0b083898712d4b9e": "19" 539 // "4fd1dc2ca860b7fb47cef10a84edb3270da05510b0a30a6b0b083898712d4b9e": "19"
556 // }, 540 // },
557 // "data": "n+AzGEEQXaSRSY4d ... BDypotrXgPo94uHfoXvGFzwCn8w=" 541 // "data": "n+AzGEEQXaSRSY4d ... BDypotrXgPo94uHfoXvGFzwCn8w="
558 // }, 542 // },
559 // "directLogins": { 543 // "directLogins": {
560 // "index": { 544 // "index": {
561 // "61e87fdc4f1d9112e3b30c1f6812d095dcdb24f014c83319091eb6c9899ec348":"0", 545 // "61e87fdc4f1d9112e3b30c1f6812d095dcdb24f014c83319091eb6c9899ec348":"0",
562 // "989593d4c48929f0c8f1581aa96969c622807e99619ed4732026e967530a68ad":"1", 546 // "989593d4c48929f0c8f1581aa96969c622807e99619ed4732026e967530a68ad":"1",
563 // ... 547 // ...
564 // "cb9ae0bba1957075ccdbfd3b3481704d62087687a2ac7c411a4f07d444bde0f7":"17", 548 // "cb9ae0bba1957075ccdbfd3b3481704d62087687a2ac7c411a4f07d444bde0f7":"17",
565 // "7e1d069b7fa57c03bd7bf48807520feb953157834503aaff8c9d493f37dea69d":"18" 549 // "7e1d069b7fa57c03bd7bf48807520feb953157834503aaff8c9d493f37dea69d":"18"
566 // }, 550 // },
567 // "data":"5YG9KKU/OZ5guUgFlms6k1 ... ZG/5Fn0uN+LoAsNfHm+EE62x" 551 // "data":"5YG9KKU/OZ5guUgFlms6k1 ... ZG/5Fn0uN+LoAsNfHm+EE62x"
568 // }, 552 // },
569 553
570 var deferredResult; 554 var deferredResult;
571 var result; 555 var result;
572 556
573//console.log("recordsIndex", this.recordsIndex());
574 result = {}; 557 result = {};
575 558
576 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.prepareRemoteDataWithKey", {trace:false}); 559 deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.prepareRemoteDataWithKey", {trace:false});
577 deferredResult.collectResults({ 560 deferredResult.collectResults({
578 'index':MochiKit.Base.partial(MochiKit.Async.succeed, this.recordsIndex()), 561 'index':MochiKit.Base.partial(MochiKit.Async.succeed, this.recordsIndex()),
579 'data': [ 562 'data': [
580 MochiKit.Base.method(this.recordsData(), 'prepareRemoteDataWithKey', aKey), 563 MochiKit.Base.method(this.recordsData(), 'prepareRemoteDataWithKey', aKey),
581 MochiKit.Base.itemgetter('data') 564 MochiKit.Base.itemgetter('data')
582 ] 565 ]
583 }); 566 });
584 deferredResult.addCallback(Clipperz.Async.setItem, result, 'records'); 567 deferredResult.addCallback(Clipperz.Async.setItem, result, 'records');
585 568
586 deferredResult.collectResults({ 569 deferredResult.collectResults({
587 'index':MochiKit.Base.partial(MochiKit.Async.succeed, this.directLoginsIndex()), 570 'index':MochiKit.Base.partial(MochiKit.Async.succeed, this.directLoginsIndex()),
588 'data': [ 571 'data': [
589 MochiKit.Base.method(this.directLoginsData(), 'prepareRemoteDataWithKey', aKey), 572 MochiKit.Base.method(this.directLoginsData(), 'prepareRemoteDataWithKey', aKey),
590 MochiKit.Base.itemgetter('data') 573 MochiKit.Base.itemgetter('data')
591 ] 574 ]
592 }); 575 });
593 deferredResult.addCallback(Clipperz.Async.setItem, result, 'directLogins'); 576 deferredResult.addCallback(Clipperz.Async.setItem, result, 'directLogins');
594 577
595 deferredResult.addCallback(MochiKit.Async.succeed, result); 578 deferredResult.addCallback(MochiKit.Async.succeed, result);
596 579
597 deferredResult.callback(); 580 deferredResult.callback();
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.js
index 646ce21..fd18faf 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } 26if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; }
29 27
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.PM.DataModel.User = function (args) { 31Clipperz.PM.DataModel.User = function (args) {
34 args = args || {}; 32 args = args || {};
35 33
36 Clipperz.PM.DataModel.User.superclass.constructor.apply(this, arguments); 34 Clipperz.PM.DataModel.User.superclass.constructor.apply(this, arguments);
37 35
38 this._username = args.username || null; 36 this._username = args.username || null;
39 this._getPassphraseFunction = args.getPassphraseFunction || null; 37 this._getPassphraseFunction = args.getPassphraseFunction || null;
40 38
41 this._data = null; 39 this._data = null;
42 40
43 this._connection = null; 41 this._connection = null;
44 this._connectionVersion = 'current'; 42 this._connectionVersion = 'current';
45 43
46 this._serverData = null; 44 this._serverData = null;
@@ -307,49 +305,48 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
307 var result; 305 var result;
308 306
309 if (anHeader.charAt(0) == '{') { 307 if (anHeader.charAt(0) == '{') {
310 varheaderData; 308 varheaderData;
311 309
312 headerData = Clipperz.Base.evalJSON(anHeader); 310 headerData = Clipperz.Base.evalJSON(anHeader);
313 result = headerData['version']; 311 result = headerData['version'];
314 } else { 312 } else {
315 result = 'LEGACY'; 313 result = 'LEGACY';
316 } 314 }
317 315
318 return result; 316 return result;
319 }, 317 },
320 318
321 //------------------------------------------------------------------------- 319 //-------------------------------------------------------------------------
322 320
323 'unpackServerData': function (someServerData) { 321 'unpackServerData': function (someServerData) {
324 var unpackedData; 322 var unpackedData;
325 var headerVersion; 323 var headerVersion;
326 324
327 varrecordsIndex; 325 varrecordsIndex;
328 var preferences; 326 var preferences;
329 var oneTimePasswords; 327 var oneTimePasswords;
330 328
331//console.log(">>> ***************** user.unpackServerData", someServerData);
332 // this.setServerLockValue(someServerData['lock']); 329 // this.setServerLockValue(someServerData['lock']);
333 330
334 headerVersion = this.headerFormatVersion(someServerData['header']); 331 headerVersion = this.headerFormatVersion(someServerData['header']);
335 332
336 switch (headerVersion) { 333 switch (headerVersion) {
337 case 'LEGACY': 334 case 'LEGACY':
338 varlegacyHeader; 335 varlegacyHeader;
339 336
340 legacyHeader = new Clipperz.PM.DataModel.User.Header.Legacy({ 337 legacyHeader = new Clipperz.PM.DataModel.User.Header.Legacy({
341 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase'), 338 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase'),
342 'remoteData': { 339 'remoteData': {
343 'data': someServerData['header'], 340 'data': someServerData['header'],
344 'version': someServerData['version'], 341 'version': someServerData['version'],
345 'recordsStats': someServerData['recordsStats'] 342 'recordsStats': someServerData['recordsStats']
346 }, 343 },
347 // 'encryptedDataKeypath': 'data', 344 // 'encryptedDataKeypath': 'data',
348 // 'encryptedVersionKeypath': 'version', 345 // 'encryptedVersionKeypath': 'version',
349 'retrieveRecordDetailFunction':MochiKit.Base.method(this, 'getRecordDetail') 346 'retrieveRecordDetailFunction':MochiKit.Base.method(this, 'getRecordDetail')
350 }); 347 });
351 348
352 recordsIndex = legacyHeader; 349 recordsIndex = legacyHeader;
353 preferences = legacyHeader; 350 preferences = legacyHeader;
354 oneTimePasswords= legacyHeader; 351 oneTimePasswords= legacyHeader;
355 break; 352 break;
@@ -396,49 +393,48 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
396 } else { 393 } else {
397 oneTimePasswords = new Clipperz.PM.DataModel.User.Header.OneTimePasswords({ 394 oneTimePasswords = new Clipperz.PM.DataModel.User.Header.OneTimePasswords({
398 'name':'preferences', 395 'name':'preferences',
399 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase') 396 'retrieveKeyFunction': MochiKit.Base.method(this, 'getPassphrase')
400 }); 397 });
401 } 398 }
402 399
403 break; 400 break;
404 } 401 }
405 402
406 unpackedData = { 403 unpackedData = {
407 'version': someServerData['version'], 404 'version': someServerData['version'],
408 'statistics': someServerData['statistics'], 405 'statistics': someServerData['statistics'],
409 'header': { 406 'header': {
410 'data': someServerData['header'], 407 'data': someServerData['header'],
411 'version': headerVersion, 408 'version': headerVersion,
412 409
413 'recordsIndex': recordsIndex, 410 'recordsIndex': recordsIndex,
414 'preferences': preferences, 411 'preferences': preferences,
415 'oneTimePasswords': oneTimePasswords 412 'oneTimePasswords': oneTimePasswords
416 } 413 }
417 }; 414 };
418 415
419 this._serverData = unpackedData; 416 this._serverData = unpackedData;
420//console.log("<<< ***************** user.unpackServerData", this._serverData);
421 417
422 return this._serverData; 418 return this._serverData;
423 }, 419 },
424 420
425 //------------------------------------------------------------------------- 421 //-------------------------------------------------------------------------
426 422
427 'getServerData': function() { 423 'getServerData': function() {
428 var deferredResult; 424 var deferredResult;
429 425
430 deferredResult = new Clipperz.Async.Deferred("User.getServerData", {trace:false}); 426 deferredResult = new Clipperz.Async.Deferred("User.getServerData", {trace:false});
431 deferredResult.acquireLock(this.deferredLockForSection('serverData')); 427 deferredResult.acquireLock(this.deferredLockForSection('serverData'));
432 deferredResult.addCallback(MochiKit.Base.bind(function(aResult) { 428 deferredResult.addCallback(MochiKit.Base.bind(function(aResult) {
433 var innerDeferredResult; 429 var innerDeferredResult;
434 430
435 innerDeferredResult = new Clipperz.Async.Deferred("User.getUserDetails.innerDeferred", {trace:false}); 431 innerDeferredResult = new Clipperz.Async.Deferred("User.getUserDetails.innerDeferred", {trace:false});
436 if (this._serverData == null) { 432 if (this._serverData == null) {
437 innerDeferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'loadingUserDetails'); 433 innerDeferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'loadingUserDetails');
438 innerDeferredResult.addMethod(this.connection(), 'message', 'getUserDetails'); 434 innerDeferredResult.addMethod(this.connection(), 'message', 'getUserDetails');
439 innerDeferredResult.addMethod(this, 'unpackServerData'); 435 innerDeferredResult.addMethod(this, 'unpackServerData');
440 innerDeferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'loadedUserDetails'); 436 innerDeferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'loadedUserDetails');
441 } 437 }
442 438
443 innerDeferredResult.addCallback(MochiKit.Base.bind(function () { 439 innerDeferredResult.addCallback(MochiKit.Base.bind(function () {
444 return this._serverData; 440 return this._serverData;
diff --git a/frontend/gamma/js/Clipperz/PM/Date.js b/frontend/gamma/js/Clipperz/PM/Date.js
index 96a2700..a62857e 100644
--- a/frontend/gamma/js/Clipperz/PM/Date.js
+++ b/frontend/gamma/js/Clipperz/PM/Date.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Date) == 'undefined') { Clipperz.PM.Date = {}; } 26if (typeof(Clipperz.PM.Date) == 'undefined') { Clipperz.PM.Date = {}; }
29 27
30Clipperz.PM.Date.VERSION = "0.1"; 28Clipperz.PM.Date.VERSION = "0.1";
31Clipperz.PM.Date.NAME = "Clipperz.PM.Date"; 29Clipperz.PM.Date.NAME = "Clipperz.PM.Date";
32 30
33MochiKit.Base.update(Clipperz.PM.Date, { 31MochiKit.Base.update(Clipperz.PM.Date, {
34 32
35 '__repr__': function () { 33 '__repr__': function () {
36 return "[" + this.NAME + " " + this.VERSION + "]"; 34 return "[" + this.NAME + " " + this.VERSION + "]";
37 }, 35 },
38 36
39 //------------------------------------------------------------------------- 37 //-------------------------------------------------------------------------
40 38
41 'toString': function () { 39 'toString': function () {
42 return this.__repr__(); 40 return this.__repr__();
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
diff --git a/frontend/gamma/js/Clipperz/PM/PIN.js b/frontend/gamma/js/Clipperz/PM/PIN.js
index bc932b2..a32889a 100644
--- a/frontend/gamma/js/Clipperz/PM/PIN.js
+++ b/frontend/gamma/js/Clipperz/PM/PIN.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.PIN) == 'undefined') { Clipperz.PM.PIN = {}; } 26if (typeof(Clipperz.PM.PIN) == 'undefined') { Clipperz.PM.PIN = {}; }
29 27
30MochiKit.Base.update(Clipperz.PM.PIN, { 28MochiKit.Base.update(Clipperz.PM.PIN, {
31 29
32 //------------------------------------------------------------------------- 30 //-------------------------------------------------------------------------
33 31
34 '__repr__': function () { 32 '__repr__': function () {
35 return "[" + this.NAME + " " + this.VERSION + "]"; 33 return "[" + this.NAME + " " + this.VERSION + "]";
36 }, 34 },
37 35
38 //------------------------------------------------------------------------- 36 //-------------------------------------------------------------------------
39 37
40 'toString': function () { 38 'toString': function () {
41 return this.__repr__(); 39 return this.__repr__();
42 }, 40 },
43 41
44 'CREDENTIALS': 'CLIPPERZ.CREDENTIALS', 42 'CREDENTIALS': 'CLIPPERZ.CREDENTIALS',
45 'FAILURE_COUNT': 'CLIPPERZ.FAILED_LOGIN_COUNT', 43 'FAILURE_COUNT': 'CLIPPERZ.FAILED_LOGIN_COUNT',
46 'ALLOWED_RETRY': 3, 44 'ALLOWED_RETRY': 3,
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy.js b/frontend/gamma/js/Clipperz/PM/Proxy.js
index 190bffd..a5eaae6 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//============================================================================= 27//=============================================================================
30 28
31Clipperz.PM.Proxy = function(args) { 29Clipperz.PM.Proxy = function(args) {
32 args = args || {}; 30 args = args || {};
33 31
34 this._shouldPayTolls = args.shouldPayTolls || false; 32 this._shouldPayTolls = args.shouldPayTolls || false;
35 33
36 this._tolls = { 34 this._tolls = {
37 'CONNECT':[], 35 'CONNECT':[],
38 'REGISTER':[], 36 'REGISTER':[],
39 'MESSAGE':[] 37 'MESSAGE':[]
40 }; 38 };
41 39
42 if (args.isDefault === true) { 40 if (args.isDefault === true) {
43 Clipperz.PM.Proxy.defaultProxy = this; 41 Clipperz.PM.Proxy.defaultProxy = this;
44 } 42 }
45 43
46 return this; 44 return this;
@@ -48,95 +46,89 @@ Clipperz.PM.Proxy = function(args) {
48 46
49Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { 47Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
50 48
51 'toString': function() { 49 'toString': function() {
52 return "Clipperz.PM.Proxy"; 50 return "Clipperz.PM.Proxy";
53 }, 51 },
54 52
55 //========================================================================= 53 //=========================================================================
56 54
57 'shouldPayTolls': function() { 55 'shouldPayTolls': function() {
58 return this._shouldPayTolls; 56 return this._shouldPayTolls;
59 }, 57 },
60 58
61 //------------------------------------------------------------------------- 59 //-------------------------------------------------------------------------
62 60
63 'tolls': function() { 61 'tolls': function() {
64 return this._tolls; 62 return this._tolls;
65 }, 63 },
66 64
67 //------------------------------------------------------------------------- 65 //-------------------------------------------------------------------------
68 66
69 'payToll': function(aRequestType, someParameters) { 67 'payToll': function(aRequestType, someParameters) {
70 vardeferredResult; 68 vardeferredResult;
71 69
72//console.log(">>> Proxy.payToll", aRequestType, someParameters);
73 if (this.shouldPayTolls()) { 70 if (this.shouldPayTolls()) {
74 deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false}); 71 deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false});
75 72
76 if (this.tolls()[aRequestType].length == 0) { 73 if (this.tolls()[aRequestType].length == 0) {
77 deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType}); 74 deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType});
78 deferredResult.addMethod(this, 'setTollCallback'); 75 deferredResult.addMethod(this, 'setTollCallback');
79 } 76 }
80 deferredResult.addMethod(this.tolls()[aRequestType], 'pop'); 77 deferredResult.addMethod(this.tolls()[aRequestType], 'pop');
81 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay')); 78 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay'));
82 deferredResult.addCallback(function(aToll) { 79 deferredResult.addCallback(function(aToll) {
83 var result; 80 var result;
84 81
85 result = { 82 result = {
86 parameters: someParameters, 83 parameters: someParameters,
87 toll: aToll 84 toll: aToll
88 } 85 }
89 86
90 return result; 87 return result;
91 }); 88 });
92 89
93 deferredResult.callback(); 90 deferredResult.callback();
94 } else { 91 } else {
95 deferredResult = MochiKit.Async.succeed({parameters:someParameters}); 92 deferredResult = MochiKit.Async.succeed({parameters:someParameters});
96 } 93 }
97//console.log("<<< Proxy.payToll");
98 94
99 return deferredResult; 95 return deferredResult;
100 }, 96 },
101 97
102 //------------------------------------------------------------------------- 98 //-------------------------------------------------------------------------
103 99
104 'addToll': function(aToll) { 100 'addToll': function(aToll) {
105//console.log(">>> Proxy.addToll", aToll);
106 this.tolls()[aToll.requestType()].push(aToll); 101 this.tolls()[aToll.requestType()].push(aToll);
107//console.log("<<< Proxy.addToll");
108 }, 102 },
109 103
110 //========================================================================= 104 //=========================================================================
111 105
112 'setTollCallback': function(someParameters) { 106 'setTollCallback': function(someParameters) {
113//console.log(">>> Proxy.setTollCallback", someParameters);
114 if (typeof(someParameters['toll']) != 'undefined') { 107 if (typeof(someParameters['toll']) != 'undefined') {
115//console.log("added a new toll", someParameters['toll']);
116 this.addToll(new Clipperz.PM.Toll(someParameters['toll'])); 108 this.addToll(new Clipperz.PM.Toll(someParameters['toll']));
117 } 109 }
118//console.log("<<< Proxy.setTallCallback", someParameters['result']); 110
119 return someParameters['result']; 111 return someParameters['result'];
120 }, 112 },
121 113
122 //========================================================================= 114 //=========================================================================
123 115
124 'registration': function (someParameters) { 116 'registration': function (someParameters) {
125 return this.processMessage('registration', someParameters, 'REGISTER'); 117 return this.processMessage('registration', someParameters, 'REGISTER');
126 }, 118 },
127 119
128 'handshake': function (someParameters) { 120 'handshake': function (someParameters) {
129 return this.processMessage('handshake', someParameters, 'CONNECT'); 121 return this.processMessage('handshake', someParameters, 'CONNECT');
130 }, 122 },
131 123
132 'message': function (someParameters) { 124 'message': function (someParameters) {
133 return this.processMessage('message', someParameters, 'MESSAGE'); 125 return this.processMessage('message', someParameters, 'MESSAGE');
134 }, 126 },
135 127
136 'logout': function (someParameters) { 128 'logout': function (someParameters) {
137 return this.processMessage('logout', someParameters, 'MESSAGE'); 129 return this.processMessage('logout', someParameters, 'MESSAGE');
138 }, 130 },
139 131
140 //========================================================================= 132 //=========================================================================
141 133
142 'processMessage': function (aFunctionName, someParameters, aRequestType) { 134 'processMessage': function (aFunctionName, someParameters, aRequestType) {
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
index 5b39b4a..7d10dd4 100755
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//============================================================================= 27//=============================================================================
30 28
31Clipperz.PM.Proxy.JSON = function(args) { 29Clipperz.PM.Proxy.JSON = function(args) {
32 Clipperz.PM.Proxy.JSON.superclass.constructor.call(this, args); 30 Clipperz.PM.Proxy.JSON.superclass.constructor.call(this, args);
33 31
34 this._url = args.url || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._url = args.url || Clipperz.Base.exception.raise('MandatoryParameter');
35 33
36 return this; 34 return this;
37} 35}
38 36
39Clipperz.Base.extend(Clipperz.PM.Proxy.JSON, Clipperz.PM.Proxy, { 37Clipperz.Base.extend(Clipperz.PM.Proxy.JSON, Clipperz.PM.Proxy, {
40 38
41 'toString': function() { 39 'toString': function() {
42 return "Clipperz.PM.Proxy.JSON"; 40 return "Clipperz.PM.Proxy.JSON";
43 }, 41 },
44 42
45 //========================================================================= 43 //=========================================================================
46 44
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 01ba122..326022c 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26try { if (typeof(Clipperz.PM.Proxy.Offline) == 'undefined') { throw ""; }} catch (e) { 24try { if (typeof(Clipperz.PM.Proxy.Offline) == 'undefined') { throw ""; }} catch (e) {
27 throw "Clipperz.PM.Proxy.Offline.DataStore depends on Clipperz.PM.Proxy.Offline!"; 25 throw "Clipperz.PM.Proxy.Offline.DataStore depends on Clipperz.PM.Proxy.Offline!";
28} 26}
29 27
30//============================================================================= 28//=============================================================================
31 29
32Clipperz.PM.Proxy.Offline.DataStore = function(args) { 30Clipperz.PM.Proxy.Offline.DataStore = function(args) {
33 args = args || {}; 31 args = args || {};
34 32
35 this._data = args.data || (typeof(_clipperz_dump_data_) != 'undefined' ? _clipperz_dump_data_ : null); 33 this._data = args.data || (typeof(_clipperz_dump_data_) != 'undefined' ? _clipperz_dump_data_ : null);
36 this._isReadOnly = (typeof(args.readOnly) == 'undefined' ? true : args.readOnly); 34 this._isReadOnly = (typeof(args.readOnly) == 'undefined' ? true : args.readOnly);
37 this._shouldPayTolls = args.shouldPayTolls || false; 35 this._shouldPayTolls = args.shouldPayTolls || false;
38 36
39 this._tolls = {}; 37 this._tolls = {};
40 this._currentStaticConnection = null; 38 this._currentStaticConnection = null;
41 39
42 return this; 40 return this;
43} 41}
44 42
45Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, { 43Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
46 44
@@ -86,64 +84,62 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
86 84
87 'setupWithEncryptedData': function(someData) { 85 'setupWithEncryptedData': function(someData) {
88 this._data = Clipperz.Base.deepClone(someData); 86 this._data = Clipperz.Base.deepClone(someData);
89 }, 87 },
90 88
91 //------------------------------------------------------------------------- 89 //-------------------------------------------------------------------------
92 90
93 'setupWithData': function(someData) { 91 'setupWithData': function(someData) {
94 var deferredResult; 92 var deferredResult;
95 var resultData; 93 var resultData;
96 var i, c; 94 var i, c;
97 95
98//Clipperz.log(">>> Proxy.Test.setupWithData"); 96//Clipperz.log(">>> Proxy.Test.setupWithData");
99 resultData = this._data; 97 resultData = this._data;
100 98
101 deferredResult = new Clipperz.Async.Deferred("Proxy.Test.seupWithData", {trace:false}); 99 deferredResult = new Clipperz.Async.Deferred("Proxy.Test.seupWithData", {trace:false});
102 c = someData['users'].length; 100 c = someData['users'].length;
103 101
104 for (i=0; i<c; i++) { 102 for (i=0; i<c; i++) {
105 varnewConnection; 103 varnewConnection;
106 varrecordConfiguration; 104 varrecordConfiguration;
107 105
108 deferredResult.addMethod(this, 'userSerializedEncryptedData', someData['users'][i]); 106 deferredResult.addMethod(this, 'userSerializedEncryptedData', someData['users'][i]);
109 deferredResult.addCallback(MochiKit.Base.bind(function(aUserSerializationContext) { 107 deferredResult.addCallback(MochiKit.Base.bind(function(aUserSerializationContext) {
110//console.log("SERIALIZED USER", aUserSerializationContext);
111 resultData['users'][aUserSerializationContext['credentials']['C']] = { 108 resultData['users'][aUserSerializationContext['credentials']['C']] = {
112 's': aUserSerializationContext['credentials']['s'], 109 's': aUserSerializationContext['credentials']['s'],
113 'v': aUserSerializationContext['credentials']['v'], 110 'v': aUserSerializationContext['credentials']['v'],
114 'version': aUserSerializationContext['data']['connectionVersion'], 111 'version': aUserSerializationContext['data']['connectionVersion'],
115 'userDetails': aUserSerializationContext['encryptedData']['user']['header'], 112 'userDetails': aUserSerializationContext['encryptedData']['user']['header'],
116 'userDetailsVersion':aUserSerializationContext['encryptedData']['user']['version'], 113 'userDetailsVersion':aUserSerializationContext['encryptedData']['user']['version'],
117 'statistics': aUserSerializationContext['encryptedData']['user']['statistics'], 114 'statistics': aUserSerializationContext['encryptedData']['user']['statistics'],
118 'lock': aUserSerializationContext['encryptedData']['user']['lock'], 115 'lock': aUserSerializationContext['encryptedData']['user']['lock'],
119 'records': this.rearrangeRecordsData(aUserSerializationContext['encryptedData']['records']) 116 'records': this.rearrangeRecordsData(aUserSerializationContext['encryptedData']['records'])
120 } 117 }
121 }, this)); 118 }, this));
122 } 119 }
123 120
124 deferredResult.addCallback(MochiKit.Base.bind(function() { 121 deferredResult.addCallback(MochiKit.Base.bind(function() {
125//console.log("this._data", resultData);
126 this._data = resultData; 122 this._data = resultData;
127 }, this)); 123 }, this));
128 124
129 deferredResult.callback(); 125 deferredResult.callback();
130//Clipperz.log("<<< Proxy.Test.setupWithData"); 126//Clipperz.log("<<< Proxy.Test.setupWithData");
131 127
132 return deferredResult; 128 return deferredResult;
133 }, 129 },
134 130
135 //========================================================================= 131 //=========================================================================
136 132
137 'getTollForRequestType': function (aRequestType) { 133 'getTollForRequestType': function (aRequestType) {
138 varresult; 134 varresult;
139 vartargetValue; 135 vartargetValue;
140 var cost; 136 var cost;
141 137
142 targetValue = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2); 138 targetValue = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2);
143 switch (aRequestType) { 139 switch (aRequestType) {
144 case 'REGISTER': 140 case 'REGISTER':
145 cost = 5; 141 cost = 5;
146 break; 142 break;
147 case 'CONNECT': 143 case 'CONNECT':
148 cost = 5; 144 cost = 5;
149 break; 145 break;
@@ -374,49 +370,49 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
374 result = { 370 result = {
375 'data': otpData['data'], 371 'data': otpData['data'],
376 'version':otpData['version'] 372 'version':otpData['version']
377 } 373 }
378 374
379 otpData['status'] = 'REQUESTED'; 375 otpData['status'] = 'REQUESTED';
380 } else { 376 } else {
381 otpData['status'] = 'DISABLED'; 377 otpData['status'] = 'DISABLED';
382 throw "The requested One Time Password has been disabled, due to a wrong keyChecksum"; 378 throw "The requested One Time Password has been disabled, due to a wrong keyChecksum";
383 } 379 }
384 } else { 380 } else {
385 throw "The requested One Time Password was not active"; 381 throw "The requested One Time Password was not active";
386 } 382 }
387 } else { 383 } else {
388 throw "The requested One Time Password has not been found" 384 throw "The requested One Time Password has not been found"
389 } 385 }
390 } catch (exception) { 386 } catch (exception) {
391 result = { 387 result = {
392 'data': Clipperz.PM.Crypto.randomKey(), 388 'data': Clipperz.PM.Crypto.randomKey(),
393 'version':Clipperz.PM.Connection.communicationProtocol.currentVersion 389 'version':Clipperz.PM.Connection.communicationProtocol.currentVersion
394 } 390 }
395 } 391 }
396 nextTollRequestType = 'CONNECT'; 392 nextTollRequestType = 'CONNECT';
397 } else { 393 } else {
398 MochiKit.Logging.logError("Clipperz.PM.Proxy.Test.handshake - unhandled message: " + someParameters.message); 394 Clipperz.logError("Clipperz.PM.Proxy.Test.handshake - unhandled message: " + someParameters.message);
399 } 395 }
400 396
401 result = { 397 result = {
402 result: result, 398 result: result,
403 toll: this.getTollForRequestType(nextTollRequestType) 399 toll: this.getTollForRequestType(nextTollRequestType)
404 } 400 }
405 401
406 return result; 402 return result;
407 }, 403 },
408 404
409 //------------------------------------------------------------------------- 405 //-------------------------------------------------------------------------
410 406
411 '_message': function(aConnection, someParameters) { 407 '_message': function(aConnection, someParameters) {
412 var result; 408 var result;
413 409
414 result = {}; 410 result = {};
415 411
416 //===================================================================== 412 //=====================================================================
417 // 413 //
418 // R E A D - O N L Y M e t h o d s 414 // R E A D - O N L Y M e t h o d s
419 // 415 //
420 //===================================================================== 416 //=====================================================================
421 if (someParameters.message == 'getUserDetails') { 417 if (someParameters.message == 'getUserDetails') {
422 var recordsStats; 418 var recordsStats;
@@ -504,215 +500,201 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
504 aConnection['C'] = credentials['C']; 500 aConnection['C'] = credentials['C'];
505 501
506 aConnection['userData']['s'] = credentials['s']; 502 aConnection['userData']['s'] = credentials['s'];
507 aConnection['userData']['v'] = credentials['v']; 503 aConnection['userData']['v'] = credentials['v'];
508 aConnection['userData']['version'] = credentials['version']; 504 aConnection['userData']['version'] = credentials['version'];
509 505
510 aConnection['userData']['userDetails'] = parameters['user']['header']; 506 aConnection['userData']['userDetails'] = parameters['user']['header'];
511 aConnection['userData']['userDetailsVersion'] = parameters['user']['version']; 507 aConnection['userData']['userDetailsVersion'] = parameters['user']['version'];
512 aConnection['userData']['statistics'] = parameters['user']['statistics']; 508 aConnection['userData']['statistics'] = parameters['user']['statistics'];
513 509
514 aConnection['userData']['lock'] = parameters['user']['lock']; 510 aConnection['userData']['lock'] = parameters['user']['lock'];
515 511
516 delete this.data()['users'][oldCValue]; 512 delete this.data()['users'][oldCValue];
517 513
518 result = {result:"done", parameters:parameters}; 514 result = {result:"done", parameters:parameters};
519 } 515 }
520 } else { 516 } else {
521 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; 517 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly;
522 } 518 }
523 //===================================================================== 519 //=====================================================================
524 /* } else if (someParameters.message == 'updateData') { 520 /* } else if (someParameters.message == 'updateData') {
525 if (this.isReadOnly() == false) { 521 if (this.isReadOnly() == false) {
526 var i, c; 522 var i, c;
527 523
528//console.log("###===============================================================");
529//console.log("###>>>", Clipperz.Base.serializeJSON(someParameters));
530//console.log("###--- userData", Clipperz.Base.serializeJSON(this.userData()));
531 if (this.userData()['lock']!= someParameters['parameters']['user']['lock']) { 524 if (this.userData()['lock']!= someParameters['parameters']['user']['lock']) {
532 throw "the lock attribute is not processed correctly" 525 throw "the lock attribute is not processed correctly"
533 } 526 }
534 527
535 this.userData()['userDetails'] = someParameters['parameters']['user']['header']; 528 this.userData()['userDetails'] = someParameters['parameters']['user']['header'];
536 this.userData()['statistics'] = someParameters['parameters']['user']['statistics']; 529 this.userData()['statistics'] = someParameters['parameters']['user']['statistics'];
537 this.userData()['userDetailsVersions']= someParameters['parameters']['user']['version']; 530 this.userData()['userDetailsVersions']= someParameters['parameters']['user']['version'];
538 531
539 c = someParameters['parameters']['records'].length; 532 c = someParameters['parameters']['records'].length;
540 for (i=0; i<c; i++) { 533 for (i=0; i<c; i++) {
541 var currentRecord; 534 var currentRecord;
542 var currentRecordData; 535 var currentRecordData;
543 536
544 currentRecordData = someParameters['parameters']['records'][i]; 537 currentRecordData = someParameters['parameters']['records'][i];
545 currentRecord = this.userData()['records'][currentRecordData['record']['reference']]; 538 currentRecord = this.userData()['records'][currentRecordData['record']['reference']];
546 539
547 if (currentRecord == null) { 540 if (currentRecord == null) {
548 } 541 }
549 542
550 currentRecord['data'] = currentRecordData['record']['data']; 543 currentRecord['data'] = currentRecordData['record']['data'];
551 currentRecord['version'] = currentRecordData['record']['version']; 544 currentRecord['version'] = currentRecordData['record']['version'];
552 currentRecord['currentVersion'] = currentRecordData['currentRecordVersion']['reference']; 545 currentRecord['currentVersion'] = currentRecordData['currentRecordVersion']['reference'];
553 546
554 currentRecord['versions'][currentRecordData['currentRecordVersion']['reference']] = { 547 currentRecord['versions'][currentRecordData['currentRecordVersion']['reference']] = {
555 'data': currentRecordData['currentRecordVersion']['data'], 548 'data': currentRecordData['currentRecordVersion']['data'],
556 'version': currentRecordData['currentRecordVersion']['version'], 549 'version': currentRecordData['currentRecordVersion']['version'],
557 'previousVersion': currentRecordData['currentRecordVersion']['previousVersion'], 550 'previousVersion': currentRecordData['currentRecordVersion']['previousVersion'],
558 'previousVersionKey':currentRecordData['currentRecordVersion']['previousVersionKey'] 551 'previousVersionKey':currentRecordData['currentRecordVersion']['previousVersionKey']
559 } 552 }
560 } 553 }
561 554
562 this.userData()['lock'] = Clipperz.PM.Crypto.randomKey(); 555 this.userData()['lock'] = Clipperz.PM.Crypto.randomKey();
563 result['lock'] = this.userData()['lock']; 556 result['lock'] = this.userData()['lock'];
564 result['result'] = 'done'; 557 result['result'] = 'done';
565//console.log("###<<< userData", Clipperz.Base.serializeJSON(this.userData()));
566 } else { 558 } else {
567 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; 559 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly;
568 } 560 }
569 */ //===================================================================== 561 */ //=====================================================================
570 } else if (someParameters.message == 'saveChanges') { 562 } else if (someParameters.message == 'saveChanges') {
571 if (this.isReadOnly() == false) { 563 if (this.isReadOnly() == false) {
572 var i, c; 564 var i, c;
573 565
574//console.log("###===============================================================");
575//console.log("###>>>", someParameters);
576//console.log("###>>>", Clipperz.Base.serializeJSON(someParameters));
577//console.log("###--- userData", Clipperz.Base.serializeJSON(this.userData()));
578//console.log("###===============================================================");
579//console.log("--- userData.lock ", this.userData()['lock']);
580//console.log("--- parameters.lock", someParameters['parameters']['user']['lock']);
581 if (aConnection['userData']['lock']!= someParameters['parameters']['user']['lock']) { 566 if (aConnection['userData']['lock']!= someParameters['parameters']['user']['lock']) {
582 throw "the lock attribute is not processed correctly" 567 throw "the lock attribute is not processed correctly"
583 } 568 }
584 569
585 aConnection['userData']['userDetails'] = someParameters['parameters']['user']['header']; 570 aConnection['userData']['userDetails'] = someParameters['parameters']['user']['header'];
586 aConnection['userData']['statistics'] = someParameters['parameters']['user']['statistics']; 571 aConnection['userData']['statistics'] = someParameters['parameters']['user']['statistics'];
587 aConnection['userData']['userDetailsVersions']= someParameters['parameters']['user']['version']; 572 aConnection['userData']['userDetailsVersions']= someParameters['parameters']['user']['version'];
588 573
589 c = someParameters['parameters']['records']['updated'].length; 574 c = someParameters['parameters']['records']['updated'].length;
590 for (i=0; i<c; i++) { 575 for (i=0; i<c; i++) {
591 var currentRecord; 576 var currentRecord;
592 var currentRecordData; 577 var currentRecordData;
593 578
594 currentRecordData = someParameters['parameters']['records']['updated'][i]; 579 currentRecordData = someParameters['parameters']['records']['updated'][i];
595 currentRecord = aConnection['userData']['records'][currentRecordData['record']['reference']]; 580 currentRecord = aConnection['userData']['records'][currentRecordData['record']['reference']];
596 581
597 if ( 582 if (
598 (typeof(aConnection['userData']['records'][currentRecordData['record']['reference']]) == 'undefined') 583 (typeof(aConnection['userData']['records'][currentRecordData['record']['reference']]) == 'undefined')
599 && 584 &&
600 (typeof(currentRecordData['currentRecordVersion']) == 'undefined') 585 (typeof(currentRecordData['currentRecordVersion']) == 'undefined')
601 ) { 586 ) {
602//console.log("######## SHIT HAPPENS");
603 throw "Record added without a recordVersion"; 587 throw "Record added without a recordVersion";
604 } 588 }
605 589
606 if (currentRecord == null) { 590 if (currentRecord == null) {
607 currentRecord = {}; 591 currentRecord = {};
608 currentRecord['versions'] = {}; 592 currentRecord['versions'] = {};
609 currentRecord['creationDate']= Clipperz.PM.Date.formatDateWithUTCFormat(new Date()); 593 currentRecord['creationDate']= Clipperz.PM.Date.formatDateWithUTCFormat(new Date());
610 currentRecord['accessDate'] = Clipperz.PM.Date.formatDateWithUTCFormat(new Date()); 594 currentRecord['accessDate'] = Clipperz.PM.Date.formatDateWithUTCFormat(new Date());
611 595
612 aConnection['userData']['records'][currentRecordData['record']['reference']] = currentRecord; 596 aConnection['userData']['records'][currentRecordData['record']['reference']] = currentRecord;
613 } 597 }
614 598
615 currentRecord['data'] = currentRecordData['record']['data']; 599 currentRecord['data'] = currentRecordData['record']['data'];
616 currentRecord['version']= currentRecordData['record']['version']; 600 currentRecord['version']= currentRecordData['record']['version'];
617 currentRecord['updateDate']= Clipperz.PM.Date.formatDateWithUTCFormat(new Date()); 601 currentRecord['updateDate']= Clipperz.PM.Date.formatDateWithUTCFormat(new Date());
618 602
619 if (typeof(currentRecordData['currentRecordVersion']) != 'undefined') { 603 if (typeof(currentRecordData['currentRecordVersion']) != 'undefined') {
620 currentRecord['currentVersion'] = currentRecordData['currentRecordVersion']['reference']; 604 currentRecord['currentVersion'] = currentRecordData['currentRecordVersion']['reference'];
621 currentRecord['versions'][currentRecordData['currentRecordVersion']['reference']] = { 605 currentRecord['versions'][currentRecordData['currentRecordVersion']['reference']] = {
622 'data': currentRecordData['currentRecordVersion']['data'], 606 'data': currentRecordData['currentRecordVersion']['data'],
623 'version': currentRecordData['currentRecordVersion']['version'], 607 'version': currentRecordData['currentRecordVersion']['version'],
624 'previousVersion': currentRecordData['currentRecordVersion']['previousVersion'], 608 'previousVersion': currentRecordData['currentRecordVersion']['previousVersion'],
625 'previousVersionKey':currentRecordData['currentRecordVersion']['previousVersionKey'], 609 'previousVersionKey':currentRecordData['currentRecordVersion']['previousVersionKey'],
626 'creationDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date()), 610 'creationDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date()),
627 'updateDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date()), 611 'updateDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date()),
628 'accessDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date()) 612 'accessDate':Clipperz.PM.Date.formatDateWithUTCFormat(new Date())
629 } 613 }
630 } 614 }
631 } 615 }
632 616
633 c = someParameters['parameters']['records']['deleted'].length; 617 c = someParameters['parameters']['records']['deleted'].length;
634 for (i=0; i<c; i++) { 618 for (i=0; i<c; i++) {
635 var currentRecordReference; 619 var currentRecordReference;
636 620
637 currentRecordReference = someParameters['parameters']['records']['deleted'][i]; 621 currentRecordReference = someParameters['parameters']['records']['deleted'][i];
638//console.log("DELETING records", currentRecordReference);
639 delete aConnection['userData']['records'][currentRecordReference]; 622 delete aConnection['userData']['records'][currentRecordReference];
640 } 623 }
641 624
642 aConnection['userData']['lock'] = Clipperz.PM.Crypto.randomKey(); 625 aConnection['userData']['lock'] = Clipperz.PM.Crypto.randomKey();
643 result['lock'] = aConnection['userData']['lock']; 626 result['lock'] = aConnection['userData']['lock'];
644 result['result'] = 'done'; 627 result['result'] = 'done';
645//console.log("###<<< userData", Clipperz.Base.serializeJSON(this.userData()));
646 } else { 628 } else {
647 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; 629 throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly;
648 } 630 }
649 631
650 //===================================================================== 632 //=====================================================================
651 // 633 //
652 // U N H A N D L E D M e t h o d 634 // U N H A N D L E D M e t h o d
653 // 635 //
654 //===================================================================== 636 //=====================================================================
655 } else { 637 } else {
656 MochiKit.Logging.logError("Clipperz.PM.Proxy.Test.message - unhandled message: " + someParameters.message); 638 Clipperz.logError("Clipperz.PM.Proxy.Test.message - unhandled message: " + someParameters.message);
657 } 639 }
658 640
659 result = { 641 result = {
660 result: result, 642 result: result,
661 toll: this.getTollForRequestType('MESSAGE') 643 toll: this.getTollForRequestType('MESSAGE')
662 } 644 }
663 645
664 // return MochiKit.Async.succeed(result); 646 // return MochiKit.Async.succeed(result);
665 return result; 647 return result;
666 }, 648 },
667 649
668 //------------------------------------------------------------------------- 650 //-------------------------------------------------------------------------
669 651
670 '_logout': function(someParameters) { 652 '_logout': function(someParameters) {
671 // return MochiKit.Async.succeed({result: 'done'}); 653 // return MochiKit.Async.succeed({result: 'done'});
672 return {result: 'done'}; 654 return {result: 'done'};
673 }, 655 },
674 656
675 //========================================================================= 657 //=========================================================================
676 //######################################################################### 658 //#########################################################################
677 659
678 'isTestData': function(aConnection) { 660 'isTestData': function(aConnection) {
679 return (typeof(aConnection['userData']['__masterkey_test_value__']) != 'undefined'); 661 return (typeof(aConnection['userData']['__masterkey_test_value__']) != 'undefined');
680 }, 662 },
681 663
682 'userDetails': function(aConnection) { 664 'userDetails': function(aConnection) {
683 var result; 665 var result;
684 666
685 if (this.isTestData(aConnection)) { 667 if (this.isTestData(aConnection)) {
686 var serializedHeader; 668 var serializedHeader;
687 var version; 669 var version;
688 670
689//MochiKit.Logging.logDebug("### test data"); 671//Clipperz.logDebug("### test data");
690 version = aConnection['userData']['userDetailsVersion']; 672 version = aConnection['userData']['userDetailsVersion'];
691 serializedHeader = Clipperz.Base.serializeJSON(aConnection['userData']['userDetails']); 673 serializedHeader = Clipperz.Base.serializeJSON(aConnection['userData']['userDetails']);
692 result = Clipperz.PM.Crypto.encryptingFunctions.versions[version].encrypt(aConnection['userData']['__masterkey_test_value__'], serializedHeader); 674 result = Clipperz.PM.Crypto.encryptingFunctions.versions[version].encrypt(aConnection['userData']['__masterkey_test_value__'], serializedHeader);
693 } else { 675 } else {
694//MochiKit.Logging.logDebug("### NOT test data"); 676//Clipperz.logDebug("### NOT test data");
695 result = aConnection['userData']['userDetails']; 677 result = aConnection['userData']['userDetails'];
696 } 678 }
697 679
698 return result; 680 return result;
699 }, 681 },
700 682
701 'statistics': function(aConnection) { 683 'statistics': function(aConnection) {
702 var result; 684 var result;
703 685
704 if (aConnection['userData']['statistics'] != null) { 686 if (aConnection['userData']['statistics'] != null) {
705 if (this.isTestData(aConnection)) { 687 if (this.isTestData(aConnection)) {
706 var serializedStatistics; 688 var serializedStatistics;
707 var version; 689 var version;
708 690
709 version = aConnection['userData']['userDetailsVersion']; 691 version = aConnection['userData']['userDetailsVersion'];
710 serializedStatistics = Clipperz.Base.serializeJSON(aConnection['userData']['statistics']); 692 serializedStatistics = Clipperz.Base.serializeJSON(aConnection['userData']['statistics']);
711 result = Clipperz.PM.Crypto.encryptingFunctions.versions[version].encrypt(aConnection['userData']['__masterkey_test_value__'], serializedStatistics); 693 result = Clipperz.PM.Crypto.encryptingFunctions.versions[version].encrypt(aConnection['userData']['__masterkey_test_value__'], serializedStatistics);
712 } else { 694 } else {
713 result = aConnection['userData']['statistics']; 695 result = aConnection['userData']['statistics'];
714 } 696 }
715 } else { 697 } else {
716 result = null; 698 result = null;
717 } 699 }
718 700
@@ -728,53 +710,51 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
728 710
729 deferredResult = new Clipperz.Async.Deferred('Proxy.Test.serializeUserEncryptedData', {trace:false}); 711 deferredResult = new Clipperz.Async.Deferred('Proxy.Test.serializeUserEncryptedData', {trace:false});
730 deferredResult.addCallback(MochiKit.Base.bind(function(aDeferredContext) { 712 deferredResult.addCallback(MochiKit.Base.bind(function(aDeferredContext) {
731 aDeferredContext['user'] = this.createUserUsingConfigurationData(aDeferredContext['data']); 713 aDeferredContext['user'] = this.createUserUsingConfigurationData(aDeferredContext['data']);
732 return aDeferredContext; 714 return aDeferredContext;
733 }, this)); 715 }, this));
734 deferredResult.addCallback(function(aDeferredContext) { 716 deferredResult.addCallback(function(aDeferredContext) {
735 // return aDeferredContext['user'].encryptedDataUsingVersion(aDeferredContext['data']['version']); 717 // return aDeferredContext['user'].encryptedDataUsingVersion(aDeferredContext['data']['version']);
736 return aDeferredContext['user'].serializedDataUsingVersion(MochiKit.Base.values(aDeferredContext['user'].records()), aDeferredContext['data']['version']); 718 return aDeferredContext['user'].serializedDataUsingVersion(MochiKit.Base.values(aDeferredContext['user'].records()), aDeferredContext['data']['version']);
737 }); 719 });
738 deferredResult.addCallback(function(aUserEncryptedData) { 720 deferredResult.addCallback(function(aUserEncryptedData) {
739 deferredContext['encryptedData'] = aUserEncryptedData; 721 deferredContext['encryptedData'] = aUserEncryptedData;
740 return deferredContext; 722 return deferredContext;
741 }); 723 });
742 deferredResult.addCallback(function(aDeferredContext) { 724 deferredResult.addCallback(function(aDeferredContext) {
743 var connection; 725 var connection;
744 726
745 connection = new Clipperz.PM.Connection.communicationProtocol.versions[aDeferredContext['data']['connectionVersion']]() 727 connection = new Clipperz.PM.Connection.communicationProtocol.versions[aDeferredContext['data']['connectionVersion']]()
746 aDeferredContext['credentials'] = connection.serverSideUserCredentials(aDeferredContext['user'].username(),aDeferredContext['user'].passphrase()); 728 aDeferredContext['credentials'] = connection.serverSideUserCredentials(aDeferredContext['user'].username(),aDeferredContext['user'].passphrase());
747 729
748 return aDeferredContext; 730 return aDeferredContext;
749 }); 731 });
750 732
751 // deferredResult.addCallback(function(aDeferredContext) { 733 // deferredResult.addCallback(function(aDeferredContext) {
752//console.log("#-#-#-#-#", aDeferredContext);
753 // return aDeferredContext['user'].serializedDataUsingVersion(MochiKit.Base.values(aDeferredContext['user'].records()), aDeferredContext['data']['version']); 734 // return aDeferredContext['user'].serializedDataUsingVersion(MochiKit.Base.values(aDeferredContext['user'].records()), aDeferredContext['data']['version']);
754 // }, deferredContext); 735 // }, deferredContext);
755 // deferredResult.addCallback(function(aUserSerializedData) { 736 // deferredResult.addCallback(function(aUserSerializedData) {
756//console.log("USER SERIALIZED DATA", aUserSerializedData);
757 // }); 737 // });
758// 738//
759 // deferredResult.addCallback(MochiKit.Async.succeed, deferredContext); 739 // deferredResult.addCallback(MochiKit.Async.succeed, deferredContext);
760 deferredResult.callback(deferredContext); 740 deferredResult.callback(deferredContext);
761 741
762 return deferredResult; 742 return deferredResult;
763 }, 743 },
764 744
765 'createUserUsingConfigurationData': function(someData) { 745 'createUserUsingConfigurationData': function(someData) {
766 var result; 746 var result;
767 var user; 747 var user;
768 var recordLabel; 748 var recordLabel;
769 749
770 user = new Clipperz.PM.DataModel.User(); 750 user = new Clipperz.PM.DataModel.User();
771 user.initForTests(); 751 user.initForTests();
772 user.setUsername(someData['username']); 752 user.setUsername(someData['username']);
773 user.setPassphrase(someData['passphrase']); 753 user.setPassphrase(someData['passphrase']);
774 754
775 for (recordLabel in someData['records']) { 755 for (recordLabel in someData['records']) {
776 var recordData; 756 var recordData;
777 var record; 757 var record;
778 var i, c; 758 var i, c;
779 759
780 recordData = someData['records'][recordLabel]; 760 recordData = someData['records'][recordLabel];
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
index a86ac4f..5764bda 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//============================================================================= 27//=============================================================================
30 28
31Clipperz.PM.Proxy.Offline = function(args) { 29Clipperz.PM.Proxy.Offline = function(args) {
32 args = args || {}; 30 args = args || {};
33 31
34 Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args); 32 Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args);
35 33
36 this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args); 34 this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args);
37 35
38 return this; 36 return this;
39} 37}
40 38
41Clipperz.Base.extend(Clipperz.PM.Proxy.Offline, Clipperz.PM.Proxy, { 39Clipperz.Base.extend(Clipperz.PM.Proxy.Offline, Clipperz.PM.Proxy, {
42 40
43 'toString': function () { 41 'toString': function () {
44 return "Clipperz.PM.Proxy.Offline"; 42 return "Clipperz.PM.Proxy.Offline";
45 }, 43 },
46 44
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
index 803c590..f628975 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//============================================================================= 27//=============================================================================
30 28
31Clipperz.PM.Proxy.OfflineCache = function(args) { 29Clipperz.PM.Proxy.OfflineCache = function(args) {
32 args = args || {}; 30 args = args || {};
33 31
34 Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args); 32 Clipperz.PM.Proxy.Offline.superclass.constructor.call(this, args);
35 33
36 //this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args); 34 //this._dataStore = args.dataStore || new Clipperz.PM.Proxy.Offline.DataStore(args);
37 35
38 return this; 36 return this;
39} 37}
40 38
41Clipperz.Base.extend(Clipperz.PM.Proxy.OfflineCache, Clipperz.PM.Proxy, { 39Clipperz.Base.extend(Clipperz.PM.Proxy.OfflineCache, Clipperz.PM.Proxy, {
42 40
43 'toString': function () { 41 'toString': function () {
44 return "Clipperz.PM.Proxy.OfflineCache"; 42 return "Clipperz.PM.Proxy.OfflineCache";
45 }, 43 },
46 44
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
index d554c6a..d459726 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Proxy) == 'undefined') { Clipperz.PM.Proxy = {}; } 26if (typeof(Clipperz.PM.Proxy) == 'undefined') { Clipperz.PM.Proxy = {}; }
29 27
30//============================================================================= 28//=============================================================================
31 29
32Clipperz.PM.Proxy.Test = function(args) { 30Clipperz.PM.Proxy.Test = function(args) {
33 Clipperz.PM.Proxy.Test.superclass.constructor.call(this, args); 31 Clipperz.PM.Proxy.Test.superclass.constructor.call(this, args);
34 32
35 args = args || {}; 33 args = args || {};
36 34
37 this._expectedRequests = (args.shouldCheckExpectedRequests === true) ? [] : null; 35 this._expectedRequests = (args.shouldCheckExpectedRequests === true) ? [] : null;
38 this._isExpectingRequests = true; 36 this._isExpectingRequests = true;
39 this._unexpectedRequests = []; 37 this._unexpectedRequests = [];
40 38
41 this.dataStore().resetData(); 39 this.dataStore().resetData();
42 40
43 return this; 41 return this;
44} 42}
45 43
46Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, { 44Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
@@ -77,88 +75,82 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
77 75
78 'mayReceiveMoreRequests': function () { 76 'mayReceiveMoreRequests': function () {
79 this._isExpectingRequests = true; 77 this._isExpectingRequests = true;
80 this.resetUnexpectedRequests(); 78 this.resetUnexpectedRequests();
81 }, 79 },
82 80
83 'isExpectingRequests': function () { 81 'isExpectingRequests': function () {
84 return this._isExpectingRequests; 82 return this._isExpectingRequests;
85 }, 83 },
86 84
87 //------------------------------------------------------------------------- 85 //-------------------------------------------------------------------------
88 86
89 'unexpectedRequests': function () { 87 'unexpectedRequests': function () {
90 return this._unexpectedRequests; 88 return this._unexpectedRequests;
91 }, 89 },
92 90
93 'resetUnexpectedRequests': function () { 91 'resetUnexpectedRequests': function () {
94 this._unexpectedRequests = []; 92 this._unexpectedRequests = [];
95 }, 93 },
96 94
97 //------------------------------------------------------------------------- 95 //-------------------------------------------------------------------------
98 96
99 'testExpectedRequestParameters': function (aPath, anActualRequest, anExpectedRequest) { 97 'testExpectedRequestParameters': function (aPath, anActualRequest, anExpectedRequest) {
100 var aKey; 98 var aKey;
101//console.log(">>> Proxy.testExpectedRequestParameters [" + aPath + "]", anActualRequest, anExpectedRequest);
102 for (aKey in anExpectedRequest) { 99 for (aKey in anExpectedRequest) {
103 if (typeof(anActualRequest[aKey]) == 'undefined') { 100 if (typeof(anActualRequest[aKey]) == 'undefined') {
104 throw "the expected paramter [" + aKey + "] is missing from the actual request"; 101 throw "the expected paramter [" + aKey + "] is missing from the actual request";
105 } 102 }
106 if (typeof(anExpectedRequest[aKey]) == 'object') { 103 if (typeof(anExpectedRequest[aKey]) == 'object') {
107 this.testExpectedRequestParameters(aPath + "." + aKey, anActualRequest[aKey], anExpectedRequest[aKey]) 104 this.testExpectedRequestParameters(aPath + "." + aKey, anActualRequest[aKey], anExpectedRequest[aKey])
108 } else { 105 } else {
109 if (! anExpectedRequest[aKey](anActualRequest[aKey])) { 106 if (! anExpectedRequest[aKey](anActualRequest[aKey])) {
110 throw "wrong value for paramter [" + aKey + "]; got '" + anActualRequest[aKey] + "'"; 107 throw "wrong value for paramter [" + aKey + "]; got '" + anActualRequest[aKey] + "'";
111 } 108 }
112 } 109 }
113 } 110 }
114//console.log("<<< Proxy.testExpectedRequestParameters");
115 }, 111 },
116 112
117 //------------------------------------------------------------------------- 113 //-------------------------------------------------------------------------
118 114
119 'checkRequest': function(aFunctionName, someParameters) { 115 'checkRequest': function(aFunctionName, someParameters) {
120 if (this.shouldCheckExpectedRequests()) { 116 if (this.shouldCheckExpectedRequests()) {
121 var expectedRequest; 117 var expectedRequest;
122 118
123//console.log(">>> Proxy.Test.checkRequest - " + aFunctionName, someParameters);
124 expectedRequest = this.expectedRequests().pop(); 119 expectedRequest = this.expectedRequests().pop();
125//console.log("--- Proxy.Test.checkRequest - expectedRequest", expectedRequest);
126 if (expectedRequest == null) { 120 if (expectedRequest == null) {
127 throw "Proxy.Test.sentMessage: no expected result specified. Got request '" + aFunctionName + "': " + someParameters; 121 throw "Proxy.Test.sentMessage: no expected result specified. Got request '" + aFunctionName + "': " + someParameters;
128 } 122 }
129 123
130 try { 124 try {
131 if (aFunctionName != expectedRequest.functionName) { 125 if (aFunctionName != expectedRequest.functionName) {
132 throw "wrong function name. Got '" + aFunctionName + "', expected '" + expectedRequest.request.functionName + "'"; 126 throw "wrong function name. Got '" + aFunctionName + "', expected '" + expectedRequest.request.functionName + "'";
133 } 127 }
134 128
135 this.testExpectedRequestParameters("parameters", someParameters, expectedRequest.parameters); 129 this.testExpectedRequestParameters("parameters", someParameters, expectedRequest.parameters);
136 } catch(exception) { 130 } catch(exception) {
137//console.log("EXCEPTION: Proxy.Test.sentMessage[" + expectedRequest.name + "]", exception)
138 throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception; 131 throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception;
139 } 132 }
140 } 133 }
141//console.log("<<< Proxy.Test.checkRequest");
142 }, 134 },
143 135
144 //========================================================================= 136 //=========================================================================
145 137
146 'sendMessage': function(aFunctionName, someParameters) { 138 'sendMessage': function(aFunctionName, someParameters) {
147 var result; 139 var result;
148 140
149 if (this.isExpectingRequests() == false) { 141 if (this.isExpectingRequests() == false) {
150 // throw Clipperz.PM.Connection.exception.UnexpectedRequest; 142 // throw Clipperz.PM.Connection.exception.UnexpectedRequest;
151Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */); 143Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */);
152 this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters}); 144 this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters});
153 }; 145 };
154 this.checkRequest(aFunctionName, someParameters); 146 this.checkRequest(aFunctionName, someParameters);
155 result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters); 147 result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters);
156 148
157 return result; 149 return result;
158 }, 150 },
159 151
160 //========================================================================= 152 //=========================================================================
161 __syntaxFix__: "syntax fix" 153 __syntaxFix__: "syntax fix"
162 154
163}); 155});
164 156
diff --git a/frontend/gamma/js/Clipperz/PM/Strings.js b/frontend/gamma/js/Clipperz/PM/Strings.js
index a051365..7e855ff 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } 26if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; }
29if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } 27if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; }
30 28
31//----------------------------------------------------------------------------- 29//-----------------------------------------------------------------------------
32/* 30/*
33Clipperz.PM.Strings.standardStrings = { 31Clipperz.PM.Strings.standardStrings = {
34 'loginPanelSwitchLanguageSelectOptions':[ 32 'loginPanelSwitchLanguageSelectOptions':[
35/ * 33/ *
36 {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true}, 34 {tag:'option', html:"Arabic (Oman) (العربية)", value:'ar-OM', disabled:true},
37 {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true}, 35 {tag:'option', html:"Arabic (Syria) (العربية)", value:'ar-SY', disabled:true},
38 {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true}, 36 {tag:'option', html:"Bahasa Indonesia", value:'id-ID', disabled:true},
39 {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true}, 37 {tag:'option', html:"Bulgarian (Български)", value:'bg-BG', disabled:true},
40 {tag:'option', html:"Català", value:'ca-ES', disabled:true}, 38 {tag:'option', html:"Català", value:'ca-ES', disabled:true},
41 {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true}, 39 {tag:'option', html:"Chinese (Simplified) (简体中文)", value:'zh-CN', disabled:true},
42 {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true}, 40 {tag:'option', html:"Chinese (Traditional) (正體中文)", value:'zh-TW', disabled:true},
43 {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true}, 41 {tag:'option', html:"Czech (Česky)", value:'cs-CZ', disabled:true},
44 {tag:'option', html:"Dansk", value:'da-DK', disabled:true}, 42 {tag:'option', html:"Dansk", value:'da-DK', disabled:true},
45 {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /}, 43 {tag:'option', html:"Deutsch", value:'de-DE'/ *, disabled:true* /},
46 {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /}, 44 {tag:'option', html:"English (American)", value:'en-US'/ *, disabled:true* /},
@@ -220,64 +218,59 @@ Clipperz.PM.Strings.Languages.setSelectedLanguage = function(aLanguage) {
220 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[Clipperz.PM.Strings.defaultLanguages['default']]); 218 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[Clipperz.PM.Strings.defaultLanguages['default']]);
221 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[Clipperz.PM.Strings.defaultLanguages['default']]); 219 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[Clipperz.PM.Strings.defaultLanguages['default']]);
222 220
223 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[selectedLanguage]); 221 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.Languages[selectedLanguage]);
224 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[selectedLanguage]); 222 MochiKit.Base.updatetree(translations, Clipperz.PM.Strings.GeneralSettings[selectedLanguage]);
225 223
226 Clipperz.PM.Strings.stringsObjectStore = new Clipperz.KeyValueObjectStore(/*{'name':'String.stringsObjectStore [1]'}*/); 224 Clipperz.PM.Strings.stringsObjectStore = new Clipperz.KeyValueObjectStore(/*{'name':'String.stringsObjectStore [1]'}*/);
227 Clipperz.PM.Strings.stringsObjectStore.initWithValues(translations); 225 Clipperz.PM.Strings.stringsObjectStore.initWithValues(translations);
228 226
229 if (typeof(bookmarklet) != 'undefined') { 227 if (typeof(bookmarklet) != 'undefined') {
230 Clipperz.PM.Strings.stringsObjectStore.setValue('bookmarklet', Clipperz.PM.Strings.translateBookmarklet(bookmarklet)); 228 Clipperz.PM.Strings.stringsObjectStore.setValue('bookmarklet', Clipperz.PM.Strings.translateBookmarklet(bookmarklet));
231 } 229 }
232 230
233 MochiKit.Signal.signal(Clipperz.PM.Strings.Languages, 'switchLanguage', selectedLanguage); 231 MochiKit.Signal.signal(Clipperz.PM.Strings.Languages, 'switchLanguage', selectedLanguage);
234 } 232 }
235} 233}
236 234
237//----------------------------------------------------------------------------- 235//-----------------------------------------------------------------------------
238 236
239Clipperz.PM.Strings.getValue = function (aKeyPath, someKeyValues) { 237Clipperz.PM.Strings.getValue = function (aKeyPath, someKeyValues) {
240 varresult; 238 varresult;
241 239
242 result = Clipperz.PM.Strings.stringsObjectStore.getValue(aKeyPath); 240 result = Clipperz.PM.Strings.stringsObjectStore.getValue(aKeyPath);
243 241
244//try {
245 if (typeof(result) == 'string') { 242 if (typeof(result) == 'string') {
246 if (typeof (someKeyValues) != 'undefined') { 243 if (typeof (someKeyValues) != 'undefined') {
247 varkey; 244 varkey;
248 245
249 for (key in someKeyValues) { 246 for (key in someKeyValues) {
250 result = result.replace( new RegExp(key), someKeyValues[key]); 247 result = result.replace( new RegExp(key), someKeyValues[key]);
251 // result.replace(, '');
252 } 248 }
253 } 249 }
254 250
255 result = result.replace(new RegExp('\n'), '<br>'); 251 result = result.replace(new RegExp('\n'), '<br>');
256 } 252 }
257//} catch (exception) {
258 //console.log("####", result, aKeyPath, someKeyValues, exception);
259//}
260 253
261 return result; 254 return result;
262} 255}
263 256
264Clipperz.PM.Strings.errorDescriptionForException = function (anException) { 257Clipperz.PM.Strings.errorDescriptionForException = function (anException) {
265 var result; 258 var result;
266 259
267 result = Clipperz.PM.Strings.getValue('exceptionsMessages' + '.' + anException.name); 260 result = Clipperz.PM.Strings.getValue('exceptionsMessages' + '.' + anException.name);
268 261
269 if (result == null) { 262 if (result == null) {
270 result = anException.message; 263 result = anException.message;
271 } 264 }
272 265
273 return result; 266 return result;
274}, 267},
275 268
276//----------------------------------------------------------------------------- 269//-----------------------------------------------------------------------------
277 270
278Clipperz.PM.Strings.Languages.initSetup = function() { 271Clipperz.PM.Strings.Languages.initSetup = function() {
279 varlanguage; 272 varlanguage;
280 varlanguageParser; 273 varlanguageParser;
281 274
282 language = navigator.language || navigator.userLanguage; //en, en-US, .... "de", "nb-no" 275 language = navigator.language || navigator.userLanguage; //en, en-US, .... "de", "nb-no"
283 languageParser = new RegExp("language=([a-z]{2}(?:\-[a-z]{2})?)(\&|$)", "i"); 276 languageParser = new RegExp("language=([a-z]{2}(?:\-[a-z]{2})?)(\&|$)", "i");
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
index 7f6c52f..7565d2d 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } 26if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; }
29 27
30Clipperz.PM.Strings.messagePanelConfigurations = { 28Clipperz.PM.Strings.messagePanelConfigurations = {
31 29
32 30
33 //------------------------------------------------------------------------- 31 //-------------------------------------------------------------------------
34 // 32 //
35 // Registration - connection 33 // Registration - connection
36 // 34 //
37 'registration_verify': function() { 35 'registration_verify': function() {
38 return { 36 return {
39 'title': null, 37 'title': null,
40 'text': Clipperz.PM.Strings['connectionRegistrationSendingRequestMessageText'] 38 'text': Clipperz.PM.Strings['connectionRegistrationSendingRequestMessageText']
41 } 39 }
42 }, 40 },
43 41
44 'registration_sendingCredentials': function() { 42 'registration_sendingCredentials': function() {
45 return { 43 return {
46 'title': null, 44 'title': null,
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
index 101ed3f..aefd94a 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; } 26if (typeof(Clipperz.PM.Strings) == 'undefined') { Clipperz.PM.Strings = {}; }
29if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; } 27if (typeof(Clipperz.PM.Strings.Languages) == 'undefined') { Clipperz.PM.Strings.Languages = {}; }
30 28
31//============================================================================= 29//=============================================================================
32// 30//
33 // D E F A U L T S ( defaults ) 31 // D E F A U L T S ( defaults )
34// 32//
35//============================================================================= 33//=============================================================================
36 34
37Clipperz.PM.Strings.Languages['defaults'] = { 35Clipperz.PM.Strings.Languages['defaults'] = {
38 36
39'elapsedTimeDescriptions': { 37'elapsedTimeDescriptions': {
40 'MORE_THAN_A_MONTH_AGO': "more than a month ago", 38 'MORE_THAN_A_MONTH_AGO': "more than a month ago",
41 'MORE_THAN_A_WEEK_AGO': "more than a week ago", 39 'MORE_THAN_A_WEEK_AGO': "more than a week ago",
42 'MORE_THAN_*_WEEKS_AGO': "more than __elapsed__ weeks ago", 40 'MORE_THAN_*_WEEKS_AGO': "more than __elapsed__ weeks ago",
43 'YESTERDAY': "yesterday", 41 'YESTERDAY': "yesterday",
44 '*_DAYS_AGO': "__elapsed__ days ago", 42 '*_DAYS_AGO': "__elapsed__ days ago",
45 'ABOUT_AN_HOUR_AGO': "about an hour ago", 43 'ABOUT_AN_HOUR_AGO': "about an hour ago",
46 '*_HOURS_AGO': "__elapsed__ hours ago", 44 '*_HOURS_AGO': "__elapsed__ hours ago",
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 b540633..85d55c0 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26//============================================================================= 24//=============================================================================
27// 25//
28 // E N G L I S H A M E R I C A N ( en_US ) 26 // E N G L I S H A M E R I C A N ( en_US )
29// 27//
30//============================================================================= 28//=============================================================================
31 29
32Clipperz.PM.Strings.Languages['en-us'] = { 30Clipperz.PM.Strings.Languages['en-us'] = {
33/* 31/*
34 //Login page - description 32 //Login page - description
35'clipperzServiceDescription': "\ 33'clipperzServiceDescription': "\
36 <!-- FIX CSS DONE -->\ 34 <!-- FIX CSS DONE -->\
37 <h2>Keep it to yourself!</h2>\ 35 <h2>Keep it to yourself!</h2>\
38 <ul>\ 36 <ul>\
39 <li>\ 37 <li>\
40 <h3>Clipperz is:</h3>\ 38 <h3>Clipperz is:</h3>\
41 <ul>\ 39 <ul>\
42 <li><p>a secure and simple password manager</p></li>\ 40 <li><p>a secure and simple password manager</p></li>\
43 <li><p>an effective single sign-on solution</p></li>\ 41 <li><p>an effective single sign-on solution</p></li>\
44 <li><p>a digital vault for your personal data</p></li>\ 42 <li><p>a digital vault for your personal data</p></li>\
45 </ul>\ 43 </ul>\
46 </li>\ 44 </li>\
diff --git a/frontend/gamma/js/Clipperz/PM/Toll.js b/frontend/gamma/js/Clipperz/PM/Toll.js
index bb31c43..e9c3092 100644
--- a/frontend/gamma/js/Clipperz/PM/Toll.js
+++ b/frontend/gamma/js/Clipperz/PM/Toll.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 26
29//============================================================================= 27//=============================================================================
30 28
31Clipperz.PM.Toll = function(args) { 29Clipperz.PM.Toll = function(args) {
32 args = args || {}; 30 args = args || {};
33 31
34 this._requestType = args.requestType; 32 this._requestType = args.requestType;
35 this._targetValue = args.targetValue; 33 this._targetValue = args.targetValue;
36 this._cost = args.cost; 34 this._cost = args.cost;
37 this._toll = null; 35 this._toll = null;
38 36
39 return this; 37 return this;
40} 38}
41 39
42Clipperz.PM.Toll.prototype = MochiKit.Base.update(null, { 40Clipperz.PM.Toll.prototype = MochiKit.Base.update(null, {
43 41
44 'toString': function() { 42 'toString': function() {
45 return "Clipperz.PM.Toll (" + this.requestType() + ": " + this.cost() + " - " + ((this.toll() == null)? 'UNPAID' : 'PAID') + ")"; 43 return "Clipperz.PM.Toll (" + this.requestType() + ": " + this.cost() + " - " + ((this.toll() == null)? 'UNPAID' : 'PAID') + ")";
46 }, 44 },
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 25e82ca..f667526 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //download.js 25 //download.js
28 //Download 26 //Download
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/15/10 28 //Created by Giulio Cesare Solaroli on 3/15/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; 33var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0;
36var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; 34var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0;
37 35
38function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) 36function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var stroke; 41 var stroke;
44 var path; 42 var path;
45 var pointX; 43 var pointX;
46 var pointY; 44 var pointY;
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 ba425ec..dae5a2d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //look.js 25 //look.js
28 //Look 26 //Look
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/15/10 28 //Created by Giulio Cesare Solaroli on 3/15/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; 33var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0;
36var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; 34var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0;
37 35
38function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) 36function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var stroke; 41 var stroke;
44 var path; 42 var path;
45 var pointX; 43 var pointX;
46 var pointY; 44 var pointY;
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 5c1f860..497fd05 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //directLogin.js 25 //directLogin.js
28 //directLogin 26 //directLogin
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; 33var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0;
36var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; 34var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0;
37 35
38function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) 36function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var stroke; 41 var stroke;
44 var path; 42 var path;
45 var pointX; 43 var pointX;
46 var pointY; 44 var pointY;
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 b829ed6..f015535 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //protect.js 25 //protect.js
28 //protect 26 //protect
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; 33var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0;
36var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; 34var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0;
37 35
38function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) 36function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 8d73cc7..47972fc 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //share.js 25 //share.js
28 //share 26 //share
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; 33var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0;
36var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; 34var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0;
37 35
38function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) 36function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 572d9be..a4f30b2 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //store.js 25 //store.js
28 //store 26 //store
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; 33var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0;
36var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; 34var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0;
37 35
38function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) 36function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 if (window.devicePixelRatio) 44 if (window.devicePixelRatio)
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
index b9443bd..dccefab 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Canvas'); 24Clipperz.Base.module('Clipperz.PM.UI.Canvas');
27 25
28MochiKit.Base.update(Clipperz.PM.UI.Canvas , { 26MochiKit.Base.update(Clipperz.PM.UI.Canvas , {
29 'marks': { 27 'marks': {
30 '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, 28 '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark,
31 '?':Clipperz_PM_UI_Canvas_Marks_questionMark, 29 '?':Clipperz_PM_UI_Canvas_Marks_questionMark,
32 'i':Clipperz_PM_UI_Canvas_Marks_info 30 'i':Clipperz_PM_UI_Canvas_Marks_info
33 }, 31 },
34 32
35 'features': { 33 'features': {
36 'store': Clipperz_PM_UI_Canvas_Features_store, 34 'store': Clipperz_PM_UI_Canvas_Features_store,
37 'protect': Clipperz_PM_UI_Canvas_Features_protect, 35 'protect': Clipperz_PM_UI_Canvas_Features_protect,
38 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, 36 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin,
39 'share': Clipperz_PM_UI_Canvas_Features_share 37 'share': Clipperz_PM_UI_Canvas_Features_share
40 }, 38 },
41 39
42 'tips': { 40 'tips': {
43 'open': Clipperz_PM_UI_Canvas_Tips_open, 41 'open': Clipperz_PM_UI_Canvas_Tips_open,
44 'close': Clipperz_PM_UI_Canvas_Tips_close 42 'close': Clipperz_PM_UI_Canvas_Tips_close
45 }, 43 },
46 44
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 cc60bba..24c0bc3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //normal.js 25 //normal.js
28 //New Image 26 //New Image
29// 27//
30 //Created by Giulio Cesare Solaroli on 2/13/12 28 //Created by Giulio Cesare Solaroli on 2/13/12
31 //Copyright 2012 Clipperz 29 //Copyright 2012 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; 33var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0;
36var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; 34var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0;
37 35
38function Clipperz_PM_UI_Canvas_Logo_normal(canvas, logo, fontSize, text_color) 36function Clipperz_PM_UI_Canvas_Logo_normal(canvas, logo, fontSize, text_color)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 39
42 canvas.width = kClipperz_PM_UI_Canvas_Logo_normalWidth; 40 canvas.width = kClipperz_PM_UI_Canvas_Logo_normalWidth;
43 canvas.height = kClipperz_PM_UI_Canvas_Logo_normalHeight; 41 canvas.height = kClipperz_PM_UI_Canvas_Logo_normalHeight;
44 42
45 context.save(); 43 context.save();
46 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);
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 02f2f80..5982f0d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //exclamationMark.js 25 //exclamationMark.js
28 //! 26 //!
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; 33var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0;
36var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; 34var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0;
37 35
38function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) 36function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 fad5c10..2501992 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //info.js 25 //info.js
28 //i 26 //i
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; 33var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0;
36var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; 34var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0;
37 35
38function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) 36function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 5842828..9a8ac7d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //questionMark.js 25 //questionMark.js
28 //? 26 //?
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/7/10 28 //Created by Giulio Cesare Solaroli on 3/7/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; 33var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0;
36var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; 34var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0;
37 35
38function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) 36function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 2462d0e..65e5ca6 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //normal.js 25 //normal.js
28 //normal 26 //normal
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/24/10 28 //Created by Giulio Cesare Solaroli on 3/24/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; 33var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0;
36var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; 34var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0;
37 35
38function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) 36function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var controlPoint1X; 44 var controlPoint1X;
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 cf475c6..5b344ef 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //normal.js 25 //normal.js
28 //normal 26 //normal
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/15/10 28 //Created by Giulio Cesare Solaroli on 3/15/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; 33var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0;
36var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; 34var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0;
37 35
38function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) 36function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 if (window.devicePixelRatio) 44 if (window.devicePixelRatio)
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 cd7ed90..21dfcc0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //close.js 25 //close.js
28 //close 26 //close
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/14/10 28 //Created by Giulio Cesare Solaroli on 3/14/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; 33var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0;
36var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; 34var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0;
37 35
38function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) 36function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 if (window.devicePixelRatio) 44 if (window.devicePixelRatio)
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 30c1c69..9c76865 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26// 24//
27 //open.js 25 //open.js
28 //open 26 //open
29// 27//
30 //Created by Giulio Cesare Solaroli on 3/14/10 28 //Created by Giulio Cesare Solaroli on 3/14/10
31 //Copyright 2010 Clipperz 29 //Copyright 2010 Clipperz
32 //This code was generated by Opacity. You may use or modify it in any way. 30 //This code was generated by Opacity. You may use or modify it in any way.
33// 31//
34 32
35var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; 33var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0;
36var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; 34var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0;
37 35
38function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) 36function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor)
39{ 37{
40 var context = canvas.getContext("2d"); 38 var context = canvas.getContext("2d");
41 var alignStroke; 39 var alignStroke;
42 var resolution; 40 var resolution;
43 var path; 41 var path;
44 var pointX; 42 var pointX;
45 var pointY; 43 var pointY;
46 var color; 44 var color;
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 b9d7adf..58b7593 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30var _Clipperz_PM_Components_base_id_ = 0; 28var _Clipperz_PM_Components_base_id_ = 0;
31 29
32//############################################################################# 30//#############################################################################
33 31
34Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { 32Clipperz.PM.UI.Common.Components.BaseComponent = function(args) {
35 args = args || {}; 33 args = args || {};
36 Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); 34 Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args);
37 35
38 this._element = args.element || null; 36 this._element = args.element || null;
39 this._ids = {}; 37 this._ids = {};
40 38
41 this._slots = {}; 39 this._slots = {};
42 this._slotComponents = {}; 40 this._slotComponents = {};
43 41
44 this._components = {}; 42 this._components = {};
45 43
46 this._cachedSlots = {}; 44 this._cachedSlots = {};
@@ -102,49 +100,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo
102 100
103 'removeComponent': function (aComponent) { 101 'removeComponent': function (aComponent) {
104 var componentId; 102 var componentId;
105 103
106 componentId = aComponent.componentId(); 104 componentId = aComponent.componentId();
107 this.components()[componentId].remove(); 105 this.components()[componentId].remove();
108 delete this.components()[componentId]; 106 delete this.components()[componentId];
109 }, 107 },
110 108
111 //------------------------------------------------------------------------- 109 //-------------------------------------------------------------------------
112/* 110/*
113 'domHelper': function() { 111 'domHelper': function() {
114 return Clipperz.YUI.DomHelper; 112 return Clipperz.YUI.DomHelper;
115 }, 113 },
116 */ 114 */
117 //------------------------------------------------------------------------- 115 //-------------------------------------------------------------------------
118/* 116/*
119 'domHelperAppend': function(aValue) { 117 'domHelperAppend': function(aValue) {
120 Clipperz.YUI.DomHelper.append(this.element().dom, aValue); 118 Clipperz.YUI.DomHelper.append(this.element().dom, aValue);
121 }, 119 },
122 */ 120 */
123 //------------------------------------------------------------------------- 121 //-------------------------------------------------------------------------
124 122
125 'element': function() { 123 'element': function() {
126//MochiKit.Logging.logDebug(">>> BaseComponent.element");
127 return MochiKit.DOM.getElement(this._element); 124 return MochiKit.DOM.getElement(this._element);
128 }, 125 },
129 126
130 'setElement': function(aNode) { 127 'setElement': function(aNode) {
131 this._element = aNode; 128 this._element = aNode;
132 }, 129 },
133 130
134 //----------------------------------------------------- 131 //-----------------------------------------------------
135 132
136 'displayElement': function() { 133 'displayElement': function() {
137 return this.element(); 134 return this.element();
138 }, 135 },
139 136
140 //------------------------------------------------------------------------- 137 //-------------------------------------------------------------------------
141 138
142 'renderInNode': function(aDomNode) { 139 'renderInNode': function(aDomNode) {
143 this.setElement(aDomNode); 140 this.setElement(aDomNode);
144 this.render(); 141 this.render();
145 }, 142 },
146 143
147 'render': function() { 144 'render': function() {
148 this.clear(); 145 this.clear();
149 this.renderSelf(); 146 this.renderSelf();
150 this.renderComponents(); 147 this.renderComponents();
@@ -292,53 +289,50 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo
292 }, 289 },
293 290
294 'setComponentForSlotNamed': function(aComponent, aSlotName) { 291 'setComponentForSlotNamed': function(aComponent, aSlotName) {
295 var domNode; 292 var domNode;
296 293
297 this.checkSlotNamed(aSlotName); 294 this.checkSlotNamed(aSlotName);
298 295
299 if (this.slotComponents()[aSlotName] != null) { 296 if (this.slotComponents()[aSlotName] != null) {
300 this.slotComponents()[aSlotName].remove(); 297 this.slotComponents()[aSlotName].remove();
301 } 298 }
302 299
303 this.slotComponents()[aSlotName] = aComponent; 300 this.slotComponents()[aSlotName] = aComponent;
304 301
305 // domNode = MochiKit.DOM.getElement(this.slotNamed(aSlotName)); 302 // domNode = MochiKit.DOM.getElement(this.slotNamed(aSlotName));
306 domNode = this.elementForSlotNamed(aSlotName); 303 domNode = this.elementForSlotNamed(aSlotName);
307 304
308 if (domNode != null) { 305 if (domNode != null) {
309 aComponent.renderInNode(domNode); 306 aComponent.renderInNode(domNode);
310 } 307 }
311 }, 308 },
312 309
313 //----------------------------------------------------- 310 //-----------------------------------------------------
314/* 311/*
315 'purgeListeners': function() { 312 'purgeListeners': function() {
316//MochiKit.Logging.logDebug(">>> Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners [" + this + "]");
317//MochiKit.Logging.logDebug("--- " + this + ".purgeListeners");
318 Clipperz.NotificationCenter.unregister(this); 313 Clipperz.NotificationCenter.unregister(this);
319 MochiKit.Signal.disconnectAllTo(this); 314 MochiKit.Signal.disconnectAllTo(this);
320//MochiKit.Logging.logDebug("<<< Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners");
321 }, 315 },
322 */ 316 */
323 //----------------------------------------------------- 317 //-----------------------------------------------------
324 318
325 'clear': function() { 319 'clear': function() {
326 varslotName; 320 varslotName;
327 var componentId; 321 var componentId;
328 322
329 MochiKit.Signal.disconnectAllTo(this); 323 MochiKit.Signal.disconnectAllTo(this);
330 324
331 for (slotName in this.slotComponents()) { 325 for (slotName in this.slotComponents()) {
332 this.slotComponents()[slotName].clear(); 326 this.slotComponents()[slotName].clear();
333 } 327 }
334 328
335 for (componentId in this.components()) { 329 for (componentId in this.components()) {
336 this.components()[componentId].clear(); 330 this.components()[componentId].clear();
337 } 331 }
338 332
339 // if (this.element() != null) { 333 // if (this.element() != null) {
340 // this.element().innerHTML = ""; 334 // this.element().innerHTML = "";
341 // } 335 // }
342 336
343 if (this.displayElement() != null) { 337 if (this.displayElement() != null) {
344 if (this.element() != this.displayElement()) { 338 if (this.element() != this.displayElement()) {
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 1010c9d..1268118 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.Button = function(args) { 26Clipperz.PM.UI.Common.Components.Button = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments);
32 30
33 this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter');
34 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._isDefault = args.isDefault|| false; 33 this._isDefault = args.isDefault|| false;
36 34
37 this.render(); 35 this.render();
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { 42Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 7f56c1e..2f82359 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30 28
31Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { 29Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) {
32 this._component = aComponent; 30 this._component = aComponent;
33 this._slotName = aSlotName; 31 this._slotName = aSlotName;
34 32
35 return this; 33 return this;
36} 34}
37 35
38//============================================================================= 36//=============================================================================
39 37
40Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { 38Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, {
41 39
42 //------------------------------------------------------------------------- 40 //-------------------------------------------------------------------------
43 41
44 'slotName': function() { 42 'slotName': function() {
45 return this._slotName; 43 return this._slotName;
46 }, 44 },
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 2db2489..bf00ffc 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { 26Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments);
32 30
33 this.render(); 31 this.render();
34 this.setSrc(args.src); 32 this.setSrc(args.src);
35 33
36 return this; 34 return this;
37} 35}
38 36
39//============================================================================= 37//=============================================================================
40 38
41Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 39Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
42 40
43 //------------------------------------------------------------------------- 41 //-------------------------------------------------------------------------
44 42
45 'toString': function () { 43 'toString': function () {
46 return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; 44 return "Clipperz.PM.UI.Common.Components.FaviconComponent component";
@@ -56,33 +54,33 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz
56 this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); 54 this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl'));
57 }, 55 },
58 56
59 //------------------------------------------------------------------------- 57 //-------------------------------------------------------------------------
60 58
61 'clear': function () {}, 59 'clear': function () {},
62 60
63 //------------------------------------------------------------------------- 61 //-------------------------------------------------------------------------
64 62
65 'renderSelf': function () { 63 'renderSelf': function () {
66 MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); 64 MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon');
67 MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); 65 MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon');
68 MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); 66 MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad');
69 }, 67 },
70 68
71 //------------------------------------------------------------------------- 69 //-------------------------------------------------------------------------
72 70
73 'setDefaultFavicon': function (anEvent) { 71 'setDefaultFavicon': function (anEvent) {
74 MochiKit.Signal.disconnectAll(anEvent.src()); 72 MochiKit.Signal.disconnectAll(anEvent.src());
75 this.setSrc(null); 73 this.setSrc(null);
76 }, 74 },
77 75
78 'handleOnLoad': function (anEvent) { 76 'handleOnLoad': function (anEvent) {
79 MochiKit.Signal.disconnectAll(anEvent.src()); 77 MochiKit.Signal.disconnectAll(anEvent.src());
80//console.log("HANDLE ON LOAD", anEvent, anEvent.src().src); 78
81 if (anEvent.src().complete == false) { 79 if (anEvent.src().complete == false) {
82 this.setSrc(null); 80 this.setSrc(null);
83 } 81 }
84 }, 82 },
85 83
86 //------------------------------------------------------------------------- 84 //-------------------------------------------------------------------------
87 __syntaxFix__: "syntax fix" 85 __syntaxFix__: "syntax fix"
88}); 86});
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 2788b79..020290b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { 26Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments);
32 30
33 // this._openFromElement = args.openFromElement || null; 31 // this._openFromElement = args.openFromElement || null;
34 this._onOkCloseToElement = args.onOkCloseToElement || null; 32 this._onOkCloseToElement = args.onOkCloseToElement || null;
35 this._onCancelCloseToElement = args.onCancelCloseToElement|| null; 33 this._onCancelCloseToElement = args.onCancelCloseToElement|| null;
36 34
37 this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); 35 this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing);
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { 42Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
@@ -110,52 +108,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBa
110 this.setButtons([{text:"Cancel", result:'CANCEL'}]); 108 this.setButtons([{text:"Cancel", result:'CANCEL'}]);
111 } else { 109 } else {
112 this.setButtons([]); 110 this.setButtons([]);
113 } 111 }
114 }, 112 },
115 113
116 //------------------------------------------------------------------------- 114 //-------------------------------------------------------------------------
117 115
118 'showFailure': function (someParameters) { 116 'showFailure': function (someParameters) {
119 // this.setType('ALERT'); 117 // this.setType('ALERT');
120 this.setType(someParameters['type']); 118 this.setType(someParameters['type']);
121 // this.setTitle("Login failed"); 119 // this.setTitle("Login failed");
122 this.setTitle(someParameters['title']); 120 this.setTitle(someParameters['title']);
123 // this.setText("Wrong passphrase; the unlock has failed."); 121 // this.setText("Wrong passphrase; the unlock has failed.");
124 this.setText(someParameters['text']); 122 this.setText(someParameters['text']);
125 // this.getElement('container').innerHTML = ''; 123 // this.getElement('container').innerHTML = '';
126 this.getElement('container').innerHTML = ''; 124 this.getElement('container').innerHTML = '';
127 // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); 125 // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]);
128 this.setButtons(someParameters['buttons']); 126 this.setButtons(someParameters['buttons']);
129 }, 127 },
130 128
131 //------------------------------------------------------------------------- 129 //-------------------------------------------------------------------------
132 130
133 'closeOk': function () { 131 'closeOk': function () {
134//console.log("=== closeOk");
135 this.showProgressBar(); 132 this.showProgressBar();
136 MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); 133 MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback'));
137 this._deferred = null; 134 this._deferred = null;
138 }, 135 },
139 136
140 'closeCancel': function () { 137 'closeCancel': function () {
141//console.log("=== closeCancel");
142 this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); 138 this.deferredHideModal({closeToElement:this.onCancelCloseToElement()});
143 this.deferred().cancel(); 139 this.deferred().cancel();
144 this._deferred = null; 140 this._deferred = null;
145 }, 141 },
146 142
147 //------------------------------------------------------------------------- 143 //-------------------------------------------------------------------------
148 144
149 'deferredDone': function () { 145 'deferredDone': function () {
150//console.log("=== deferredDone");
151 return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); 146 return this.deferredHideModal({closeToElement:this.onOkCloseToElement()});
152 }, 147 },
153 148
154 'deferredError': function (someParameters) { 149 'deferredError': function (someParameters) {
155//console.log("=== deferredError");
156 this.showFailure(someParameters); 150 this.showFailure(someParameters);
157 }, 151 },
158 152
159 //------------------------------------------------------------------------- 153 //-------------------------------------------------------------------------
160 __syntaxFix__: "syntax fix" 154 __syntaxFix__: "syntax fix"
161}); 155});
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 089e3d4..78e8c9b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js
@@ -1,62 +1,58 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { 26Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) {
29 args = args || {}; 27 args = args || {};
30 28
31//MochiKit.Logging.logDebug(">>> new TextFormField");
32 Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); 29 Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args);
33 30
34 this._wrapperElement = null; 31 this._wrapperElement = null;
35 this._entropyElement = null; 32 this._entropyElement = null;
36 33
37 this.render(); 34 this.render();
38//MochiKit.Logging.logDebug("<<< new TextFormField");
39 35
40 return this; 36 return this;
41}; 37};
42 38
43Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { 39Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, {
44 40
45 'toString': function() { 41 'toString': function() {
46 return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; 42 return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay";
47 }, 43 },
48 44
49 //----------------------------------------------------- 45 //-----------------------------------------------------
50 46
51 'wrapperElement': function() { 47 'wrapperElement': function() {
52 return this._wrapperElement; 48 return this._wrapperElement;
53 }, 49 },
54 50
55 'setWrapperElement': function(aValue) { 51 'setWrapperElement': function(aValue) {
56 this._wrapperElement = aValue; 52 this._wrapperElement = aValue;
57 }, 53 },
58 54
59 //----------------------------------------------------- 55 //-----------------------------------------------------
60 56
61 'passwordElement': function() { 57 'passwordElement': function() {
62 return this.element(); 58 return this.element();
@@ -89,49 +85,38 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Cl
89 this.connect('onchange', 'updateEntropyElement'); 85 this.connect('onchange', 'updateEntropyElement');
90 this.connect('onblur', 'updateEntropyElement'); 86 this.connect('onblur', 'updateEntropyElement');
91*/ 87*/
92 MochiKit.Signal.disconnectAllTo(this); 88 MochiKit.Signal.disconnectAllTo(this);
93 89
94 this.setEntropyElement(this.element()); 90 this.setEntropyElement(this.element());
95 this.entropyElement().addClass("entropyLevelIndicator"); 91 this.entropyElement().addClass("entropyLevelIndicator");
96 92
97 this.updateEntropyElement(); 93 this.updateEntropyElement();
98 94
99 this.connect('onkeyup', 'updateEntropyElement'); 95 this.connect('onkeyup', 'updateEntropyElement');
100 this.connect('onchange', 'updateEntropyElement'); 96 this.connect('onchange', 'updateEntropyElement');
101 this.connect('onblur', 'updateEntropyElement'); 97 this.connect('onblur', 'updateEntropyElement');
102 }, 98 },
103 99
104 //----------------------------------------------------- 100 //-----------------------------------------------------
105 101
106 'computeEntropyForString': function(aValue) { 102 'computeEntropyForString': function(aValue) {
107 return Clipperz.PM.Crypto.passwordEntropy(aValue); 103 return Clipperz.PM.Crypto.passwordEntropy(aValue);
108 }, 104 },
109 105
110 //----------------------------------------------------- 106 //-----------------------------------------------------
111 107
112 'updateEntropyElement': function(anEvent) { 108 'updateEntropyElement': function(anEvent) {
113/*
114//MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement");
115 varmaxExtent;
116 varentropy;
117
118 entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value));
119//MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy);
120 this.entropyElement().setStyle('background-position', "0px " + -entropy + "px");
121 this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128));
122//MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement");
123*/
124 varentropy; 109 varentropy;
125 110
126 entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); 111 entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value));
127 112
128 if (entropy == 0) { 113 if (entropy == 0) {
129 this.entropyElement().setStyle('background-position', "0px 26px"); 114 this.entropyElement().setStyle('background-position', "0px 26px");
130 } else { 115 } else {
131 this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); 116 this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px");
132 } 117 }
133 }, 118 },
134 119
135 //----------------------------------------------------- 120 //-----------------------------------------------------
136 __syntaxFix__: '__syntaxFix__' 121 __syntaxFix__: '__syntaxFix__'
137}); 122});
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 5991530..6638008 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { 26Clipperz.PM.UI.Common.Components.ProgressBar = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments);
32 30
33 this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter');
34 32
35 this.renderSelf(); 33 this.renderSelf();
36 34
37 MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') 35 MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler')
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { 42Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 1d816a9..8c98811 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { 26Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments);
32 30
33 this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter');
34 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR 33 this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR
36 this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); 34 this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter');
37 35
38 this._buttonComponents = []; 36 this._buttonComponents = [];
39 this._deferred = null; 37 this._deferred = null;
40 38
41 this.renderModalMask(); 39 this.renderModalMask();
42 40
43 return this; 41 return this;
44} 42}
45 43
46//============================================================================= 44//=============================================================================
@@ -197,101 +195,93 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
197 195
198 'closeOk': function () { 196 'closeOk': function () {
199 this.deferred().callback(); 197 this.deferred().callback();
200 this._deferred = null; 198 this._deferred = null;
201 }, 199 },
202 200
203 'closeCancel': function () { 201 'closeCancel': function () {
204 this.deferred().cancel(); 202 this.deferred().cancel();
205 this._deferred = null; 203 this._deferred = null;
206 }, 204 },
207 205
208 'closeError': function () { 206 'closeError': function () {
209 this.deferred().errback(); 207 this.deferred().errback();
210 this._deferred = null; 208 this._deferred = null;
211 }, 209 },
212 210
213 //------------------------------------------------------------------------- 211 //-------------------------------------------------------------------------
214 212
215 'buttonEventHandler': function(aButton, anEvent) { 213 'buttonEventHandler': function(aButton, anEvent) {
216 anEvent.preventDefault(); 214 anEvent.preventDefault();
217 215
218 // MochiKit.Signal.signal(this, 'cancelEvent'); 216 // MochiKit.Signal.signal(this, 'cancelEvent');
219 switch (aButton['result']) { 217 switch (aButton['result']) {
220 case 'OK': 218 case 'OK':
221//console.log("==> OK");
222 this.closeOk(); 219 this.closeOk();
223 break; 220 break;
224 case 'CANCEL': 221 case 'CANCEL':
225//console.log("==> CANCEL");
226 this.closeCancel(); 222 this.closeCancel();
227 break; 223 break;
228 default: 224 default:
229//console.log("==> ????");
230 this.closeError(); 225 this.closeError();
231 break; 226 break;
232 } 227 }
233//console.log("<==");
234 }, 228 },
235 229
236 //------------------------------------------------------------------------- 230 //-------------------------------------------------------------------------
237 231
238 'deferredShow': function (someArgs, aResult) { 232 'deferredShow': function (someArgs, aResult) {
239 this.deferredShowModal(someArgs); 233 this.deferredShowModal(someArgs);
240 234
241 this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); 235 this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement });
242 this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); 236 this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement }));
243 this.deferred().addCallback(MochiKit.Async.succeed, aResult); 237 this.deferred().addCallback(MochiKit.Async.succeed, aResult);
244 238
245 return this.deferred(); 239 return this.deferred();
246 }, 240 },
247 241
248 //------------------------------------------------------------------------- 242 //-------------------------------------------------------------------------
249 243
250 'modalDialogMask': function () { 244 'modalDialogMask': function () {
251 return this.getId('modalDialogMask'); 245 return this.getId('modalDialogMask');
252 }, 246 },
253 247
254 'modalDialog': function () { 248 'modalDialog': function () {
255 return this.getId('modalDialog'); 249 return this.getId('modalDialog');
256 }, 250 },
257 251
258 'modalDialogFrame': function() { 252 'modalDialogFrame': function() {
259 return this.getId('modalDialogFrame'); 253 return this.getId('modalDialogFrame');
260 }, 254 },
261 255
262 //------------------------------------------------------------------------- 256 //-------------------------------------------------------------------------
263 257
264 'renderModalMask': function () { 258 'renderModalMask': function () {
265 Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, 259 Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body,
266 {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper simpleMessagePanelMask', children:[ 260 {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper simpleMessagePanelMask', children:[
267 {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask simpleMessagePanelMask'}, 261 {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask simpleMessagePanelMask'},
268 {tag:'div', id:this.getId('modalDialogFrame'), cls:'modalDialogFrame simpleMessagePanelMask'}, 262 {tag:'div', id:this.getId('modalDialogFrame'), cls:'modalDialogFrame simpleMessagePanelMask'},
269 {tag:'div', id:this.getId('modalDialog'), cls:'modalDialog simpleMessagePanelMask'} 263 {tag:'div', id:this.getId('modalDialog'), cls:'modalDialog simpleMessagePanelMask'}
270 ]} 264 ]}
271 ); 265 );
272 266
273 MochiKit.Style.hideElement(this.getId('modalDialogMask')); 267 MochiKit.Style.hideElement(this.getId('modalDialogMask'));
274 MochiKit.Style.hideElement(this.getId('modalDialogFrame')); 268 MochiKit.Style.hideElement(this.getId('modalDialogFrame'));
275 }, 269 },
276 270
277 //------------------------------------------------------------------------- 271 //-------------------------------------------------------------------------
278 272
279 'keyDownHandler': function (anEvent) { 273 'keyDownHandler': function (anEvent) {
280 if (anEvent.key().string == 'KEY_ENTER') { 274 if (anEvent.key().string == 'KEY_ENTER') {
281 anEvent.preventDefault(); 275 anEvent.preventDefault();
282//console.log("13 - RETURN ?", this);
283 this.closeOk(); 276 this.closeOk();
284//console.log('<<< 13')
285 } 277 }
286 278
287 if (anEvent.key().string == 'KEY_ESCAPE') { 279 if (anEvent.key().string == 'KEY_ESCAPE') {
288 anEvent.preventDefault(); 280 anEvent.preventDefault();
289//console.log("27 - ESC ?", this);
290 this.closeCancel(); 281 this.closeCancel();
291//console.log("<<< 27");
292 } 282 }
293 }, 283 },
294 284
295 //------------------------------------------------------------------------- 285 //-------------------------------------------------------------------------
296 __syntaxFix__: "syntax fix" 286 __syntaxFix__: "syntax fix"
297}); 287});
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 936514a..1e2a690 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { 26Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); 28 Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args);
31 29
32 this._tabPanelController = null; 30 this._tabPanelController = null;
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 37Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; 40 return "Clipperz.PM.UI.Common.Components.TabPanelComponent component";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
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 8df7e0e..6517d2a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.Tooltip = function(args) { 26Clipperz.PM.UI.Common.Components.Tooltip = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments);
32 30
33 this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' 33 this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT'
36 34
37 this._boxDimensions = null; 35 this._boxDimensions = null;
38 this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); 36 this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled);
39 this._isVisible = false; 37 this._isVisible = false;
40 38
41 this.renderSelf(); 39 this.renderSelf();
42 40
43 return this; 41 return this;
44} 42}
45 43
46//============================================================================= 44//=============================================================================
@@ -120,89 +118,82 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
120 118
121 'displayElement': function() { 119 'displayElement': function() {
122 return this.getElement('tooltip'); 120 return this.getElement('tooltip');
123 }, 121 },
124 122
125 //------------------------------------------------------------------------- 123 //-------------------------------------------------------------------------
126 124
127 'boxDimensions': function () { 125 'boxDimensions': function () {
128 return this._boxDimensions; 126 return this._boxDimensions;
129 }, 127 },
130 128
131 //------------------------------------------------------------------------- 129 //-------------------------------------------------------------------------
132 130
133 'show': function () { 131 'show': function () {
134 var elementSizeAndPosition; 132 var elementSizeAndPosition;
135 var arrowPosition; 133 var arrowPosition;
136 var bodyPosition; 134 var bodyPosition;
137 135
138 if (this.isVisible() == false) { 136 if (this.isVisible() == false) {
139 arrowPosition = {}; 137 arrowPosition = {};
140 bodyPosition = {}; 138 bodyPosition = {};
141 139
142 this.setIsVisible(true); 140 this.setIsVisible(true);
143 elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); 141 elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element());
144//console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition));
145//console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions()));
146 switch (this.position()) { 142 switch (this.position()) {
147 case 'ABOVE': 143 case 'ABOVE':
148//console.log("ABOVE");
149 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); 144 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px');
150 bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); 145 bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2);
151 bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; 146 bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13;
152 147
153 // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); 148 // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2);
154 // arrowPosition.y = elementSizeAndPosition.position.y - 13; 149 // arrowPosition.y = elementSizeAndPosition.position.y - 13;
155 break; 150 break;
156 case 'BELOW': 151 case 'BELOW':
157//console.log("BELOW");
158 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); 152 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px');
159 bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); 153 bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2);
160 bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; 154 bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13;
161 155
162 // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); 156 // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2);
163 // arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; 157 // arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h;
164 break; 158 break;
165 case 'LEFT': 159 case 'LEFT':
166//console.log("LEFT");
167 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); 160 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px');
168 bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; 161 bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13;
169 bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); 162 bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2);
170 163
171 // arrowPosition.x = elementSizeAndPosition.position.x -13; 164 // arrowPosition.x = elementSizeAndPosition.position.x -13;
172 // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); 165 // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2);
173 break; 166 break;
174 case 'RIGHT': 167 case 'RIGHT':
175//console.log("RIGHT");
176 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); 168 // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px');
177 bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; 169 bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13;
178 bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); 170 bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2);
179 171
180 // arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; 172 // arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w;
181 // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); 173 // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2);
182 break; 174 break;
183 } 175 }
184//console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y);
185 176
186 MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition); 177 MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition);
187 // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); 178 // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition);
188 // MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); 179 // MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition);
189 MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); 180 MochiKit.Visual.appear(this.displayElement(), {duration:0.4});
190 } 181 }
191 }, 182 },
192 183
193 'hide': function () { 184 'hide': function () {
194 if (this.isVisible() == true) { 185 if (this.isVisible() == true) {
195 MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); 186 MochiKit.Visual.fade(this.displayElement(), {duration:0.4});
196 this.setIsVisible(false); 187 this.setIsVisible(false);
197 } 188 }
198 }, 189 },
199 190
200 //------------------------------------------------------------------------- 191 //-------------------------------------------------------------------------
201/* 192/*
202 'shouldRemoveElementWhenClearningUp': function () { 193 'shouldRemoveElementWhenClearningUp': function () {
203 return false; 194 return false;
204 }, 195 },
205*/ 196*/
206 //------------------------------------------------------------------------- 197 //-------------------------------------------------------------------------
207 __syntaxFix__: "syntax fix" 198 __syntaxFix__: "syntax fix"
208}); 199});
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 c41fc7c..ba58edd 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { 26Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) {
29Clipperz.log(">>> TranslatorWidget.new"); 27Clipperz.log(">>> TranslatorWidget.new");
30 args = args || {}; 28 args = args || {};
31 29
32 Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); 30 Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments);
33 31
34 // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); 32 // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter');
35 // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); 33 // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter');
36 34
37 //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); 35 //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show');
38 //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); 36 //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide');
39 37
40Clipperz.log("<<< TranslatorWidget.new"); 38Clipperz.log("<<< TranslatorWidget.new");
41 return this; 39 return this;
42} 40}
43 41
44//============================================================================= 42//=============================================================================
45 43
46Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { 44Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, {
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 5fd10f9..77d59a5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers');
27 25
28Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { 26Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) {
29 this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); 27 this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter');
30 this._target = Clipperz.PM.Crypto.randomKey(); 28 this._target = Clipperz.PM.Crypto.randomKey();
31 29
32 return this; 30 return this;
33} 31}
34 32
35MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { 33MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, {
36 34
37 'toString': function() { 35 'toString': function() {
38 return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; 36 return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner";
39 }, 37 },
40 38
41 //----------------------------------------------------------------------------- 39 //-----------------------------------------------------------------------------
42 40
43 'directLogin': function () { 41 'directLogin': function () {
44 return this._directLogin; 42 return this._directLogin;
45 }, 43 },
46 44
@@ -133,132 +131,126 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy
133 'method':someAttributes['formAttributes']['method'], 131 'method':someAttributes['formAttributes']['method'],
134 'action':someAttributes['formAttributes']['action'] 132 'action':someAttributes['formAttributes']['action']
135 }); 133 });
136 134
137 submitFunction = formElement.submit; 135 submitFunction = formElement.submit;
138 136
139 MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { 137 MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) {
140 return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); 138 return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]});
141 }, MochiKit.Base.items(someAttributes['inputValues']))); 139 }, MochiKit.Base.items(someAttributes['inputValues'])));
142 140
143 html =''; 141 html ='';
144 html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; 142 html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>';
145 html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; 143 html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML;
146 144
147 this.updateWindowWithHTMLContent(aWindow, html); 145 this.updateWindowWithHTMLContent(aWindow, html);
148 this.submitLoginForm(aWindow, submitFunction); 146 this.submitLoginForm(aWindow, submitFunction);
149 }, 147 },
150 148
151 //------------------------------------------------------------------------- 149 //-------------------------------------------------------------------------
152 150
153 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { 151 'runHttpAuthDirectLogin': function(aWindow, someAttributes) {
154 var completeUrl; 152 var completeUrl;
155 var url; 153 var url;
156 154
157//console.log("runHttpAuthDirectLogin", someAttributes);
158 url = someAttributes['inputValues']['url']; 155 url = someAttributes['inputValues']['url'];
159 156
160 if (/^https?\:\/\//.test(url) == false) { 157 if (/^https?\:\/\//.test(url) == false) {
161 url = 'http://' + url; 158 url = 'http://' + url;
162 } 159 }
163 160
164 if (Clipperz_IEisBroken === true) { 161 if (Clipperz_IEisBroken === true) {
165 completeUrl = url; 162 completeUrl = url;
166 } else { 163 } else {
167 var username; 164 var username;
168 var password; 165 var password;
169 166
170 username = someAttributes['inputValues']['username']; 167 username = someAttributes['inputValues']['username'];
171 password = someAttributes['inputValues']['password']; 168 password = someAttributes['inputValues']['password'];
172 /(^https?\:\/\/)?(.*)/.test(url); 169 /(^https?\:\/\/)?(.*)/.test(url);
173 170
174 completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; 171 completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2;
175 } 172 }
176 173
177 window.open(completeUrl, this.target()); 174 window.open(completeUrl, this.target());
178 }, 175 },
179 176
180 //============================================================================= 177 //=============================================================================
181 178
182 'runDirectLogin': function (aWindow) { 179 'runDirectLogin': function (aWindow) {
183 var deferredResult; 180 var deferredResult;
184 181
185//console.log(">>> runDirectLogin");
186 deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); 182 deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false});
187 deferredResult.addMethod(this, 'initialWindowSetup', aWindow); 183 deferredResult.addMethod(this, 'initialWindowSetup', aWindow);
188 deferredResult.addMethod(this.directLogin(), 'label'); 184 deferredResult.addMethod(this.directLogin(), 'label');
189 deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); 185 deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow);
190 deferredResult.collectResults({ 186 deferredResult.collectResults({
191 'type': MochiKit.Base.method(this.directLogin(), 'type'), 187 'type': MochiKit.Base.method(this.directLogin(), 'type'),
192 'label': MochiKit.Base.method(this.directLogin(), 'label'), 188 'label': MochiKit.Base.method(this.directLogin(), 'label'),
193 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), 189 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'),
194 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') 190 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues')
195 }); 191 });
196//deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; });
197 deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { 192 deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) {
198//console.log("SOME ATTRIBUTES", someAttributes);
199 switch (someAttributes['type']) { 193 switch (someAttributes['type']) {
200 case 'http_auth': 194 case 'http_auth':
201 this.runHttpAuthDirectLogin(aWindow, someAttributes); 195 this.runHttpAuthDirectLogin(aWindow, someAttributes);
202 break; 196 break;
203 case 'simple_url': 197 case 'simple_url':
204 this.runSimpleUrlDirectLogin(aWindow, someAttributes); 198 this.runSimpleUrlDirectLogin(aWindow, someAttributes);
205 break; 199 break;
206 default: 200 default:
207 this.runSubmitFormDirectLogin(aWindow, someAttributes); 201 this.runSubmitFormDirectLogin(aWindow, someAttributes);
208 break; 202 break;
209 } 203 }
210 }, this)); 204 }, this));
211 deferredResult.callback(); 205 deferredResult.callback();
212//console.log("<<< runDirectLogin");
213 206
214 return deferredResult; 207 return deferredResult;
215 }, 208 },
216 209
217 //============================================================================= 210 //=============================================================================
218 211
219 'run': function () { 212 'run': function () {
220 var newWindow; 213 var newWindow;
221 214
222 newWindow = window.open(Clipperz.PM.Strings.getValue('directLoginJumpPageUrl'), this.target()); 215 newWindow = window.open(Clipperz.PM.Strings.getValue('directLoginJumpPageUrl'), this.target());
223 216
224 return this.runDirectLogin(newWindow); 217 return this.runDirectLogin(newWindow);
225 }, 218 },
226 219
227 //============================================================================= 220 //=============================================================================
228 221
229 'test': function () { 222 'test': function () {
230 var iFrame; 223 var iFrame;
231 var newWindow; 224 var newWindow;
232 225
233 iFrame = MochiKit.DOM.createDOM('iframe'); 226 iFrame = MochiKit.DOM.createDOM('iframe');
234 MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, iFrame); 227 MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, iFrame);
235 228
236 newWindow = iFrame.contentWindow; 229 newWindow = iFrame.contentWindow;
237 230
238 return this.runDirectLogin(newWindow); 231 return this.runDirectLogin(newWindow);
239 }, 232 },
240 233
241 //============================================================================= 234 //=============================================================================
242 __syntaxFix__: "syntax fix" 235 __syntaxFix__: "syntax fix"
243}); 236});
244 237
245//----------------------------------------------------------------------------- 238//-----------------------------------------------------------------------------
246 239
247Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (aDirectLogin) { 240Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (aDirectLogin) {
248 varrunner; 241 varrunner;
249 242
250 runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); 243 runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin});
251 return runner.run(); 244 return runner.run();
252}; 245};
253 246
254//----------------------------------------------------------------------------- 247//-----------------------------------------------------------------------------
255 248
256Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) { 249Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) {
257 varrunner; 250 varrunner;
258 251
259//console.log(">>>>>> TESTING DIRECT LOGIN");
260 runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); 252 runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin});
261 return runner.test(); 253 return runner.test();
262}; 254};
263 255
264//----------------------------------------------------------------------------- 256//-----------------------------------------------------------------------------
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 41fe17f..52d81d4 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers');
27 25
28Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { 26Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 this._numberOfSteps= 0; 29 this._numberOfSteps= 0;
32 this._currentStep= 0; 30 this._currentStep= 0;
33 31
34 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); 32 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle');
35 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); 33 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle');
36 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); 34 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle');
37 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); 35 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle');
38 36
39 return this; 37 return this;
40} 38}
41 39
42MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { 40MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, {
43 41
44 'toString': function() { 42 'toString': function() {
45 return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; 43 return "Clipperz.PM.UI.Common.Controllers.ProgressBarController";
46 }, 44 },
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 341fde9..d3e86de 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers');
27 25
28Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { 26Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 this._component = args.component; 29 this._component = args.component;
32 this._configuration = args.configuration; 30 this._configuration = args.configuration;
33 this._isEnabled = args.enabled || true; 31 this._isEnabled = args.enabled || true;
34 32
35 this._selectedTab = null; 33 this._selectedTab = null;
36 return this; 34 return this;
37} 35}
38 36
39MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { 37MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, {
40 38
41 'toString': function() { 39 'toString': function() {
42 return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; 40 return "Clipperz.PM.UI.Common.Controllers.TabPanelController";
43 }, 41 },
44 42
45 //----------------------------------------------------------------------------- 43 //-----------------------------------------------------------------------------
46 44
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 ef38bc6..c13d96a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js
@@ -1,28 +1,26 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26 //Still empty, but here it should be reasonable to factor in code duplicated between 24 //Still empty, but here it should be reasonable to factor in code duplicated between
27 //- DirectLoginWizardController 25 //- DirectLoginWizardController
28 //- NewUserWizardController \ No newline at end of file 26 //- 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 ea987cd..f0ccdfb 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js
@@ -1,56 +1,54 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Compact'); 24Clipperz.Base.module('Clipperz.PM.UI.Compact');
27 25
28Clipperz.PM.UI.Compact.MainController = function() { 26Clipperz.PM.UI.Compact.MainController = function() {
29 //this._loginPanel = null; 27 //this._loginPanel = null;
30 //this._user = null; 28 //this._user = null;
31// 29//
32 //this._isRunningCompact = false; 30 //this._isRunningCompact = false;
33 // 31 //
34 //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); 32 //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback');
35 //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); 33 //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler');
36// 34//
37 //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); 35 //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException');
38 36
39 return this; 37 return this;
40} 38}
41 39
42MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { 40MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, {
43 41
44 'toString': function() { 42 'toString': function() {
45 return "Clipperz.PM.UI.Compact.MainController"; 43 return "Clipperz.PM.UI.Compact.MainController";
46 }, 44 },
47 45
48 //----------------------------------------------------------------------------- 46 //-----------------------------------------------------------------------------
49 47
50 'run': function(shouldShowRegistrationForm) { 48 'run': function(shouldShowRegistrationForm) {
51MochiKit.Logging.logDebug("running " + this.toString()); 49 Clipperz.logDebug("running " + this.toString());
52 }, 50 },
53 51
54 //----------------------------------------------------------------------------- 52 //-----------------------------------------------------------------------------
55 __syntaxFix__: "syntax fix" 53 __syntaxFix__: "syntax fix"
56}); \ No newline at end of file 54}); \ No newline at end of file
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
index 32dfa63..abf4758 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
@@ -1,85 +1,82 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components');
27 25
28Clipperz.PM.UI.Mobile.Components.CardDetail = function(args) { 26Clipperz.PM.UI.Mobile.Components.CardDetail = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Mobile.Components.CardDetail.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Mobile.Components.CardDetail.superclass.constructor.apply(this, arguments);
32 30
33 //this._cardReference = null; 31 //this._cardReference = null;
34 32
35 return this; 33 return this;
36} 34}
37 35
38//============================================================================= 36//=============================================================================
39 37
40Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { 38Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, {
41 39
42 //------------------------------------------------------------------------- 40 //-------------------------------------------------------------------------
43 41
44 'toString': function () { 42 'toString': function () {
45 return "Clipperz.PM.UI.Mobile.Components.CardDetail component"; 43 return "Clipperz.PM.UI.Mobile.Components.CardDetail component";
46 }, 44 },
47 45
48 //------------------------------------------------------------------------- 46 //-------------------------------------------------------------------------
49/* 47/*
50 'cardReference': function () { 48 'cardReference': function () {
51 return this._cardReference; 49 return this._cardReference;
52 }, 50 },
53 51
54 'setCardReference': function (aValue) { 52 'setCardReference': function (aValue) {
55 this._cardReference = aValue; 53 this._cardReference = aValue;
56 }, 54 },
57*/ 55*/
58 //------------------------------------------------------------------------- 56 //-------------------------------------------------------------------------
59 57
60 'renderSelf': function () { 58 'renderSelf': function () {
61console.log("CardDetail.renderSelf");
62 this.append(this.element(), {tag:'div', cls:'cardDetail', children:[ 59 this.append(this.element(), {tag:'div', cls:'cardDetail', children:[
63 {tag:'div', cls:'toolbar', children:[ 60 {tag:'div', cls:'toolbar', children:[
64 {tag:'a', href:'#', cls:'back', html:"List"}, 61 {tag:'a', href:'#', cls:'back', html:"List"},
65 {tag:'h1', id:this.getId('cardTitle'), html:"…"} 62 {tag:'h1', id:this.getId('cardTitle'), html:"…"}
66 ]}, 63 ]},
67 {tag:'div', cls:'scroll', id:this.getId('cardDetails'), children:[ 64 {tag:'div', cls:'scroll', id:this.getId('cardDetails'), children:[
68 ]} 65 ]}
69 ]}); 66 ]});
70 }, 67 },
71/* 68/*
72 'renderSelf': function() { 69 'renderSelf': function() {
73 this.append(this.element(), [ 70 this.append(this.element(), [
74 {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ 71 {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[
75 {tag:'div', id:this.getId('progressBar')} //, 72 {tag:'div', id:this.getId('progressBar')} //,
76 ]} 73 ]}
77 ]); 74 ]);
78 75
79 this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); 76 this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')}));
80 MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); 77 MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0);
81 }, 78 },
82*/ 79*/
83 80
84 'setTitle': function (aValue) { 81 'setTitle': function (aValue) {
85 this.getElement('cardTitle').innerHTML = aValue; 82 this.getElement('cardTitle').innerHTML = aValue;
@@ -134,59 +131,57 @@ console.log("CardDetail.renderSelf");
134 return deferredResult; 131 return deferredResult;
135 }, 132 },
136 133
137 //------------------------------------------------------------------------- 134 //-------------------------------------------------------------------------
138 135
139 'directLoginElement': function () { 136 'directLoginElement': function () {
140 varresult; 137 varresult;
141 138
142 result = this.getElement('directLoginList'); 139 result = this.getElement('directLoginList');
143 if (result == null) { 140 if (result == null) {
144 this.append(this.getElement('cardDetails'), {tag:'h2', html:"Direct login"}); 141 this.append(this.getElement('cardDetails'), {tag:'h2', html:"Direct login"});
145 result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('directLoginList')}); 142 result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('directLoginList')});
146 } 143 }
147 144
148 return result; 145 return result;
149 }, 146 },
150 147
151 'addDirectLogin': function (aDirectLogin) { 148 'addDirectLogin': function (aDirectLogin) {
152 this.append(this.directLoginElement(), {tag:'li', cls:'directLogin forward', children:[ 149 this.append(this.directLoginElement(), {tag:'li', cls:'directLogin forward', children:[
153 {tag:'a', href:'#', html:"direct login", children:[ 150 {tag:'a', href:'#', html:"direct login", children:[
154 {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:'http://www.clipperz.com/favicon.ico'}]} 151 {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:'http://www.clipperz.com/favicon.ico'}]}
155 ]} 152 ]}
156 ]}) 153 ]})
157 154
158console.log("ADD DIRECT LOGIN", aDirectLogin);
159 }, 155 },
160 156
161 //========================================================================= 157 //=========================================================================
162 158
163 'showCard': function (aCard) { 159 'showCard': function (aCard) {
164 var deferredResult; 160 var deferredResult;
165 161
166 // this.render(); 162 // this.render();
167 163
168console.log("CardDetail.showCard", aCard);
169 deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false}); 164 deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false});
170 deferredResult.addMethod(aCard, 'label'); 165 deferredResult.addMethod(aCard, 'label');
171 deferredResult.addMethod(this, 'setTitle'); 166 deferredResult.addMethod(this, 'setTitle');
172 167
173 deferredResult.addMethod(aCard, 'fields'); 168 deferredResult.addMethod(aCard, 'fields');
174 deferredResult.addCallback(MochiKit.Base.values); 169 deferredResult.addCallback(MochiKit.Base.values);
175 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addField')); 170 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addField'));
176 171
177 deferredResult.addMethod(aCard, 'directLogins'); 172 deferredResult.addMethod(aCard, 'directLogins');
178 deferredResult.addCallback(MochiKit.Base.values); 173 deferredResult.addCallback(MochiKit.Base.values);
179 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addDirectLogin')); 174 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addDirectLogin'));
180 175
181 176
182 deferredResult.callback(); 177 deferredResult.callback();
183 178
184 return deferredResult; 179 return deferredResult;
185 // return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ 180 // return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [
186 // MochiKit.Base.method(this.record(), 'hasPendingChanges'), 181 // MochiKit.Base.method(this.record(), 'hasPendingChanges'),
187 // MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), 182 // MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'),
188 // 183 //
189 // MochiKit.Base.method(this.record(), 'label'), 184 // MochiKit.Base.method(this.record(), 'label'),
190 // MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), 185 // MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'),
191 // MochiKit.Base.method(this.record(), 'notes'), 186 // MochiKit.Base.method(this.record(), 'notes'),
192 // MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), 187 // MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'),
@@ -245,49 +240,48 @@ console.log("CardDetail.showCard", aCard);
245 MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) 240 MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row'])
246 ) 241 )
247 }; 242 };
248 243
249 if (someData['notes'] != '') { 244 if (someData['notes'] != '') {
250 this.append(this.element(), [ 245 this.append(this.element(), [
251 {tag:'h2', html:"Notes"}, 246 {tag:'h2', html:"Notes"},
252 {tag:'fieldset', id:this.getId('fieldset'), children:[ 247 {tag:'fieldset', id:this.getId('fieldset'), children:[
253 {tag:'div', cls:'row notes', children:[ 248 {tag:'div', cls:'row notes', children:[
254 {tag:'span', html:someData['notes']} 249 {tag:'span', html:someData['notes']}
255 ]} 250 ]}
256 ]} 251 ]}
257 ]); 252 ]);
258 }; 253 };
259 254
260 return true; 255 return true;
261 }, 256 },
262 257
263 //------------------------------------------------------------------------- 258 //-------------------------------------------------------------------------
264/* 259/*
265 'toggleClickHandler': function (anEvent) { 260 'toggleClickHandler': function (anEvent) {
266 varnextState; 261 varnextState;
267 varfieldValue; 262 varfieldValue;
268 263
269//console.log("TOGGLE");
270 anEvent.preventDefault; 264 anEvent.preventDefault;
271 fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; 265 fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0];
272 266
273 nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); 267 nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true');
274 if (nextState) { 268 if (nextState) {
275 MochiKit.DOM.removeElementClass(fieldValue, 'clear'); 269 MochiKit.DOM.removeElementClass(fieldValue, 'clear');
276 } else { 270 } else {
277 MochiKit.DOM.addElementClass(fieldValue, 'clear'); 271 MochiKit.DOM.addElementClass(fieldValue, 'clear');
278 } 272 }
279 273
280 MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); 274 MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState);
281 }, 275 },
282* / 276* /
283 //========================================================================= 277 //=========================================================================
284/* 278/*
285 'directLoginClickHandler': function (anEvent) { 279 'directLoginClickHandler': function (anEvent) {
286 anEvent.preventDefault(); 280 anEvent.preventDefault();
287 281
288 if (/(directLogin_)/.test(anEvent.src().id)) { 282 if (/(directLogin_)/.test(anEvent.src().id)) {
289 var directLoginReference; 283 var directLoginReference;
290 284
291 directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; 285 directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2];
292 MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); 286 MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference});
293 } 287 }
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
index a4aa212..a0e4879 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components');
27 25
28Clipperz.PM.UI.Mobile.Components.CardList = function(args) { 26Clipperz.PM.UI.Mobile.Components.CardList = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments);
32 30
33 this._cardDetail = null; 31 this._cardDetail = null;
34 32
35 return this; 33 return this;
36} 34}
37 35
38//============================================================================= 36//=============================================================================
39 37
40Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { 38Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, {
41 39
42 //------------------------------------------------------------------------- 40 //-------------------------------------------------------------------------
43 41
44 'toString': function () { 42 'toString': function () {
45 return "Clipperz.PM.UI.Mobile.Components.CardList component"; 43 return "Clipperz.PM.UI.Mobile.Components.CardList component";
46 }, 44 },
@@ -69,80 +67,77 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C
69 67
70 // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); 68 // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler');
71 // MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); 69 // MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler');
72 70
73 // MochiKit.Style.hideElement('backButton'); 71 // MochiKit.Style.hideElement('backButton');
74 // MochiKit.Style.hideElement(this.getElement('cardDetail')); 72 // MochiKit.Style.hideElement(this.getElement('cardDetail'));
75 }, 73 },
76 74
77 'showCards': function (someCards) { 75 'showCards': function (someCards) {
78 varcardListElement; 76 varcardListElement;
79 if (this.isFullyRendered() == false) { 77 if (this.isFullyRendered() == false) {
80 this.render(); 78 this.render();
81 }; 79 };
82 80
83 cardListElement = this.getElement('list') 81 cardListElement = this.getElement('list')
84 82
85 cardInfo = { 83 cardInfo = {
86 '_rowObject': MochiKit.Async.succeed, 84 '_rowObject': MochiKit.Async.succeed,
87 '_reference': MochiKit.Base.methodcaller('reference'), 85 '_reference': MochiKit.Base.methodcaller('reference'),
88 '_searchableContent':MochiKit.Base.methodcaller('searchableContent'), 86 '_searchableContent':MochiKit.Base.methodcaller('searchableContent'),
89 'label': MochiKit.Base.methodcaller('label'), 87 'label': MochiKit.Base.methodcaller('label'),
90 'favicon': MochiKit.Base.methodcaller('favicon') 88 'favicon': MochiKit.Base.methodcaller('favicon')
91 }; 89 };
92 90
93//console.log("someCards", someCards);
94 deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false}); 91 deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false});
95 deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false})); 92 deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false}));
96 deferredResult.addCallback(Clipperz.Async.collectAll); 93 deferredResult.addCallback(Clipperz.Async.collectAll);
97 deferredResult.addCallback(MochiKit.Base.methodcaller('sort', Clipperz.Base.caseInsensitiveKeyComparator('label'))); 94 deferredResult.addCallback(MochiKit.Base.methodcaller('sort', Clipperz.Base.caseInsensitiveKeyComparator('label')));
98 deferredResult.addCallbackPass(MochiKit.DOM.replaceChildNodes, cardListElement); 95 deferredResult.addCallbackPass(MochiKit.DOM.replaceChildNodes, cardListElement);
99 // deferredResult.addCallbackPass(MochiKit.DOM.removeElementClass, cardListElement, 'loading'); 96 // deferredResult.addCallbackPass(MochiKit.DOM.removeElementClass, cardListElement, 'loading');
100 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'appendCardToList', cardListElement)); 97 deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'appendCardToList', cardListElement));
101 deferredResult.callback(someCards); 98 deferredResult.callback(someCards);
102 }, 99 },
103 100
104 'appendCardToList': function (aCardListElement, aCardInfo) { 101 'appendCardToList': function (aCardListElement, aCardInfo) {
105//console.log("appendCardToList", aCardInfo);
106 this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[ 102 this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[
107 {tag:'a', href:'#', html:aCardInfo['label'], children:[ 103 {tag:'a', href:'#', html:aCardInfo['label'], children:[
108 {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]} 104 {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]}
109 ]} 105 ]}
110 ]}); 106 ]});
111 }, 107 },
112 108
113 'cardSelectionHandler': function (anEvent) { 109 'cardSelectionHandler': function (anEvent) {
114 var listElement; 110 var listElement;
115 varcardReference; 111 varcardReference;
116 112
117 anEvent.preventDefault(); 113 anEvent.preventDefault();
118 114
119 listElement = anEvent.target(); 115 listElement = anEvent.target();
120 if (MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') == null) { 116 if (MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') == null) {
121 listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem'); 117 listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem');
122 } 118 }
123 cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference'); 119 cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference');
124console.log("###", listElement, cardReference);
125 //TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected 120 //TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected
126 MochiKit.Signal.signal(this, 'selectedCard', cardReference); 121 MochiKit.Signal.signal(this, 'selectedCard', cardReference);
127 }, 122 },
128 123
129 //------------------------------------------------------------------------- 124 //-------------------------------------------------------------------------
130/* 125/*
131 'searchHandler': function (anEvent) { 126 'searchHandler': function (anEvent) {
132 if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN 127 if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN
133 anEvent.preventDefault(); 128 anEvent.preventDefault();
134 } else { 129 } else {
135 if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { 130 if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) {
136 anEvent.target().value = ""; 131 anEvent.target().value = "";
137 } 132 }
138 133
139 if (anEvent.type() == 'keyup') { 134 if (anEvent.type() == 'keyup') {
140 MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); 135 MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value);
141 } 136 }
142 } 137 }
143 }, 138 },
144 139
145 //------------------------------------------------------------------------- 140 //-------------------------------------------------------------------------
146 141
147 'update': function (someObjects) { 142 'update': function (someObjects) {
148 varcardListPanel; 143 varcardListPanel;
@@ -150,49 +145,48 @@ console.log("###", listElement, cardReference);
150 145
151 cardListPanel = this.getElement('cardListPanel'); 146 cardListPanel = this.getElement('cardListPanel');
152 cardListPanel.innerHTML = ''; 147 cardListPanel.innerHTML = '';
153 148
154 c = someObjects.length; 149 c = someObjects.length;
155 150
156 for (i=0; i<c; i++) { 151 for (i=0; i<c; i++) {
157 this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ 152 this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[
158 {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=')}, 153 {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=')},
159 {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} 154 {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']}
160 ]}) 155 ]})
161 156
162 MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); 157 MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler');
163 } 158 }
164 159
165 }, 160 },
166 161
167 'cardListClickHandler': function (anEvent) { 162 'cardListClickHandler': function (anEvent) {
168 anEvent.preventDefault(); 163 anEvent.preventDefault();
169 164
170 if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { 165 if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) {
171 var cardListReference; 166 var cardListReference;
172 167
173 cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; 168 cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2];
174//console.log("Showing detail for card named", cardListReference);
175 MochiKit.Signal.signal(this, 'selectedCard', cardListReference); 169 MochiKit.Signal.signal(this, 'selectedCard', cardListReference);
176 } 170 }
177 }, 171 },
178 172
179 //========================================================================= 173 //=========================================================================
180 174
181 'cardDetail': function (someData) { 175 'cardDetail': function (someData) {
182 if (this._cardDetail == null) { 176 if (this._cardDetail == null) {
183 this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:this.getElement('cardDetail')}); 177 this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:this.getElement('cardDetail')});
184 } 178 }
185 179
186 return this._cardDetail; 180 return this._cardDetail;
187 }, 181 },
188 182
189 //------------------------------------------------------------------------- 183 //-------------------------------------------------------------------------
190 184
191 'removeCardDetail': function () { 185 'removeCardDetail': function () {
192 if (this._cardDetail != null) { 186 if (this._cardDetail != null) {
193 this._cardDetail.remove(); 187 this._cardDetail.remove();
194 this._cardDetail = null; 188 this._cardDetail = null;
195 } 189 }
196 }, 190 },
197 191
198 //========================================================================= 192 //=========================================================================
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
index eafcdbc..3aeac0c 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components');
27 25
28Clipperz.PM.UI.Mobile.Components.LoginForm = function(args) { 26Clipperz.PM.UI.Mobile.Components.LoginForm = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 this._pin = ''; 29 this._pin = '';
32 30
33 this._message = null; 31 this._message = null;
34 this._steps = 0; 32 this._steps = 0;
35 this._actualSteps = 0; 33 this._actualSteps = 0;
36 34
37 this._callback = null; 35 this._callback = null;
38 this._errorCallback = null; 36 this._errorCallback = null;
39 37
40 this._mode = 'CREDENTIALS'; 38 this._mode = 'CREDENTIALS';
41 39
42 Clipperz.PM.UI.Mobile.Components.LoginForm.superclass.constructor.apply(this, arguments); 40 Clipperz.PM.UI.Mobile.Components.LoginForm.superclass.constructor.apply(this, arguments);
43 41
44 return this; 42 return this;
45} 43}
46 44
@@ -118,49 +116,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
118 } else { 116 } else {
119 this.getElement('message').innerHTML = aValue; 117 this.getElement('message').innerHTML = aValue;
120 MochiKit.Style.showElement(this.getElement('credentialsMessage')); 118 MochiKit.Style.showElement(this.getElement('credentialsMessage'));
121 } 119 }
122 }, 120 },
123 121
124 'setMessage': function (aValue) { 122 'setMessage': function (aValue) {
125 this._setMessage(aValue); 123 this._setMessage(aValue);
126 MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error'); 124 MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error');
127 }, 125 },
128 126
129 'setErrorMessage': function (aValue) { 127 'setErrorMessage': function (aValue) {
130 this._setMessage(aValue); 128 this._setMessage(aValue);
131 MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error'); 129 MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error');
132 }, 130 },
133 131
134 //------------------------------------------------------------------------- 132 //-------------------------------------------------------------------------
135 133
136 'setCallbacks': function (args) { 134 'setCallbacks': function (args) {
137 this._callback = args['callback']; 135 this._callback = args['callback'];
138 this._errorCallback = args['errorCallback']; 136 this._errorCallback = args['errorCallback'];
139 }, 137 },
140 138
141 'showErrors': function (args) { 139 'showErrors': function (args) {
142//console.log("LoginForm.showErrors", args);
143 if (args['previousFailedAttempt'] == 'LOGIN') { 140 if (args['previousFailedAttempt'] == 'LOGIN') {
144 this.setErrorMessage("Wrong credentials"); 141 this.setErrorMessage("Wrong credentials");
145 } else if (args['previousFailedAttempt'] == 'PIN') { 142 } else if (args['previousFailedAttempt'] == 'PIN') {
146 if (args['failedAttempts'] == -1) { 143 if (args['failedAttempts'] == -1) {
147 this.setErrorMessage("Wrong PIN - Resetted"); 144 this.setErrorMessage("Wrong PIN - Resetted");
148 } else { 145 } else {
149 this.setErrorMessage("Wrong PIN"); 146 this.setErrorMessage("Wrong PIN");
150 } 147 }
151 } else { 148 } else {
152 this.setMessage(null); 149 this.setMessage(null);
153 } 150 }
154 }, 151 },
155 152
156 'updateWithArgs': function (args) { 153 'updateWithArgs': function (args) {
157 this.renderIfNeeded(); 154 this.renderIfNeeded();
158 this.setCallbacks(args); 155 this.setCallbacks(args);
159 this.showErrors(args); 156 this.showErrors(args);
160 this.updateRendering(); 157 this.updateRendering();
161 }, 158 },
162 159
163 'showPinLogin': function (args) { 160 'showPinLogin': function (args) {
164 this.setPin(''); 161 this.setPin('');
165 this.setMode('PIN'); 162 this.setMode('PIN');
166 this.updateWithArgs(args); 163 this.updateWithArgs(args);
@@ -278,79 +275,73 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
278 MochiKit.Signal.connect(this.getElement('pinForm'), 'onsubmit', this, 'submitPinHandler'); 275 MochiKit.Signal.connect(this.getElement('pinForm'), 'onsubmit', this, 'submitPinHandler');
279 MochiKit.Signal.connect(this.getElement('pinSubmitButton'), 'onclick', this, 'submitPinHandler'); 276 MochiKit.Signal.connect(this.getElement('pinSubmitButton'), 'onclick', this, 'submitPinHandler');
280 277
281 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); 278 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle');
282 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); 279 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle');
283 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); 280 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle');
284 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); 281 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle');
285 }, 282 },
286 283
287 //------------------------------------------------------------------------- 284 //-------------------------------------------------------------------------
288 285
289 'submitPinHandler': function (anEvent) { 286 'submitPinHandler': function (anEvent) {
290 varpin; 287 varpin;
291 288
292 this.setMessage(null); 289 this.setMessage(null);
293 pin = this.getElement('PIN').value; 290 pin = this.getElement('PIN').value;
294 // $(this.getAnchor('PIN')).blur(); 291 // $(this.getAnchor('PIN')).blur();
295 this.getElement('PIN').blur(); 292 this.getElement('PIN').blur();
296 293
297 credentials = Clipperz.PM.PIN.credentialsWithPIN(pin); 294 credentials = Clipperz.PM.PIN.credentialsWithPIN(pin);
298 this.loginWithCredentials(credentials); 295 this.loginWithCredentials(credentials);
299 }, 296 },
300 297
301 'submitCredentialsHandler': function (anEvent) { 298 'submitCredentialsHandler': function (anEvent) {
302//console.log("submitCredentialsHandler");
303 varcredentials; 299 varcredentials;
304 300
305 this.setMessage(null); 301 this.setMessage(null);
306 302
307 credentials = {}; 303 credentials = {};
308 credentials['username'] = this.getElement('usernameField').value; 304 credentials['username'] = this.getElement('usernameField').value;
309 credentials['passphrase'] = this.getElement('passphraseField').value; 305 credentials['passphrase'] = this.getElement('passphraseField').value;
310 // $(this.getAnchor('passphraseField')).blur(); 306 // $(this.getAnchor('passphraseField')).blur();
311 this.getElement('passphraseField').blur(); 307 this.getElement('passphraseField').blur();
312 308
313 this.loginWithCredentials(credentials); 309 this.loginWithCredentials(credentials);
314 }, 310 },
315 311
316 //------------------------------------------------------------------------- 312 //-------------------------------------------------------------------------
317 313
318 'loginWithCredentials': function (someCredentials) { 314 'loginWithCredentials': function (someCredentials) {
319 varargs; 315 varargs;
320 316
321 args = {}; 317 args = {};
322 args['credentials'] = someCredentials; 318 args['credentials'] = someCredentials;
323 args['errorCallback'] = this.errorCallback(); 319 args['errorCallback'] = this.errorCallback();
324 320
325 MochiKit.Style.hideElement(this.getElement('credentialsBody')); 321 MochiKit.Style.hideElement(this.getElement('credentialsBody'));
326 MochiKit.Style.showElement(this.getElement('validating')); 322 MochiKit.Style.showElement(this.getElement('validating'));
327 323
328 MochiKit.Async.callLater(0.1, this.callback(), args); 324 MochiKit.Async.callLater(0.1, this.callback(), args);
329 }, 325 },
330 326
331 //------------------------------------------------------------------------- 327 //-------------------------------------------------------------------------
332 328
333 'initProgressHandle': function (anEvent) { 329 'initProgressHandle': function (anEvent) {
334//console.log("** initProgressHandle", anEvent);
335 this._steps = anEvent['steps']; 330 this._steps = anEvent['steps'];
336 this._actualSteps = 0; 331 this._actualSteps = 0;
337 }, 332 },
338 333
339 'updateProgressHandle': function (anEvent) { 334 'updateProgressHandle': function (anEvent) {
340//console.log("** updateProgressHandle", anEvent);
341 this._steps += anEvent['extraSteps']; 335 this._steps += anEvent['extraSteps'];
342 }, 336 },
343 337
344 'advanceProgressHandle': function (anEvent) { 338 'advanceProgressHandle': function (anEvent) {
345//console.log("** advanceProgressHandle", anEvent);
346 this._actualSteps ++; 339 this._actualSteps ++;
347//console.log("STEPS: " + this._actualSteps + "/" + this._steps);
348 }, 340 },
349 341
350 'progressDoneHandle': function (anEvent) { 342 'progressDoneHandle': function (anEvent) {
351//console.log("** progressDoneHandle", anEvent);
352 }, 343 },
353 344
354 //------------------------------------------------------------------------- 345 //-------------------------------------------------------------------------
355 __syntaxFix__: "syntax fix" 346 __syntaxFix__: "syntax fix"
356}); 347});
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
index 12a61f7..9951f44 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
@@ -1,333 +1,321 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers');
27 25
28Clipperz.PM.UI.Mobile.Controllers.MainController = function() { 26Clipperz.PM.UI.Mobile.Controllers.MainController = function() {
29 this._jQTouch = null; 27 // this._jQTouch = null;
30 this._user = null; 28 this._user = null;
31 this._proxy = null; 29 this._proxy = null;
32 this._loginForm = null; 30 this._loginForm = null;
33 this._cardList = null; 31 this._cardList = null;
34 this._cardDetail= null; 32 this._cardDetail= null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype, { 37MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Mobile.Controllers.MainController"; 40 return "Clipperz.PM.UI.Mobile.Controllers.MainController";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
47 'user': function () { 45 'user': function () {
48 return this._user; 46 return this._user;
49 }, 47 },
50 48
51 'setUser': function (aValue) { 49 'setUser': function (aValue) {
52 this._user = aValue; 50 this._user = aValue;
53 }, 51 },
54 52
55 //------------------------------------------------------------------------- 53 //-------------------------------------------------------------------------
56 54/*
57 'jQTouch': function () { 55 'jQTouch': function () {
58 return this._jQTouch; 56 return this._jQTouch;
59 }, 57 },
60 58
61 'setJQTouch': function (aValue) { 59 'setJQTouch': function (aValue) {
62 this._jQTouch = aValue; 60 this._jQTouch = aValue;
63 }, 61 },
64 62*/
65 //========================================================================= 63 //=========================================================================
66 64
67 'run': function () { 65 'run': function () {
68 console.log("MainController.run");
69
70 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin')); 66 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin'));
71 Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[ 67 Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[
72 {tag:'div', id:'loginForm'}, 68 {tag:'div', id:'loginForm'},
73 {tag:'div', id:'cardList'}, 69 {tag:'div', id:'cardList'},
74 {tag:'div', id:'cardDetail'}, 70 {tag:'div', id:'cardDetail'},
75 {tag:'div', id:'preferences'} 71 {tag:'div', id:'preferences'}
76 ]}); 72 ]});
77 73
78 this.showLoginForm(); 74 this.showLoginForm();
79 75
80 this.initjQTouch(); 76 // this.initjQTouch();
81 77
82 78
83 // this.showAddToHomeScreenBaloon(); 79 // this.showAddToHomeScreenBaloon();
84 // this.selectInitialProxy(); 80 // this.selectInitialProxy();
85 }, 81 },
86 82/*
87 'initjQTouch': function () { 83 'initjQTouch': function () {
88 var jqt; 84 var jqt;
89 85
90 jqt = new $.jQTouch({ 86 jqt = new $.jQTouch({
91 icon: 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAIAAAAAvxIqAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAKJGNVd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJGWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19HvFpgJSpO64PIN5G+fAp30Hc8TziHS4miFhheJbjLMMzHB8POFPqKGKWi6TXtSriJcT9MzH5bAzzHIK1I08t6hq6zHpRdu2aYdJYuk9Q/881bzZa8Xrx6fLmJo/iu4/VXnfH1BB/rmu5ScQvI77m+BkmfxXxvcZcJY14L0DymZp7pML5yTcW61PvIN6JuGr4halQvmjNlCa4bXJ5zj6qhpxrujeKPYMXEd+q00KR5yNAlWZzrF+Ie+uNsdC/MO4tTOZafhbroyXuR3Df08bLiHsQf+ja6gTPWVimZl7l/oUrjl8OcxDWLbNU5D6JRL2gxkDu16fGuC054OMhclsyXTOOFEL+kmMGs4i5kfNuQ62EnBuam8tzP+Q+tSqhz9SuqpZlvR1EfBiOJTSgYMMM7jpYsAEyqJCHDL4dcFFTAwNMlFDUUpQYiadhDmXteeWAw3HEmA2s15k1RmnP4RHuhBybdBOF7MfnICmSQ2SYjIBM3iRvkcMki9IRcnDTthyLz2Ld2fTzPjTQK+Mdg8y5nkZfFO+se9LQr3/09xZr+5GcaSufeAfAww60mAPx+q8u/bAr8rFCLrx7s+vqEkw8qb+p26n11Aruq6m1iJH6PbWGv1VIY25mkNE8PkaQhxfLIF7DZXx80HD/A3l2jLclYs061xNpWCfoB6WHJTjbH0mV35Q/lRXlC+W8cndbl9t2SfhU+Fb4UfhO+F74GWThknBZ+Em4InwjXIyd1ePnY/Psg3pb1TJNu15TMKWMtFt6ScpKL0ivSMXIn9QtDUlj0h7U7N48t3i8eC0GnMC91dX2sTivgloDTgUVeEGHLTizbf5Da9JLhkhh29QOs1luMcScmBXTIIt7xRFxSBxnuJWfuAd1I7jntkyd/pgKaIwVr3MgmDo2q8x6IdB5QH162mcX7ajtnHGN2bov71OU1+U0fqqoXLD0wX5ZM005UHmySz3qLtDqILDvIL+iH6jB9y2x83ok898GOPQX3lk3Itl0A+BrD6D7tUjWh3fis58BXDigN9yF8M5PJH4B8Gr79/F/XRm8m241mw/wvur4BGDj42bzn+Vmc+NL9L8GcMn8F1kAcXjEKMJAAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNC40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrlPw1BAAAd7klEQVR4nO19eZQV13nn797a3tr7yg5ikxCIHRohkACBEFqsJY4z8T52nPHYPp74JJ54bMfOsRMf2Z44OZ7EJ16iDLIsS5ZlydJY+2Ii1haiAQFCNGvTNHS/9/pt9Wq93/xRb+9u6OU1wif9O3Wq6223bv3qu7/vu9+9txqYwAQmMIEJTGACE5jABCbwnxTs/a4AHnjggY0bNwohxl4U5/xnP/tZe3v72Iv6g8fDDz9MlcOHP/zh9/uCAEB+vysA27YBkHAh7KK3aSRlMIDAFcZl13UrW73R4f2nNQvXYGYMjANUROkVyWXZvbBIDcLXOH4VHBGuGVoBgAMMYGAAERhAeekfyC8r+svA3n8nUYxrilYXxAFkScz6sKENlgHkfc5AYmSyMc64dmglEOW4pOyOUSlZxS9Y4RVjIHeEcjy+uGZoJYBErmlTdk/5V0NQxnLkUgXiswrimqEVAIkcTQU685+BioJsyikAkDXbCVqHABWslcpopcJfopIuTIFZMSECQ0GAWBGJA2j13mQspw8MeRumayJczeNaorVMW7MxVqkUgIEox6Yo7CdEYAhQji+UuKxyWgcFA0SWWbompODaoRUD7K40Hri8dJIgIVjRt99fXEu0FhNKpWabbfulYJTthjGAXLqW5PVapRUYwGyuj1AcGGTBQAJiQgQGotDFQkFkBwkGcpZbiAK8nqsgEsC10te6FmglAESCeZFAltPiMGvQSAtALhYAsrSSmLDWLIg8Wt0iQgdoa7nXKupm5TuvwgW5NEFrFp6kilyEVGAWGERSvT0rsWgwkEtZeZ2g1YNnX1llRIHNYlq9Dy6Tc4EgciHcPzwRuP/++9Pp9KuvvuoNk1QKRAQIKjBSrABFx9l2P2jvgIFcCAFyxyNunTVj2h/dt82nad/8zg+G+ZPh0ur3+7/70HdnXTdrz54927dvf+qpp7q7u0dbzxJkaaVSESjYbFHbz3NKJSksIOuySFTSZQX8/lvWrPjQg3dvWr92UktTV/eFH/30kYu9fcP57XBpXbOmbebMGURi1apVq1at+upX/9czTz+9/ZGf79q1a8yjciKrjCgKPEvcF8o7tRggBiRIuCQqE2DNnjXjvrs2P3jvHTfMn6sosmmayWSiqaF2w/q2X/zqt8MpYbi0Pvjgg4xzYaXgpIhrLY31f/aZP//EJz6+e/fu7du3P/3Ms5cuXRrlRQjynHhRp55KDgbpdJUIQDbf6hnsGKw1FAysu3nlnzxw94Z1bfX1dY5tO44BV6gwDVcmId+7dWMlaa2urr5j8+0kXLgW4yoTJukpwSQu+2+5Ze0t69Z9/aunnvnts9t//os9e/aO/MIIwi2JBMqZ9YS1zGXlDgRlIwHhQjijE4F5c2Y9eM8dH7hr8/Vzr+MSt03TTPerkutTuCSrINW2kpaptK1YNG3KpLNdV1a/YdG6fv26GTNnuJbByQWTwRQmSZKwyYoLMya4Nqml4bOf+++f/PhHd+7c9cijjz373O96+4alQQCIBIQrhFuqrQNsVgwwWO/TbEfLJRJCjEyOqsKhDevaPnT/tnVrVtbVVlu27ZhpmVl+iWRNYpIMcIDAFZU5KcdsrK3efNuan2z/1RVLHhatD95/Hxgn12CMgbw0vgBjjKuMXC4M0pOOLklycMNt6zZsuPXUyZO/efq3jz72RPv+t69culegtxXKH0DrQB3wDgi5/quLgt+7AhbMn/PgvVvu2bpp7uyZnDPbNKx0ROW2ooBzCVwCGIQAIxCBQ1EVltZdV7l787qfPvLkFVvklWltbGzccNt6YWUYOeBK9pqLXQqXGeOycMiOuWZEcN/USY3/44uf+/QnP/YfO3c98ugvf/fiy9FobKjyCUTCpWy/s6jkkoNSqS3skR0vIEFCkHAvf7011VWb1q/54/vvXLt6WU11tW2ZrpngyAS5KyscXAI4iCBcMMpOWgBBEJd9CqKm6Vu2aP6cWdOOd54ZK60bb1s/eXKrldEVr7kVsZGj2LMRxrgqMUcSGaEnbV1SpNDmjetu33jric7Op37z7GNP/Lrj0DuD8SqyXU+IrHqW8VvSNSjrdCH7KYmsvA4RCSxaMO/Be7bcs3XDdTOnc8ZsM+2kuzVmKpwYl8A4gKx5gmXbfvYAAIFLqkyGaVZXBbfc2lYBWh+47wMggrCYoiBvU0DBlLIXKbLHTOIS4+SQExHxXof5Zk5p/PKXPv+ZT33s9zvefPTxJ198+fX+eKLAKuWttcxlDTDYEmXIcQoAjMj1rLXMZdXX1tx+25oPfmDrmpVLqsJh28oIIyKTHuK2JDEwzzxF1iVmzbOYU++MHIIpisYyumPL226/+V8efsK5bFh5BVqnTpmybm2bbegcAkzKznIgKr0wkXtHZAc/iAAwLktMSCIjMklHl/xSeNuWW7du3nj8vfd+/fRzv3zymSPHjgPw4k0ityhuHZTZPK2D9LgYuQRBJNyc11qy6Po/uueOu7asnzl9GgM5ZkKkzviZoXABzzwJIBdMADyXEfemKnnH3mwwBpY9KVc0hSVM01w0f9YN82YdPPLe6GndvOm2pqYGQ0+qipQjseiCy7qSVEqHRzTjXFI4OYrb5yZ6BfPNmd70lb/8/H/79Eff2LHz4UceD/h9wnUgRDmVA5kt7hqIXMo1a7ACwhWO01BX88cf2PpfHty2avnicDDgWDrpFxSk/MzmHGBSzr95I7gsSxwxMAbGQBxEYLl9Yd4CgUk+hWUyZtAf2Lph9eVpvdyMMMbYs089dsfmjbaR0nwhICthOZPMbdmXOUdMBLjZg8KnORUWthC2Q7LLw5K/1rJhGBlVVbmTCIme3J27jPvK39ocoV7YKpwENTtyfSaTqQqHOBPCjMsirrGMxAisaNJc9oCVHGT3vGjPAF7yDpfITvdG01wJH363c+uffskwraGou5y1zr5u1uoVSy0jI3MGzpF3CESFrcRsaWhNyHk2xjlXVHIh+pxkrwyfxqtclzMigmBe4UPSivLj3I6RICJBIqQJnjmnIqkwh/Gcz/ES5IUpiGzAxnPdNZ4z5LywMoDAOASYrGk8plvW/FlTFi+YvXv/kdHQeueWjbU11YaelNRAzsGW+qtyTUCRBytuy6LoHuQsl0myRDLpqptwhOxCAs9rqyj9eZk4oLQO3idCdmM+iqtM53nz9NpNfg4s5ayVsQK/xLPBMssJQj6uyjLLCxVgkk9T0knDFwjcuWHVaGiVJeneu7Y4tsVATFJzjRrZRsGkrBV4zV84gAPk55rJhebPvD6lneUUZVwzzmWVuSCzkJwelNlifoGi9gGAGEOIp4rUMN8pYIWDPJtULAI5YSWWlVTPeIlyFFPhJUHVfFKy3zLljWsWPxTwp/TMyGi94fp5S2+60TIzmqqAK1lCyYGdgHEJ+jlkeqB3I9MFMwonBWHBixaYDK5BqYIShlYPtR5qPbQGyAFwDRAQTqny5oKY7LG4HLNsqN6Bd0fzg4zFhKJgsN5Bll9WOChQyQr+iigXJOReCmKy6pPchG3Omtq84qZ5r+06MDJa7966KRTwZwxD0kIw+hB/B5G30H8QyfeQPgs7CVE6U7d4CmUxOMBlKGH4WhCYjPBchGbBPwVKFZgMYQFOSc+isC8S2WJmB0lxFZ14YAWGVFWAeM6JFcWqlJvmhXw8kL/xAJP9fiWRMWUlsO225SOjVVXVbXdstB3B4wfZwR8jfgiZbm9MpETlhwlyYMZgxNB/FHgZnEFrRGg2ahai5kb4WsEVCCvX0Sp2WZcV2QKzrNxy84QWuGalNpu3guIDzzsxEM/63oIs5E4toGh+hfWZlrxu5Q211aFYPDVcWpfedOON82dbtu07sx3nXoAMMEAaNo8DwQrXCBCMS8hcQu9OyBpCs1G/HLVL4WsGOMgqUl5RwmNJQrbIa5U4MZQ2HFa6L9PWHJvFzT8byeZdmWe2yPcLmKT6VYrp1pTm2jVL5z/32iDLwAan6rOf+si6taudZLev8/uM9MtGt6NC3mLIRaYXsQ707kD6JJgMrR5czWW1Sw22oLmicFDwhKUDt1lac28ylN+M4o0V3R42YI+8TXg/55ysVNqQZcVx3f/3+lsDr28Qaw0GA1s23mLarhTbzY3eETT20cEr30mjdw/69iA0E03rUbccchCuVS61JRRjQGCAIXWgzGAHD12pYLnFCpv3ltnvQPUFVClhWmbb4tnNDTUX+/rLrmkQa13btvxzn/pTx3H8p34o6acrb6qDIn91Vj+iB9D/NiDga4akFSVSS0W2kJbNezYxiCWiKH4o2CYKRoqylyh6M49SlyjJZCXTGVETDhzpPH/kRFfZ1Qxiivdu3SjLEqwos/rAclW9avDsJnMBpx7Fse8hsjuX3i7rK3sKkGfcBTyP5w6yCe99J7sXInec/0L+uLgXXlaOyKVmBFxTljiERcLdesvCgYvCyq21vq7277/2xYBPcUmyGjba1ctJDjA3ye1EiQ8Yb3iWaycQexv6afiaoNYOYrPFCuvZLyu24sGkEwXnM0iSM29BeYvOvvT8mG0Z6VS8Pxrpj6dcIsZITGqpf+a1t+NJvbj65dpaU1PTr4sWpgb8ZJrMrl5pVa9mdkxJHVajv1fi+ySjuxCNjDe8U/QfReokmtajcT0kDcIq19ZiOkRx+82FBPluqxdpZV96LTUfsRYrbD4lyMEIwrIsR8/YaUOYFhPEOGc+nyakQHfMfvPAKcMub86DcOMPBJctWXzX1k0bb1k5e3qzyoVlmrZgIMacmJI8rMb+Q020S2bP1eMXgABC0zH5bgSmQtil6RgM5rtQFJaiaPVmPmWFLI8exWVJLAYIsmxHN9y0CdOWXMEkiWmaRrK/O+buPnT2+df37W7viEUHGQy9HCWBYGjZ0sXbNm/YtG7ldVMbFeaYpukIBjBmx+TUEV//m2qyXTIvXSV+CZA0tNyO+lUA5TJqZfkt76v5lFXRz7MdqhyhJblBno1bGSCEabm6ibTJTVcWgnHONE2D7L8QFzs7zjz/RvvetzqikcsNLQ+LiVAovHz50js337rx5uUzJ9fJcEzTyPOrpo9o8Z1a8m3J6h13fj2aapegdQskX26tvCgIAkoNtpjZgoWiQKuXnQFBkGmLtMl1SzZdxSUmsSybPQnadfDM82+8tbu9IxrpHU41R0ZAuKp6xfKl225ff9vNS6a31Mhk5+2X21FFP+KL79bSHZLVN778CiA4FVPugVoHYZcSStkeUZmdUqm1slyClYRpU9qS05ZquqogLnFoqgol0JOgXYfOvfBG++72jkjfsNgsPuFoUFVds3LF0m2333rr6oXTmqs4WZZh2h6/TlRNH/Un92rpg5IdGdt5hgYBai0m3w3/lFzWsTgILRNZrw4sqwwgEmTZSFtK2tZMVxPEOSefpkEO9CRo9+FzL/x+/659HZG+Uc6AGuvlVtfUrlq5bNumdetWLpjaFOaukbNfcCem6cd8qX0+/bBkRytxtlIQIPsx6S6EZmXDg9IkbHZNYtZIyWPTdFjaUnXbbwgtZ5sKU4IXE9j9zrnn39i/u72jr3e088lyqNiF1tTWrV65bNumW25ZccOUBj9cwzQMhyQQSU5Myxzzp9p9maOSE6vkaT0n1roFoTmlNlv8DUFCmLaUtrW07TeFTxCXGGmaytTgxQT2HDn//Bv7d+07MHY286i8+NXW1betXHbnprVrl82bXOeHq5uG6RAHSLKjmvFuIH3AZxyR3HhlzkcAV9C6BaHZEFbuLQJAwjVsnra1tBOwXJ8LLjFomsKU4KUk9h7pfmHH2zv3Hui9dLEyNSnCOMZEdfUNa1Yvv3PjzTcvnt1aq1qZpG074DKE3dLzkM94r6I2q6J1CwLTiz2YcO2uRH1a1HLmSpxrgareFPYevfDCjgM79x64dLGnQqcfBFcjlG9oaFq9atmXPrF1drNmu7y2/8ma+PPjo7NboTVCONm3GExTnE22giu9Kf7dR/fs2nfgYs+Fip54cIx31g8A+vouvXfkQLWccYgH0vuqEy+NSwLXyaDnFVj9YJRPoGiq0+S7IFwnLOvxC+9eHU4xtoz/cFFbFfzJ331mxtRWlulqivxUEplxaSQMcE1YUQSn5YYLCUQ+2XZs02Hhm2+asWP/yUhcv3JRY8a408oY+9YXP7ipbaFppJqjD2t29zgKDwPsFIQF/6RszhAEICDrKZ35/eEFsxqf33ncssd90fG40/qRe9d+/sO3G5Zbl3gmnNk/7mLOACsCOQC1Nve4IcE480vpaEqZ3FRXHVJff+vUOFdinGldcv2M7//Vh7ikBvX2huSzjF2tfLjRC18zJBVwvTFwWRYK9IjuWzS7uTemHz5ZsRB1UIwjrXXVwX/+2kcmN9dzs6s18XNO5vidqxzChZNCYFJhDJHIp9iObacs36oFre3HLlzoG2QgulIYL1o5Y9/6wn23rZxvGqnW5KOqc+kqpWU9MMBOg6vQaiGc7AgCQ1DNJHXGJf+S2Y0vt59OG5VcDlmM8aL1o/e0ffZD6zOW25j+Xdg8dFU59cAAKw5/E7iUHxtnHAFFj6TkxprQpMbgK+1nhRgXXRoXWpfdMP2hv7iPMTlk7G/KvPg+cOpBuCAbvgbAzU/LlWWhwuhLaXOn1tiOaD82LiJbeVrra0I//OsPtjTUSGbXJP1JjiHn1g4fBObCx71JicOHJwVqFSStMEWDyKfZruP069ryufXHz/Wf7kmOvYZlqDCtnLNvf+6utUuvs8zU5MyTmohc+TfDQIJd183XVtNJjhGGnEQQJnz12bHu7KA3hTQjlWGuUJfNrdtxsKc/VYF7X4wK0/qxu1f+2QOrM6bbYr4Udt6tSJk2AmfZBh2NAAujfKLDFcAA14AczAVb3ui3YJyCqh5JKOGgOnty+OX9F2ynkg8oqyStyxdM/fvP30lMqrY7mqw3KlXsebQl0crI1NHoR9THRphRJIAs+Gqy8oqcyCpC40ZvXJveHPCr0puHRzascnlUjNaGmuA//dU9TXXVitU9xXp2xDo4BGI0s4dukmVFVv2upaepqYadldhIAiMGuBYUPyRvAVQu3iLh1yzhuNGUsmhWuCdqvNtVMZGtDK0SZ9/+7Ja2hdMcMznV+q1K5VO9RgcLwTNiraJoz3ck955yls/UdJMsBGt5F8NIAiMCIKAGQE7OYL2NQj4jpTPDkpbPDe873t8br4zIVobWT9y97JP3LDFMp9V5vYoq1eNmZ90VGTREDPVLP3jx1Z2Hbm5b0RpIJu2QDCvEoyMpCRA2VB84gRzABhwv6mJMhLRMJKFqsnTjjMArB6KGVQGRrQCtqxZM+daf3yZIqnEONou9Yy/QQ8Sd2ePMUzXtO788tq/juOvYh08n7ly3ULEjSVEX5n0qN0ZQHBE4QeagHKdwAAfkyIrjk81Lca2lRmmslt84FB84aDtSjJXWxtrgD/5iS311UHW6p4lXRhwADQGTQqesFYqqvPKO+Y+PvE4kAPT1RVJUs2Fxo5nRdVFdJ1/gbNiWxQC4UBhgAhZgASZgAzbI8fsM4VJfUp0/WdNN9+DpseZkx0SrJPFvf+bWlTe0OlZqOr2soTKST2Cn7SWGqIrZvr/84Y54vOD63zl+dsacBTe0WClDEiTVKMN9GAQACIJsg9s5g/U2G8wCOeFAOq3L6Yy89DrtaFemKzKmdMGYBl0+vm3hllXTM4bZSrsDGMkVXha99rSY1aCoyv95uvPc+ZJhEhLOd37y4ul0k8rNi2ZzxGoaQc+YADu3uqx4E4AQnNmzWroVnpK58+X7aifVjekJYaO31tU3TvrGJ9oEsTpxpIV1jKUSxciI0CljoSrLb7wn/uHnO2jAv9DJ6OnOXtq6ZiYykYRTXadEZD68YM67AXLpxKwiyIrwK+bFqFwToBmN/LXDpjta7zVKWptrg//7C+trw37N7ZkuvclRmS4KgZ/M3GC4wYQT/PKP9sX6B4/8z3f3SOFpa+aqum4YQmvwRYdrsjQ0rQQQ/D4HwrnUL2Y2urIk9p4Y5XWNhlZZ4t/6dNuyeQ2ulZol7VBZhQbdGHrMKT3GJJ9P/YdnL7751rHLfLfj3a6FixbPDEcSpswhqrT0cM/C8wsrSk6dR1XQSet2Im0vnCbOR9E5qrkZo9HWj985f9Oy1kzGnCy95WeVifwBpJ3QeX2KT3Z3nMCTLw6+Oi8P28x8+2c7+9gMmTLnUnVxMzBckXUGW7UhChtjmDtFaDKRiy9sYXNaRnMtI7bWpddP/btPLXcsUxAx2CEek1gF+qkC/ERytumqKVH11z85FIld+W4lEvGLRvj2pXVWui9l+xr8aWk4Y2UMkIdeZMIAwsUI+uLMcRFWae7U0IsdrjvCbPeIrTWq4534ZH+4hgkjYk9512hLuA0jLaQcDN16c9wMaKr845d6T545P8zfvfjavicO+INBLWWIU7HwsAw299C9QWyWwbJw5CSOnWa2RTKRG75+b3SRSyNmacTW2h9PPPf7w0r93KXzW5lx0XDkqNMCICTHR9ZPz4MhaQVPJqZqktjdFfrez9tH8pQw6jjeu2rFTc3y6f4MfLIb0obhZNhgXoujP4nDJ1kkwRmRX9N6fau/+ZT79ItvjfSpZRidy3Jsa+e+g8f7fCuWLq6VopZlxp26tBsKyYnhxjpFcIkf759qOUxntV95+L2+yJBPzBoUlmUcvcC2tE3imZP9GdQHSLlixMkHLIslnL2Io6eZYUEiClQ37+xf/pV/e+/YuydGejkeRh+3njp99qW3umdcv2JOM3P0vrQTiNl1Gjf88uBPLhgcDOcS9Zf0kN+n/vOr9ut7j4+iJn19EV2etm6+m0kldIs1hYfxT8nywQCHaeHoaZy5yEmQwsFqb/zZ/inff2RvMj6SbE4pxtR5TSbiz+84bIfmLF8wVTZ7TIeiVp0jpLCS5nxY3iNu+Dr76zXJab9Q/71fHBLuKL3fkc7emfOWzavp6U/ZnKE2dKWVj7k1WdF+HOpk0QTjRH6fv0dr+8avjedebSd3TJ3XsaZaSDhvdRw90MWXLl3WpMYsI5mwwgk7EFJ0VboCR47g70ZqLUeYvP6rj1y41Dey5l9aD/dAp75+9Y1V7tlomlX74fddllkJRDjTjSNnmGlBAgVqWndEl3714WMnOk+OvhqF4iuB890XXth7rmX2iuunqK7ek3HkSCascCekmkN6Z4bTsWBvSgoElH/dob2yp3OMdcjo6dPx6s3L6p1UbyLDmqsgDXVxHIaNd07iTA8jQSpnVLfox+0t//iLPelkZcLwig26ZPT0SzuP9MszVy6aqVldluVEjYDh8CrNlAYKAkNMlzojiipnDvRO/u5jJ12nAhNMzl/oleuuXzU1nUzoloOmmsG+xHEphoOdLJZgnCjgD5z3tf3Nr1Mv7dhPojIDRajwyCuJw0dP7OmkhUtWTQpGLD2SsNRYRgkqtk8pinsYbAdHLjLbMS25+euPGT2XRu8cynD4RN/Cm5ZNVbqiCfKpqCoWWQZBONHFjp1llg0Z5K+d/Fp0ydf+/cjp06crVQEPlZ9+0dvb+7td56qmrVw0Q6X0qYzt9qXBmQj7Csv4Tvay3hQF/P5/293y0q5KTot0Xftwl7tx1Vw10xVNsoYqaJq3bAO6gYOd7HwfANIkJuoX/6i98YeP7zbSiSsWO1KMy2Qh28rs2HOsy565csnsoHPaMs1omqUtVPkgK+hLoLOXaRIO9c9+6JdnnUo0/2Ik4vE+0brhBl8mEUtnWEs9uISLEXScYHEdEigYCp1V277+ZPy1nW+P07+FG7+JmPRe55nfH8W8m9ZPr07YeiJlskiKSRyne5ltk6O2fuMJ58LFykx7KcPJsxfrpy++qSHSnzCFYLEEjp5ljoDCyF8/7YWLi/7m3w+eO3duPE7tYXynDff3x17YdU5qWr1kTg1Lnzcs9CWY7SDg9/3f/a0v7By/WdHU0RlbvWJJI85GkoimGAP5ZG7XLf2nndU//tVu0xjHya24CpPcXcfae+D48cSU5cuWVotuy7RUiR1NXvfQ4+ccp8Izn4phW8a7vcqWldOYfoERgqGqTrnta4/3vrn3ICqUdL8MrsZKFwBnz51/9VBm+oL1cxuMjKt+8zfifE/Fxr6GQl8kmvHNXD9HSP7a57pv/NvtHd3dw82N/SGBy75P/cmW//rA6qv1xAwwSf2fn77z3ttXXBP/FGiccTXW2L1/p5vABCYwgQlMYAL/2fH/AdkCEQl+/Ar/AAAAAElFTkSuQmCCCg==', 87 icon: 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAIAAAAAvxIqAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAKJGNVd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJGWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19HvFpgJSpO64PIN5G+fAp30Hc8TziHS4miFhheJbjLMMzHB8POFPqKGKWi6TXtSriJcT9MzH5bAzzHIK1I08t6hq6zHpRdu2aYdJYuk9Q/881bzZa8Xrx6fLmJo/iu4/VXnfH1BB/rmu5ScQvI77m+BkmfxXxvcZcJY14L0DymZp7pML5yTcW61PvIN6JuGr4halQvmjNlCa4bXJ5zj6qhpxrujeKPYMXEd+q00KR5yNAlWZzrF+Ie+uNsdC/MO4tTOZafhbroyXuR3Df08bLiHsQf+ja6gTPWVimZl7l/oUrjl8OcxDWLbNU5D6JRL2gxkDu16fGuC054OMhclsyXTOOFEL+kmMGs4i5kfNuQ62EnBuam8tzP+Q+tSqhz9SuqpZlvR1EfBiOJTSgYMMM7jpYsAEyqJCHDL4dcFFTAwNMlFDUUpQYiadhDmXteeWAw3HEmA2s15k1RmnP4RHuhBybdBOF7MfnICmSQ2SYjIBM3iRvkcMki9IRcnDTthyLz2Ld2fTzPjTQK+Mdg8y5nkZfFO+se9LQr3/09xZr+5GcaSufeAfAww60mAPx+q8u/bAr8rFCLrx7s+vqEkw8qb+p26n11Aruq6m1iJH6PbWGv1VIY25mkNE8PkaQhxfLIF7DZXx80HD/A3l2jLclYs061xNpWCfoB6WHJTjbH0mV35Q/lRXlC+W8cndbl9t2SfhU+Fb4UfhO+F74GWThknBZ+Em4InwjXIyd1ePnY/Psg3pb1TJNu15TMKWMtFt6ScpKL0ivSMXIn9QtDUlj0h7U7N48t3i8eC0GnMC91dX2sTivgloDTgUVeEGHLTizbf5Da9JLhkhh29QOs1luMcScmBXTIIt7xRFxSBxnuJWfuAd1I7jntkyd/pgKaIwVr3MgmDo2q8x6IdB5QH162mcX7ajtnHGN2bov71OU1+U0fqqoXLD0wX5ZM005UHmySz3qLtDqILDvIL+iH6jB9y2x83ok898GOPQX3lk3Itl0A+BrD6D7tUjWh3fis58BXDigN9yF8M5PJH4B8Gr79/F/XRm8m241mw/wvur4BGDj42bzn+Vmc+NL9L8GcMn8F1kAcXjEKMJAAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNC40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrlPw1BAAAd7klEQVR4nO19eZQV13nn797a3tr7yg5ikxCIHRohkACBEFqsJY4z8T52nPHYPp74JJ54bMfOsRMf2Z44OZ7EJ16iDLIsS5ZlydJY+2Ii1haiAQFCNGvTNHS/9/pt9Wq93/xRb+9u6OU1wif9O3Wq6223bv3qu7/vu9+9txqYwAQmMIEJTGACE5jABCbwnxTs/a4AHnjggY0bNwohxl4U5/xnP/tZe3v72Iv6g8fDDz9MlcOHP/zh9/uCAEB+vysA27YBkHAh7KK3aSRlMIDAFcZl13UrW73R4f2nNQvXYGYMjANUROkVyWXZvbBIDcLXOH4VHBGuGVoBgAMMYGAAERhAeekfyC8r+svA3n8nUYxrilYXxAFkScz6sKENlgHkfc5AYmSyMc64dmglEOW4pOyOUSlZxS9Y4RVjIHeEcjy+uGZoJYBErmlTdk/5V0NQxnLkUgXiswrimqEVAIkcTQU685+BioJsyikAkDXbCVqHABWslcpopcJfopIuTIFZMSECQ0GAWBGJA2j13mQspw8MeRumayJczeNaorVMW7MxVqkUgIEox6Yo7CdEYAhQji+UuKxyWgcFA0SWWbompODaoRUD7K40Hri8dJIgIVjRt99fXEu0FhNKpWabbfulYJTthjGAXLqW5PVapRUYwGyuj1AcGGTBQAJiQgQGotDFQkFkBwkGcpZbiAK8nqsgEsC10te6FmglAESCeZFAltPiMGvQSAtALhYAsrSSmLDWLIg8Wt0iQgdoa7nXKupm5TuvwgW5NEFrFp6kilyEVGAWGERSvT0rsWgwkEtZeZ2g1YNnX1llRIHNYlq9Dy6Tc4EgciHcPzwRuP/++9Pp9KuvvuoNk1QKRAQIKjBSrABFx9l2P2jvgIFcCAFyxyNunTVj2h/dt82nad/8zg+G+ZPh0ur3+7/70HdnXTdrz54927dvf+qpp7q7u0dbzxJkaaVSESjYbFHbz3NKJSksIOuySFTSZQX8/lvWrPjQg3dvWr92UktTV/eFH/30kYu9fcP57XBpXbOmbebMGURi1apVq1at+upX/9czTz+9/ZGf79q1a8yjciKrjCgKPEvcF8o7tRggBiRIuCQqE2DNnjXjvrs2P3jvHTfMn6sosmmayWSiqaF2w/q2X/zqt8MpYbi0Pvjgg4xzYaXgpIhrLY31f/aZP//EJz6+e/fu7du3P/3Ms5cuXRrlRQjynHhRp55KDgbpdJUIQDbf6hnsGKw1FAysu3nlnzxw94Z1bfX1dY5tO44BV6gwDVcmId+7dWMlaa2urr5j8+0kXLgW4yoTJukpwSQu+2+5Ze0t69Z9/aunnvnts9t//os9e/aO/MIIwi2JBMqZ9YS1zGXlDgRlIwHhQjijE4F5c2Y9eM8dH7hr8/Vzr+MSt03TTPerkutTuCSrINW2kpaptK1YNG3KpLNdV1a/YdG6fv26GTNnuJbByQWTwRQmSZKwyYoLMya4Nqml4bOf+++f/PhHd+7c9cijjz373O96+4alQQCIBIQrhFuqrQNsVgwwWO/TbEfLJRJCjEyOqsKhDevaPnT/tnVrVtbVVlu27ZhpmVl+iWRNYpIMcIDAFZU5KcdsrK3efNuan2z/1RVLHhatD95/Hxgn12CMgbw0vgBjjKuMXC4M0pOOLklycMNt6zZsuPXUyZO/efq3jz72RPv+t69culegtxXKH0DrQB3wDgi5/quLgt+7AhbMn/PgvVvu2bpp7uyZnDPbNKx0ROW2ooBzCVwCGIQAIxCBQ1EVltZdV7l787qfPvLkFVvklWltbGzccNt6YWUYOeBK9pqLXQqXGeOycMiOuWZEcN/USY3/44uf+/QnP/YfO3c98ugvf/fiy9FobKjyCUTCpWy/s6jkkoNSqS3skR0vIEFCkHAvf7011VWb1q/54/vvXLt6WU11tW2ZrpngyAS5KyscXAI4iCBcMMpOWgBBEJd9CqKm6Vu2aP6cWdOOd54ZK60bb1s/eXKrldEVr7kVsZGj2LMRxrgqMUcSGaEnbV1SpNDmjetu33jric7Op37z7GNP/Lrj0DuD8SqyXU+IrHqW8VvSNSjrdCH7KYmsvA4RCSxaMO/Be7bcs3XDdTOnc8ZsM+2kuzVmKpwYl8A4gKx5gmXbfvYAAIFLqkyGaVZXBbfc2lYBWh+47wMggrCYoiBvU0DBlLIXKbLHTOIS4+SQExHxXof5Zk5p/PKXPv+ZT33s9zvefPTxJ198+fX+eKLAKuWttcxlDTDYEmXIcQoAjMj1rLXMZdXX1tx+25oPfmDrmpVLqsJh28oIIyKTHuK2JDEwzzxF1iVmzbOYU++MHIIpisYyumPL226/+V8efsK5bFh5BVqnTpmybm2bbegcAkzKznIgKr0wkXtHZAc/iAAwLktMSCIjMklHl/xSeNuWW7du3nj8vfd+/fRzv3zymSPHjgPw4k0ityhuHZTZPK2D9LgYuQRBJNyc11qy6Po/uueOu7asnzl9GgM5ZkKkzviZoXABzzwJIBdMADyXEfemKnnH3mwwBpY9KVc0hSVM01w0f9YN82YdPPLe6GndvOm2pqYGQ0+qipQjseiCy7qSVEqHRzTjXFI4OYrb5yZ6BfPNmd70lb/8/H/79Eff2LHz4UceD/h9wnUgRDmVA5kt7hqIXMo1a7ACwhWO01BX88cf2PpfHty2avnicDDgWDrpFxSk/MzmHGBSzr95I7gsSxwxMAbGQBxEYLl9Yd4CgUk+hWUyZtAf2Lph9eVpvdyMMMbYs089dsfmjbaR0nwhICthOZPMbdmXOUdMBLjZg8KnORUWthC2Q7LLw5K/1rJhGBlVVbmTCIme3J27jPvK39ocoV7YKpwENTtyfSaTqQqHOBPCjMsirrGMxAisaNJc9oCVHGT3vGjPAF7yDpfITvdG01wJH363c+uffskwraGou5y1zr5u1uoVSy0jI3MGzpF3CESFrcRsaWhNyHk2xjlXVHIh+pxkrwyfxqtclzMigmBe4UPSivLj3I6RICJBIqQJnjmnIqkwh/Gcz/ES5IUpiGzAxnPdNZ4z5LywMoDAOASYrGk8plvW/FlTFi+YvXv/kdHQeueWjbU11YaelNRAzsGW+qtyTUCRBytuy6LoHuQsl0myRDLpqptwhOxCAs9rqyj9eZk4oLQO3idCdmM+iqtM53nz9NpNfg4s5ayVsQK/xLPBMssJQj6uyjLLCxVgkk9T0knDFwjcuWHVaGiVJeneu7Y4tsVATFJzjRrZRsGkrBV4zV84gAPk55rJhebPvD6lneUUZVwzzmWVuSCzkJwelNlifoGi9gGAGEOIp4rUMN8pYIWDPJtULAI5YSWWlVTPeIlyFFPhJUHVfFKy3zLljWsWPxTwp/TMyGi94fp5S2+60TIzmqqAK1lCyYGdgHEJ+jlkeqB3I9MFMwonBWHBixaYDK5BqYIShlYPtR5qPbQGyAFwDRAQTqny5oKY7LG4HLNsqN6Bd0fzg4zFhKJgsN5Bll9WOChQyQr+iigXJOReCmKy6pPchG3Omtq84qZ5r+06MDJa7966KRTwZwxD0kIw+hB/B5G30H8QyfeQPgs7CVE6U7d4CmUxOMBlKGH4WhCYjPBchGbBPwVKFZgMYQFOSc+isC8S2WJmB0lxFZ14YAWGVFWAeM6JFcWqlJvmhXw8kL/xAJP9fiWRMWUlsO225SOjVVXVbXdstB3B4wfZwR8jfgiZbm9MpETlhwlyYMZgxNB/FHgZnEFrRGg2ahai5kb4WsEVCCvX0Sp2WZcV2QKzrNxy84QWuGalNpu3guIDzzsxEM/63oIs5E4toGh+hfWZlrxu5Q211aFYPDVcWpfedOON82dbtu07sx3nXoAMMEAaNo8DwQrXCBCMS8hcQu9OyBpCs1G/HLVL4WsGOMgqUl5RwmNJQrbIa5U4MZQ2HFa6L9PWHJvFzT8byeZdmWe2yPcLmKT6VYrp1pTm2jVL5z/32iDLwAan6rOf+si6taudZLev8/uM9MtGt6NC3mLIRaYXsQ707kD6JJgMrR5czWW1Sw22oLmicFDwhKUDt1lac28ylN+M4o0V3R42YI+8TXg/55ysVNqQZcVx3f/3+lsDr28Qaw0GA1s23mLarhTbzY3eETT20cEr30mjdw/69iA0E03rUbccchCuVS61JRRjQGCAIXWgzGAHD12pYLnFCpv3ltnvQPUFVClhWmbb4tnNDTUX+/rLrmkQa13btvxzn/pTx3H8p34o6acrb6qDIn91Vj+iB9D/NiDga4akFSVSS0W2kJbNezYxiCWiKH4o2CYKRoqylyh6M49SlyjJZCXTGVETDhzpPH/kRFfZ1Qxiivdu3SjLEqwos/rAclW9avDsJnMBpx7Fse8hsjuX3i7rK3sKkGfcBTyP5w6yCe99J7sXInec/0L+uLgXXlaOyKVmBFxTljiERcLdesvCgYvCyq21vq7277/2xYBPcUmyGjba1ctJDjA3ye1EiQ8Yb3iWaycQexv6afiaoNYOYrPFCuvZLyu24sGkEwXnM0iSM29BeYvOvvT8mG0Z6VS8Pxrpj6dcIsZITGqpf+a1t+NJvbj65dpaU1PTr4sWpgb8ZJrMrl5pVa9mdkxJHVajv1fi+ySjuxCNjDe8U/QfReokmtajcT0kDcIq19ZiOkRx+82FBPluqxdpZV96LTUfsRYrbD4lyMEIwrIsR8/YaUOYFhPEOGc+nyakQHfMfvPAKcMub86DcOMPBJctWXzX1k0bb1k5e3qzyoVlmrZgIMacmJI8rMb+Q020S2bP1eMXgABC0zH5bgSmQtil6RgM5rtQFJaiaPVmPmWFLI8exWVJLAYIsmxHN9y0CdOWXMEkiWmaRrK/O+buPnT2+df37W7viEUHGQy9HCWBYGjZ0sXbNm/YtG7ldVMbFeaYpukIBjBmx+TUEV//m2qyXTIvXSV+CZA0tNyO+lUA5TJqZfkt76v5lFXRz7MdqhyhJblBno1bGSCEabm6ibTJTVcWgnHONE2D7L8QFzs7zjz/RvvetzqikcsNLQ+LiVAovHz50js337rx5uUzJ9fJcEzTyPOrpo9o8Z1a8m3J6h13fj2aapegdQskX26tvCgIAkoNtpjZgoWiQKuXnQFBkGmLtMl1SzZdxSUmsSybPQnadfDM82+8tbu9IxrpHU41R0ZAuKp6xfKl225ff9vNS6a31Mhk5+2X21FFP+KL79bSHZLVN778CiA4FVPugVoHYZcSStkeUZmdUqm1slyClYRpU9qS05ZquqogLnFoqgol0JOgXYfOvfBG++72jkjfsNgsPuFoUFVds3LF0m2333rr6oXTmqs4WZZh2h6/TlRNH/Un92rpg5IdGdt5hgYBai0m3w3/lFzWsTgILRNZrw4sqwwgEmTZSFtK2tZMVxPEOSefpkEO9CRo9+FzL/x+/659HZG+Uc6AGuvlVtfUrlq5bNumdetWLpjaFOaukbNfcCem6cd8qX0+/bBkRytxtlIQIPsx6S6EZmXDg9IkbHZNYtZIyWPTdFjaUnXbbwgtZ5sKU4IXE9j9zrnn39i/u72jr3e088lyqNiF1tTWrV65bNumW25ZccOUBj9cwzQMhyQQSU5Myxzzp9p9maOSE6vkaT0n1roFoTmlNlv8DUFCmLaUtrW07TeFTxCXGGmaytTgxQT2HDn//Bv7d+07MHY286i8+NXW1betXHbnprVrl82bXOeHq5uG6RAHSLKjmvFuIH3AZxyR3HhlzkcAV9C6BaHZEFbuLQJAwjVsnra1tBOwXJ8LLjFomsKU4KUk9h7pfmHH2zv3Hui9dLEyNSnCOMZEdfUNa1Yvv3PjzTcvnt1aq1qZpG074DKE3dLzkM94r6I2q6J1CwLTiz2YcO2uRH1a1HLmSpxrgareFPYevfDCjgM79x64dLGnQqcfBFcjlG9oaFq9atmXPrF1drNmu7y2/8ma+PPjo7NboTVCONm3GExTnE22giu9Kf7dR/fs2nfgYs+Fip54cIx31g8A+vouvXfkQLWccYgH0vuqEy+NSwLXyaDnFVj9YJRPoGiq0+S7IFwnLOvxC+9eHU4xtoz/cFFbFfzJ331mxtRWlulqivxUEplxaSQMcE1YUQSn5YYLCUQ+2XZs02Hhm2+asWP/yUhcv3JRY8a408oY+9YXP7ipbaFppJqjD2t29zgKDwPsFIQF/6RszhAEICDrKZ35/eEFsxqf33ncssd90fG40/qRe9d+/sO3G5Zbl3gmnNk/7mLOACsCOQC1Nve4IcE480vpaEqZ3FRXHVJff+vUOFdinGldcv2M7//Vh7ikBvX2huSzjF2tfLjRC18zJBVwvTFwWRYK9IjuWzS7uTemHz5ZsRB1UIwjrXXVwX/+2kcmN9dzs6s18XNO5vidqxzChZNCYFJhDJHIp9iObacs36oFre3HLlzoG2QgulIYL1o5Y9/6wn23rZxvGqnW5KOqc+kqpWU9MMBOg6vQaiGc7AgCQ1DNJHXGJf+S2Y0vt59OG5VcDlmM8aL1o/e0ffZD6zOW25j+Xdg8dFU59cAAKw5/E7iUHxtnHAFFj6TkxprQpMbgK+1nhRgXXRoXWpfdMP2hv7iPMTlk7G/KvPg+cOpBuCAbvgbAzU/LlWWhwuhLaXOn1tiOaD82LiJbeVrra0I//OsPtjTUSGbXJP1JjiHn1g4fBObCx71JicOHJwVqFSStMEWDyKfZruP069ryufXHz/Wf7kmOvYZlqDCtnLNvf+6utUuvs8zU5MyTmohc+TfDQIJd183XVtNJjhGGnEQQJnz12bHu7KA3hTQjlWGuUJfNrdtxsKc/VYF7X4wK0/qxu1f+2QOrM6bbYr4Udt6tSJk2AmfZBh2NAAujfKLDFcAA14AczAVb3ui3YJyCqh5JKOGgOnty+OX9F2ynkg8oqyStyxdM/fvP30lMqrY7mqw3KlXsebQl0crI1NHoR9THRphRJIAs+Gqy8oqcyCpC40ZvXJveHPCr0puHRzascnlUjNaGmuA//dU9TXXVitU9xXp2xDo4BGI0s4dukmVFVv2upaepqYadldhIAiMGuBYUPyRvAVQu3iLh1yzhuNGUsmhWuCdqvNtVMZGtDK0SZ9/+7Ja2hdMcMznV+q1K5VO9RgcLwTNiraJoz3ck955yls/UdJMsBGt5F8NIAiMCIKAGQE7OYL2NQj4jpTPDkpbPDe873t8br4zIVobWT9y97JP3LDFMp9V5vYoq1eNmZ90VGTREDPVLP3jx1Z2Hbm5b0RpIJu2QDCvEoyMpCRA2VB84gRzABhwv6mJMhLRMJKFqsnTjjMArB6KGVQGRrQCtqxZM+daf3yZIqnEONou9Yy/QQ8Sd2ePMUzXtO788tq/juOvYh08n7ly3ULEjSVEX5n0qN0ZQHBE4QeagHKdwAAfkyIrjk81Lca2lRmmslt84FB84aDtSjJXWxtrgD/5iS311UHW6p4lXRhwADQGTQqesFYqqvPKO+Y+PvE4kAPT1RVJUs2Fxo5nRdVFdJ1/gbNiWxQC4UBhgAhZgASZgAzbI8fsM4VJfUp0/WdNN9+DpseZkx0SrJPFvf+bWlTe0OlZqOr2soTKST2Cn7SWGqIrZvr/84Y54vOD63zl+dsacBTe0WClDEiTVKMN9GAQACIJsg9s5g/U2G8wCOeFAOq3L6Yy89DrtaFemKzKmdMGYBl0+vm3hllXTM4bZSrsDGMkVXha99rSY1aCoyv95uvPc+ZJhEhLOd37y4ul0k8rNi2ZzxGoaQc+YADu3uqx4E4AQnNmzWroVnpK58+X7aifVjekJYaO31tU3TvrGJ9oEsTpxpIV1jKUSxciI0CljoSrLb7wn/uHnO2jAv9DJ6OnOXtq6ZiYykYRTXadEZD68YM67AXLpxKwiyIrwK+bFqFwToBmN/LXDpjta7zVKWptrg//7C+trw37N7ZkuvclRmS4KgZ/M3GC4wYQT/PKP9sX6B4/8z3f3SOFpa+aqum4YQmvwRYdrsjQ0rQQQ/D4HwrnUL2Y2urIk9p4Y5XWNhlZZ4t/6dNuyeQ2ulZol7VBZhQbdGHrMKT3GJJ9P/YdnL7751rHLfLfj3a6FixbPDEcSpswhqrT0cM/C8wsrSk6dR1XQSet2Im0vnCbOR9E5qrkZo9HWj985f9Oy1kzGnCy95WeVifwBpJ3QeX2KT3Z3nMCTLw6+Oi8P28x8+2c7+9gMmTLnUnVxMzBckXUGW7UhChtjmDtFaDKRiy9sYXNaRnMtI7bWpddP/btPLXcsUxAx2CEek1gF+qkC/ERytumqKVH11z85FIld+W4lEvGLRvj2pXVWui9l+xr8aWk4Y2UMkIdeZMIAwsUI+uLMcRFWae7U0IsdrjvCbPeIrTWq4534ZH+4hgkjYk9512hLuA0jLaQcDN16c9wMaKr845d6T545P8zfvfjavicO+INBLWWIU7HwsAw299C9QWyWwbJw5CSOnWa2RTKRG75+b3SRSyNmacTW2h9PPPf7w0r93KXzW5lx0XDkqNMCICTHR9ZPz4MhaQVPJqZqktjdFfrez9tH8pQw6jjeu2rFTc3y6f4MfLIb0obhZNhgXoujP4nDJ1kkwRmRX9N6fau/+ZT79ItvjfSpZRidy3Jsa+e+g8f7fCuWLq6VopZlxp26tBsKyYnhxjpFcIkf759qOUxntV95+L2+yJBPzBoUlmUcvcC2tE3imZP9GdQHSLlixMkHLIslnL2Io6eZYUEiClQ37+xf/pV/e+/YuydGejkeRh+3njp99qW3umdcv2JOM3P0vrQTiNl1Gjf88uBPLhgcDOcS9Zf0kN+n/vOr9ut7j4+iJn19EV2etm6+m0kldIs1hYfxT8nywQCHaeHoaZy5yEmQwsFqb/zZ/inff2RvMj6SbE4pxtR5TSbiz+84bIfmLF8wVTZ7TIeiVp0jpLCS5nxY3iNu+Dr76zXJab9Q/71fHBLuKL3fkc7emfOWzavp6U/ZnKE2dKWVj7k1WdF+HOpk0QTjRH6fv0dr+8avjedebSd3TJ3XsaZaSDhvdRw90MWXLl3WpMYsI5mwwgk7EFJ0VboCR47g70ZqLUeYvP6rj1y41Dey5l9aD/dAp75+9Y1V7tlomlX74fddllkJRDjTjSNnmGlBAgVqWndEl3714WMnOk+OvhqF4iuB890XXth7rmX2iuunqK7ek3HkSCascCekmkN6Z4bTsWBvSgoElH/dob2yp3OMdcjo6dPx6s3L6p1UbyLDmqsgDXVxHIaNd07iTA8jQSpnVLfox+0t//iLPelkZcLwig26ZPT0SzuP9MszVy6aqVldluVEjYDh8CrNlAYKAkNMlzojiipnDvRO/u5jJ12nAhNMzl/oleuuXzU1nUzoloOmmsG+xHEphoOdLJZgnCjgD5z3tf3Nr1Mv7dhPojIDRajwyCuJw0dP7OmkhUtWTQpGLD2SsNRYRgkqtk8pinsYbAdHLjLbMS25+euPGT2XRu8cynD4RN/Cm5ZNVbqiCfKpqCoWWQZBONHFjp1llg0Z5K+d/Fp0ydf+/cjp06crVQEPlZ9+0dvb+7td56qmrVw0Q6X0qYzt9qXBmQj7Csv4Tvay3hQF/P5/293y0q5KTot0Xftwl7tx1Vw10xVNsoYqaJq3bAO6gYOd7HwfANIkJuoX/6i98YeP7zbSiSsWO1KMy2Qh28rs2HOsy565csnsoHPaMs1omqUtVPkgK+hLoLOXaRIO9c9+6JdnnUo0/2Ik4vE+0brhBl8mEUtnWEs9uISLEXScYHEdEigYCp1V277+ZPy1nW+P07+FG7+JmPRe55nfH8W8m9ZPr07YeiJlskiKSRyne5ltk6O2fuMJ58LFykx7KcPJsxfrpy++qSHSnzCFYLEEjp5ljoDCyF8/7YWLi/7m3w+eO3duPE7tYXynDff3x17YdU5qWr1kTg1Lnzcs9CWY7SDg9/3f/a0v7By/WdHU0RlbvWJJI85GkoimGAP5ZG7XLf2nndU//tVu0xjHya24CpPcXcfae+D48cSU5cuWVotuy7RUiR1NXvfQ4+ccp8Izn4phW8a7vcqWldOYfoERgqGqTrnta4/3vrn3ICqUdL8MrsZKFwBnz51/9VBm+oL1cxuMjKt+8zfifE/Fxr6GQl8kmvHNXD9HSP7a57pv/NvtHd3dw82N/SGBy75P/cmW//rA6qv1xAwwSf2fn77z3ttXXBP/FGiccTXW2L1/p5vABCYwgQlMYAL/2fH/AdkCEQl+/Ar/AAAAAElFTkSuQmCCCg==',
92 // icon4: 'jqtouch4.png', 88 // icon4: 'jqtouch4.png',
93 // startupScreen: null, //Pass a string path to a 320px x 460px startup screen for full screen apps. 89 // startupScreen: null, //Pass a string path to a 320px x 460px startup screen for full screen apps.
94 statusBar: 'black-translucent', //Styles the status bar when running as a fullscreen app. Other options are `default`, `black`, and `black-translucent`. 90 statusBar: 'black-translucent', //Styles the status bar when running as a fullscreen app. Other options are `default`, `black`, and `black-translucent`.
95 // addGlossToIcon: true, //Set to 'false' to prevent automatic glossy button effect on icon. 91 // addGlossToIcon: true, //Set to 'false' to prevent automatic glossy button effect on icon.
96 preloadImages: false, //Pass an array of image paths to load them before page loads. Ex: `['images/link_over.png', 'images/link_select.png']` 92 preloadImages: false, //Pass an array of image paths to load them before page loads. Ex: `['images/link_over.png', 'images/link_select.png']`
97 fixedViewport: true, //Removes the user's ability to scale the page. Ensures the site behaves more like an application. 93 fixedViewport: true, //Removes the user's ability to scale the page. Ensures the site behaves more like an application.
98 // fullScreen: true, //The website will become a fullscreen application when saved to a user's home screen. Set to `false` to disable. 94 // fullScreen: true, //The website will become a fullscreen application when saved to a user's home screen. Set to `false` to disable.
99 // fullScreenClass: 'fullscreen' //Adds a class to the `<body>` when running in full-screen mode, to allow for easy detection and styling. Set to `false` to disable. 95 // fullScreenClass: 'fullscreen' //Adds a class to the `<body>` when running in full-screen mode, to allow for easy detection and styling. Set to `false` to disable.
100 // themeSelectionSelector: '#jqt #themes ul', //??? 96 // themeSelectionSelector: '#jqt #themes ul', //???
101 97
102 // useAnimations: true, //Set to `false` to disable all animations. 98 // useAnimations: true, //Set to `false` to disable all animations.
103 // useFastTouch: true, //Removes ~350ms onClick delay when tapping a link (use in conjunction with the .tap() event) **Experimental** 99 // useFastTouch: true, //Removes ~350ms onClick delay when tapping a link (use in conjunction with the .tap() event) **Experimental**
104 // useTouchScroll: true, //Adds support for iOS5 scrolling. Set to false to disable. **Experimental** 100 // useTouchScroll: true, //Adds support for iOS5 scrolling. Set to false to disable. **Experimental**
105 101
106 cacheGetRequests: false, //Automatically caches GET requests, so subsequent taps reference the pre-loaded views. (default: true) 102 cacheGetRequests: false, //Automatically caches GET requests, so subsequent taps reference the pre-loaded views. (default: true)
107 103
108 // backSelector: '.back, .cancel, .goback', //A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used. 104 // backSelector: '.back, .cancel, .goback', //A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used.
109 105
110 // cubeSelector: '.cube', //Link selector for a cube animation. 106 // cubeSelector: '.cube', //Link selector for a cube animation.
111 // dissolveSelector: '.dissolve', //Link selector for a dissolve animation. 107 // dissolveSelector: '.dissolve', //Link selector for a dissolve animation.
112 // fadeSelector: '.fade', //Link selector for a fade animation. 108 // fadeSelector: '.fade', //Link selector for a fade animation.
113 // flipSelector: '.flip', //Link selector for a 3d flip animation. 109 // flipSelector: '.flip', //Link selector for a 3d flip animation.
114 formSelector: null, //Sets which forms are automatically submitted via Ajax. (default: 'form') 110 formSelector: null, //Sets which forms are automatically submitted via Ajax. (default: 'form')
115 // popSelector: '.pop', //Link selector for a pop animation. (default: '.pop') 111 // popSelector: '.pop', //Link selector for a pop animation. (default: '.pop')
116 // slideSelector: 'body > * > ul li a', //Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector `'li &gt; a, a:not(.dontslide)'`, etc. (default: 'body > * > ul li a') 112 // slideSelector: 'body > * > ul li a', //Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector `'li &gt; a, a:not(.dontslide)'`, etc. (default: 'body > * > ul li a')
117 // slideupSelector: '.slideup', //Link selector for a slide up animation. (default: '.slideup') 113 // slideupSelector: '.slideup', //Link selector for a slide up animation. (default: '.slideup')
118 // submitSelector: '.submit', //Selector which, when clicked, will submit its parent form (and close keyboard if open). (default: '.submit') 114 // submitSelector: '.submit', //Selector which, when clicked, will submit its parent form (and close keyboard if open). (default: '.submit')
119 // swapSelector: '.swap', //Link selector for 3d swap animation. (default: '.swap') 115 // swapSelector: '.swap', //Link selector for 3d swap animation. (default: '.swap')
120 // touchSelector: 'a, .touch', //Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like `swipe` (default: 'a, .touch') 116 // touchSelector: 'a, .touch', //Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like `swipe` (default: 'a, .touch')
121 117
122 debug: false 118 debug: false
123 }); 119 });
124 120
125 this.setJQTouch(jqt); 121 this.setJQTouch(jqt);
126 }, 122 },
127 123*/
128 //========================================================================= 124 //=========================================================================
129 125
130 'showAddToHomeScreenBaloon': function () { 126 'showAddToHomeScreenBaloon': function () {
131console.log(">>> showAddToHomeScreenBaloon");
132 }, 127 },
133 128
134 //------------------------------------------------------------------------- 129 //-------------------------------------------------------------------------
135 130
136 'selectInitialProxy': function () { 131 'selectInitialProxy': function () {
137//console.log(">>> selectInitialProxy");
138 if (this.isOnline()) { 132 if (this.isOnline()) {
139//console.log("--- selectInitialProxy: using default proxy");
140 this._proxy = Clipperz.PM.Proxy.defaultProxy; 133 this._proxy = Clipperz.PM.Proxy.defaultProxy;
141 } else { 134 } else {
142 if (this.hasLocalData()) { 135 if (this.hasLocalData()) {
143//console.log("--- selectInitialProxy: using local cache proxy");
144 this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false}); 136 this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false});
145 } else { 137 } else {
146 this.showOfflineError(); 138 this.showOfflineError();
147 } 139 }
148 } 140 }
149 }, 141 },
150 142
151 //------------------------------------------------------------------------- 143 //-------------------------------------------------------------------------
152 144
153 'showLoginForm': function (args) { 145 'showLoginForm': function (args) {
154 args = args || {}; 146 args = args || {};
155 147
156 args['callback'] = MochiKit.Base.method(this, 'doLogin'); 148 args['callback'] = MochiKit.Base.method(this, 'doLogin');
157 149
158 if (Clipperz.PM.PIN.isSet()) { 150 if (Clipperz.PM.PIN.isSet()) {
159 args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedPinLogin'); 151 args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedPinLogin');
160 this.loginForm().showPinLogin(args); 152 this.loginForm().showPinLogin(args);
161 } else { 153 } else {
162 args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedCredentialsLogin'); 154 args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedCredentialsLogin');
163 this.loginForm().showCredentialsLogin(args); 155 this.loginForm().showCredentialsLogin(args);
164 } 156 }
165 }, 157 },
166 158
167 //......................................................................... 159 //.........................................................................
168 160
169 'handleFailedCredentialsLogin': function () { 161 'handleFailedCredentialsLogin': function () {
170console.log("LOGIN FAILED");
171 this.showLoginForm({'previousFailedAttempt':'LOGIN'}); 162 this.showLoginForm({'previousFailedAttempt':'LOGIN'});
172 }, 163 },
173 164
174 //......................................................................... 165 //.........................................................................
175 166
176 'handleFailedPinLogin': function () { 167 'handleFailedPinLogin': function () {
177 varfailedAttempts; 168 varfailedAttempts;
178 varstatus; 169 varstatus;
179 170
180 failedAttempts = Clipperz.PM.PIN.recordFailedAttempt(); 171 failedAttempts = Clipperz.PM.PIN.recordFailedAttempt();
181 this.showLoginForm({'previousFailedAttempt':'PIN', 'failedAttempts': failedAttempts}); 172 this.showLoginForm({'previousFailedAttempt':'PIN', 'failedAttempts': failedAttempts});
182 }, 173 },
183 174
184 //------------------------------------------------------------------------- 175 //-------------------------------------------------------------------------
185 176
186 'doLogin': function (someArgs) { 177 'doLogin': function (someArgs) {
187 var deferredResult; 178 var deferredResult;
188 var credentials; 179 var credentials;
189 var errorCallback; 180 var errorCallback;
190 var user; 181 var user;
191 var getPassphraseDelegate; 182 var getPassphraseDelegate;
192 183
193//console.log(">>> MainController.doLogin", someArgs);
194 credentials = someArgs['credentials']; 184 credentials = someArgs['credentials'];
195 errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop; 185 errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop;
196 186
197 getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, credentials.passphrase); 187 getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, credentials.passphrase);
198 user = new Clipperz.PM.DataModel.User({'username':credentials.username, 'getPassphraseFunction':getPassphraseDelegate}); 188 user = new Clipperz.PM.DataModel.User({'username':credentials.username, 'getPassphraseFunction':getPassphraseDelegate});
199 189
200 deferredResult = new Clipperz.Async.Deferred('MainController.doLogin', {trace:false}); 190 deferredResult = new Clipperz.Async.Deferred('MainController.doLogin', {trace:false});
201 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); 191 deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4});
202 deferredResult.addCallback(MochiKit.Async.wait, 0.1); 192 deferredResult.addCallback(MochiKit.Async.wait, 0.1);
203 deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); 193 deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection');
204 deferredResult.addMethod(user, 'login'); 194 deferredResult.addMethod(user, 'login');
205 deferredResult.addCallbacks( 195 deferredResult.addCallbacks(
206 MochiKit.Base.method(this, 'processSuccessfulLogin', user), 196 MochiKit.Base.method(this, 'processSuccessfulLogin', user),
207 errorCallback 197 errorCallback
208 ); 198 );
209 deferredResult.callback(); 199 deferredResult.callback();
210 200
211 return deferredResult; 201 return deferredResult;
212 }, 202 },
213 203
214 //.......................................................................... 204 //..........................................................................
215 205
216 'processSuccessfulLogin': function (aUser) { 206 'processSuccessfulLogin': function (aUser) {
217 var deferredResult; 207 var deferredResult;
218 208
219 deferredResult = new Clipperz.Async.Deferred('MainController.processSuccessfulLogin', {trace:false}); 209 deferredResult = new Clipperz.Async.Deferred('MainController.processSuccessfulLogin', {trace:false});
220 deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); 210 deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount');
221 // deferredResult.addMethod(this, 'removeLoginForm'); 211 // deferredResult.addMethod(this, 'removeLoginForm');
222 deferredResult.addMethod(this, 'setUser', aUser); 212 deferredResult.addMethod(this, 'setUser', aUser);
223 deferredResult.addMethod(this, 'setupApplication'); 213 deferredResult.addMethod(this, 'setupApplication');
224 deferredResult.addMethod(this, 'runApplication'); 214 deferredResult.addMethod(this, 'runApplication');
225 deferredResult.callback(); 215 deferredResult.callback();
226 216
227 return deferredResult; 217 return deferredResult;
228 }, 218 },
229 219
230 //------------------------------------------------------------------------- 220 //-------------------------------------------------------------------------
231 221
232 'setupApplication': function () { 222 'setupApplication': function () {
233 vardeferredResult; 223 vardeferredResult;
234 224
235console.log(">>> setupApplication");
236 deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false}); 225 deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false});
237 deferredResult.addMethod(this, 'welcomeFirstTimeUser'); 226 deferredResult.addMethod(this, 'welcomeFirstTimeUser');
238 deferredResult.addMethod(this, 'showPaymentReminder'); 227 deferredResult.addMethod(this, 'showPaymentReminder');
239 deferredResult.addMethod(this, 'copyDataLocally'); 228 deferredResult.addMethod(this, 'copyDataLocally');
240 deferredResult.callback(arguments); 229 deferredResult.callback(arguments);
241 230
242 return deferredResult; 231 return deferredResult;
243 }, 232 },
244 233
245 234
246 //.......................................................................... 235 //..........................................................................
247 236
248 'isFirstTimeUser': function () { 237 'isFirstTimeUser': function () {
249 return false; 238 return false;
250 }, 239 },
251 240
252 'welcomeFirstTimeUser': function () { 241 'welcomeFirstTimeUser': function () {
253 vardeferredResult; 242 vardeferredResult;
254 243
255 deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false}); 244 deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false});
256 245
257 if (this.isFirstTimeUser()) { 246 if (this.isFirstTimeUser()) {
258 deferredResult.addCallback(function () { console.log("--> welcome"); }); 247 deferredResult.addCallback(function () { Clipperz.log("--> welcome"); });
259 } 248 }
260 deferredResult.callback(); 249 deferredResult.callback();
261 250
262 return deferredResult; 251 return deferredResult;
263 }, 252 },
264 253
265 //.......................................................................... 254 //..........................................................................
266 255
267 'shouldShowPaymentReminder': function () { 256 'shouldShowPaymentReminder': function () {
268 return true; 257 return true;
269 }, 258 },
270 259
271 'showPaymentReminder': function () { 260 'showPaymentReminder': function () {
272 vardeferredResult; 261 vardeferredResult;
273 262
274 deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false}); 263 deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false});
275 264
276 if (this.shouldShowPaymentReminder()) { 265 if (this.shouldShowPaymentReminder()) {
277 deferredResult.addCallback(function () { console.log("--> payment reminder"); }); 266 deferredResult.addCallback(function () { Clipperz.log("--> payment reminder"); });
278 } 267 }
279 deferredResult.callback(); 268 deferredResult.callback();
280 269
281 return deferredResult; 270 return deferredResult;
282 }, 271 },
283 272
284 //.......................................................................... 273 //..........................................................................
285 274
286 'canCopyDataLocally': function () { 275 'canCopyDataLocally': function () {
287 return false; 276 return false;
288 }, 277 },
289 278
290 'copyDataLocally': function () { 279 'copyDataLocally': function () {
291 vardeferredResult; 280 vardeferredResult;
292 281
293 deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false}); 282 deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false});
294 283
295 if (this.canCopyDataLocally()) { 284 if (this.canCopyDataLocally()) {
296 deferredResult.addCallback(function () { console.log("--> copy data locally"); }); 285 deferredResult.addCallback(function () { Clipperz.log("--> copy data locally"); });
297 } 286 }
298 deferredResult.callback(); 287 deferredResult.callback();
299 288
300 return deferredResult; 289 return deferredResult;
301 290
302 }, 291 },
303 292
304 //------------------------------------------------------------------------- 293 //-------------------------------------------------------------------------
305 294
306 'runApplication': function () { 295 'runApplication': function () {
307 var deferredResult; 296 var deferredResult;
308 297
309//console.log(">>> runApplication");
310 deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true}); 298 deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true});
311 deferredResult.addMethod(this.user(), 'getRecords'); 299 deferredResult.addMethod(this.user(), 'getRecords');
312 deferredResult.addMethod(this, 'showCards'); 300 deferredResult.addMethod(this, 'showCards');
313 deferredResult.callback(); 301 deferredResult.callback();
314 302
315 return deferredResult; 303 return deferredResult;
316 }, 304 },
317 305
318 //========================================================================= 306 //=========================================================================
319 307
320 'showOfflineError': function (anException) { 308 'showOfflineError': function (anException) {
321 alert("Error: " + anException); 309 alert("Error: " + anException);
322 throw anException; 310 throw anException;
323 }, 311 },
324 312
325 //========================================================================= 313 //=========================================================================
326 314
327 'isOnline': function() { 315 'isOnline': function() {
328 return navigator.onLine; 316 return navigator.onLine;
329 }, 317 },
330 318
331 'hasLocalData': function() { 319 'hasLocalData': function() {
332 return false; 320 return false;
333 }, 321 },
@@ -341,53 +329,53 @@ console.log(">>> setupApplication");
341 329
342 return this._loginForm; 330 return this._loginForm;
343 }, 331 },
344 332
345 'removeLoginForm': function () { 333 'removeLoginForm': function () {
346 if (this._loginForm != null) { 334 if (this._loginForm != null) {
347 this._loginForm.remove(); 335 this._loginForm.remove();
348 this._loginForm = null; 336 this._loginForm = null;
349 } 337 }
350 }, 338 },
351 339
352 //------------------------------------------------------------------------- 340 //-------------------------------------------------------------------------
353 341
354 'cardList': function () { 342 'cardList': function () {
355 if (this._cardList == null) { 343 if (this._cardList == null) {
356 this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:MochiKit.DOM.getElement('cardList')}); 344 this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:MochiKit.DOM.getElement('cardList')});
357 MochiKit.Signal.connect(this._cardList, 'selectedCard', this, 'selectCardHandler'); 345 MochiKit.Signal.connect(this._cardList, 'selectedCard', this, 'selectCardHandler');
358 } 346 }
359 347
360 return this._cardList; 348 return this._cardList;
361 }, 349 },
362 350
363 'showCards': function (someCards) { 351 'showCards': function (someCards) {
364 this.cardList().showCards(someCards); 352 this.cardList().showCards(someCards);
365 this.jQTouch().goTo('#cardList', 'slideleft'); 353 // this.jQTouch().goTo('#cardList', 'slideleft');
366 }, 354 },
367 355
368 //------------------------------------------------------------------------- 356 //-------------------------------------------------------------------------
369 357
370 'cardDetail': function () { 358 'cardDetail': function () {
371 if (this._cardDetail == null) { 359 if (this._cardDetail == null) {
372 this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:MochiKit.DOM.getElement('cardDetail')}); 360 this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:MochiKit.DOM.getElement('cardDetail')});
373 } 361 }
374 362
375 return this._cardDetail; 363 return this._cardDetail;
376 }, 364 },
377 365
378 'selectCardHandler': function (aCardReference) { 366 'selectCardHandler': function (aCardReference) {
379 var deferredResult; 367 var deferredResult;
380 368
381 deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true}); 369 deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true});
382 deferredResult.addMethod(this.cardDetail(), 'render'); 370 deferredResult.addMethod(this.cardDetail(), 'render');
383 deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft'); 371 // deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft');
384 deferredResult.addMethod(this.user(), 'getRecord', aCardReference); 372 deferredResult.addMethod(this.user(), 'getRecord', aCardReference);
385 deferredResult.addMethod(this.cardDetail(), 'showCard'); 373 deferredResult.addMethod(this.cardDetail(), 'showCard');
386 deferredResult.callback(); 374 deferredResult.callback();
387 375
388 return deferredResult; 376 return deferredResult;
389 }, 377 },
390 378
391 //========================================================================= 379 //=========================================================================
392 __syntaxFix__: "syntax fix" 380 __syntaxFix__: "syntax fix"
393}); 381});
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 d6b0574..82c8dfd 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { 26Clipperz.PM.UI.Web.Components.AccountPanel = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments);
32 30
33 //this._initiallySelectedTab = args.selected || 'ACCOUNT'; 31 //this._initiallySelectedTab = args.selected || 'ACCOUNT';
34 this._initiallySelectedTab = args.selected || 'PASSPHRASE'; 32 this._initiallySelectedTab = args.selected || 'PASSPHRASE';
35 this._tabPanelControllerConfiguration = { 33 this._tabPanelControllerConfiguration = {
36 // 'ACCOUNT': { 34 // 'ACCOUNT': {
37 // tab:'accountTab', 35 // tab:'accountTab',
38 // panel:'accountPanel' 36 // panel:'accountPanel'
39 // }, 37 // },
40 'PASSPHRASE': { 38 'PASSPHRASE': {
41 tab:'passphraseTab', 39 tab:'passphraseTab',
42 panel:'passphrasePanel' 40 panel:'passphrasePanel'
43 }, 41 },
44 'OTP': { 42 'OTP': {
45 tab:'OTPTab', 43 tab:'OTPTab',
46 panel:'OTPPanel' 44 panel:'OTPPanel'
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 3b3c8b4..da5fd76 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.AppPage = function(args) { 26Clipperz.PM.UI.Web.Components.AppPage = function(args) {
29 args = args || {}; 27 args = args || {};
30 Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); 28 Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args);
31 29
32 this._element = args.element || null; 30 this._element = args.element || null;
33 31
34 this._slots = { 32 this._slots = {
35 'cardGrid' : this.getId('cardGrid'), 33 'cardGrid' : this.getId('cardGrid'),
36 // 'directLoginGrid' : this.getId('directLoginGrid'), 34 // 'directLoginGrid' : this.getId('directLoginGrid'),
37 'accountPanel': this.getId('accountPanel'), 35 'accountPanel': this.getId('accountPanel'),
38 'dataPanel': this.getId('dataPanel'), 36 'dataPanel': this.getId('dataPanel'),
39 'toolsPanel': this.getId('toolsPanel'), 37 'toolsPanel': this.getId('toolsPanel'),
40 'userInfoBox': this.getId('userInfoBox'), 38 'userInfoBox': this.getId('userInfoBox'),
41 'tabSidePanel': this.getId('tabSidePanel') 39 'tabSidePanel': this.getId('tabSidePanel')
42 }; 40 };
43 41
44 return this; 42 return this;
45} 43}
46 44
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 1835ca9..4cfca32 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { 26Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments);
32 MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); 30 MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs');
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 37Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
40 38
41 //------------------------------------------------------------------------- 39 //-------------------------------------------------------------------------
42 40
43 'toString': function () { 41 'toString': function () {
44 return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; 42 return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component";
45 }, 43 },
46 44
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 af33d85..8bb64f5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { 26Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._tabPanelController = null; 31 this._tabPanelController = null;
34 32
35 this._tabPanelControllerConfiguration = { 33 this._tabPanelControllerConfiguration = {
36 'DETAILS': { 34 'DETAILS': {
37 tab:'detailTab', 35 tab:'detailTab',
38 panel:'detailTabpanel' 36 panel:'detailTabpanel'
39 }, 37 },
40 'DIRECT_LOGINS': { 38 'DIRECT_LOGINS': {
41 tab:'directLoginTab', 39 tab:'directLoginTab',
42 panel:'directLoginTabpanel' 40 panel:'directLoginTabpanel'
43 }, 41 },
44 'SHARING': { 42 'SHARING': {
45 tab:'sharingTab', 43 tab:'sharingTab',
46 panel:'sharingTabpanel' 44 panel:'sharingTabpanel'
@@ -661,49 +659,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz
661 MochiKit.DOM.addElementClass(this.element(), 'fixed'); 659 MochiKit.DOM.addElementClass(this.element(), 'fixed');
662 } 660 }
663 }, 661 },
664 662
665 //========================================================================= 663 //=========================================================================
666 664
667 'unselectCurrentSelectedItems': function () { 665 'unselectCurrentSelectedItems': function () {
668 MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.displayElement(), ['.selectedField']), function (anElement) { 666 MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.displayElement(), ['.selectedField']), function (anElement) {
669 MochiKit.DOM.removeElementClass(anElement, 'selectedField'); 667 MochiKit.DOM.removeElementClass(anElement, 'selectedField');
670 }); 668 });
671 }, 669 },
672 670
673 //========================================================================= 671 //=========================================================================
674 672
675 'hideProgressMask': function () { 673 'hideProgressMask': function () {
676 MochiKit.DOM.removeElementClass(this.getId('panel'), 'loading'); 674 MochiKit.DOM.removeElementClass(this.getId('panel'), 'loading');
677 }, 675 },
678 676
679 'showProgressMask': function () { 677 'showProgressMask': function () {
680 this.getElement('progressDescription').innerHTML = "Saving"; 678 this.getElement('progressDescription').innerHTML = "Saving";
681 MochiKit.DOM.addElementClass(this.getId('panel'), 'loading'); 679 MochiKit.DOM.addElementClass(this.getId('panel'), 'loading');
682 }, 680 },
683 681
684 'showError': function (anError) { 682 'showError': function (anError) {
685//console.log(">>> showError", anError);
686 MochiKit.Style.hideElement(this.getId('progress')); 683 MochiKit.Style.hideElement(this.getId('progress'));
687 this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']); 684 this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']);
688 MochiKit.Style.showElement(this.getId('error')); 685 MochiKit.Style.showElement(this.getId('error'));
689 }, 686 },
690 687
691 //------------------------------------------------------------------------- 688 //-------------------------------------------------------------------------
692 689
693 'cancel': function () { 690 'cancel': function () {
694/* 691/*
695 var deferredResult; 692 var deferredResult;
696 693
697 deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.cancel", {trace:false}); 694 deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.cancel", {trace:false});
698 deferredResult.addCallback(MochiKit.Base.method(this, 'isSavingEnabled')); 695 deferredResult.addCallback(MochiKit.Base.method(this, 'isSavingEnabled'));
699 deferredResult.addIf([ 696 deferredResult.addIf([
700 MochiKit.Base.method(this, 'askConfirmationForLoosingPendingChanges') 697 MochiKit.Base.method(this, 'askConfirmationForLoosingPendingChanges')
701 ], []); 698 ], []);
702 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, this, 'cancel')); 699 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, this, 'cancel'));
703 deferredResult.callback(); 700 deferredResult.callback();
704 701
705 return deferredResult; 702 return deferredResult;
706*/ 703*/
707 MochiKit.Signal.signal(this, 'cancel'); 704 MochiKit.Signal.signal(this, 'cancel');
708 }, 705 },
709 706
@@ -741,86 +738,83 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz
741 this.unselectCurrentSelectedItems(); 738 this.unselectCurrentSelectedItems();
742 }, 739 },
743 740
744 //------------------------------------------------------------------------- 741 //-------------------------------------------------------------------------
745 742
746 'handleTabSelected': function (aSelectedTab) { 743 'handleTabSelected': function (aSelectedTab) {
747 this.unselectCurrentSelectedItems(); 744 this.unselectCurrentSelectedItems();
748 745
749 switch (aSelectedTab) { 746 switch (aSelectedTab) {
750 case 'DETAILS': 747 case 'DETAILS':
751 // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); 748 // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton'));
752 break; 749 break;
753 case 'DIRECT_LOGINS': 750 case 'DIRECT_LOGINS':
754 // MochiKit.Style.showElement(this.getElement('addDirectLoginButton')); 751 // MochiKit.Style.showElement(this.getElement('addDirectLoginButton'));
755 break; 752 break;
756 case 'SHARING': 753 case 'SHARING':
757 // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); 754 // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton'));
758 break; 755 break;
759 } 756 }
760 }, 757 },
761 758
762 //------------------------------------------------------------------------- 759 //-------------------------------------------------------------------------
763 760
764 'handleKeyEvent': function (anEvent) { 761 'handleKeyEvent': function (anEvent) {
765//console.log("####", anEvent.key().string);
766 if (anEvent.key().string == 'KEY_ESCAPE') { 762 if (anEvent.key().string == 'KEY_ESCAPE') {
767 MochiKit.Signal.signal(this, 'changedValue'); 763 MochiKit.Signal.signal(this, 'changedValue');
768 this.cancel(); 764 this.cancel();
769 } else if (anEvent.key().string == 'KEY_ENTER') { 765 } else if (anEvent.key().string == 'KEY_ENTER') {
770 if (anEvent.target().nodeName == 'TEXTAREA') { 766 if (anEvent.target().nodeName == 'TEXTAREA') {
771 767
772 } else { 768 } else {
773 anEvent.preventDefault(); 769 anEvent.preventDefault();
774 } 770 }
775 } 771 }
776 }, 772 },
777 773
778 //========================================================================= 774 //=========================================================================
779 775
780 'askConfirmationForLoosingPendingChanges': function () { 776 'askConfirmationForLoosingPendingChanges': function () {
781 var deferredResult; 777 var deferredResult;
782 var confirmationDialog; 778 var confirmationDialog;
783 779
784 confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ 780 confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({
785 title:"Alert", 781 title:"Alert",
786 text:"Should lost pending changes?", 782 text:"Should lost pending changes?",
787 type:'ALERT', 783 type:'ALERT',
788 buttons: [ 784 buttons: [
789 {text:"Cancel",result:'CANCEL', isDefault:true}, 785 {text:"Cancel",result:'CANCEL', isDefault:true},
790 {text:"Ok", result:'OK'} 786 {text:"Ok", result:'OK'}
791 ] 787 ]
792 }); 788 });
793 789
794 deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false}); 790 deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false});
795 // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); 791 // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()});
796 deferredResult.addMethod(confirmationDialog, 'deferredShow', { 792 deferredResult.addMethod(confirmationDialog, 'deferredShow', {
797 'openFromElement': this.getElement('cancelButton'), 793 'openFromElement': this.getElement('cancelButton'),
798 'onOkCloseToElement': null, //this.getElement('cancelButton'), 794 'onOkCloseToElement': null, //this.getElement('cancelButton'),
799 'onCancelCloseToElement':this.getElement('cancelButton') 795 'onCancelCloseToElement':this.getElement('cancelButton')
800 }); 796 });
801 // deferredResult.addCallback(function () { console.log("DELETE: " + anObject.toString(), anObject); });
802 // deferredResult.addErrbackPass(function () { console.log("skip deletion: " + anObject.toString(), anObject); });
803 deferredResult.callback(); 797 deferredResult.callback();
804 798
805 return deferredResult; 799 return deferredResult;
806 }, 800 },
807 801
808 //========================================================================= 802 //=========================================================================
809 803
810 'showDirectLoginEditingComponent': function () { 804 'showDirectLoginEditingComponent': function () {
811 varwidth; 805 varwidth;
812 var transition; 806 var transition;
813 var duration; 807 var duration;
814 808
815 width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; 809 width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w'];
816 transition = MochiKit.Visual.Transitions.sinoidal; 810 transition = MochiKit.Visual.Transitions.sinoidal;
817 duration = 1; 811 duration = 1;
818 812
819 return Clipperz.Async.callbacks("CardDialogComponent.showDirectLoginEditingComponent", [ 813 return Clipperz.Async.callbacks("CardDialogComponent.showDirectLoginEditingComponent", [
820 MochiKit.Base.method(this, 'disableCardTitleEditing'), 814 MochiKit.Base.method(this, 'disableCardTitleEditing'),
821 MochiKit.Base.method(this.tabPanelController(), 'disable'), 815 MochiKit.Base.method(this.tabPanelController(), 'disable'),
822 816
823 MochiKit.Base.bind(function () { 817 MochiKit.Base.bind(function () {
824 MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); 818 MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']});
825 MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width}); 819 MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width});
826 MochiKit.Style.showElement(this.getElement('directLoginEditDetail')); 820 MochiKit.Style.showElement(this.getElement('directLoginEditDetail'));
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 2e61f5f..0cee650 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js
@@ -1,82 +1,79 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { 26Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._faviconComponent = null; 32 this._faviconComponent = null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39//============================================================================= 37//=============================================================================
40 38
41Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
42 40
43 //------------------------------------------------------------------------- 41 //-------------------------------------------------------------------------
44 42
45 'toString': function () { 43 'toString': function () {
46 return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; 44 return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component";
47 }, 45 },
48 46
49 //------------------------------------------------------------------------- 47 //-------------------------------------------------------------------------
50 48
51 'reference': function () { 49 'reference': function () {
52 return this._reference; 50 return this._reference;
53 }, 51 },
54 52
55 //------------------------------------------------------------------------- 53 //-------------------------------------------------------------------------
56 54
57 'renderSelf': function() { 55 'renderSelf': function() {
58//console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf");
59 this.append(this.element(), [ 56 this.append(this.element(), [
60 {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ 57 {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[
61 {tag:'img', cls:'favicon', id:this.getId('favicon')} 58 {tag:'img', cls:'favicon', id:this.getId('favicon')}
62 ]}, 59 ]},
63 {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ 60 {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[
64 {tag:'input', id:this.getId('label'), type:'text'} 61 {tag:'input', id:this.getId('label'), type:'text'}
65 ]}, 62 ]},
66 {tag:'div', cls:'open', children:[ 63 {tag:'div', cls:'open', children:[
67 {tag:'span', children:[ 64 {tag:'span', children:[
68 {tag:'a', href:'open', id:this.getId('open'), html:'&nbsp;'} 65 {tag:'a', href:'open', id:this.getId('open'), html:'&nbsp;'}
69 ]} 66 ]}
70 ]}, 67 ]},
71 {tag:'div', cls:'edit', children:[ 68 {tag:'div', cls:'edit', children:[
72 {tag:'span', children:[ 69 {tag:'span', children:[
73 {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} 70 {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"}
74 ]} 71 ]}
75 ]}, 72 ]},
76 {tag:'div', cls:'delete', children:[ 73 {tag:'div', cls:'delete', children:[
77 {tag:'span', children:[ 74 {tag:'span', children:[
78 {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} 75 {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"}
79 ]} 76 ]}
80 ]} 77 ]}
81/* 78/*
82 {tag:'td', cls:'fieldState'}, 79 {tag:'td', cls:'fieldState'},
@@ -96,84 +93,81 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginCo
96 {tag:'span', children:[ 93 {tag:'span', children:[
97 {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} 94 {tag:'a', href:'#', id:this.getId('delete'), html:"delete"}
98 ]} 95 ]}
99 ]} 96 ]}
100 ]} 97 ]}
101*/ 98*/
102 ]); 99 ]);
103 100
104 MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); 101 MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue'));
105 MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); 102 MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin');
106 MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); 103 MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin');
107 MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); 104 MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin');
108 }, 105 },
109 106
110 //------------------------------------------------------------------------- 107 //-------------------------------------------------------------------------
111 108
112 'shouldShowElementWhileRendering': function () { 109 'shouldShowElementWhileRendering': function () {
113 return false; 110 return false;
114 }, 111 },
115 112
116 //------------------------------------------------------------------------- 113 //-------------------------------------------------------------------------
117 114
118 'faviconComponent': function () { 115 'faviconComponent': function () {
119 if (this._faviconComponent == null) { 116 if (this._faviconComponent == null) {
120//console.log("created the FAVICON component");
121 this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); 117 this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')});
122 } 118 }
123 119
124 return this._faviconComponent; 120 return this._faviconComponent;
125 }, 121 },
126 122
127 //========================================================================= 123 //=========================================================================
128 124
129 'label': function () { 125 'label': function () {
130 return this.getElement('label').value; 126 return this.getElement('label').value;
131 }, 127 },
132 128
133 'setLabel': function (aValue) { 129 'setLabel': function (aValue) {
134 this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); 130 this.getElement('label').value = Clipperz.Base.sanitizeString(aValue);
135 }, 131 },
136 132
137 //------------------------------------------------------------------------- 133 //-------------------------------------------------------------------------
138 134
139 'favicon': function () { 135 'favicon': function () {
140 // return this.getElement('favicon').src; 136 // return this.getElement('favicon').src;
141 return this.faviconComponent().src(); 137 return this.faviconComponent().src();
142 }, 138 },
143 139
144 'setFavicon': function (aValue) { 140 'setFavicon': function (aValue) {
145 // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); 141 // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue);
146 this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); 142 this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue));
147 }, 143 },
148 144
149 //========================================================================= 145 //=========================================================================
150 146
151 'openDirectLogin': function (anEvent) { 147 'openDirectLogin': function (anEvent) {
152 anEvent.preventDefault(); 148 anEvent.preventDefault();
153 149
154 MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); 150 MochiKit.Signal.signal(this, 'openDirectLogin', this.reference());
155 }, 151 },
156 152
157 //------------------------------------------------------------------------- 153 //-------------------------------------------------------------------------
158 154
159 'editDirectLogin': function (anEvent) { 155 'editDirectLogin': function (anEvent) {
160 anEvent.preventDefault(); 156 anEvent.preventDefault();
161 157
162 MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); 158 MochiKit.Signal.signal(this, 'editDirectLogin', this.reference());
163//console.log("EDIT DIRECT LOGIN");
164 }, 159 },
165 160
166 //------------------------------------------------------------------------- 161 //-------------------------------------------------------------------------
167 162
168 'deleteDirectLogin': function (anEvent) { 163 'deleteDirectLogin': function (anEvent) {
169 anEvent.preventDefault(); 164 anEvent.preventDefault();
170 165
171 MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); 166 MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference());
172//console.log("DELETE DIRECT LOGIN");
173 }, 167 },
174 168
175 169
176 170
177 //========================================================================= 171 //=========================================================================
178 __syntaxFix__: "syntax fix" 172 __syntaxFix__: "syntax fix"
179}); 173});
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 b58062c..689406a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { 26Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._actionType = null; 32 this._actionType = null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39//============================================================================= 37//=============================================================================
40 38
41Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
42 40
43 //------------------------------------------------------------------------- 41 //-------------------------------------------------------------------------
44 42
45 'toString': function () { 43 'toString': function () {
46 return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; 44 return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component";
@@ -148,40 +146,38 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponen
148 //========================================================================= 146 //=========================================================================
149 147
150 'isHidden': function () { 148 'isHidden': function () {
151 // return this.getElement('value').value; 149 // return this.getElement('value').value;
152 return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); 150 return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked');
153 }, 151 },
154 152
155 'setIsHidden': function (aValue) { 153 'setIsHidden': function (aValue) {
156 // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); 154 // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue);
157 MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); 155 MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked'));
158 MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); 156 MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked'));
159 }, 157 },
160 158
161 'toggleIsHidden': function (anEvent) { 159 'toggleIsHidden': function (anEvent) {
162 anEvent.preventDefault(); 160 anEvent.preventDefault();
163 161
164 this.setIsHidden(! this.isHidden()); 162 this.setIsHidden(! this.isHidden());
165 MochiKit.Signal.signal(this, 'changedValue'); 163 MochiKit.Signal.signal(this, 'changedValue');
166 }, 164 },
167 165
168 //========================================================================= 166 //=========================================================================
169 167
170 'handleActionLink': function (anEvent) { 168 'handleActionLink': function (anEvent) {
171 anEvent.preventDefault(); 169 anEvent.preventDefault();
172
173//console.log("ACTION LINK - " + this.actionType());
174 MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); 170 MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target());
175 }, 171 },
176 172
177 //========================================================================= 173 //=========================================================================
178 174
179 'deleteField': function (anEvent) { 175 'deleteField': function (anEvent) {
180 anEvent.preventDefault(); 176 anEvent.preventDefault();
181 177
182 MochiKit.Signal.signal(this, 'deleteField', this.reference()); 178 MochiKit.Signal.signal(this, 'deleteField', this.reference());
183 }, 179 },
184 180
185 //========================================================================= 181 //=========================================================================
186 __syntaxFix__: "syntax fix" 182 __syntaxFix__: "syntax fix"
187}); 183});
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 391c379..41e32a0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.ColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args);
33 31
34 this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; 33 this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');;
36 this._label = args.label || null; 34 this._label = args.label || null;
37 this._isSortable = args.sortable|| false; 35 this._isSortable = args.sortable|| false;
38 this._comparator = args.comparator|| null; 36 this._comparator = args.comparator|| null;
39 this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' 37 this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED'
40 this._cssClass = args.cssClass|| ''; 38 this._cssClass = args.cssClass|| '';
41 39
42 this._signalIdentifiers = []; 40 this._signalIdentifiers = [];
43 41
44 return this; 42 return this;
45} 43}
46 44
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 d3aa175..3d0ba76 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { 26Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments);
32 30
33 return this; 31 return this;
34} 32}
35 33
36//============================================================================= 34//=============================================================================
37 35
38Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 36Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; 41 return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component";
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 462d864..23f6710 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.DataPanel = function(args) { 26Clipperz.PM.UI.Web.Components.DataPanel = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments);
32 30
33 this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; 31 this._initiallySelectedTab = args.selected || 'OFFLINE_COPY';
34 this._tabPanelControllerConfiguration = { 32 this._tabPanelControllerConfiguration = {
35 'OFFLINE_COPY': { 33 'OFFLINE_COPY': {
36 tab:'offlineCopyTab', 34 tab:'offlineCopyTab',
37 panel:'offlineCopyPanel' 35 panel:'offlineCopyPanel'
38 }, 36 },
39 'SHARING': { 37 'SHARING': {
40 tab:'sharingTab', 38 tab:'sharingTab',
41 panel:'sharingPanel' 39 panel:'sharingPanel'
42 }, 40 },
43 'IMPORT': { 41 'IMPORT': {
44 tab:'importTab', 42 tab:'importTab',
45 panel:'importPanel' 43 panel:'importPanel'
46 }, 44 },
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 ea55ba4..b305045 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args);
33 31
34 this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter');
35 33
36 return this; 34 return this;
37} 35}
38 36
39//============================================================================= 37//=============================================================================
40 38
41Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
42 40
43 'toString': function () { 41 'toString': function () {
44 return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; 42 return "Clipperz.PM.UI.Web.Components.DateColumnManager component";
45 }, 43 },
46 44
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 fe59494..6efe4c6 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args);
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { 37Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; 40 return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
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 a1f0f9f..2dad703 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26/* 24/*
27Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 25Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
28 26
29//############################################################################# 27//#############################################################################
30 28
31Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { 29Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) {
32 args = args || {}; 30 args = args || {};
33 Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); 31 Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args);
34 32
35 this._actionMethod = args.actionMethod || null; 33 this._actionMethod = args.actionMethod || null;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
43 41
44 'toString': function () { 42 'toString': function () {
45 return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; 43 return "Clipperz.PM.UI.Web.Components.DateColumnManager component";
46 }, 44 },
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 1a76b0c..f5f99d4 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { 26Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._initiallySelectedFieldKey = args.selectedFieldKey|| null; 33 this._initiallySelectedFieldKey = args.selectedFieldKey|| null;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
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 5114b1d..55d2c01 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { 26Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._tabPanelController = null; 31 this._tabPanelController = null;
34 32
35 this._initiallySelectedTab = args.selected || 'TYPE'; 33 this._initiallySelectedTab = args.selected || 'TYPE';
36 this._tabPanelControllerConfiguration = { 34 this._tabPanelControllerConfiguration = {
37 'LABEL': { 35 'LABEL': {
38 tab:'labelTab', 36 tab:'labelTab',
39 panel:'labelTabpanel' 37 panel:'labelTabpanel'
40 }, 38 },
41 'TYPE': { 39 'TYPE': {
42 tab:'typeTab', 40 tab:'typeTab',
43 panel:'typeTabpanel' 41 panel:'typeTabpanel'
44 }, 42 },
45 'CONFIGURATION': { 43 'CONFIGURATION': {
46 tab:'configurationTab', 44 tab:'configurationTab',
@@ -84,49 +82,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent,
84 return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; 82 return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component";
85 }, 83 },
86 84
87 //========================================================================= 85 //=========================================================================
88 86
89 'directLoginReference': function () { 87 'directLoginReference': function () {
90 return this._directLoginReference; 88 return this._directLoginReference;
91 }, 89 },
92 90
93 //------------------------------------------------------------------------- 91 //-------------------------------------------------------------------------
94 92
95 'setDirectLoginReference': function (aDirectLoginReference) { 93 'setDirectLoginReference': function (aDirectLoginReference) {
96 this._directLoginReference = aDirectLoginReference; 94 this._directLoginReference = aDirectLoginReference;
97 95
98 return this._directLoginReference; 96 return this._directLoginReference;
99 }, 97 },
100 98
101 //========================================================================= 99 //=========================================================================
102 100
103 'label': function () { 101 'label': function () {
104 return this.getElement('label').value 102 return this.getElement('label').value
105 }, 103 },
106 104
107 'setLabel': function (aValue) { 105 'setLabel': function (aValue) {
108//console.log("##> LABEL: " + aValue);
109 this.getElement('label').value = (aValue ? aValue : ''); 106 this.getElement('label').value = (aValue ? aValue : '');
110 }, 107 },
111 108
112 //------------------------------------------------------------------------- 109 //-------------------------------------------------------------------------
113 110
114 'favicon': function () { 111 'favicon': function () {
115 return this.getElement('faviconURL').value; 112 return this.getElement('faviconURL').value;
116 }, 113 },
117 114
118 'setFavicon': function (aValue) { 115 'setFavicon': function (aValue) {
119 var regexp; 116 var regexp;
120 var displayValue; 117 var displayValue;
121 118
122 regexp = new RegExp('^data\:\/\/.*', 'i'); 119 regexp = new RegExp('^data\:\/\/.*', 'i');
123 if (regexp.test(aValue)) { 120 if (regexp.test(aValue)) {
124 displayValue = '' 121 displayValue = ''
125 } else { 122 } else {
126 displayValue = (aValue ? aValue : ''); 123 displayValue = (aValue ? aValue : '');
127 } 124 }
128 125
129 this.getElement('faviconURL').value = displayValue; 126 this.getElement('faviconURL').value = displayValue;
130 this.faviconComponent().setSrc(aValue); 127 this.faviconComponent().setSrc(aValue);
131 }, 128 },
132 129
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 fa57233..58b5b26 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { 26Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter');
35 this._initialValue = args.initialValue || null; 33 this._initialValue = args.initialValue || null;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
@@ -72,103 +70,98 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueCo
72 }, this.fieldOptions()['options']); 70 }, this.fieldOptions()['options']);
73 }, 71 },
74 72
75 //------------------------------------------------------------------------- 73 //-------------------------------------------------------------------------
76 74
77 'selectedValue': function () { 75 'selectedValue': function () {
78 var result; 76 var result;
79 77
80 result = this.getElement('select').value; 78 result = this.getElement('select').value;
81 79
82 if (result == '---') { 80 if (result == '---') {
83 result = null; 81 result = null;
84 } 82 }
85 83
86 return result; 84 return result;
87 }, 85 },
88 86
89 'initialValue': function () { 87 'initialValue': function () {
90 return this._initialValue; 88 return this._initialValue;
91 }, 89 },
92 90
93 //========================================================================= 91 //=========================================================================
94 92
95 'renderSelf': function() { 93 'renderSelf': function() {
96//console.log(">>> DirectLoginEditingFormValueComponent.renderSelf");
97//console.log("FIELD OPTIONS", this.fieldOptions());
98//console.log("OPTION VALUES", this.optionValues());
99 this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ 94 this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[
100 {tag:'span', cls:'formFieldName', html:this.formFieldName()}, 95 {tag:'span', cls:'formFieldName', html:this.formFieldName()},
101 {tag:'div', id:this.getId('values')} 96 {tag:'div', id:this.getId('values')}
102 ]}); 97 ]});
103 98
104 if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { 99 if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) {
105 this.append(this.getElement('values'), 100 this.append(this.getElement('values'),
106 {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: 101 {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children:
107 MochiKit.Base.flattenArguments( 102 MochiKit.Base.flattenArguments(
108 // {tag:'option', value:'---', html:"---"}, 103 // {tag:'option', value:'---', html:"---"},
109 MochiKit.Base.map( 104 MochiKit.Base.map(
110 MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), 105 MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this),
111 this.optionValues() 106 this.optionValues()
112 ) 107 )
113 ) 108 )
114 } 109 }
115 ); 110 );
116 111
117 MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); 112 MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange');
118 113
119 if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { 114 if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) {
120 var initiallySelectedOptions; 115 var initiallySelectedOptions;
121 initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); 116 initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']);
122 if (initiallySelectedOptions.length == 1) { 117 if (initiallySelectedOptions.length == 1) {
123 MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); 118 MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true});
124 this.handleSelectChange(); 119 this.handleSelectChange();
125 } else { 120 } else {
126 Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); 121 Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true});
127 } 122 }
128 } else { 123 } else {
129 Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); 124 Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true});
130 } 125 }
131 } else if (this.fieldType() == 'checkbox') { 126 } else if (this.fieldType() == 'checkbox') {
132 this.append(this.getElement('values'), 127 this.append(this.getElement('values'),
133 {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} 128 {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'}
134 ); 129 );
135 130
136 MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); 131 MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange');
137 132
138 if (this.initialValue()) { 133 if (this.initialValue()) {
139 MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); 134 MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true});
140 } 135 }
141 } else { 136 } else {
142 WTF = TODO; 137 WTF = TODO;
143 } 138 }
144//console.log("<<< DirectLoginEditingFormValueComponent.renderSelf");
145 }, 139 },
146 140
147 //========================================================================= 141 //=========================================================================
148 142
149 'handleSelectChange': function (anEvent) { 143 'handleSelectChange': function (anEvent) {
150//console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value);
151 var options; 144 var options;
152 145
153 options = {}; 146 options = {};
154 147
155 options['fieldName'] = this.formFieldName(); 148 options['fieldName'] = this.formFieldName();
156 149
157 if (this.fieldType() == 'checkbox') { 150 if (this.fieldType() == 'checkbox') {
158 options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); 151 options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null);
159 } else { 152 } else {
160 options['selectedValue'] = this.selectedValue(); 153 options['selectedValue'] = this.selectedValue();
161 } 154 }
162 155
163 MochiKit.Signal.signal(this, 'formValueChange', options); 156 MochiKit.Signal.signal(this, 'formValueChange', options);
164 }, 157 },
165 158
166 //========================================================================= 159 //=========================================================================
167 __syntaxFix__: "syntax fix" 160 __syntaxFix__: "syntax fix"
168}); 161});
169 162
170 163
171 164
172 165
173 166
174 167
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 d8dc941..b4fc24e 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args);
33 31
34 this._enterLeaveCounter = 0; 32 this._enterLeaveCounter = 0;
35 this._selectedRowObject = null; 33 this._selectedRowObject = null;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
43 41
44 'toString': function () { 42 'toString': function () {
45 return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; 43 return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component";
46 }, 44 },
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 6297002..bdb044a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args);
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 37Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; 40 return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
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 51d55f4..21dddc9 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.GridComponent = function(args) { 26Clipperz.PM.UI.Web.Components.GridComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._columnsManagers = args.columnsManagers; 31 this._columnsManagers = args.columnsManagers;
34 32
35 this._rowsObjects = []; 33 this._rowsObjects = [];
36 this._noRowsGridComponent = null; 34 this._noRowsGridComponent = null;
37 35
38 this._slots = { 36 this._slots = {
39 'headerSlot':this.getId('headerSlot') 37 'headerSlot':this.getId('headerSlot')
40 }; 38 };
41 39
42 return this; 40 return this;
43} 41}
44 42
45//============================================================================= 43//=============================================================================
46 44
@@ -104,55 +102,53 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI
104 102
105 headerElement = this.getElement('thead_tr'); 103 headerElement = this.getElement('thead_tr');
106 headerElement.innerHTML = ""; 104 headerElement.innerHTML = "";
107 105
108 MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { 106 MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) {
109 aColumnManager.renderHeader(headerElement); 107 aColumnManager.renderHeader(headerElement);
110 }); 108 });
111 }, 109 },
112 110
113 //------------------------------------------------------------------------- 111 //-------------------------------------------------------------------------
114 112
115 'update': function (someObjects) { 113 'update': function (someObjects) {
116 this._rowsObjects = someObjects 114 this._rowsObjects = someObjects
117 this.refresh(); 115 this.refresh();
118 this.focus(); 116 this.focus();
119 }, 117 },
120 118
121 'focus': function () { 119 'focus': function () {
122 this.getElement('search').focus(); 120 this.getElement('search').focus();
123 }, 121 },
124 122
125 //------------------------------------------------------------------------- 123 //-------------------------------------------------------------------------
126 124
127 'startSearch': function () { 125 'startSearch': function () {
128//console.log("--> startSearch");
129 MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); 126 MochiKit.DOM.addElementClass(this.getElement('search'), 'running');
130 }, 127 },
131 128
132 'endSearch': function () { 129 'endSearch': function () {
133 MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); 130 MochiKit.DOM.removeElementClass(this.getElement('search'), 'running');
134//console.log("<-- startSearch");
135 }, 131 },
136 132
137 //------------------------------------------------------------------------- 133 //-------------------------------------------------------------------------
138 134
139 'disconnectColumnManagersRowsSignals': function () { 135 'disconnectColumnManagersRowsSignals': function () {
140 MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { 136 MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) {
141 aColumnManager.disconnectRowsSignals(); 137 aColumnManager.disconnectRowsSignals();
142 }); 138 });
143 }, 139 },
144 140
145 //------------------------------------------------------------------------- 141 //-------------------------------------------------------------------------
146 142
147 'refresh': function () { 143 'refresh': function () {
148 var gridRowsElement; 144 var gridRowsElement;
149 var rowClass; 145 var rowClass;
150 146
151 this.disconnectColumnManagersRowsSignals(); 147 this.disconnectColumnManagersRowsSignals();
152 148
153 { 149 {
154 MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); 150 MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled');
155 // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); 151 // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null);
156 MochiKit.DOM.removeElementClass(this.element(), 'empty'); 152 MochiKit.DOM.removeElementClass(this.element(), 'empty');
157 MochiKit.DOM.removeElementClass(this.element(), 'noRows'); 153 MochiKit.DOM.removeElementClass(this.element(), 'noRows');
158 } 154 }
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 3e03fcf..d1d9d7f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args);
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 37Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; 40 return "Clipperz.PM.UI.Web.Components.ImageColumnManager component";
43 }, 41 },
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
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 f3f9cd5..69f735b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args);
33 31
34 this._actionMethod = args.actionMethod || null; 32 this._actionMethod = args.actionMethod || null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39//============================================================================= 37//=============================================================================
40 38
41Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
42 40
43 'toString': function () { 41 'toString': function () {
44 return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; 42 return "Clipperz.PM.UI.Web.Components.DateColumnManager component";
45 }, 43 },
46 44
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 a10ba4f..38a9421 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.LoginForm = function(args) { 26Clipperz.PM.UI.Web.Components.LoginForm = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 this._autocomplete = args.autocomplete || 'off'; 29 this._autocomplete = args.autocomplete || 'off';
32 30
33 Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); 31 Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments);
34 32
35 this._slots = { 33 this._slots = {
36 'passphraseEntropy':this.getId('passphraseEntropy') 34 'passphraseEntropy':this.getId('passphraseEntropy')
37 }; 35 };
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { 42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 2894af8..3498e3f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.LoginPage = function(args) { 26Clipperz.PM.UI.Web.Components.LoginPage = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments);
32 30
33 this._slots = { 31 this._slots = {
34 'loginForm':this.getId('loginBoxSlot') 32 'loginForm':this.getId('loginBoxSlot')
35 }; 33 };
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
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 26506e7..3fef6c5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
@@ -1,93 +1,90 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { 26Clipperz.PM.UI.Web.Components.LoginProgress = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments);
32 30
33 this._deferred = null; 31 this._deferred = null;
34 32
35 return this; 33 return this;
36} 34}
37 35
38//============================================================================= 36//=============================================================================
39 37
40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { 38Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, {
41 39
42 //------------------------------------------------------------------------- 40 //-------------------------------------------------------------------------
43 41
44 'toString': function () { 42 'toString': function () {
45 return "Clipperz.PM.UI.Web.Components.LoginProgress component"; 43 return "Clipperz.PM.UI.Web.Components.LoginProgress component";
46 }, 44 },
47 45
48 //------------------------------------------------------------------------- 46 //-------------------------------------------------------------------------
49 47
50 'deferred': function() { 48 'deferred': function() {
51 return this._deferred; 49 return this._deferred;
52 }, 50 },
53 51
54 'setDeferred': function(aValue) { 52 'setDeferred': function(aValue) {
55 this._deferred = aValue; 53 this._deferred = aValue;
56 }, 54 },
57 55
58 //------------------------------------------------------------------------- 56 //-------------------------------------------------------------------------
59 57
60 'renderSelf': function() { 58 'renderSelf': function() {
61 // var loginProgressElement; 59 // var loginProgressElement;
62 // 60 //
63 // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); 61 // loginProgressElement = MochiKit.DOM.getElement('loginProgress');
64 // 62 //
65 // if (loginProgressElement == null) { 63 // if (loginProgressElement == null) {
66 // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); 64 // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true);
67 // } 65 // }
68 66
69//console.log(">> LoginProgress.renderSelf", this.element());
70 this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ 67 this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [
71 // this.append(loginProgressElement, [ 68 // this.append(loginProgressElement, [
72 {tag:'div', cls:'header', children:[ 69 {tag:'div', cls:'header', children:[
73 {tag:'h3', id:this.getId('title'), html:"login progress"} 70 {tag:'h3', id:this.getId('title'), html:"login progress"}
74 ]}, 71 ]},
75 {tag:'div', cls:'body', children:[ 72 {tag:'div', cls:'body', children:[
76 {tag:'div', id:this.getId('progressBar')}, 73 {tag:'div', id:this.getId('progressBar')},
77 {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ 74 {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[
78 // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, 75 // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]},
79 {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, 76 {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]},
80 {tag:'p', html:"Login failed"} 77 {tag:'p', html:"Login failed"}
81 ]} 78 ]}
82 ]}, 79 ]},
83 {tag:'div', cls:'footer', children:[ 80 {tag:'div', cls:'footer', children:[
84 {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ 81 {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[
85 // {tag:'div', cls:'button', id:this.getId('button'), children:[ 82 // {tag:'div', cls:'button', id:this.getId('button'), children:[
86 // {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} 83 // {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"}
87 // ]} 84 // ]}
88 {tag:'a', cls:'button', id:this.getId('button'), html:"cancel"} 85 {tag:'a', cls:'button', id:this.getId('button'), html:"cancel"}
89 ]} 86 ]}
90 ]} 87 ]}
91 ]}); 88 ]});
92 // ]); 89 // ]);
93 90
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 feb16ad..06746d1 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { 26Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._tabPanelController = null; 31 this._tabPanelController = null;
34 32
35 this._initiallySelectedTab = args.selected || 'CREDENTIALS'; 33 this._initiallySelectedTab = args.selected || 'CREDENTIALS';
36 this._tabPanelControllerConfiguration = { 34 this._tabPanelControllerConfiguration = {
37 'CREDENTIALS': { 35 'CREDENTIALS': {
38 tab:'credentialsTab', 36 tab:'credentialsTab',
39 panel:'credentialsTabpanel' 37 panel:'credentialsTabpanel'
40 }, 38 },
41 'CHECK_CREDENTIALS': { 39 'CHECK_CREDENTIALS': {
42 tab:'checkCredentialsTab', 40 tab:'checkCredentialsTab',
43 panel:'checkCredentialsTabpanel' 41 panel:'checkCredentialsTabpanel'
44 }, 42 },
45 'TERMS_OF_SERVICE': { 43 'TERMS_OF_SERVICE': {
46 tab:'termsOfServiceTab', 44 tab:'termsOfServiceTab',
@@ -102,50 +100,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli
102 //========================================================================= 100 //=========================================================================
103 101
104 'shouldShowElementWhileRendering': function() { 102 'shouldShowElementWhileRendering': function() {
105 return false; 103 return false;
106 }, 104 },
107 105
108 //========================================================================= 106 //=========================================================================
109 107
110 'tabPanelController': function () { 108 'tabPanelController': function () {
111 if (this._tabPanelController == null) { 109 if (this._tabPanelController == null) {
112 this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ 110 this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({
113 component:this, 111 component:this,
114 configuration:this._tabPanelControllerConfiguration 112 configuration:this._tabPanelControllerConfiguration
115 }); 113 });
116 114
117 MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') 115 MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected')
118 } 116 }
119 117
120 return this._tabPanelController; 118 return this._tabPanelController;
121 }, 119 },
122 120
123 //------------------------------------------------------------------------- 121 //-------------------------------------------------------------------------
124 122
125 'renderSelf': function() { 123 'renderSelf': function() {
126//console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
127
128 this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ 124 this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [
129 {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ 125 {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[
130 {tag:'div', cls:'header', children:[ 126 {tag:'div', cls:'header', children:[
131 {tag:'div', cls:'title', children:[ 127 {tag:'div', cls:'title', children:[
132 {tag:'h3', id:this.getId('title'), html:"Create new user"} 128 {tag:'h3', id:this.getId('title'), html:"Create new user"}
133 ]} 129 ]}
134 ]}, 130 ]},
135 {tag:'div', id:this.getId('body'), cls:'body', children:[ 131 {tag:'div', id:this.getId('body'), cls:'body', children:[
136 {tag:'div', cls:'tabContainer', children:[ 132 {tag:'div', cls:'tabContainer', children:[
137 {tag:'ul', cls:'tabs', children:[ 133 {tag:'ul', cls:'tabs', children:[
138 {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, 134 {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]},
139 {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, 135 {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]},
140 {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, 136 {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]},
141 {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, 137 {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//,
142 // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, 138 // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]},
143 ]}, 139 ]},
144 {tag:'ul', cls:'tabPanels', children:[ 140 {tag:'ul', cls:'tabPanels', children:[
145 {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ 141 {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[
146 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, 142 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]},
147 {tag:'ul', cls:'credentials', children:[ 143 {tag:'ul', cls:'credentials', children:[
148 {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, 144 {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]},
149 {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} 145 {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]}
150 ]} 146 ]}
151 ]}, 147 ]},
@@ -312,52 +308,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli
312 MochiKit.Signal.signal(this, 'changedValue', anEvent); 308 MochiKit.Signal.signal(this, 'changedValue', anEvent);
313 309
314 this.incrementUpdateFaviconCounter(); 310 this.incrementUpdateFaviconCounter();
315 MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); 311 MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon'));
316 }, 312 },
317 313
318 //------------------------------------------------------------------------- 314 //-------------------------------------------------------------------------
319 315
320 'handleBackClick': function (anEvent) { 316 'handleBackClick': function (anEvent) {
321 anEvent.preventDefault(); 317 anEvent.preventDefault();
322 318
323 MochiKit.Signal.signal(this, 'back'); 319 MochiKit.Signal.signal(this, 'back');
324 }, 320 },
325 321
326 //========================================================================= 322 //=========================================================================
327 323
328 'bottomMargin': function () { 324 'bottomMargin': function () {
329 var result; 325 var result;
330 326
331 //TODO: WTF!!! 327 //TODO: WTF!!!
332 // result =MochiKit.Style.getElementPosition(this.element())['y'] + 328 // result =MochiKit.Style.getElementPosition(this.element())['y'] +
333 // MochiKit.Style.getElementDimensions(this.element())['h']; 329 // MochiKit.Style.getElementDimensions(this.element())['h'];
334 330
335 // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y']; 331 // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y'];
336//console.log("### bottomMargin");
337//console.log('displayElement', this.displayElement());
338//console.log('-- Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
339//console.log('element', MochiKit.Style.getElementPosition('modalDialog') ['y'], MochiKit.Style.getElementDimensions('modalDialog')['h']);
340 // result = 450; 332 // result = 450;
341 333
342 result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] + 334 result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] +
343 Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] - 335 Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] -
344 60; 336 60;
345 337
346 return result; 338 return result;
347 }, 339 },
348 340
349 //========================================================================= 341 //=========================================================================
350 342
351 'focusOnUsernameElement': function () { 343 'focusOnUsernameElement': function () {
352 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus')); 344 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus'));
353 }, 345 },
354 346
355 'focusOnRePassphraseElement': function () { 347 'focusOnRePassphraseElement': function () {
356 this.getElement('re-passphrase').focus(); 348 this.getElement('re-passphrase').focus();
357 }, 349 },
358 /* 350 /*
359 'focusOnBookmarkletConfigurationElement': function () { 351 'focusOnBookmarkletConfigurationElement': function () {
360 this.getElement('bookmarkletConfiguration').focus(); 352 this.getElement('bookmarkletConfiguration').focus();
361 }, 353 },
362 354
363 'focusOnFaviconElement': function () { 355 'focusOnFaviconElement': function () {
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 3cc5a37..30cbeb2 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.Page = function(args) { 26Clipperz.PM.UI.Web.Components.Page = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments);
32 30
33 this._slots = { 31 this._slots = {
34 'header':'pageHeader', 32 'header':'pageHeader',
35 'body': 'pageBody', 33 'body': 'pageBody',
36 'footer':'pageFooter' 34 'footer':'pageFooter'
37 }; 35 };
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { 42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 dcf506f..df3ca0c 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.PageFooter = function(args) { 26Clipperz.PM.UI.Web.Components.PageFooter = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments);
32 30
33 return this; 31 return this;
34} 32}
35 33
36//============================================================================= 34//=============================================================================
37 35
38Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { 36Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, {
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return "Clipperz.PM.UI.Web.Components.PageFooter component"; 41 return "Clipperz.PM.UI.Web.Components.PageFooter component";
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
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 b8f3b05..5e49fb5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.PageHeader = function(args) { 26Clipperz.PM.UI.Web.Components.PageHeader = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments);
32 this._newsIsOpen = args.newsIsOpen || false; 30 this._newsIsOpen = args.newsIsOpen || false;
33 this._animationDuration = args.animationDuration || 0.5; 31 this._animationDuration = args.animationDuration || 0.5;
34 32
35 this._offset = 82; 33 this._offset = 82;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
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 987e51e..5eb0c1f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
27 25
28Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { 26Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments);
32 30
33 this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter');
34 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter');
35 33
36 this._boxDimensions = null; 34 this._boxDimensions = null;
37 this._isVisible = false; 35 this._isVisible = false;
38 36
39 this.renderSelf(); 37 this.renderSelf();
40 38
41 return this; 39 return this;
42} 40}
43 41
44//============================================================================= 42//=============================================================================
45 43
46Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { 44Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, {
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 69c1ede..ad8d677 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { 26Clipperz.PM.UI.Web.Components.RulerComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); 28 Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments);
31 29
32 this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); 30 this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter');
33 // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); 31 // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter');
34 this._steps = args.steps; 32 this._steps = args.steps;
35 33
36 this._currentStep = -1; 34 this._currentStep = -1;
37 35
38 return this; 36 return this;
39} 37}
40 38
41//============================================================================= 39//=============================================================================
42 40
43Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { 41Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
44 42
45 //------------------------------------------------------------------------- 43 //-------------------------------------------------------------------------
46 44
@@ -91,49 +89,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.U
91 89
92 'renderSelf': function(/*aContainer, aPosition*/) { 90 'renderSelf': function(/*aContainer, aPosition*/) {
93 this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ 91 this.setElement(this.append(MochiKit.DOM.currentDocument().body, [
94 {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ 92 {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[
95 {tag:'div', cls:'ruler', children:[ 93 {tag:'div', cls:'ruler', children:[
96 {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:'&nbsp;'}, 94 {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:'&nbsp;'},
97 {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:'&nbsp;'}, 95 {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:'&nbsp;'},
98 {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:'&nbsp;'}, 96 {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:'&nbsp;'},
99 {tag:'div', cls:'marker', id:this.getId('marker'), children:[ 97 {tag:'div', cls:'marker', id:this.getId('marker'), children:[
100 {tag:'div', cls:'previous', id:this.getId('previousButton')}, 98 {tag:'div', cls:'previous', id:this.getId('previousButton')},
101 {tag:'div', cls:'markerBody'}, 99 {tag:'div', cls:'markerBody'},
102 {tag:'div', cls:'next', id:this.getId('nextButton')} 100 {tag:'div', cls:'next', id:this.getId('nextButton')}
103 ]}, 101 ]},
104 {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, 102 {tag:'div', cls:'steps', id:this.getId('stepsFrame')},
105 // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ 103 // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[
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())} 104 // {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())}
107 // ]}, 105 // ]},
108 {tag:'div', cls:'dots', id:this.getId('dotsFrame')} 106 {tag:'div', cls:'dots', id:this.getId('dotsFrame')}
109 // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ 107 // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[
110 // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} 108 // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())}
111 // ]} 109 // ]}
112 ]} 110 ]}
113 ]} 111 ]}
114 ])); 112 ]));
115//console.log("ELEMENT", this.element());
116 113
117 MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); 114 MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit');
118 115
119 MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); 116 MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious');
120 MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); 117 MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious');
121 118
122 MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); 119 MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext');
123 MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); 120 MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext');
124 121
125 this.enablePrevious(false); 122 this.enablePrevious(false);
126 this.enableNext(false); 123 this.enableNext(false);
127 124
128 // this.cursorMoved(); 125 // this.cursorMoved();
129 }, 126 },
130 127
131 //......................................................................... 128 //.........................................................................
132 129
133 'renderStepsComponents': function () { 130 'renderStepsComponents': function () {
134 varstepsFrame; 131 varstepsFrame;
135 var dotsFrame; 132 var dotsFrame;
136 133
137 stepsFrames = this.getElement('stepsFrame'); 134 stepsFrames = this.getElement('stepsFrame');
138 MochiKit.DOM.setElementClass(stepsFrames, 'steps'); 135 MochiKit.DOM.setElementClass(stepsFrames, 'steps');
139 MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); 136 MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length);
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 666afe9..edcdb62 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { 26Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) {
29 args = args || {}; 27 args = args || {};
30 Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); 28 Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args);
31 29
32 this._element = args.element || null; 30 this._element = args.element || null;
33 31
34 this._slots = { 32 this._slots = {
35 }; 33 };
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
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 3dc9ce9..9b1796a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28//############################################################################# 26//#############################################################################
29 27
30Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { 28Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) {
31 args = args || {}; 29 args = args || {};
32 Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); 30 Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args);
33 31
34 return this; 32 return this;
35} 33}
36 34
37//============================================================================= 35//=============================================================================
38 36
39Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { 37Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, {
40 38
41 'toString': function () { 39 'toString': function () {
42 return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; 40 return "Clipperz.PM.UI.Web.Components.TextColumnManager component";
43 }, 41 },
44 42
45 //----------------------------------------------------- 43 //-----------------------------------------------------
46 44
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 0fa369f..034ed91 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { 26Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments);
32 30
33 this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; 31 this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR';
34 this._tabPanelControllerConfiguration = { 32 this._tabPanelControllerConfiguration = {
35 'PASSWORD_GENERATOR': { 33 'PASSWORD_GENERATOR': {
36 tab:'passwordGeneratorTab', 34 tab:'passwordGeneratorTab',
37 panel:'passwordGeneratorPanel' 35 panel:'passwordGeneratorPanel'
38 }, 36 },
39 'BOOKMARKLET': { 37 'BOOKMARKLET': {
40 tab:'bookmarkletTab', 38 tab:'bookmarkletTab',
41 panel:'bookmarkletPanel' 39 panel:'bookmarkletPanel'
42 }, 40 },
43 'COMPACT_EDITION': { 41 'COMPACT_EDITION': {
44 tab:'compactEditionTab', 42 tab:'compactEditionTab',
45 panel:'compactEditionPanel' 43 panel:'compactEditionPanel'
46 }, 44 },
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 21ccf2a..fe46729 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { 26Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._openFromElement = args.openFromElement || null; 31 this._openFromElement = args.openFromElement || null;
34 this._onOkCloseToElement = args.onOkCloseToElement || null; 32 this._onOkCloseToElement = args.onOkCloseToElement || null;
35 this._onCancelCloseToElement = args.onCancelCloseToElement|| null; 33 this._onCancelCloseToElement = args.onCancelCloseToElement|| null;
36 34
37 this._progressBarComponent = null; 35 this._progressBarComponent = null;
38 36
39 return this; 37 return this;
40} 38}
41 39
42//============================================================================= 40//=============================================================================
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { 42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, {
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
@@ -139,43 +137,42 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clip
139 137
140 'closeOk': function () { 138 'closeOk': function () {
141 var passphrase; 139 var passphrase;
142 140
143 passphrase = this.getElement('passphrase').value; 141 passphrase = this.getElement('passphrase').value;
144 this.showProgressBar(); 142 this.showProgressBar();
145 // this.deferred().callback(passphrase); 143 // this.deferred().callback(passphrase);
146 MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); 144 MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase));
147 this._deferred = null; 145 this._deferred = null;
148 }, 146 },
149 147
150 'closeCancel': function () { 148 'closeCancel': function () {
151 this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); 149 this.deferredHideModal({closeToElement:this.onCancelCloseToElement()});
152 this.deferred().cancel(); 150 this.deferred().cancel();
153 this._deferred = null; 151 this._deferred = null;
154 }, 152 },
155 153
156 //------------------------------------------------------------------------- 154 //-------------------------------------------------------------------------
157 155
158 'userSuccessfullyLoggedInHandler': function (anEvent) { 156 'userSuccessfullyLoggedInHandler': function (anEvent) {
159 this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); 157 this.deferredHideModal({closeToElement:this.onOkCloseToElement()});
160 }, 158 },
161 159
162 'userLoginFailedHandler': function (anEvent) { 160 'userLoginFailedHandler': function (anEvent) {
163//console.log("############### FAILED LOGIN ################");
164 this.showFailure(); 161 this.showFailure();
165 }, 162 },
166 163
167 //------------------------------------------------------------------------- 164 //-------------------------------------------------------------------------
168/* 165/*
169 'deferredShow': function (someArgs, aResult) { 166 'deferredShow': function (someArgs, aResult) {
170 this.deferredShowModal(someArgs); 167 this.deferredShowModal(someArgs);
171 168
172 // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); 169 // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement });
173 // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); 170 // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement }));
174 // this.deferred().addCallback(MochiKit.Async.succeed, aResult); 171 // this.deferred().addCallback(MochiKit.Async.succeed, aResult);
175 172
176 return this.deferred(); 173 return this.deferred();
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/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
index d699dc6..fbf58e0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { 26Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments);
32 30
33 this._slots = {}; 31 this._slots = {};
34 this._isLocked = false; 32 this._isLocked = false;
35 this._lockTooltip = null; 33 this._lockTooltip = null;
36 34
37 return this; 35 return this;
38} 36}
39 37
40//============================================================================= 38//=============================================================================
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, {
43 41
44 //------------------------------------------------------------------------- 42 //-------------------------------------------------------------------------
45 43
46 'toString': function () { 44 'toString': function () {
@@ -55,119 +53,115 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.C
55 MochiKit.Signal.signal(this, 'logout'); 53 MochiKit.Signal.signal(this, 'logout');
56//Clipperz.log("<<< UserInfoBox.handleLogout"); 54//Clipperz.log("<<< UserInfoBox.handleLogout");
57 }, 55 },
58 56
59 //------------------------------------------------------------------------- 57 //-------------------------------------------------------------------------
60 58
61 'lockTooltip': function () { 59 'lockTooltip': function () {
62 return this._lockTooltip; 60 return this._lockTooltip;
63 }, 61 },
64 62
65 //------------------------------------------------------------------------- 63 //-------------------------------------------------------------------------
66 64
67 'isLocked': function () { 65 'isLocked': function () {
68 return this._isLocked; 66 return this._isLocked;
69 }, 67 },
70 68
71 'setIsLocked': function (aValue) { 69 'setIsLocked': function (aValue) {
72 this._isLocked = aValue; 70 this._isLocked = aValue;
73 }, 71 },
74 72
75 'toggleLock': function(anEvent) { 73 'toggleLock': function(anEvent) {
76 var deferredResult; 74 var deferredResult;
77 var shouldLock; 75 var shouldLock;
78 76
79//console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]");
80 anEvent.preventDefault(); 77 anEvent.preventDefault();
81 this.lockTooltip().hide(); 78 this.lockTooltip().hide();
82 79
83 shouldLock = (this.isLocked() == false); 80 shouldLock = (this.isLocked() == false);
84 81
85 if (shouldLock) { 82 if (shouldLock) {
86 var maskElement; 83 var maskElement;
87 84
88 this.setIsLocked(true); 85 this.setIsLocked(true);
89 maskElement = this.getId('modalDialogMask'); 86 maskElement = this.getId('modalDialogMask');
90 deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ 87 deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [
91 MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), 88 MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'),
92 MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), 89 MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}),
93 MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), 90 MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')),
94 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') 91 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock')
95 ], {trace:false}); 92 ], {trace:false});
96 } else { 93 } else {
97 deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ 94 deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [
98 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') 95 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock')
99 ], {trace:false}); 96 ], {trace:false});
100 } 97 }
101//console.log("<<< UserInfoBox.toggleLock");
102 98
103 return deferredResult; 99 return deferredResult;
104 }, 100 },
105 101
106 //------------------------------------------------------------------------- 102 //-------------------------------------------------------------------------
107 103
108 'unlock': function () { 104 'unlock': function () {
109 var deferredResult; 105 var deferredResult;
110 var maskElement; 106 var maskElement;
111 107
112 this.setIsLocked(false); 108 this.setIsLocked(false);
113 maskElement = this.getId('modalDialogMask'); 109 maskElement = this.getId('modalDialogMask');
114 110
115 deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ 111 deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [
116 MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), 112 MochiKit.Base.partial(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}), 113 // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}),
118 MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') 114 MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked')
119 ], {trace:false}); 115 ], {trace:false});
120 }, 116 },
121 117
122 //------------------------------------------------------------------------- 118 //-------------------------------------------------------------------------
123 119
124 'askForPassphrase': function () { 120 'askForPassphrase': function () {
125 varunlockPasswordComponent; 121 varunlockPasswordComponent;
126/* 122/*
127 vardeferredResult; 123 vardeferredResult;
128 124
129 deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); 125 deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false});
130 deferredResult.addCallback(MochiKit.Async.succeed, 'test'); 126 deferredResult.addCallback(MochiKit.Async.succeed, 'test');
131 127
132 deferredResult.callback(); 128 deferredResult.callback();
133 129
134 return deferredResult; 130 return deferredResult;
135*/ 131*/
136//console.log(">>> UserInfoBox.askForPassphrase");
137 unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ 132 unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({
138 'title':"Unlock account", 133 'title':"Unlock account",
139 'text': "Insert the passprase to unlock the account", 134 'text': "Insert the passprase to unlock the account",
140 'type': 'INFO', 135 'type': 'INFO',
141 'buttons': [ 136 'buttons': [
142 {text:"Cancel",result:'CANCEL'}, 137 {text:"Cancel",result:'CANCEL'},
143 {text:"Unlock", result:'OK',isDefault:true} 138 {text:"Unlock", result:'OK',isDefault:true}
144 ], 139 ],
145 'openFromElement': this.getElement('lock'), 140 'openFromElement': this.getElement('lock'),
146 'onOkCloseToElement': null, 141 'onOkCloseToElement': null,
147 'onCancelCloseToElement':this.getId('lock') 142 'onCancelCloseToElement':this.getId('lock')
148 }); 143 });
149//console.log("<<< UserInfoBox.askForPassphrase");
150 144
151 return unlockPasswordComponent.getPassphrase(); 145 return unlockPasswordComponent.getPassphrase();
152 }, 146 },
153 147
154 //========================================================================= 148 //=========================================================================
155 149
156 'renderSelf': function(/*aContainer, aPosition*/) { 150 'renderSelf': function(/*aContainer, aPosition*/) {
157 this.append(this.element(), [ 151 this.append(this.element(), [
158 // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, 152 // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'},
159 {tag:'div', cls:'header', children:[ 153 {tag:'div', cls:'header', children:[
160 {tag:'h1', html:"Welcome"}, 154 {tag:'h1', html:"Welcome"},
161 {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:'&nbsp;'} 155 {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:'&nbsp;'}
162 ]}, 156 ]},
163 {tag:'div', cls:'body', children:[ 157 {tag:'div', cls:'body', children:[
164 {tag:'h3', id:this.getId('username'), html:""}, 158 {tag:'h3', id:this.getId('username'), html:""},
165 {tag:'ul', children:[ 159 {tag:'ul', children:[
166 {tag:'li', id:this.getId('cards'), children:[ 160 {tag:'li', id:this.getId('cards'), children:[
167 {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, 161 {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"},
168 {tag:'span', id:this.getId('cardsLabel'), html:"cards"} 162 {tag:'span', id:this.getId('cardsLabel'), html:"cards"}
169 ]}, 163 ]},
170 {tag:'li', id:this.getId('directLogins'), children:[ 164 {tag:'li', id:this.getId('directLogins'), children:[
171 {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, 165 {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"},
172 {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} 166 {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"}
173 ]} 167 ]}
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 1ab2e69..3d9d6d3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.AppController = function(args) { 26Clipperz.PM.UI.Web.Controllers.AppController = function(args) {
29 27
30 this._user = null; 28 this._user = null;
31 this._tabSlotNames = { 29 this._tabSlotNames = {
32 //tabName: slotName 30 //tabName: slotName
33 'cards': 'cardGrid', 31 'cards': 'cardGrid',
34 // 'directLogins':'directLoginGrid', 32 // 'directLogins':'directLoginGrid',
35 'account': 'accountPanel', 33 'account': 'accountPanel',
36 'data': 'dataPanel', 34 'data': 'dataPanel',
37 'tools': 'toolsPanel' 35 'tools': 'toolsPanel'
38 }; 36 };
39 37
40 //controllers 38 //controllers
41 this._cardsController= null; 39 this._cardsController= null;
42 //this._directLoginsController = null; 40 //this._directLoginsController = null;
43 this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); 41 this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController();
44 42
45 //components 43 //components
46 this._appPage = null; 44 this._appPage = null;
@@ -303,49 +301,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, {
303 }, 301 },
304 302
305 //----------------------------------------------------------------------------- 303 //-----------------------------------------------------------------------------
306 304
307 'handleLock': function (anEvent) { 305 'handleLock': function (anEvent) {
308 return Clipperz.Async.callbacks("AppController.handleLock", [ 306 return Clipperz.Async.callbacks("AppController.handleLock", [
309 MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'), 307 MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'),
310 MochiKit.Base.method(this.user(), 'lock') 308 MochiKit.Base.method(this.user(), 'lock')
311 ], {trace:false}); 309 ], {trace:false});
312 }, 310 },
313 311
314 //............................................................................. 312 //.............................................................................
315 313
316 'handleUnlock': function (anEvent) { 314 'handleUnlock': function (anEvent) {
317 return Clipperz.Async.callbacks("AppController.handleUnock", [ 315 return Clipperz.Async.callbacks("AppController.handleUnock", [
318 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), 316 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'),
319 MochiKit.Base.method(this.user(), 'login'), 317 MochiKit.Base.method(this.user(), 'login'),
320 MochiKit.Base.method(this.cardsController(), 'focus'), 318 MochiKit.Base.method(this.cardsController(), 'focus'),
321 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), 319 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'),
322 MochiKit.Base.method(this.userInfoBox(), 'unlock') 320 MochiKit.Base.method(this.userInfoBox(), 'unlock')
323 ], {trace:false}); 321 ], {trace:false});
324 }, 322 },
325 323
326 'handleDownloadOfflineCopy': function (anEvent) { 324 'handleDownloadOfflineCopy': function (anEvent) {
327console.log("AppController.handleDownloadOfflineCopy");
328 var downloadHref; 325 var downloadHref;
329 326
330 downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; 327 downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl;
331 328
332 if (Clipperz_IEisBroken == true) { 329 if (Clipperz_IEisBroken == true) {
333 window.open(downloadHref, ""); 330 window.open(downloadHref, "");
334 } else { 331 } else {
335 vardeferredResult; 332 vardeferredResult;
336 var newWindow; 333 var newWindow;
337 334
338 newWindow = window.open("", ""); 335 newWindow = window.open("", "");
339 336
340 deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true}); 337 deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true});
341 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); 338 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"});
342 deferredResult.addCallback(function(aWindow) { 339 deferredResult.addCallback(function(aWindow) {
343 aWindow.location.href = downloadHref; 340 aWindow.location.href = downloadHref;
344 }, newWindow); 341 }, newWindow);
345 deferredResult.callback(); 342 deferredResult.callback();
346 } 343 }
347 }, 344 },
348 345
349 //============================================================================= 346 //=============================================================================
350 __syntaxFix__: "syntax fix" 347 __syntaxFix__: "syntax fix"
351}); 348});
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 effde31..b1ff81f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { 26Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); 29 Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args);
32 30
33 this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); 31 this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter');
34 this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); 32 this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter');
35 33
36 this._referenceElement = null; 34 this._referenceElement = null;
37 this._cardDialogComponent = null; 35 this._cardDialogComponent = null;
38 36
39 this._fieldsReferences = {}; 37 this._fieldsReferences = {};
40 this._directLoginReferences = {}; 38 this._directLoginReferences = {};
41 39
42 this._directLoginWizardController = null; 40 this._directLoginWizardController = null;
43 this._directLoginEditingComponent = null; 41 this._directLoginEditingComponent = null;
44 this._isDirectLoginEditingComponentVisible = false; 42 this._isDirectLoginEditingComponentVisible = false;
45 43
46 return this; 44 return this;
@@ -353,49 +351,48 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object
353 351
354 'addField': function () { 352 'addField': function () {
355 return this.record().addField({ 353 return this.record().addField({
356 'label':this.cardDialogComponent().newFieldLabel(), 354 'label':this.cardDialogComponent().newFieldLabel(),
357 'value':this.cardDialogComponent().newFieldValue(), 355 'value':this.cardDialogComponent().newFieldValue(),
358 'isHidden':this.cardDialogComponent().newFieldIsHidden() 356 'isHidden':this.cardDialogComponent().newFieldIsHidden()
359 }); 357 });
360 }, 358 },
361 359
362 'handleAddField': function () { 360 'handleAddField': function () {
363 return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ 361 return Clipperz.Async.callbacks("CardDialogController.handleAddField", [
364 MochiKit.Base.method(this, 'addField'), 362 MochiKit.Base.method(this, 'addField'),
365 363
366 MochiKit.Base.method(this, 'addCardDialogComponentWithField'), 364 MochiKit.Base.method(this, 'addCardDialogComponentWithField'),
367 MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), 365 MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'),
368 366
369 MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), 367 MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'),
370 MochiKit.Base.method(this, 'handleChangedValue') 368 MochiKit.Base.method(this, 'handleChangedValue')
371 ], {trace:false}) 369 ], {trace:false})
372 }, 370 },
373 371
374 //------------------------------------------------------------------------- 372 //-------------------------------------------------------------------------
375 373
376 'handlePerformFieldAction': function (aFieldID, aTargetElement) { 374 'handlePerformFieldAction': function (aFieldID, aTargetElement) {
377//console.log("### targetElement", aTargetElement);
378 return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ 375 return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [
379 MochiKit.Base.method(this.record(), 'fields'), 376 MochiKit.Base.method(this.record(), 'fields'),
380 MochiKit.Base.itemgetter(aFieldID), 377 MochiKit.Base.itemgetter(aFieldID),
381 Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { 378 Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", {
382 'value':MochiKit.Base.methodcaller('value'), 379 'value':MochiKit.Base.methodcaller('value'),
383 'type': MochiKit.Base.methodcaller('actionType') 380 'type': MochiKit.Base.methodcaller('actionType')
384 }, {trace:false}), 381 }, {trace:false}),
385 MochiKit.Base.bind(function (someValues) { 382 MochiKit.Base.bind(function (someValues) {
386 switch (someValues['type']) { 383 switch (someValues['type']) {
387 case 'NONE': 384 case 'NONE':
388 throw "this event handler should not be triggered for fields with type 'NONE'"; 385 throw "this event handler should not be triggered for fields with type 'NONE'";
389 break; 386 break;
390 case 'URL': 387 case 'URL':
391 var url; 388 var url;
392 389
393 url = someValues['value']; 390 url = someValues['value'];
394 if (/^https?\:\/\//.test(url) == false) { 391 if (/^https?\:\/\//.test(url) == false) {
395 url = 'http://' + url; 392 url = 'http://' + url;
396 } 393 }
397 394
398 window.open(url); 395 window.open(url);
399 break; 396 break;
400 case 'EMAIL': 397 case 'EMAIL':
401 var url; 398 var url;
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 f58f0b8..68b5b9f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.CardsController = function() { 26Clipperz.PM.UI.Web.Controllers.CardsController = function() {
29 Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); 27 Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments);
30 28
31 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); 29 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard');
32 30
33 return this; 31 return this;
34} 32}
35 33
36Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { 34Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, {
37 35
38 'toString': function() { 36 'toString': function() {
39 return "Clipperz.PM.UI.Web.Controllers.CardsController"; 37 return "Clipperz.PM.UI.Web.Controllers.CardsController";
40 }, 38 },
41 39
42 'createGrid': function () { 40 'createGrid': function () {
43 var grid; 41 var grid;
44 42
45 grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ 43 grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [
46 new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ 44 new Clipperz.PM.UI.Web.Components.FaviconColumnManager({
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 c025a51..92ed6e3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { 26Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) {
29 this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); 27 this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter');
30 this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); 28 this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter');
31 29
32 MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); 30 MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue');
33 MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); 31 MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward');
34 MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); 32 MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed');
35 33
36 this._directLogin = null; 34 this._directLogin = null;
37 this._directLoginHasJustBeenAdded = false; 35 this._directLoginHasJustBeenAdded = false;
38 36
39 this._rulerComponent = null; 37 this._rulerComponent = null;
40 38
41 this._steps = null; 39 this._steps = null;
42 this._currentStepIndex = 0; 40 this._currentStepIndex = 0;
43 this._isNextEnabled = false; 41 this._isNextEnabled = false;
44 42
45 this._recordFields = null; 43 this._recordFields = null;
46 this._originalBindings = null; 44 this._originalBindings = null;
@@ -142,49 +140,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.
142 }, 140 },
143 141
144 'recordFieldWithReference': function (aReference) { 142 'recordFieldWithReference': function (aReference) {
145 var matchingValues; 143 var matchingValues;
146 var result; 144 var result;
147 145
148 matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); 146 matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields());
149 147
150 if (matchingValues.length == 0) { 148 if (matchingValues.length == 0) {
151 result = null; 149 result = null;
152 } else { 150 } else {
153 result = matchingValues[0]; 151 result = matchingValues[0];
154 } 152 }
155 153
156 return result; 154 return result;
157 }, 155 },
158 156
159 //----------------------------------------------------------------------------- 157 //-----------------------------------------------------------------------------
160 158
161 'originalBindings': function () { 159 'originalBindings': function () {
162 return this._originalBindings; 160 return this._originalBindings;
163 }, 161 },
164 162
165 'setOriginalBindings': function (aValue) { 163 'setOriginalBindings': function (aValue) {
166//console.log("BINDINGS", aValue);
167 this._originalBindings = aValue; 164 this._originalBindings = aValue;
168 }, 165 },
169 166
170 //============================================================================= 167 //=============================================================================
171 168
172 'rulerComponent': function () { 169 'rulerComponent': function () {
173 if (this._rulerComponent == null) { 170 if (this._rulerComponent == null) {
174 this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ 171 this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({
175 translationContext:'Wizards.DirectLoginWizard' 172 translationContext:'Wizards.DirectLoginWizard'
176 }); 173 });
177 this._rulerComponent.render(); 174 this._rulerComponent.render();
178 175
179 MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); 176 MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit');
180 MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); 177 MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done');
181 MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); 178 MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward');
182 MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); 179 MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward');
183 MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); 180 MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved');
184 } 181 }
185 182
186 return this._rulerComponent; 183 return this._rulerComponent;
187 }, 184 },
188 185
189 //----------------------------------------------------------------------------- 186 //-----------------------------------------------------------------------------
190 187
@@ -386,50 +383,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.
386 'currentStep': function () { 383 'currentStep': function () {
387 return this.steps()[this.currentStepIndex()]; 384 return this.steps()[this.currentStepIndex()];
388 }, 385 },
389 386
390 //============================================================================= 387 //=============================================================================
391 388
392 'handleExit': function () { 389 'handleExit': function () {
393 MochiKit.Signal.signal(this, 'exit'); 390 MochiKit.Signal.signal(this, 'exit');
394 }, 391 },
395 392
396 'done': function () { 393 'done': function () {
397 this.doneWithRuler(); 394 this.doneWithRuler();
398 395
399 Clipperz.Async.callbacks("DirectLoginWizardController.done", [ 396 Clipperz.Async.callbacks("DirectLoginWizardController.done", [
400 MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), 397 MochiKit.Base.method(this.directLoginEditingComponent(), 'label'),
401 MochiKit.Base.method(this.directLogin(), 'setLabel'), 398 MochiKit.Base.method(this.directLogin(), 'setLabel'),
402 399
403 MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), 400 MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'),
404 MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), 401 MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'),
405 402
406 //Bindings 403 //Bindings
407 MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), 404 MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'),
408 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { 405 // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) {
409 Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { 406 Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) {
410//console.log("aBindingComponent", aBindingComponent);
411 // this.directLogin().
412 return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ 407 return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [
413 MochiKit.Base.method(this.directLogin(), 'bindings'), 408 MochiKit.Base.method(this.directLogin(), 'bindings'),
414 MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), 409 MochiKit.Base.itemgetter(aBindingComponent.formFieldName()),
415 MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) 410 MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue())
416 ], {trace:false}); 411 ], {trace:false});
417 }, this)), 412 }, this)),
418 413
419 MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), 414 MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'),
420 MochiKit.Base.method(this.directLogin(), 'setFavicon'), 415 MochiKit.Base.method(this.directLogin(), 'setFavicon'),
421 416
422 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { 417 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', {
423 'directLogin': this.directLogin(), 418 'directLogin': this.directLogin(),
424 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() 419 'hasJustBeenAdded':this.directLoginHasJustBeenAdded()
425 }) 420 })
426 ], {trace:false}); 421 ], {trace:false});
427 }, 422 },
428 423
429 //============================================================================= 424 //=============================================================================
430 425
431 'handleMoveBackward': function () { 426 'handleMoveBackward': function () {
432 if (this._currentStepIndex > 0) { 427 if (this._currentStepIndex > 0) {
433 varafterMoveAction; 428 varafterMoveAction;
434 429
435 this._currentStepIndex --; 430 this._currentStepIndex --;
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 6ca3be4..7ab512a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26/* 24/*
27Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 25Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
28 26
29Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { 27Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() {
30 Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); 28 Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments);
31 29
32 return this; 30 return this;
33}; 31};
34 32
35Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { 33Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, {
36 34
37 'createGrid': function () { 35 'createGrid': function () {
38 return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ 36 return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [
39 new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ 37 new Clipperz.PM.UI.Web.Components.FaviconColumnManager({
40 'name': 'DirectLogins.favicon', 38 'name': 'DirectLogins.favicon',
41 'selector': MochiKit.Base.methodcaller('favicon'), 39 'selector': MochiKit.Base.methodcaller('favicon'),
42 'cssClass': 'favicon' 40 'cssClass': 'favicon'
43 }), 41 }),
44 // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ 42 // new Clipperz.PM.UI.Web.Components.LinkColumnManager({
45 new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ 43 new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({
46 'name': 'DirectLogins.title', 44 'name': 'DirectLogins.title',
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 bfc093a..de59ec3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { 26Clipperz.PM.UI.Web.Controllers.FilterController = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); 29 Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args);
32 30
33 this._filterElements = []; 31 this._filterElements = [];
34 this._filter = ""; 32 this._filter = "";
35 33
36 this._pendingSearchClicks = 0; 34 this._pendingSearchClicks = 0;
37 35
38 return this; 36 return this;
39}; 37};
40 38
41 39
42Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { 40Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, {
43 41
44 //----------------------------------------------------------------------------- 42 //-----------------------------------------------------------------------------
45 43
46 'getFilter': function () { 44 'getFilter': function () {
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 8bb3016..44fbdef 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.GridController = function(args) { 26Clipperz.PM.UI.Web.Controllers.GridController = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); 29 Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args);
32 30
33 this._grid = null; 31 this._grid = null;
34 this._user = null; 32 this._user = null;
35 this._sortedColumnManager = null; 33 this._sortedColumnManager = null;
36 this._cachedObjects = null; 34 this._cachedObjects = null;
37 this._filterController = args.filterController || null; 35 this._filterController = args.filterController || null;
38 36
39 this._deferredDisplaySelectedRowsInvocation = null; 37 this._deferredDisplaySelectedRowsInvocation = null;
40 38
41 return this; 39 return this;
42}; 40};
43 41
44Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { 42Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, {
45 43
46 'toString': function() { 44 'toString': function() {
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 a57152d..ac85d36 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { 26Clipperz.PM.UI.Web.Controllers.LoginController = function(args) {
29 this._args = args || {}; 27 this._args = args || {};
30 28
31 this._loginPage = null; 29 this._loginPage = null;
32 30
33 this._newUserWizardController = null; 31 this._newUserWizardController = null;
34 this._newUserCreationComponent = null; 32 this._newUserCreationComponent = null;
35 33
36 return this; 34 return this;
37} 35}
38 36
39MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { 37MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, {
40 38
41 'toString': function() { 39 'toString': function() {
42 return "Clipperz.PM.UI.Web.Controllers.LoginController"; 40 return "Clipperz.PM.UI.Web.Controllers.LoginController";
43 }, 41 },
44 42
45 'args': function () { 43 'args': function () {
46 return this._args; 44 return this._args;
@@ -191,60 +189,58 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, {
191 user = someParameters.user; 189 user = someParameters.user;
192 newUserCreationComponent = this.newUserCreationComponent(); 190 newUserCreationComponent = this.newUserCreationComponent();
193 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), 191 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})),
194 192
195 deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); 193 deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false});
196 194
197 deferredResult.addCallbackList([ 195 deferredResult.addCallbackList([
198 MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), 196 MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'),
199 MochiKit.Base.method(user, 'login'), 197 MochiKit.Base.method(user, 'login'),
200 MochiKit.Base.method(this, 'userLoggedIn', user), 198 MochiKit.Base.method(this, 'userLoggedIn', user),
201 MochiKit.Base.method(this, 'clearNewUserCreationComponent') 199 MochiKit.Base.method(this, 'clearNewUserCreationComponent')
202 ]); 200 ]);
203 deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); 201 deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)});
204 deferredResult.callback(); 202 deferredResult.callback();
205 203
206 return deferredResult; 204 return deferredResult;
207 }, 205 },
208 206
209 207
210 //========================================================================= 208 //=========================================================================
211 209
212 'handleFailedLogin': function(aLoginProgress, anError) { 210 'handleFailedLogin': function(aLoginProgress, anError) {
213 var result; 211 var result;
214 212
215//console.log("anError", anError);
216 if (anError instanceof MochiKit.Async.CancelledError) { 213 if (anError instanceof MochiKit.Async.CancelledError) {
217 result = anError; 214 result = anError;
218 } else { 215 } else {
219 var deferredResult; 216 var deferredResult;
220 217
221MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError); 218Clipperz.logError("## MainController - FAILED LOGIN: " + anError);
222 deferredResult = new MochiKit.Async.Deferred(); 219 deferredResult = new MochiKit.Async.Deferred();
223 220
224 aLoginProgress.showErrorMessage("failed login"); 221 aLoginProgress.showErrorMessage("failed login");
225 // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); 222 // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback');
226 MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); 223 MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback');
227 deferredResult.addCallback(MochiKit.Async.fail, anError) 224 deferredResult.addCallback(MochiKit.Async.fail, anError)
228 result = deferredResult; 225 result = deferredResult;
229 } 226 }
230 227
231 return result; 228 return result;
232 }, 229 },
233 230
234 'handleGenericError': function(anError) { 231 'handleGenericError': function(anError) {
235 var result; 232 var result;
236 233
237 if (anError instanceof MochiKit.Async.CancelledError) { 234 if (anError instanceof MochiKit.Async.CancelledError) {
238 result = anError; 235 result = anError;
239 } else { 236 } else {
240MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); 237Clipperz.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack);
241//console.log(anError);
242 result = new MochiKit.Async.CancelledError(anError); 238 result = new MochiKit.Async.CancelledError(anError);
243 } 239 }
244 240
245 return result; 241 return result;
246 }, 242 },
247 243
248 //----------------------------------------------------------------------------- 244 //-----------------------------------------------------------------------------
249 __syntaxFix__: "syntax fix" 245 __syntaxFix__: "syntax fix"
250}); 246});
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 c83e3c0..9194125 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.MainController = function(args) { 26Clipperz.PM.UI.Web.Controllers.MainController = function(args) {
29 this._args = args; 27 this._args = args;
30 28
31 //controllers 29 //controllers
32 this._loginController =null; 30 this._loginController =null;
33 this._appController =null; 31 this._appController =null;
34 32
35 //components 33 //components
36 this._headerComponent = null; 34 this._headerComponent = null;
37 this._pageComponent =null; 35 this._pageComponent =null;
38 this._footerComponent = null; 36 this._footerComponent = null;
39 37
40 this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); 38 this._passphraseDelegateLock = new MochiKit.Async.DeferredLock();
41 this._passphraseDelegateLock.acquire(); 39 this._passphraseDelegateLock.acquire();
42//Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); 40//Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock);
43 this._passphraseDelegate = null; 41 this._passphraseDelegate = null;
44 42
45 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); 43 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent');
46 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); 44 MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived');
@@ -154,56 +152,50 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, {
154 'setPassphraseDelegate': function (aDelegate) { 152 'setPassphraseDelegate': function (aDelegate) {
155 var shouldReleaseLock; 153 var shouldReleaseLock;
156 154
157 shouldReleaseLock = (this._passphraseDelegate == null); 155 shouldReleaseLock = (this._passphraseDelegate == null);
158 156
159 this._passphraseDelegate = aDelegate; 157 this._passphraseDelegate = aDelegate;
160 158
161 if (shouldReleaseLock) { 159 if (shouldReleaseLock) {
162 this._passphraseDelegateLock.release(); 160 this._passphraseDelegateLock.release();
163 } 161 }
164 }, 162 },
165 163
166 //......................................................................... 164 //.........................................................................
167 165
168 'removePassphraseDelegate': function (aDelegate) { 166 'removePassphraseDelegate': function (aDelegate) {
169 if (this._passphraseDelegate == aDelegate) { 167 if (this._passphraseDelegate == aDelegate) {
170 this._passphraseDelegate = null; 168 this._passphraseDelegate = null;
171 this._passphraseDelegateLock.acquire(); 169 this._passphraseDelegateLock.acquire();
172 } 170 }
173 }, 171 },
174 172
175 //------------------------------------------------------------------------- 173 //-------------------------------------------------------------------------
176 174
177 'loginControllerUserLoggedInCallback': function(anEvent) { 175 'loginControllerUserLoggedInCallback': function(anEvent) {
178//Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent);
179 // this.setUser(anEvent.parameters()['user']);
180//console.log("--- loginControllerUserLoggedInCallback - 1");
181
182//console.log("--- loginControllerUserLoggedInCallback - 2");
183 this.headerComponent().switchToLoggedMode(); 176 this.headerComponent().switchToLoggedMode();
184 this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); 177 this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']});
185//Clipperz.log("<<< loginControllerUserLoggedInCallback");
186 }, 178 },
187 179
188 //----------------------------------------------------------------------------- 180 //-----------------------------------------------------------------------------
189 181
190 'handleRemoteRequestSent': function () { 182 'handleRemoteRequestSent': function () {
191//Clipperz.log("REMOTE REQUEST sent >>>"); 183//Clipperz.log("REMOTE REQUEST sent >>>");
192 }, 184 },
193 185
194 'handleRemoteRequestReceived': function () { 186 'handleRemoteRequestReceived': function () {
195//Clipperz.log("REMOTE REQUEST received <<<"); 187//Clipperz.log("REMOTE REQUEST received <<<");
196 }, 188 },
197 189
198 //----------------------------------------------------------------------------- 190 //-----------------------------------------------------------------------------
199 191
200 'handleLogout': function(anEvent) { 192 'handleLogout': function(anEvent) {
201 this.exit('logout.html'); 193 this.exit('logout.html');
202 }, 194 },
203 195
204 //----------------------------------------------------------------------------- 196 //-----------------------------------------------------------------------------
205 197
206 'exit': function(aPageName) { 198 'exit': function(aPageName) {
207//Clipperz.log("### exit " + aPageName); 199//Clipperz.log("### exit " + aPageName);
208 MochiKit.Async.wait(0).addCallback(function() { 200 MochiKit.Async.wait(0).addCallback(function() {
209 window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; 201 window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage;
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 7db6888..b70aa17 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { 26Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) {
29 this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); 27 this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter');
30 28
31 MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); 29 MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue');
32 MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); 30 MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward');
33 MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); 31 MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed');
34 32
35 this._rulerComponent = null; 33 this._rulerComponent = null;
36 34
37 this._steps = null; 35 this._steps = null;
38 this._currentStepIndex = 0; 36 this._currentStepIndex = 0;
39 this._isNextEnabled = false; 37 this._isNextEnabled = false;
40 38
41 this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' 39 this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED'
42 this._user = null; 40 this._user = null;
43 return this; 41 return this;
44} 42}
45 43
46MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { 44MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, {
@@ -51,49 +49,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
51 49
52 //------------------------------------------------------------------------- 50 //-------------------------------------------------------------------------
53 51
54 'newUserCreationComponent': function () { 52 'newUserCreationComponent': function () {
55 return this._newUserCreationComponent; 53 return this._newUserCreationComponent;
56 }, 54 },
57 55
58 //============================================================================= 56 //=============================================================================
59 57
60 'user': function () { 58 'user': function () {
61 return this._user; 59 return this._user;
62 }, 60 },
63 61
64 'setUser': function (aValue) { 62 'setUser': function (aValue) {
65 this._user = aValue; 63 this._user = aValue;
66 }, 64 },
67 65
68 //----------------------------------------------------------------------------- 66 //-----------------------------------------------------------------------------
69 67
70 'userCreationState': function () { 68 'userCreationState': function () {
71 return this._userCreationState; 69 return this._userCreationState;
72 }, 70 },
73 71
74 'setUserCreationState': function (aValue) { 72 'setUserCreationState': function (aValue) {
75//console.log("+++ NewUserWizardController.setUserCreationState", aValue);
76 this._userCreationState = aValue; 73 this._userCreationState = aValue;
77 this.checkState(); 74 this.checkState();
78 }, 75 },
79 76
80 //============================================================================= 77 //=============================================================================
81 78
82 'resetCurrentStepIndex': function () { 79 'resetCurrentStepIndex': function () {
83 this._currentStepIndex = 0; 80 this._currentStepIndex = 0;
84 this.rulerComponent().resetStatus({animateTransition:true}); 81 this.rulerComponent().resetStatus({animateTransition:true});
85 }, 82 },
86 83
87 //----------------------------------------------------------------------------- 84 //-----------------------------------------------------------------------------
88 85
89 'enableNext': function (aValue) { 86 'enableNext': function (aValue) {
90 this.rulerComponent().enableNext(aValue); 87 this.rulerComponent().enableNext(aValue);
91 this._isNextEnabled = aValue; 88 this._isNextEnabled = aValue;
92 }, 89 },
93 90
94 'isNextEnabled': function () { 91 'isNextEnabled': function () {
95 return this._isNextEnabled; 92 return this._isNextEnabled;
96 }, 93 },
97 94
98 //----------------------------------------------------------------------------- 95 //-----------------------------------------------------------------------------
99 96
@@ -201,58 +198,55 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
201 enableNext = false; 198 enableNext = false;
202 199
203 this.newUserCreationComponent().disableAllPanels(); 200 this.newUserCreationComponent().disableAllPanels();
204 201
205 switch(this.currentStep()) { 202 switch(this.currentStep()) {
206 case 'CREDENTIALS': 203 case 'CREDENTIALS':
207 this.newUserCreationComponent().enableCredentialsPanel(); 204 this.newUserCreationComponent().enableCredentialsPanel();
208 205
209 enableNext = ( 206 enableNext = (
210 (this.newUserCreationComponent().username() != '') 207 (this.newUserCreationComponent().username() != '')
211 && 208 &&
212 (this.newUserCreationComponent().passphrase() != '') 209 (this.newUserCreationComponent().passphrase() != '')
213 ); 210 );
214 // enablePrevious = false; 211 // enablePrevious = false;
215 break; 212 break;
216 case 'CHECK_CREDENTIALS': 213 case 'CHECK_CREDENTIALS':
217 this.newUserCreationComponent().enableCheckCredentialsPanel(); 214 this.newUserCreationComponent().enableCheckCredentialsPanel();
218 215
219 enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); 216 enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase());
220 // enablePrevious = true; 217 // enablePrevious = true;
221 break 218 break
222 case 'TERMS_OF_SERVICE': 219 case 'TERMS_OF_SERVICE':
223 this.newUserCreationComponent().enableTermsOfServicePanel(); 220 this.newUserCreationComponent().enableTermsOfServicePanel();
224 221
225//console.log("awareOfUnrecoverablePassphrase", this.newUserCreationComponent().awareOfUnrecoverablePassphrase());
226//console.log("readTermsOfService", this.newUserCreationComponent().readTermsOfService());
227 enableNext = ( 222 enableNext = (
228 (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') 223 (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on')
229 && 224 &&
230 (this.newUserCreationComponent().readTermsOfService() == 'on') 225 (this.newUserCreationComponent().readTermsOfService() == 'on')
231 ) 226 )
232 break; 227 break;
233 case 'CREATE_USER': 228 case 'CREATE_USER':
234//console.log(">>> CREATE_USER", this.userCreationState());
235 this.newUserCreationComponent().enableCreateUserPanel(); 229 this.newUserCreationComponent().enableCreateUserPanel();
236 230
237 switch (this.userCreationState()) { 231 switch (this.userCreationState()) {
238 case 'IDLE': 232 case 'IDLE':
239 this.setUserCreationState('IN PROGRESS'); 233 this.setUserCreationState('IN PROGRESS');
240 this.preformActualUserRegistration(); 234 this.preformActualUserRegistration();
241 235
242 enablePrevious = false; 236 enablePrevious = false;
243 enableNext = false; 237 enableNext = false;
244 break; 238 break;
245 case 'IN PROGRESS': 239 case 'IN PROGRESS':
246 enablePrevious = false; 240 enablePrevious = false;
247 enableNext = false; 241 enableNext = false;
248 break; 242 break;
249 case 'DONE': 243 case 'DONE':
250 enablePrevious = false; 244 enablePrevious = false;
251 enableNext = true; 245 enableNext = true;
252 break; 246 break;
253 case 'FAILED': 247 case 'FAILED':
254 enablePrevious = true; 248 enablePrevious = true;
255 enableNext = false; 249 enableNext = false;
256 break; 250 break;
257 }; 251 };
258 break; 252 break;
@@ -316,49 +310,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
316 // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), 310 // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'),
317 Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ 311 Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [
318 MochiKit.Base.method(this, 'hideRuler'), 312 MochiKit.Base.method(this, 'hideRuler'),
319 MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') 313 MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal')
320 ], {trace:false}), 314 ], {trace:false}),
321 MochiKit.Base.method(this, 'resetRuler'), 315 MochiKit.Base.method(this, 'resetRuler'),
322 // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), 316 // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'),
323 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') 317 MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit')
324 ], {trace:false}) 318 ], {trace:false})
325 }, 319 },
326 320
327 'done': function () { 321 'done': function () {
328 this.doneWithRuler(); 322 this.doneWithRuler();
329 MochiKit.Signal.signal(this, 'done', {'user': this.user()}); 323 MochiKit.Signal.signal(this, 'done', {'user': this.user()});
330 }, 324 },
331 325
332 //============================================================================= 326 //=============================================================================
333 327
334 'handleMoveBackward': function () { 328 'handleMoveBackward': function () {
335 if (this._currentStepIndex > 0) { 329 if (this._currentStepIndex > 0) {
336 varafterMoveAction; 330 varafterMoveAction;
337 331
338 afterMoveAction = MochiKit.Base.noop; 332 afterMoveAction = MochiKit.Base.noop;
339 333
340//console.log("<-- backward", this.currentStep());
341 switch(this.currentStep()) { 334 switch(this.currentStep()) {
342 case 'CREDENTIALS': 335 case 'CREDENTIALS':
343 case 'CHECK_CREDENTIALS': 336 case 'CHECK_CREDENTIALS':
344 case 'TERMS_OF_SERVICE': 337 case 'TERMS_OF_SERVICE':
345 this._currentStepIndex --; 338 this._currentStepIndex --;
346 this.rulerComponent().moveBackward(afterMoveAction); 339 this.rulerComponent().moveBackward(afterMoveAction);
347 break; 340 break;
348 case 'CREATE_USER': 341 case 'CREATE_USER':
349 this.setUser(null); 342 this.setUser(null);
350 this.newUserCreationComponent().hideAllProgeressStates(); 343 this.newUserCreationComponent().hideAllProgeressStates();
351 this.resetCurrentStepIndex(); 344 this.resetCurrentStepIndex();
352 this.setUserCreationState('IDLE'); 345 this.setUserCreationState('IDLE');
353 break; 346 break;
354 // case 'LOGIN': 347 // case 'LOGIN':
355 // break; 348 // break;
356 }; 349 };
357 350
358 } 351 }
359 352
360 if (this._currentStepIndex == 0) { 353 if (this._currentStepIndex == 0) {
361 this.enablePrevious(false); 354 this.enablePrevious(false);
362 } 355 }
363 }, 356 },
364 357
@@ -385,49 +378,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
385 this.rulerComponent().moveForward(afterMoveAction); 378 this.rulerComponent().moveForward(afterMoveAction);
386 }; 379 };
387 }, 380 },
388 381
389 'handleCursorMoved': function () { 382 'handleCursorMoved': function () {
390 // this.checkState(); 383 // this.checkState();
391 // this.setFocus(); 384 // this.setFocus();
392 385
393 return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ 386 return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [
394 MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), 387 MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'),
395 MochiKit.Base.method(this, 'checkState'), 388 MochiKit.Base.method(this, 'checkState'),
396 MochiKit.Base.method(this, 'setFocus') 389 MochiKit.Base.method(this, 'setFocus')
397 ], {trace:false}); 390 ], {trace:false});
398 }, 391 },
399 392
400 //------------------------------------------------------------------------- 393 //-------------------------------------------------------------------------
401 394
402 'handleChangedValue': function (anEvent) { 395 'handleChangedValue': function (anEvent) {
403 this.checkState(); 396 this.checkState();
404 }, 397 },
405 398
406 //------------------------------------------------------------------------- 399 //-------------------------------------------------------------------------
407 400
408 'handleNewUserCreationComponentKeyPressed': function (anEvent) { 401 'handleNewUserCreationComponentKeyPressed': function (anEvent) {
409//console.log(">>> handleNewUserCreationComponentKeyPressed", anEvent.key().string);
410 if (anEvent.key().string == 'KEY_ENTER') { 402 if (anEvent.key().string == 'KEY_ENTER') {
411 if (anEvent.target().nodeName != 'TEXTAREA') { 403 if (anEvent.target().nodeName != 'TEXTAREA') {
412 anEvent.preventDefault(); 404 anEvent.preventDefault();
413 this.handleMoveForward(); 405 this.handleMoveForward();
414 } 406 }
415 } else if (anEvent.key().string == 'KEY_TAB') { 407 } else if (anEvent.key().string == 'KEY_TAB') {
416 if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { 408 if (anEvent.target() == this.newUserCreationComponent().usernameElement()) {
417 } else { 409 } else {
418 this.handleMoveForward(); 410 this.handleMoveForward();
419 if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { 411 if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) {
420 anEvent.preventDefault(); 412 anEvent.preventDefault();
421 } 413 }
422 } 414 }
423 } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { 415 } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) {
424 this.handleMoveForward(); 416 this.handleMoveForward();
425 } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { 417 } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) {
426 this.handleMoveBackward(); 418 this.handleMoveBackward();
427 } else if (anEvent.key().string == 'KEY_ESCAPE') { 419 } else if (anEvent.key().string == 'KEY_ESCAPE') {
428 anEvent.stop(); 420 anEvent.stop();
429 this.handleExit(); 421 this.handleExit();
430 } else { 422 } else {
431 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); 423 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState'));
432 } 424 }
433 }, 425 },
diff --git a/frontend/gamma/js/Clipperz/Set.js b/frontend/gamma/js/Clipperz/Set.js
index 7023888..b3831a4 100644
--- a/frontend/gamma/js/Clipperz/Set.js
+++ b/frontend/gamma/js/Clipperz/Set.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26 24
27if (typeof(Clipperz) == 'undefined') { 25if (typeof(Clipperz) == 'undefined') {
28 Clipperz = {}; 26 Clipperz = {};
29} 27}
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.Set = function(args) { 31Clipperz.Set = function(args) {
34 args = args || {}; 32 args = args || {};
35 //MochiKit.Base.bindMethods(this); 33 //MochiKit.Base.bindMethods(this);
36 34
37 if (args.items != null) { 35 if (args.items != null) {
38 this._items = args.items.slice(); 36 this._items = args.items.slice();
39 } else { 37 } else {
40 this._items = []; 38 this._items = [];
41 } 39 }
42 40
43 return this; 41 return this;
44} 42}
45 43
46//============================================================================= 44//=============================================================================
diff --git a/frontend/gamma/js/Clipperz/Signal.js b/frontend/gamma/js/Clipperz/Signal.js
index ca3e322..f9b74c9 100644
--- a/frontend/gamma/js/Clipperz/Signal.js
+++ b/frontend/gamma/js/Clipperz/Signal.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Signal) == 'undefined') { Clipperz.Signal = {}; } 25if (typeof(Clipperz.Signal) == 'undefined') { Clipperz.Signal = {}; }
28 26
29Clipperz.Signal.VERSION = "0.1"; 27Clipperz.Signal.VERSION = "0.1";
30Clipperz.Signal.NAME = "Clipperz.Signal"; 28Clipperz.Signal.NAME = "Clipperz.Signal";
31 29
32MochiKit.Base.update(Clipperz.Signal, { 30MochiKit.Base.update(Clipperz.Signal, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/Style.js b/frontend/gamma/js/Clipperz/Style.js
index d377893..acbe71b 100644
--- a/frontend/gamma/js/Clipperz/Style.js
+++ b/frontend/gamma/js/Clipperz/Style.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Style) == 'undefined') { Clipperz.Style = {}; } 25if (typeof(Clipperz.Style) == 'undefined') { Clipperz.Style = {}; }
28 26
29Clipperz.Style.VERSION = "0.1"; 27Clipperz.Style.VERSION = "0.1";
30Clipperz.Style.NAME = "Clipperz.DOM"; 28Clipperz.Style.NAME = "Clipperz.DOM";
31 29
32MochiKit.Base.update(Clipperz.Style, { 30MochiKit.Base.update(Clipperz.Style, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/Visual.js b/frontend/gamma/js/Clipperz/Visual.js
index c2da3b7..93ed725 100644
--- a/frontend/gamma/js/Clipperz/Visual.js
+++ b/frontend/gamma/js/Clipperz/Visual.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; } 25if (typeof(Clipperz.Visual) == 'undefined') { Clipperz.Visual = {}; }
28 26
29Clipperz.Visual.VERSION = "0.1"; 27Clipperz.Visual.VERSION = "0.1";
30Clipperz.Visual.NAME = "Clipperz.Visual"; 28Clipperz.Visual.NAME = "Clipperz.Visual";
31 29
32MochiKit.Base.update(Clipperz.Visual, { 30MochiKit.Base.update(Clipperz.Visual, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
35 33
36 '__repr__': function () { 34 '__repr__': function () {
37 return "[" + this.NAME + " " + this.VERSION + "]"; 35 return "[" + this.NAME + " " + this.VERSION + "]";
38 }, 36 },
39 37
40 //------------------------------------------------------------------------- 38 //-------------------------------------------------------------------------
41 39
42 'toString': function () { 40 'toString': function () {
43 return this.__repr__(); 41 return this.__repr__();
44 }, 42 },
45 43
46 //------------------------------------------------------------------------- 44 //-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/YUI/DomHelper.js b/frontend/gamma/js/Clipperz/YUI/DomHelper.js
index 87c74f5..0a1f9fe 100644
--- a/frontend/gamma/js/Clipperz/YUI/DomHelper.js
+++ b/frontend/gamma/js/Clipperz/YUI/DomHelper.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30/** 28/**
31 * @class Clipperz.ext.DomHelper 29 * @class Clipperz.ext.DomHelper
32 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM. 30 * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM.
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>. 31 * 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>.
34 * @singleton 32 * @singleton
35 */ 33 */
36Clipperz.YUI.DomHelper = new function(){ 34Clipperz.YUI.DomHelper = new function(){
37 /**@private*/ 35 /**@private*/
38 var d = document; 36 var d = document;
39 var tempTableEl = null; 37 var tempTableEl = null;
40 /** True to force the use of DOM instead of html fragments @type Boolean */ 38 /** True to force the use of DOM instead of html fragments @type Boolean */
41 this.useDom = false; 39 this.useDom = false;
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; 40 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;
43 /** 41 /**
44 * Applies a style specification to an element 42 * Applies a style specification to an element
45 * @param {String/HTMLElement} el The element to apply styles to 43 * @param {String/HTMLElement} el The element to apply styles to
46 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or 44 * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or
@@ -419,60 +417,55 @@ Clipperz.YUI.DomHelper.Template.prototype = {
419 /** 417 /**
420 * Applies the supplied values to the template and inserts the new node(s) after el 418 * Applies the supplied values to the template and inserts the new node(s) after el
421 * @param {String/HTMLElement/Element} el The context element 419 * @param {String/HTMLElement/Element} el The context element
422 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) 420 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
423 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element 421 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element
424 * @return {HTMLElement} The new node 422 * @return {HTMLElement} The new node
425 */ 423 */
426 insertAfter : function(el, values, returnElement){ 424 insertAfter : function(el, values, returnElement){
427 el = el.dom ? el.dom : YAHOO.util.Dom.get(el); 425 el = el.dom ? el.dom : YAHOO.util.Dom.get(el);
428 var newNode = Clipperz.YUI.DomHelper.insertHtml('afterEnd', el, this.applyTemplate(values)); 426 var newNode = Clipperz.YUI.DomHelper.insertHtml('afterEnd', el, this.applyTemplate(values));
429 return returnElement ? YAHOO.Element.get(newNode, true) : newNode; 427 return returnElement ? YAHOO.Element.get(newNode, true) : newNode;
430 }, 428 },
431 429
432 /** 430 /**
433 * Applies the supplied values to the template and append the new node(s) to el 431 * Applies the supplied values to the template and append the new node(s) to el
434 * @param {String/HTMLElement/Element} el The context element 432 * @param {String/HTMLElement/Element} el The context element
435 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) 433 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
436 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element 434 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element
437 * @return {HTMLElement} The new node 435 * @return {HTMLElement} The new node
438 */ 436 */
439 append : function(el, values, returnElement){ 437 append : function(el, values, returnElement){
440 var sanitizedValues; 438 var sanitizedValues;
441 var key; 439 var key;
442 440
443 // sanitizedValues = MochiKit.Base.map(sanitizedValues)
444//console.log("values", values);
445 sanitizedValues = {}; 441 sanitizedValues = {};
446 for (key in values) { 442 for (key in values) {
447 sanitizedValues[key] = Clipperz.Base.sanitizeString(values[key]); 443 sanitizedValues[key] = Clipperz.Base.sanitizeString(values[key]);
448 } 444 }
449//console.log("sanitizedValues", sanitizedValues);
450// el = el.dom ? el.dom : YAHOO.util.Dom.get(el);
451 el = (typeof el == 'string') ? YAHOO.util.Dom.get(el) : el; 445 el = (typeof el == 'string') ? YAHOO.util.Dom.get(el) : el;
452//Clipperz.log(this.applyTemplate(sanitizedValues));
453 var newNode = Clipperz.YUI.DomHelper.insertHtml('beforeEnd', el, this.applyTemplate(sanitizedValues)); 446 var newNode = Clipperz.YUI.DomHelper.insertHtml('beforeEnd', el, this.applyTemplate(sanitizedValues));
454// return returnElement ? YAHOO.Element.get(newNode, true) : newNode; 447
455 return newNode; 448 return newNode;
456 }, 449 },
457 450
458 /** 451 /**
459 * Applies the supplied values to the template and overwrites the content of el with the new node(s) 452 * Applies the supplied values to the template and overwrites the content of el with the new node(s)
460 * @param {String/HTMLElement/Element} el The context element 453 * @param {String/HTMLElement/Element} el The context element
461 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) 454 * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
462 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element 455 * @param {<i>Boolean</i>} returnElement (optional) true to return a YAHOO.Element
463 * @return {HTMLElement} The new node 456 * @return {HTMLElement} The new node
464 */ 457 */
465 overwrite : function(el, values, returnElement){ 458 overwrite : function(el, values, returnElement){
466 el = el.dom ? el.dom : YAHOO.util.Dom.get(el); 459 el = el.dom ? el.dom : YAHOO.util.Dom.get(el);
467 el.innerHTML = ''; 460 el.innerHTML = '';
468 var newNode = Clipperz.YUI.DomHelper.insertHtml('beforeEnd', el, this.applyTemplate(values)); 461 var newNode = Clipperz.YUI.DomHelper.insertHtml('beforeEnd', el, this.applyTemplate(values));
469 return returnElement ? YAHOO.Element.get(newNode, true) : newNode; 462 return returnElement ? YAHOO.Element.get(newNode, true) : newNode;
470 } 463 }
471}; 464};
472/** 465/**
473 * Alias for applyTemplate 466 * Alias for applyTemplate
474 * @method 467 * @method
475 */ 468 */
476Clipperz.YUI.DomHelper.Template.prototype.apply = Clipperz.YUI.DomHelper.Template.prototype.applyTemplate; 469Clipperz.YUI.DomHelper.Template.prototype.apply = Clipperz.YUI.DomHelper.Template.prototype.applyTemplate;
477 470
478Clipperz.YUI.Template = Clipperz.YUI.DomHelper.Template; 471Clipperz.YUI.Template = Clipperz.YUI.DomHelper.Template;
diff --git a/frontend/gamma/js/Clipperz/YUI/DomQuery.js b/frontend/gamma/js/Clipperz/YUI/DomQuery.js
index 76d0fae..c1af0ca 100644
--- a/frontend/gamma/js/Clipperz/YUI/DomQuery.js
+++ b/frontend/gamma/js/Clipperz/YUI/DomQuery.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30/* 28/*
31 * yui-ext 0.40 29 * yui-ext 0.40
32 * Copyright(c) 2006, Jack Slocum. 30 * Copyright(c) 2006, Jack Slocum.
33 */ 31 */
34 32
35/** 33/**
36 * @class Clipperz.YUI.DomQuery 34 * @class Clipperz.YUI.DomQuery
37 * Provides high performance selector/xpath processing by compiling queries into reusable functions. 35 * Provides high performance selector/xpath processing by compiling queries into reusable functions.
38 * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in). 36 * New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
39 * @singleton 37 * @singleton
40 */ 38 */
41Clipperz.YUI.DomQuery = function(){ 39Clipperz.YUI.DomQuery = function(){
42 var cache = {}, simpleCache = {}, valueCache = {}; 40 var cache = {}, simpleCache = {}, valueCache = {};
43 var nonSpace = /\S/; 41 var nonSpace = /\S/;
44 var trimRe = /^\s*(.*?)\s*$/; 42 var trimRe = /^\s*(.*?)\s*$/;
45 var tplRe = /\{(\d+)\}/g; 43 var tplRe = /\{(\d+)\}/g;
46 var modeRe = /^(\s?[\/>]\s?|\s|$)/; 44 var modeRe = /^(\s?[\/>]\s?|\s|$)/;
diff --git a/frontend/gamma/js/Clipperz/YUI/Utils.js b/frontend/gamma/js/Clipperz/YUI/Utils.js
index e9929fc..4def842 100644
--- a/frontend/gamma/js/Clipperz/YUI/Utils.js
+++ b/frontend/gamma/js/Clipperz/YUI/Utils.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof YAHOO == 'undefined') { YAHOO = {}; }; 24if (typeof YAHOO == 'undefined') { YAHOO = {}; };
27if (typeof YAHOO.util == 'undefined') { YAHOO.util = {}; }; 25if (typeof YAHOO.util == 'undefined') { YAHOO.util = {}; };
28if (typeof YAHOO.util.Dom == 'undefined') { YAHOO.util.Dom = {}; }; 26if (typeof YAHOO.util.Dom == 'undefined') { YAHOO.util.Dom = {}; };
29 27
30YAHOO.extend = function(subc, superc, overrides) { 28YAHOO.extend = function(subc, superc, overrides) {
31 var F = function() {}; 29 var F = function() {};
32 F.prototype=superc.prototype; 30 F.prototype=superc.prototype;
33 subc.prototype=new F(); 31 subc.prototype=new F();
34 subc.prototype.constructor=subc; 32 subc.prototype.constructor=subc;
35 subc.superclass=superc.prototype; 33 subc.superclass=superc.prototype;
36 if (superc.prototype.constructor == Object.prototype.constructor) { 34 if (superc.prototype.constructor == Object.prototype.constructor) {
37 superc.prototype.constructor=superc; 35 superc.prototype.constructor=superc;
38 } 36 }
39 37
40 if (overrides) { 38 if (overrides) {
41 for (var i in overrides) { 39 for (var i in overrides) {
42 subc.prototype[i]=overrides[i]; 40 subc.prototype[i]=overrides[i];
43 } 41 }
44 } 42 }
45}; 43};
46 44