summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/Main.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Main.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/Main.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Main.js b/frontend/beta/js/Clipperz/PM/Main.js
index 9a068e1..989e0a4 100644
--- a/frontend/beta/js/Clipperz/PM/Main.js
+++ b/frontend/beta/js/Clipperz/PM/Main.js
@@ -1,152 +1,149 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz's Javascript Crypto Library. 5This file is part of Clipperz Community Edition.
6Javascript Crypto Library provides web developers with an extensive 6Clipperz Community Edition is an online password manager.
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please 7For further information about its features and functionalities please
11refer to http://www.clipperz.com 8refer to http://www.clipperz.com.
12 9
13* Javascript Crypto Library is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
17 14
18* Javascript Crypto Library is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
22 19
23* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see 21 License along with Clipperz Community Edition. If not, see
25 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
26 23
27*/ 24*/
28 25
29if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 26if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
30 27
31Clipperz.PM.VERSION = "0.1"; 28Clipperz.PM.VERSION = "0.1";
32Clipperz.PM.NAME = "Clipperz.PM"; 29Clipperz.PM.NAME = "Clipperz.PM";
33 30
34//############################################################################# 31//#############################################################################
35 32
36Clipperz.PM.Main = function() { 33Clipperz.PM.Main = function() {
37 this._loginPanel = null; 34 this._loginPanel = null;
38 this._user = null; 35 this._user = null;
39 36
40 this._isRunningCompact = false; 37 this._isRunningCompact = false;
41 38
42 Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); 39 Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback');
43 Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); 40 Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler');
44 41
45 Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); 42 Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException');
46 43
47 return this; 44 return this;
48} 45}
49 46
50//============================================================================= 47//=============================================================================
51 48
52MochiKit.Base.update(Clipperz.PM.Main.prototype, { 49MochiKit.Base.update(Clipperz.PM.Main.prototype, {
53 'toString': function() { 50 'toString': function() {
54 return "Clipperz.PM.Main"; 51 return "Clipperz.PM.Main";
55 }, 52 },
56 53
57 'switchLanguageHandler': function() { 54 'switchLanguageHandler': function() {
58//MochiKit.Logging.logDebug(">>> main.switchLanguageHandler"); 55//MochiKit.Logging.logDebug(">>> main.switchLanguageHandler");
59 YAHOO.ext.Element.get('donateHeaderIconLink').dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl']; 56 YAHOO.ext.Element.get('donateHeaderIconLink').dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl'];
60 YAHOO.ext.Element.get('donateHeaderLink').update(Clipperz.PM.Strings['donateHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl']; 57 YAHOO.ext.Element.get('donateHeaderLink').update(Clipperz.PM.Strings['donateHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl'];
61 YAHOO.ext.Element.get('creditsHeaderLink').update(Clipperz.PM.Strings['creditsHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['creditsHeaderLinkUrl']; 58 YAHOO.ext.Element.get('creditsHeaderLink').update(Clipperz.PM.Strings['creditsHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['creditsHeaderLinkUrl'];
62 YAHOO.ext.Element.get('feedbackHeaderLink').update(Clipperz.PM.Strings['feedbackHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['feedbackHeaderLinkUrl']; 59 YAHOO.ext.Element.get('feedbackHeaderLink').update(Clipperz.PM.Strings['feedbackHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['feedbackHeaderLinkUrl'];
63 YAHOO.ext.Element.get('helpHeaderLink').update(Clipperz.PM.Strings['helpHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['helpHeaderLinkUrl']; 60 YAHOO.ext.Element.get('helpHeaderLink').update(Clipperz.PM.Strings['helpHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['helpHeaderLinkUrl'];
64 YAHOO.ext.Element.get('forumHeaderLink').update(Clipperz.PM.Strings['forumHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['forumHeaderLinkUrl']; 61 YAHOO.ext.Element.get('forumHeaderLink').update(Clipperz.PM.Strings['forumHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['forumHeaderLinkUrl'];
65 62
66 if (YAHOO.ext.Element.get('logout') != null) { 63 if (YAHOO.ext.Element.get('logout') != null) {
67 YAHOO.ext.Element.get('logout').update(Clipperz.PM.Strings['logoutMenuLabel']); 64 YAHOO.ext.Element.get('logout').update(Clipperz.PM.Strings['logoutMenuLabel']);
68 YAHOO.ext.Element.get('lock').update(Clipperz.PM.Strings['lockMenuLabel']); 65 YAHOO.ext.Element.get('lock').update(Clipperz.PM.Strings['lockMenuLabel']);
69 66
70 YAHOO.ext.Element.get('recordsTabAnchor').update(Clipperz.PM.Strings['recordMenuLabel']); 67 YAHOO.ext.Element.get('recordsTabAnchor').update(Clipperz.PM.Strings['recordMenuLabel']);
71 YAHOO.ext.Element.get('accountTabAnchor').update(Clipperz.PM.Strings['accountMenuLabel']); 68 YAHOO.ext.Element.get('accountTabAnchor').update(Clipperz.PM.Strings['accountMenuLabel']);
72 YAHOO.ext.Element.get('dataTabAnchor').update(Clipperz.PM.Strings['dataMenuLabel']); 69 YAHOO.ext.Element.get('dataTabAnchor').update(Clipperz.PM.Strings['dataMenuLabel']);
73 // YAHOO.ext.Element.get('contactsTabAnchor').update(Clipperz.PM.Strings['contactsMenuLabel']); 70 // YAHOO.ext.Element.get('contactsTabAnchor').update(Clipperz.PM.Strings['contactsMenuLabel']);
74 YAHOO.ext.Element.get('toolsTabAnchor').update(Clipperz.PM.Strings['toolsMenuLabel']); 71 YAHOO.ext.Element.get('toolsTabAnchor').update(Clipperz.PM.Strings['toolsMenuLabel']);
75 } 72 }
76//MochiKit.Logging.logDebug("<<< main.switchLanguageHandler"); 73//MochiKit.Logging.logDebug("<<< main.switchLanguageHandler");
77 }, 74 },
78 75
79 //------------------------------------------------------------------------- 76 //-------------------------------------------------------------------------
80 77
81 'fixToDrawTheMainTabsCorrectlyOnSafari': function() { 78 'fixToDrawTheMainTabsCorrectlyOnSafari': function() {
82 this.switchLanguageHandler(); 79 this.switchLanguageHandler();
83 }, 80 },
84 81
85 //------------------------------------------------------------------------- 82 //-------------------------------------------------------------------------
86 83
87 'run': function(shouldShowRegistrationForm) { 84 'run': function(shouldShowRegistrationForm) {
88 varmainElement; 85 varmainElement;
89 86
90 Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'updateProgressDialogStatus'); 87 Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'updateProgressDialogStatus');
91 88
92 YAHOO.ext.Element.get('recordDetailEditModeHeaderMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask(); 89 YAHOO.ext.Element.get('recordDetailEditModeHeaderMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask();
93 YAHOO.ext.Element.get('recordDetailEditModeVerticalMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask(); 90 YAHOO.ext.Element.get('recordDetailEditModeVerticalMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask();
94 91
95//MochiKit.Logging.logDebug(">>> Main.run"); 92//MochiKit.Logging.logDebug(">>> Main.run");
96 mainElement = YAHOO.ext.Element.get('main'); 93 mainElement = YAHOO.ext.Element.get('main');
97 if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { 94 if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) {
98 YAHOO.ext.Element.get('applicationVersionType').dom.className = "readOnly"; 95 YAHOO.ext.Element.get('applicationVersionType').dom.className = "readOnly";
99 } 96 }
100 mainElement.update(""); 97 mainElement.update("");
101 98
102 Clipperz.YUI.DomHelper.append(mainElement.dom, {tag:'ul', cls:'clipperzTabPanels', children:[ 99 Clipperz.YUI.DomHelper.append(mainElement.dom, {tag:'ul', cls:'clipperzTabPanels', children:[
103 {tag:'li', id:'loginPanel'} 100 {tag:'li', id:'loginPanel'}
104 ]}) 101 ]})
105 102
106 this.setLoginPanel(new Clipperz.PM.Components.Panels.LoginPanel(YAHOO.ext.Element.get('loginPanel'))); 103 this.setLoginPanel(new Clipperz.PM.Components.Panels.LoginPanel(YAHOO.ext.Element.get('loginPanel')));
107 104
108//MochiKit.Logging.logDebug("--- Main.run - selecting active form to show ..."); 105//MochiKit.Logging.logDebug("--- Main.run - selecting active form to show ...");
109 if (shouldShowRegistrationForm == true) { 106 if (shouldShowRegistrationForm == true) {
110 this.loginPanel().showRegistrationForm(false); 107 this.loginPanel().showRegistrationForm(false);
111 } else { 108 } else {
112 this.loginPanel().showLoginForm(false); 109 this.loginPanel().showLoginForm(false);
113 } 110 }
114 111
115 this.switchLanguageHandler(); 112 this.switchLanguageHandler();
116//MochiKit.Logging.logDebug("--- Main.run - selecting active form to show. done."); 113//MochiKit.Logging.logDebug("--- Main.run - selecting active form to show. done.");
117//MochiKit.Logging.logDebug("<<< Main.run"); 114//MochiKit.Logging.logDebug("<<< Main.run");
118 }, 115 },
119 116
120 //------------------------------------------------------------------------- 117 //-------------------------------------------------------------------------
121 118
122 'runCompact': function() { 119 'runCompact': function() {
123 this.setIsRunningCompact(true); 120 this.setIsRunningCompact(true);
124 YAHOO.ext.Element.get(document.body).addClass("compact"); 121 YAHOO.ext.Element.get(document.body).addClass("compact");
125 new Clipperz.PM.Components.Compact.LoginForm(YAHOO.ext.Element.get('mainDiv')); 122 new Clipperz.PM.Components.Compact.LoginForm(YAHOO.ext.Element.get('mainDiv'));
126 }, 123 },
127 124
128 'showCompactInterface': function() { 125 'showCompactInterface': function() {
129//MochiKit.Logging.logDebug(">>> main.showCompactInterface"); 126//MochiKit.Logging.logDebug(">>> main.showCompactInterface");
130 new Clipperz.PM.Components.Compact.CompactInterface(YAHOO.ext.Element.get('compactBody'), {user:this.user()}); 127 new Clipperz.PM.Components.Compact.CompactInterface(YAHOO.ext.Element.get('compactBody'), {user:this.user()});
131//MochiKit.Logging.logDebug("<<< main.showCompactInterface"); 128//MochiKit.Logging.logDebug("<<< main.showCompactInterface");
132 }, 129 },
133 130
134 //------------------------------------------------------------------------- 131 //-------------------------------------------------------------------------
135 132
136 'mainPage': function() { 133 'mainPage': function() {
137 if (this._mainPage == null) { 134 if (this._mainPage == null) {
138 this._mainPage = new Clipperz.PM.Components.MainPage(); 135 this._mainPage = new Clipperz.PM.Components.MainPage();
139 } 136 }
140 137
141 return this._mainPage; 138 return this._mainPage;
142 }, 139 },
143 140
144 //------------------------------------------------------------------------- 141 //-------------------------------------------------------------------------
145 142
146 'loginPanel': function() { 143 'loginPanel': function() {
147 return this._loginPanel; 144 return this._loginPanel;
148 }, 145 },
149 146
150 'setLoginPanel': function(aValue) { 147 'setLoginPanel': function(aValue) {
151 this._loginPanel = aValue; 148 this._loginPanel = aValue;
152 }, 149 },