author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (side-by-side diff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-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/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js index 0f6858a..1312967 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js +++ b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js @@ -1,214 +1,212 @@ /* -Copyright 2008-2011 Clipperz Srl +Copyright 2008-2013 Clipperz Srl -This file is part of Clipperz Community Edition. -Clipperz Community Edition is an online password manager. +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 Community Edition 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 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 Community Edition 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. +* 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 Community Edition. If not, see - <http://www.gnu.org/licenses/>. + License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } if (typeof(Clipperz.PM.Components.Compact) == 'undefined') { Clipperz.PM.Components.Compact = {}; } Clipperz.PM.Components.Compact.CompactInterface = function(anElement, args) { Clipperz.PM.Components.Compact.CompactInterface.superclass.constructor.call(this, anElement, args); this._directLoginItemTemplate = null; this._user = args.user; this._autoLockTimer = null; Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'userNotificationHandler') Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); this.render(); return this; }; YAHOO.extendX(Clipperz.PM.Components.Compact.CompactInterface, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Compact.CompactInterface"; }, //----------------------------------------------------- 'render': function() { var result; var layout; var registerButton; //MochiKit.Logging.logDebug(">>> CompactInterface.render"); this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', children:[ {tag:'div', id:this.getId('cantentPanel'), children:[ {tag:'h4', id:this.getId('message')}, {tag:'ul', id:'directLogins', children:[]} ]}, {tag:'div', id:this.getId('lockPanel'), cls:'lockPanel', children:[ {tag:'div', htmlString:Clipperz.PM.Strings['lockDescription']}, {tag:'form', id:'lockDialogForm', children:[ {tag:'input', type:'password', id:this.getId('lockPassphrase')} ]}, {tag:'div', id:this.getId('unlock')} ]} ]}); this.getElement('lockPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); YAHOO.ext.Element.get('lockBlock').show(); MochiKit.Signal.connect(YAHOO.ext.Element.get('lock').dom, 'onclick', this, 'doLockEventHandler'); new YAHOO.ext.Button(this.getId('unlock'), {text:Clipperz.PM.Strings['unlockButtonLabel'], handler:this.doUnlockEventHandler, scope:this, minWidth:0}); this.getElement('unlock').swallowEvent('click', true); new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('lockPassphrase')); MochiKit.Signal.connect('lockDialogForm', 'onsubmit', this, 'doUnlockEventHandler'); this.getElement('cantentPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY); //MochiKit.Logging.logDebug("<<< CompactInterface.render"); return result; }, //----------------------------------------------------- 'directLoginAddedHandler': function(anEvent) { this.redrawDirectLoginItems(); }, //----------------------------------------------------- 'compareDirectLogins': function(a, b) { return MochiKit.Base.compare(a.label().toLowerCase(), b.label().toLowerCase()); }, //----------------------------------------------------- 'redrawDirectLoginItems': function() { var template; var allDirectLogins; this.getElement('message').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug(">>> CompactInterface.redrawDirectLoginItems"); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 0"); MochiKit.Iter.forEach(YAHOO.ext.Element.get('directLogins').getChildrenByTagName('li'), function(aDirectLoginElement) { MochiKit.Signal.disconnectAll(aDirectLoginElement.dom); //MochiKit.Logging.logDebug("disconnecting IMG " + aDirectLoginElement.getChildrenByTagName('img')[0].dom.src); MochiKit.Signal.disconnectAll(aDirectLoginElement.getChildrenByTagName('img')[0].dom); }) //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 1"); YAHOO.ext.Element.get('directLogins').update(""); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 2"); allDirectLogins = MochiKit.Base.values(this.user().directLoginReferences()); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 3"); allDirectLogins.sort(this.compareDirectLogins); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 4"); template = this.directLoginItemTemplate(); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 5"); MochiKit.Iter.forEach(allDirectLogins, MochiKit.Base.bind(function(aDirectLogin) { var directLoginElement; var faviconImageElementID; faviconImageElementID = aDirectLogin.reference() + "_faviconIMG"; directLoginElement = template.append('directLogins', { elementID:faviconImageElementID, faviconUrl:aDirectLogin.fixedFavicon(), directLoginTitle:aDirectLogin.label(), directLoginReference:aDirectLogin.reference() }, true); //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 6: " + recordElement.dom); directLoginElement.addClassOnOver("hover"); MochiKit.Signal.connect(directLoginElement.dom, 'onclick', this, 'handleDirectLoginClick'); MochiKit.Signal.connect(faviconImageElementID, 'onload', this, 'handleLoadedFaviconImage'); MochiKit.Signal.connect(faviconImageElementID, 'onerror', aDirectLogin, 'handleMissingFaviconImage'); MochiKit.Signal.connect(faviconImageElementID, 'onabort', aDirectLogin, 'handleMissingFaviconImage'); // YAHOO.ext.Element.get(faviconImageElementID).dom.src = aDirectLogin.fixedFavicon(); }, this)); this.resetAutoLockTimer(); //MochiKit.Logging.logDebug("<<< CompactInterface.redrawDirectLoginItems"); }, //----------------------------------------------------- 'directLoginItemTemplate': function() { if (this._directLoginItemTemplate == null) { this._directLoginItemTemplate = Clipperz.YUI.DomHelper.createTemplate({tag:'li', id:'{directLoginReference}', children:[ {tag:'table', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'20', align:'center', valign:'top', children:[ {tag:'img', id:'{elementID}', src:'{faviconUrl}'} ]}, {tag:'td', valign:'top', children:[ {tag:'a', cls:'directLoginItemTitle', html:'{directLoginTitle}'} ]} ]} ]} ]} ]}); this._directLoginItemTemplate.compile(); } return this._directLoginItemTemplate; }, //------------------------------------------------------------------------- 'handleDirectLoginClick': function(anEvent) { var directLoginReference; //MochiKit.Logging.logDebug(">>> MainPanel.handleDirectLoginClick !!!"); directLoginReference = this.user().directLoginReferences()[anEvent.src().id]; this.openDirectLogin(directLoginReference); this.resetAutoLockTimer(); //MochiKit.Logging.logDebug("<<< MainPanel.handleDirectLoginClick"); }, //----------------------------------------------------- 'openDirectLogin': function(aDirectLoginReference) { var deferredResult; var newWindow; //MochiKit.Logging.logDebug(">>> MainPanel.openDirectLogin - " + aDirectLoginReference.label()); deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("MainPanel.openDirectLogin - 1: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(aDirectLoginReference, 'setupJumpPageWindow')); deferredResult.addCallback(MochiKit.Base.method(aDirectLoginReference, 'deferredDirectLogin')); deferredResult.addCallback(function(aDirectLogin) { aDirectLogin.runDirectLogin(newWindow); }); newWindow = window.open(Clipperz.PM.Strings['directLoginJumpPageUrl'], ""); // MochiKit.Signal.connect(newWindow, 'onload', MochiKit.Base.method(deferredResult, 'callback', newWindow)) // MochiKit.Signal.connect(newWindow, 'onload', MochiKit.Base.partial(alert, "done")); deferredResult.callback(newWindow); //MochiKit.Logging.logDebug("<<< MainPanel.openDirectLogin"); }, //------------------------------------------------------------------------- 'handleLoadedFaviconImage': function(anEvent) { |