summaryrefslogtreecommitdiff
path: root/frontend/gamma/tests/tests/Components/FullApp/main_test.js
Unidiff
Diffstat (limited to 'frontend/gamma/tests/tests/Components/FullApp/main_test.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/tests/tests/Components/FullApp/main_test.js111
1 files changed, 0 insertions, 111 deletions
diff --git a/frontend/gamma/tests/tests/Components/FullApp/main_test.js b/frontend/gamma/tests/tests/Components/FullApp/main_test.js
deleted file mode 100644
index b13972a..0000000
--- a/frontend/gamma/tests/tests/Components/FullApp/main_test.js
+++ b/dev/null
@@ -1,111 +0,0 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz Community Edition.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please
8refer to http://www.clipperz.com.
9
10* Clipperz Community Edition is free software: you can redistribute
11 it and/or modify it under the terms of the GNU Affero General Public
12 License as published by the Free Software Foundation, either version
13 3 of the License, or (at your option) any later version.
14
15* Clipperz Community Edition is distributed in the hope that it will
16 be useful, but WITHOUT ANY WARRANTY; without even the implied
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details.
19
20* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see
22 <http://www.gnu.org/licenses/>.
23
24*/
25
26function _pm_logEvent(anEvent) {
27 //console.log("####", anEvent);
28
29 anEvent.preventDefault();
30}
31
32function handleGenericDeferredError(anError) {
33 var result;
34
35 if (anError instanceof MochiKit.Async.CancelledError) {
36 result = anError;
37 } else {
38MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack);
39//console.log(anError);
40 result = new MochiKit.Async.CancelledError(anError);
41 }
42
43 return result;
44}
45
46
47Clipperz.PM.RunTime = {};
48
49
50function run() {
51 var shouldShowRegistrationForm;
52 var useCompactDesign;
53 var controllerParameters;
54 //var iPhoneDesign;
55
56 //MochiKit.Signal.connect(document.body, 'onkeydown', _pm_logEvent);
57 //MochiKit.Signal.connect(document.body, 'onkeypress', _pm_logEvent);
58 //MochiKit.Signal.connect(document.body, 'onclick', _pm_logEvent);
59
60 controllerParameters = {};
61
62 MochiKit.DOM.removeElement('javaScriptAlert');
63 Clipperz.PM.Strings.Languages.initSetup();
64
65 if (window.location.search.indexOf('registration') != -1) {
66 shouldShowRegistrationForm = true;
67 } else {
68 shouldShowRegistrationForm = false;
69 }
70
71 if (window.location.search.indexOf('autocomplete') != -1) {
72 controllerParameters['autocomplete'] = 'on'
73 }
74
75 //if ((window.location.search.indexOf('iPhone') != -1) || (navigator.userAgent.match('iPhone'))) {
76 // iPhoneDesign = true;
77 //} else {
78 // iPhoneDesign = false;
79 //}
80
81 if (window.location.search.indexOf('compact') != -1) {
82 useCompactDesign = true;
83 } else {
84 useCompactDesign = false;
85 }
86
87 if (useCompactDesign == true) {
88 Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Compact.Controllers.MainController(controllerParameters);
89 //} else if (iPhoneDesign == true) {
90 // Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.iPhone.Controllers.MainController();
91 } else {
92 Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Web.Controllers.MainController(controllerParameters);
93 }
94
95 Clipperz.PM.RunTime.mainController.run(shouldShowRegistrationForm);
96
97//Clipperz.log("HASH: " + window.location.hash);
98 //if (window.location.hash != "") {
99 // window.location.hash = ""
100 //}
101//Clipperz.log("HASH cleaned");
102 //#credentials=base64encoded({username:'joe', passphrase:'clipperz'})
103 //MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'doLogin', {username:'joe', passphrase:'clipperz'});
104}
105
106Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose();
107
108var proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false});
109proxy.dataStore().setupWithEncryptedData(testData['testData']);
110
111MochiKit.DOM.addLoadEvent(run);