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.js | 2 |
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,248 +1,248 @@ /* Copyright 2008-2013 Clipperz Srl This file is part of Clipperz, the online password manager. For further information about its features and functionalities please refer to http://www.clipperz.com. * Clipperz is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * Clipperz is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } Clipperz.PM.VERSION = "0.1"; Clipperz.PM.NAME = "Clipperz.PM"; //############################################################################# Clipperz.PM.Main = function() { this._loginPanel = null; this._user = null; this._isRunningCompact = false; Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); return this; } //============================================================================= MochiKit.Base.update(Clipperz.PM.Main.prototype, { 'toString': function() { return "Clipperz.PM.Main"; }, 'switchLanguageHandler': function() { //MochiKit.Logging.logDebug(">>> main.switchLanguageHandler"); YAHOO.ext.Element.get('donateHeaderIconLink').dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl']; YAHOO.ext.Element.get('donateHeaderLink').update(Clipperz.PM.Strings['donateHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['donateHeaderLinkUrl']; - YAHOO.ext.Element.get('creditsHeaderLink').update(Clipperz.PM.Strings['creditsHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['creditsHeaderLinkUrl']; +// YAHOO.ext.Element.get('creditsHeaderLink').update(Clipperz.PM.Strings['creditsHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['creditsHeaderLinkUrl']; YAHOO.ext.Element.get('feedbackHeaderLink').update(Clipperz.PM.Strings['feedbackHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['feedbackHeaderLinkUrl']; YAHOO.ext.Element.get('helpHeaderLink').update(Clipperz.PM.Strings['helpHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['helpHeaderLinkUrl']; YAHOO.ext.Element.get('forumHeaderLink').update(Clipperz.PM.Strings['forumHeaderLinkLabel']).dom.href = Clipperz.PM.Strings['forumHeaderLinkUrl']; if (YAHOO.ext.Element.get('logout') != null) { YAHOO.ext.Element.get('logout').update(Clipperz.PM.Strings['logoutMenuLabel']); YAHOO.ext.Element.get('lock').update(Clipperz.PM.Strings['lockMenuLabel']); YAHOO.ext.Element.get('recordsTabAnchor').update(Clipperz.PM.Strings['recordMenuLabel']); YAHOO.ext.Element.get('accountTabAnchor').update(Clipperz.PM.Strings['accountMenuLabel']); YAHOO.ext.Element.get('dataTabAnchor').update(Clipperz.PM.Strings['dataMenuLabel']); // YAHOO.ext.Element.get('contactsTabAnchor').update(Clipperz.PM.Strings['contactsMenuLabel']); YAHOO.ext.Element.get('toolsTabAnchor').update(Clipperz.PM.Strings['toolsMenuLabel']); } //MochiKit.Logging.logDebug("<<< main.switchLanguageHandler"); }, //------------------------------------------------------------------------- 'fixToDrawTheMainTabsCorrectlyOnSafari': function() { this.switchLanguageHandler(); }, //------------------------------------------------------------------------- 'run': function(shouldShowRegistrationForm) { var mainElement; Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'updateProgressDialogStatus'); YAHOO.ext.Element.get('recordDetailEditModeHeaderMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask(); YAHOO.ext.Element.get('recordDetailEditModeVerticalMask').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide().unmask(); //MochiKit.Logging.logDebug(">>> Main.run"); mainElement = YAHOO.ext.Element.get('main'); if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { YAHOO.ext.Element.get('applicationVersionType').dom.className = "readOnly"; } mainElement.update(""); Clipperz.YUI.DomHelper.append(mainElement.dom, {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:'loginPanel'} ]}) this.setLoginPanel(new Clipperz.PM.Components.Panels.LoginPanel(YAHOO.ext.Element.get('loginPanel'))); //MochiKit.Logging.logDebug("--- Main.run - selecting active form to show ..."); if (shouldShowRegistrationForm == true) { this.loginPanel().showRegistrationForm(false); } else { this.loginPanel().showLoginForm(false); } this.switchLanguageHandler(); //MochiKit.Logging.logDebug("--- Main.run - selecting active form to show. done."); //MochiKit.Logging.logDebug("<<< Main.run"); }, //------------------------------------------------------------------------- 'runCompact': function() { this.setIsRunningCompact(true); YAHOO.ext.Element.get(document.body).addClass("compact"); new Clipperz.PM.Components.Compact.LoginForm(YAHOO.ext.Element.get('mainDiv')); }, 'showCompactInterface': function() { //MochiKit.Logging.logDebug(">>> main.showCompactInterface"); new Clipperz.PM.Components.Compact.CompactInterface(YAHOO.ext.Element.get('compactBody'), {user:this.user()}); //MochiKit.Logging.logDebug("<<< main.showCompactInterface"); }, //------------------------------------------------------------------------- 'mainPage': function() { if (this._mainPage == null) { this._mainPage = new Clipperz.PM.Components.MainPage(); } return this._mainPage; }, //------------------------------------------------------------------------- 'loginPanel': function() { return this._loginPanel; }, 'setLoginPanel': function(aValue) { this._loginPanel = aValue; }, //------------------------------------------------------------------------- 'showMainPanels': function() { var mainElement; var logoutBlock; var lockBlock; var menusTRElement; this.loginPanel().remove(); this.setLoginPanel(null); logoutBlock = YAHOO.ext.Element.get('logoutLI'); Clipperz.YUI.DomHelper.append(logoutBlock.dom, {tag:'a', href:"#", id:'logout', htmlString:Clipperz.PM.Strings['logoutMenuLabel']}); MochiKit.Signal.connect('logout', 'onclick', this, 'doLogoutEventHandler'); lockBlock = YAHOO.ext.Element.get('lockLI'); Clipperz.YUI.DomHelper.append(lockBlock.dom, {tag:'a', href:"#", id:'lock', htmlString:Clipperz.PM.Strings['lockMenuLabel']}); MochiKit.Signal.connect('lock', 'onclick', this, 'doLockEventHandler'); menusTRElement = YAHOO.ext.Element.get('menusTR'); Clipperz.YUI.DomHelper.append(menusTRElement.dom, {tag:'td', id:'recordsTab', children:[{tag:'div', children:[{tag:'a', id:'recordsTabAnchor', htmlString:Clipperz.PM.Strings['recordMenuLabel']}]}]}); Clipperz.YUI.DomHelper.append(menusTRElement.dom, {tag:'td', id:'accountTab', children:[{tag:'div', children:[{tag:'a', id:'accountTabAnchor', htmlString:Clipperz.PM.Strings['accountMenuLabel']}]}]}); Clipperz.YUI.DomHelper.append(menusTRElement.dom, {tag:'td', id:'dataTab', children:[{tag:'div', children:[{tag:'a', id:'dataTabAnchor', htmlString:Clipperz.PM.Strings['dataMenuLabel']}]}]}); // Clipperz.YUI.DomHelper.append(menusTRElement.dom, {tag:'td', id:'contactsTab', children:[{tag:'div', children:[{tag:'a', id:'contactsTabAnchor', htmlString:Clipperz.PM.Strings['contactsMenuLabel']}]}]}); Clipperz.YUI.DomHelper.append(menusTRElement.dom, {tag:'td', id:'toolsTab', children:[{tag:'div', children:[{tag:'a', id:'toolsTabAnchor', htmlString:Clipperz.PM.Strings['toolsMenuLabel']}]}]}); mainElement = YAHOO.ext.Element.get('main'); mainElement.update(""); Clipperz.YUI.DomHelper.append(mainElement.dom, {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:'recordsPanel'}, {tag:'li', id:'accountPanel'}, {tag:'li', id:'dataPanel'}, // {tag:'li', id:'contactsPanel'}, {tag:'li', id:'toolsPanel'} ]}, true) new Clipperz.PM.Components.TabPanel.TabPanelController({ name: 'mainTabPanel', config:{ 'recordsTab':'recordsPanel', 'accountTab':'accountPanel', 'dataTab':'dataPanel', // 'contactsTab':'contactsPanel', 'toolsTab':'toolsPanel'}, selectedTab:'recordsTab' }).setUp(); new Clipperz.PM.Components.Panels.MainPanel(YAHOO.ext.Element.get('recordsPanel'), {user:this.user()}); new Clipperz.PM.Components.Panels.AccountPanel(YAHOO.ext.Element.get('accountPanel'), {user:this.user()}); new Clipperz.PM.Components.Panels.DataPanel(YAHOO.ext.Element.get('dataPanel'), {user:this.user()}); // new Clipperz.PM.Components.Panels.ContactsPanel(YAHOO.ext.Element.get('contactsPanel'), {user:this.user()}); new Clipperz.PM.Components.Panels.ToolsPanel(YAHOO.ext.Element.get('toolsPanel'), {user:this.user()}); this.fixToDrawTheMainTabsCorrectlyOnSafari(); // fix to //MochiKit.Logging.logDebug("<<< Main.showMainPanels"); }, //------------------------------------------------------------------------- 'userConnectedCallback': function(anEvent) { //MochiKit.Logging.logDebug(">>> Main.userConnectedCallback"); //MochiKit.Logging.logDebug(">>> doConnect - user: " + this.user()); this.setUser(anEvent.source()); if (this.isRunningCompact()) { this.showCompactInterface(); } else { this.showMainPanels(); } //MochiKit.Logging.logDebug("<<< Main.userConnectedCallback"); }, //----------------------------------------------------------------------------- 'user': function() { return this._user; }, 'setUser': function(aValue) { this._user = aValue; }, //----------------------------------------------------------------------------- 'doLogoutEventHandler': function(anEvent) { var deferred; anEvent.stop(); deferred = new MochiKit.Async.Deferred(); //deferred.addBoth(function(res) {MochiKit.Logging.logDebug("Main.doLogoutEventHandler - 1: " + res); return res;}); deferred.addCallback(MochiKit.Base.method(this.user(), 'doLogout')); //deferred.addBoth(function(res) {MochiKit.Logging.logDebug("Main.doLogoutEventHandler - 2: " + res); return res;}); deferred.addCallback(Clipperz.PM.exit, 'logout.html'); //deferred.addBoth(function(res) {MochiKit.Logging.logDebug("Main.doLogoutEventHandler - 3: " + res); return res;}); deferred.callback(); }, //----------------------------------------------------------------------------- 'doLockEventHandler': function(anEvent) { |