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