Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components') (more/less context) (ignore whitespace changes)
51 files changed, 510 insertions, 612 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js index f3a3902..07c0b97 100644 --- a/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js @@ -1,121 +1,119 @@ /* -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 = {}; } //############################################################################# var _Clipperz_PM_Components_Panels_base_id_ = 0; //############################################################################# Clipperz.PM.Components.BaseComponent = function(anElement, args) { args = args || {}; // MochiKit.Base.bindMethods(this); // Clipperz.PM.Components.BaseComponent.superclass.constructor.call(this, args); this._element = anElement; this._ids = {}; return this; } //============================================================================= //MochiKit.Base.update(Clipperz.PM.Components.BaseComponent.prototype, { YAHOO.extendX(Clipperz.PM.Components.BaseComponent, YAHOO.ext.util.Observable, { 'isClipperzPMComponent': true, //------------------------------------------------------------------------- 'toString': function () { return "Clipperz.PM.Components.BaseComponent component"; }, //------------------------------------------------------------------------- 'domHelper': function() { return Clipperz.YUI.DomHelper; }, //------------------------------------------------------------------------- 'element': function() { //MochiKit.Logging.logDebug(">>> BaseComponent.element"); return this._element; }, 'setElement': function(aValue) { this._element = aValue; }, //----------------------------------------------------- 'remove': function() { //MochiKit.Logging.logDebug(">>> BaseComponent.remove"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); //MochiKit.Logging.logDebug("<<< BaseComponent.remove"); }, //------------------------------------------------------------------------- 'getId': function(aValue) { var result; result = this._ids[aValue]; if (typeof(result) == 'undefined') { _Clipperz_PM_Components_Panels_base_id_ ++; result = "Clipperz_PM_Components_Panels_" + aValue + "_" + _Clipperz_PM_Components_Panels_base_id_; this._ids[aValue] = result; //MochiKit.Logging.logDebug(">>> getId(" + aValue + ") = " + result); } else { //MochiKit.Logging.logDebug("<<< getId(" + aValue + ") = " + result); } return result; }, 'getDom': function(aValue) { return YAHOO.util.Dom.get(this.getId(aValue)); }, 'getElement': function(aValue) { return YAHOO.ext.Element.get(this.getId(aValue)); }, 'getActor': function(aValue, anAnimator) { return new YAHOO.ext.Actor(this.getDom(aValue), anAnimator); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactHeader.js b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactHeader.js index 7a3b3a3..14e42a5 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactHeader.js +++ b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactHeader.js @@ -1,83 +1,81 @@ /* -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.CompactHeader = function(anElement, args) { Clipperz.PM.Components.Compact.CompactHeader.superclass.constructor.call(this, anElement, args); this.render(); return this; }; YAHOO.extendX(Clipperz.PM.Components.Compact.CompactHeader, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Compact.CompactHeader"; }, //----------------------------------------------------- 'render': function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', children:[ {tag:'img', src:'./images/logo.gif'}, {tag:'div', id:'lockBlock', children:[ {tag:'input', type:'checkbox', id:'autolock'}, {tag:'span', html:'auto'}, {tag:'a', href:'#', htmlString:Clipperz.PM.Strings['lockMenuLabel'], id:'lock'} ]} ]}); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', id:'compactMiscLinks', children:[ {tag:'a', id:'donateHeaderIconLink', target:'_blank', href:Clipperz.PM.Strings['donateHeaderLinkUrl'], children:[ {tag:'img', id:'donateHeaderLinkIcon', src:'./images/smiles_small.gif'} ]}, {tag:'ul', children:[ {tag:'li', children:[{tag:'a', id:'donateHeaderLink', html:'donate', target:'_blank'}]}, {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', html:'credits', target:'_blank'}]}, {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', html:'feedback', target:'_blank'}]}, {tag:'li', children:[{tag:'a', id:'helpHeaderLink', html:'help', target:'_blank'}]}, {tag:'li', children:[{tag:'a', id:'forumHeaderLink', html:'forum', target:'_blank'}]} ]} ]} ); YAHOO.ext.Element.get('lockBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); Clipperz.NotificationCenter.notify(this, 'switchLanguage'); }, //----------------------------------------------------- __syntaxFix__: '__syntaxFix__' }); 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) { diff --git a/frontend/beta/js/Clipperz/PM/Components/Compact/LoginForm.js b/frontend/beta/js/Clipperz/PM/Components/Compact/LoginForm.js index a1e60d8..013dd0d 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Compact/LoginForm.js +++ b/frontend/beta/js/Clipperz/PM/Components/Compact/LoginForm.js @@ -1,186 +1,184 @@ /* -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.LoginForm = function(anElement, args) { Clipperz.PM.Components.Compact.LoginForm.superclass.constructor.call(this, anElement, args); this.render(); Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'userNotificationHandler') return this; }; YAHOO.extendX(Clipperz.PM.Components.Compact.LoginForm, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Compact.LoginForm"; }, //----------------------------------------------------- 'render': function() { var result; var layout; MochiKit.Signal.disconnectAllTo(this); this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', id:this.getId('baseDiv'), cls:'LoginPanel', children:[ {tag:'div', id:'compactHeader'}, {tag:'div', id:'compactBody', children:[ {tag:'form', id:this.getId('loginForm_form'), children:[ {tag:'dl', children:[ {tag:'dt', htmlString:Clipperz.PM.Strings['loginFormUsernameLabel']}, {tag:'dd', children:[ {tag:'input', id:this.getId('login_username'), type:'text', size:'30', name:'username'} ]}, {tag:'dt', htmlString:Clipperz.PM.Strings['loginFormPassphraseLabel']}, {tag:'dd', children:[ {tag:'input', id:this.getId('login_passphrase'), type:'password', size:'30', name:'passphrase'} ]} ]}, {tag:'div', id:this.getId('login_submit')} ]}, {tag:'h4', id:this.getId('message')} ]} ]}); new Clipperz.PM.Components.Compact.CompactHeader(YAHOO.ext.Element.get('compactHeader')); MochiKit.Signal.connect(this.getId('loginForm_form'), 'onsubmit', this, 'stopFormSubmit'); new YAHOO.ext.Button(this.getId('login_submit'), {text:Clipperz.PM.Strings['loginFormButtonLabel'], handler:this.doLogin, scope:this, minWidth:0}); this.getElement('login_submit').swallowEvent('click', true); MochiKit.Signal.connect(this.getId('loginForm_form'), 'onkeydown', this, 'onkeydown'); new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('login_passphrase')); this.getElement('login_username').focus(); return result; }, //----------------------------------------------------- 'doLogin': function(e) { //MochiKit.Logging.logDebug(">>> compact.LoginForm.doLogin"); if (this.checkLoginForm()) { this.doLoginWithUsernameAndPassphrase(this.getDom('login_username').value, this.getDom('login_passphrase').value); } //MochiKit.Logging.logDebug("<<< compact.LoginForm.doLogin"); }, //......................................................................... 'doLoginWithUsernameAndPassphrase': function(anUsername, aPassphrase) { var deferredResult; var user; //MochiKit.Logging.logDebug(">>> compact.LoginForm.doLoginWithUsernameAndPassphrase"); user = new Clipperz.PM.DataModel.User({username:anUsername, passphrase:aPassphrase}); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.method(user, 'connect')); deferredResult.addCallback(MochiKit.Base.method(user, 'loadPreferences')); deferredResult.addCallback(MochiKit.Base.method(user, 'loadRecords')); deferredResult.addCallback(MochiKit.Base.method(user, 'loadDirectLogins')); deferredResult.addErrback(MochiKit.Base.bind(function() { this.getElement('loginForm_form').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show(); this.getElement('message').update(Clipperz.PM.Strings['loginMessagePanelFailureText']); this.getDom('login_passphrase').value = ""; this.getElement('login_passphrase').focus(); }, this)) //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("compact.LoginForm.doLogin - 6: " + res); return res;}); deferredResult.callback("token"); //MochiKit.Logging.logDebug("<<< compact.LoginForm.doLoginWithUsernameAndPassphrase"); return deferredResult; }, //......................................................................... 'checkLoginForm': function() { var result; var username var passphrase; //MochiKit.Logging.logDebug(">>> checkLoginForm"); username = this.getDom('login_username').value; passphrase = this.getDom('login_passphrase').value; if ((username != "") && (passphrase != "")) { result = true; } else { if (username == "") { this.getElement('login_username').focus(); } else if (passphrase == "") { this.getElement('login_passphrase').focus(); } result = false; } //MochiKit.Logging.logDebug("<<< checkLoginForm - " + result); return result; }, //------------------------------------------------------------------------- 'stopFormSubmit': function(anEvent) { anEvent.stop(); }, //------------------------------------------------------------------------- 'onkeydown': function(anEvent) { //MochiKit.Logging.logDebug(">>> onkeydown - " + anEvent.src().id); if (anEvent.key().code == 13) { this.doLogin(); anEvent.stop(); } }, //----------------------------------------------------- 'userNotificationHandler': function(anEvent) { //MochiKit.Logging.logDebug(">>> compact.LoginForm.userNotificationHandler"); //MochiKit.Logging.logDebug("userNotificationHandler - event: " + anEvent.event()); this.getElement('loginForm_form').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); if (this.getDom('message') != null) { this.getElement('message').update(Clipperz.PM.Strings.messagePanelConfigurations[anEvent.parameters()]()['text']); } //MochiKit.Logging.logDebug("<<< compact.LoginForm.userNotificationHandler"); }, //----------------------------------------------------- __syntaxFix__: '__syntaxFix__' }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js index 3f4952d..fef8e9e 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js @@ -1,171 +1,169 @@ /* -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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImport.CSVImportColumns = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.CSVImport.CSVImportColumns.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportColumns, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImport.CSVImportColumns component"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'render': function() { var i,c; var columnSelectorCheckboxCells; var checkboxes; var data; //MochiKit.Logging.logDebug(">>> CSVImportColumns.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); data = this.mainComponent().parsedValues(); columnSelectorCheckboxCells = []; c = data[0].length; for (i=0; i<c; i++) { columnSelectorCheckboxCells.push({tag:'th', valign:'top', cls:(this.mainComponent().isColumnSelected(i) ? 'selectedColumn': 'skippedColumn'), children:[ {tag:'input', type:'checkbox', id:this.getId('columnCheckbox_' + i), value:i} ]}) } this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Columns']}, {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview columns', cellspacing:'0', children:[ {tag:'thead', id:this.getId('previewData_thead'), children:[ {tag:'tr', children:columnSelectorCheckboxCells} ]}, {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} ]} ]} ]}); c = data[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { this.getDom('columnCheckbox_' + i).checked = true; } } this.renderData(this.getElement('previewData_tbody'), data); checkboxes = MochiKit.DOM.getElementsByTagAndClassName('input', null, this.getDom('previewData_thead')); c = checkboxes.length; for (i=0; i<c; i++) { MochiKit.Signal.connect(checkboxes[i], 'onclick', this, 'renderDataHandler'); } //MochiKit.Logging.logDebug("<<< CSVImportColumns.render"); }, //------------------------------------------------------------------------- 'renderData': function(anElement, someData) { var config; var i,c; //MochiKit.Logging.logDebug(">>> CSVImportColumns.renderData"); // anElement.update(""); MochiKit.DOM.replaceChildNodes(anElement.dom); config = MochiKit.Base.map(MochiKit.Base.bind(function(aRowData) { var result; var i,c; result = {tag:'tr', children:[]}; c = aRowData.length; for (i=0; i<c; i++) { var field; field = aRowData[i]; result.children.push({tag:'td', valign:'top', cls:(this.mainComponent().isColumnSelected(i) ? 'selectedColumn': 'skippedColumn'), html:(MochiKit.Base.isNotEmpty(field) ? field.replace(/\n/g, '<br>') : ' ')}); } return result; }, this), someData); MochiKit.Base.map(function(aRowConfig) {Clipperz.YUI.DomHelper.append(anElement, aRowConfig);}, config); Clipperz.Style.applyZebraStylesToTable(this.getId('previewDada')); //MochiKit.Logging.logDebug("<<< CSVImportColumns.renderData"); }, //------------------------------------------------------------------------- 'renderDataHandler': function(anEvent) { var thElement; thElement = YAHOO.ext.Element.get(anEvent.src().parentNode); if (anEvent.src().checked == true) { this.mainComponent().skippedColumns().remove(anEvent.src().value); thElement.addClass('selectedColumn'); thElement.removeClass('skippedColumn'); } else { this.mainComponent().skippedColumns().add(anEvent.src().value); thElement.removeClass('selectedColumn'); thElement.addClass('skippedColumn'); } if (this.mainComponent().skippedColumns().allItems().length == this.mainComponent().parsedValues()[0].length) { this.mainComponent().nextButton().disable(); } else { this.mainComponent().nextButton().enable(); } this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js index f7dbd5d..e816380 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImport.CSVImportFields = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.CSVImport.CSVImportFields.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportFields, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImport.CSVImportFields component"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'render': function() { var fieldsHeaderCells; var titleColumnIndex; var notesColumnIndex; var i,c; Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); titleColumnIndex = this.mainComponent().titleColumnIndex() notesColumnIndex = this.mainComponent().notesColumnIndex() fieldsHeaderCells = []; fieldsHeaderCells.push({tag:'td', valign:'top', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}); c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { var trimmedLabel; trimmedLabel = Clipperz.Base.trim(this.mainComponent().labelForColumn(i)); fieldsHeaderCells.push({tag:'td', valign:'top', id:this.getId('fieldHeaderTD_' + i), cls:((trimmedLabel == "") ? 'missingLabelWarning' : (this.isColumnSetup(i) ? 'configuredColumn': 'unconfiguredColumn')), children:[ {tag:'span', html:((trimmedLabel == "") ? Clipperz.PM.Strings['CSV_ImportWizard_Fields_MissingLabelWarning'] : trimmedLabel)/*, cls:((trimmedLabel == "") ? 'missingLabelWarning' : '')*/}, {tag:'select', id:this.getId('select_' + i), name:i, children:[ {tag:'option', value:'UNDEFINED', html:"select data type", cls:'disabledOption'}, {tag:'option', value:'TXT', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['TXT']['shortDescription']}, {tag:'option', value:'PWD', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['PWD']['shortDescription']}, {tag:'option', value:'URL', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['URL']['shortDescription']}, {tag:'option', value:'DATE', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['DATE']['shortDescription']}, {tag:'option', value:'ADDR', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['ADDR']['shortDescription']} ]} ]}) } } if (notesColumnIndex != -1) { fieldsHeaderCells.push({tag:'td', valign:'top', cls:'notes', html:this.mainComponent().labelForColumn(notesColumnIndex)}); } this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Fields']}, {tag:'div', id:this.getId('dataDiv'), children:[ {tag:'div', children:[ ]}, {tag:'div', cls:'csvImportPreview', children:[ {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ {tag:'thead', id:this.getId('previewData_thead'), children:[ {tag:'tr', cls:'CSV_previewData_header', children:fieldsHeaderCells} ]}, {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} ]} ]} ]} ]}); for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { Clipperz.DOM.selectOptionMatchingValue(this.getDom('select_' + i), this.mainComponent().typeForColumn(i)); MochiKit.Signal.connect(this.getDom('select_' + i), 'onchange', this, 'renderDataRowsHandler'); } } this.renderDataRows(this.getElement('previewData_tbody')); // Clipperz.NotificationCenter.register(null, 'updatedCSVImportColumnHeader', this, 'renderDataRowsHandler'); }, //------------------------------------------------------------------------- 'isColumnSetup': function(aColumnIndex) { return ((Clipperz.Base.trim(this.mainComponent().labelForColumn(aColumnIndex)) != "") && (this.mainComponent().typeForColumn(aColumnIndex) != 'UNDEFINED')); }, //------------------------------------------------------------------------- 'renderDataRowsHandler': function(anEvent) { var columnIndex; var tdElement; //MochiKit.Logging.logDebug(">>> renderDataRowsHandler") columnIndex = anEvent.src().name; this.mainComponent().setTypeForColumn(anEvent.src().value, columnIndex); tdElement = this.getElement('fieldHeaderTD_' + columnIndex); if (this.isColumnSetup(columnIndex)) { tdElement.removeClass('unconfiguredColumn'); tdElement.addClass('configuredColumn'); } else { tdElement.addClass('unconfiguredColumn'); tdElement.removeClass('configuredColumn'); } this.renderDataRows(this.getElement('previewData_tbody')); }, //------------------------------------------------------------------------- 'renderDataRows': function(anElement) { var titleColumnIndex; var notesColumnIndex; var data var i,c; //MochiKit.Logging.logDebug("#### >> renderDataRows"); // anElement.update(""); MochiKit.DOM.replaceChildNodes(anElement.dom); if (this.mainComponent().isFirstRowHeader()) { data = this.mainComponent().parsedValues().slice(1); } else { data = this.mainComponent().parsedValues(); } titleColumnIndex = this.mainComponent().titleColumnIndex(); notesColumnIndex = this.mainComponent().notesColumnIndex(); c = data.length; for (i=0; i<c; i++) { var rowData; var rowConfig; var ii, cc; rowData = data[i]; rowConfig = {tag:'tr', children:[ {tag:'td', valign:'top', cls:'title', html:(MochiKit.Base.isNotEmpty(rowData[titleColumnIndex]) ? rowData[titleColumnIndex].replace(/\n/g, '<br>') : ' ')} ]}; cc = rowData.length; for (ii=0; ii<cc; ii++) { // if ((ii != titleColumnIndex) && (ii != notesColumnIndex)) { if ((ii != titleColumnIndex) && (ii != notesColumnIndex) && (this.mainComponent().isColumnSelected(ii))) { rowConfig.children.push({ tag:'td', valign:'top', cls:(this.isColumnSetup(ii) ? 'configuredColumn' : 'unconfiguredColumn'), html:(MochiKit.Base.isNotEmpty(rowData[ii]) ? rowData[ii].replace(/\n/g, '<br>') : ' ') }); } } if (notesColumnIndex != -1) { rowConfig.children.push({tag:'td', valign:'top', cls:'notes', html:(MochiKit.Base.isNotEmpty(rowData[notesColumnIndex]) ? rowData[notesColumnIndex].replace(/\n/g, '<br>') : ' ')}); } this.domHelper().append(anElement, rowConfig); } Clipperz.Style.applyZebraStylesToTable(this.getId('previewDada')); this.checkWetherToEnableNextButton(); //MochiKit.Logging.logDebug("#### << renderDataRows"); }, diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js index 5cb8679..dbde138 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImport.CSVImportHeader = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.CSVImport.CSVImportHeader.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; this._pendingDeferredLabelFieldHandlerEvents = 0; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportHeader, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImport.CSVImportHeader component"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'render': function() { var thConfigs; var i,c; //MochiKit.Logging.logDebug(">>> CSVImportHeader.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); thConfigs = []; c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { // thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:this.mainComponent().labelForColumn(i)}]}); thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:""}]}); } } this.element().update(""); this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header']}, {tag:'div', cls:'importStepParameters', children:[ {tag:'input', type:'checkbox', name:'isFistRowHeader', id:this.getId('isFirstRowHeader_checkbox')}, {tag:'span', id:this.getId('isFirstRowHeader_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header_Settings_firstRowHeaderLabel']} ]}, {tag:'div', id:this.getId('dataDiv'), children:[ {tag:'div', cls:'csvImportPreview', children:[ {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview header', cellspacing:'0', children:[ {tag:'thead', children:[{tag:'tr', children:thConfigs}]}, {tag:'tbody', id:this.getId('previewData_tbody')} ]} ]} ]} ]}); for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { this.getElement('headerTextField_' + i).dom.value = this.mainComponent().labelForColumn(i); } } this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); if (this.mainComponent().isFirstRowHeader()) { this.getDom('isFirstRowHeader_checkbox').click(); } c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onchange', MochiKit.Base.partial(MochiKit.Base.method(this, 'labelFieldHandler'), i)); MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onkeypress', MochiKit.Base.partial(MochiKit.Base.method(this, 'deferredLabelFieldHandler'), i)); } } MochiKit.Signal.connect(this.getDom('isFirstRowHeader_checkbox'), 'onclick', this, 'toggleFirstRowHeaderCheckboxHandler'); if (Clipperz_IEisBroken != true) { MochiKit.Signal.connect(this.getDom('isFirstRowHeader_span'), 'onclick', this.getDom('isFirstRowHeader_checkbox'), 'click'); } //MochiKit.Logging.logDebug("<<< CSVImportHeader.render"); }, //------------------------------------------------------------------------- 'renderData': function(anElement, someData) { var trConfigs; var data; var i,c; // anElement.update(""); MochiKit.DOM.replaceChildNodes(anElement.dom); if (this.mainComponent().isFirstRowHeader()) { data = someData.slice(1); } else { data = someData; } trConfigs = MochiKit.Base.map(MochiKit.Base.bind(function(aRowData) { var result; var i,c; result = {tag:'tr', children:[]}; c = aRowData.length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { result.children.push({tag:'td', valign:'top', html:(MochiKit.Base.isNotEmpty(aRowData[i]) ? aRowData[i].replace(/\n/g, '<br>') : ' ')}); } } return result; }, this), data); MochiKit.Base.map(function(aRowConfig) {Clipperz.YUI.DomHelper.append(anElement, aRowConfig);}, trConfigs); Clipperz.Style.applyZebraStylesToTable(this.getId('previewDada')); }, //------------------------------------------------------------------------- 'toggleFirstRowHeaderCheckboxHandler': function() { var firstRowData; var i,c; //MochiKit.Logging.logDebug(">>> toggleFirstRowHeaderCheckboxHandler"); this.mainComponent().setIsFirstRowHeader(this.getDom('isFirstRowHeader_checkbox').checked); firstRowData = this.mainComponent().parsedValues()[0]; c = firstRowData.length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { var label; if (this.mainComponent().isFirstRowHeader()) { label = firstRowData[i]; } else { label = null; } this.mainComponent().setLabelForColumn(label, i); } }; this.updateInputFieldValues(); this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); //MochiKit.Logging.logDebug("<<< toggleFirstRowHeaderCheckboxHandler"); }, //------------------------------------------------------------------------- 'updateInputFieldValues': function() { var i,c; //MochiKit.Logging.logDebug(">>> updateInputFieldValues"); c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { this.getDom('headerTextField_' + i).value = this.mainComponent().labelForColumn(i); } } //console.log('[1] fieldSettings', fieldSettings); //MochiKit.Logging.logDebug("<<< updateInputFieldValues"); }, //------------------------------------------------------------------------- 'labelFieldHandler': function(aColumnIndex, anEvent) { var inputField; //MochiKit.Logging.logDebug(">>> labelFieldHandler"); inputField = anEvent.src(); this.mainComponent().setLabelForColumn(inputField.value, aColumnIndex); //MochiKit.Logging.logDebug("##### [" + anEvent.src().id + "] -> label[" + aColumnIndex + "]: '" + inputField.value + "'"); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js index 6344e06..ccfdeca 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js @@ -1,209 +1,207 @@ /* -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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImport.CSVImportNotes = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.CSVImport.CSVImportNotes.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportNotes, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImport.CSVImportNotes component"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'render': function() { var notesSelectorCheckboxCells; var totalNumberOfColumns; var titleColumnIndex; var notesColumnIndex; var i,c; Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); titleColumnIndex = this.mainComponent().titleColumnIndex() notesColumnIndex = this.mainComponent().notesColumnIndex() totalNumberOfColumns = this.mainComponent().parsedValues()[0].length; notesSelectorCheckboxCells = [{tag:'th', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}]; c = totalNumberOfColumns; for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { notesSelectorCheckboxCells.push({tag:'th', id:this.getId('th_' + i), valign:'top', children:[ {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportNotesColumn', value:i}, {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} ]}) } } this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes']}, {tag:'div', id:this.getId('dataDiv'), children:[ {tag:'div', cls:'importStepParameters', children:[ {tag:'input', id:this.getId('doNotSetNotes_radio'), type:'radio', name:'CSVImportNotesColumn', value:-1}, {tag:'span', id:this.getId('doNotSetNotes_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes_Settings_noSelectionLabel']} ]}, {tag:'div', cls:'csvImportPreview', children:[ {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ {tag:'thead', id:this.getId('previewData_thead'), children:[ {tag:'tr', children:notesSelectorCheckboxCells} ]}, {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} ]} ]} ]} ]}); this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); if ((notesColumnIndex >= totalNumberOfColumns) || (notesColumnIndex == titleColumnIndex) || !(this.mainComponent().isColumnSelected(notesColumnIndex))) { this.mainComponent().setNotesColumnIndex(-1); notesColumnIndex = -1; } c = totalNumberOfColumns; for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); if (Clipperz_IEisBroken != true) { MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); } } } MochiKit.Signal.connect(this.getDom('doNotSetNotes_radio'), 'onclick', this, 'renderDataHandler'); if (Clipperz_IEisBroken != true) { MochiKit.Signal.connect(this.getDom('doNotSetNotes_span'), 'onclick', this.getDom('doNotSetNotes_radio'), 'click'); } if (notesColumnIndex == -1) { this.getDom('doNotSetNotes_radio').click(); } else { this.getDom('radio_' + notesColumnIndex).click(); } }, //------------------------------------------------------------------------- 'renderData': function(anElement, someData) { var data; var config; var titleColumnIndex; var notesColumnIndex; var i,c; // anElement.update(""); MochiKit.DOM.replaceChildNodes(anElement.dom); titleColumnIndex = this.mainComponent().titleColumnIndex(); notesColumnIndex = this.mainComponent().notesColumnIndex(); if (this.mainComponent().isFirstRowHeader()) { data = someData.slice(1); } else { data = someData; } // config = [{tag:'tr', cls:'CSV_previewData_header', children:[{tag:'td', valign:'top', html:header[titleColumnIndex], cls:'title'}]}]; // c = header.length; // for (i=0; i<c; i++) { // if (i != titleColumnIndex) { // config[0].children.push({tag:'td', valign:'top', html:header[i], cls:((notesColumnIndex == i) ? 'notesColumn': '')}) // } // } config = MochiKit.Base.map(MochiKit.Base.bind(function(aTitleColumnIndex, aRowData) { var result; var i,c; result = {tag:'tr', children:[{tag:'td', valign:'top', cls:'title', html:(MochiKit.Base.isNotEmpty(aRowData[aTitleColumnIndex]) ? aRowData[aTitleColumnIndex].replace(/\n/g, '<br>') : ' ')}]}; c = aRowData.length; for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { result.children.push({tag:'td', valign:'top', cls:((notesColumnIndex == i) ? 'notesColumn': ''), html:(MochiKit.Base.isNotEmpty(aRowData[i]) ? aRowData[i].replace(/\n/g, '<br>') : ' ')}); } } return result; }, this, titleColumnIndex), data); MochiKit.Base.map(function(aRowConfig) {Clipperz.YUI.DomHelper.append(anElement, aRowConfig);}, config); Clipperz.Style.applyZebraStylesToTable(this.getId('previewDada')); }, //------------------------------------------------------------------------- 'renderDataHandler': function(anEvent) { var titleColumnIndex; var i,c; this.mainComponent().setNotesColumnIndex(anEvent.src().value); titleColumnIndex = this.mainComponent().titleColumnIndex(); c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { this.getElement('th_' + i).removeClass('notesColumn'); } } if (anEvent.src().value != -1) { this.getElement('th_' + anEvent.src().value).addClass('notesColumn'); } this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js index aa57580..4b2149a 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js @@ -1,186 +1,184 @@ /* -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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImport.CSVImportTitle = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.CSVImport.CSVImportTitle.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportTitle, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImport.CSVImportTitle component"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'render': function() { var titleSelectorCheckboxCells; var titleColumnIndex; var i,c; Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); titleColumnIndex = this.mainComponent().titleColumnIndex() titleSelectorCheckboxCells = []; c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { titleSelectorCheckboxCells.push({tag:'th', valign:'top', id:this.getId('th_' + i), children:[ {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportTitleColumn', value:i}, {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} ]}) } } if (titleColumnIndex >= titleSelectorCheckboxCells.length) { this.mainComponent().setTitleColumnIndex(-1); } this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ {tag:'thead', id:this.getId('previewData_thead'), children:[ {tag:'tr', children:titleSelectorCheckboxCells} ]}, {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} ]} ]} ]}); this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); if (Clipperz_IEisBroken != true) { MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); } } } if (titleColumnIndex != -1) { this.getDom('radio_' + titleColumnIndex).click(); } else { this.mainComponent().nextButton().disable(); } }, //------------------------------------------------------------------------- 'renderData': function(anElement, someData) { var data; var config; var titleColumnIndex; var i,c; // anElement.update(""); MochiKit.DOM.replaceChildNodes(anElement.dom); titleColumnIndex = this.mainComponent().titleColumnIndex() if (this.mainComponent().isFirstRowHeader()) { data = someData.slice(1); } else { data = someData; } config = MochiKit.Base.map(MochiKit.Base.bind(function(aRowData) { var result; var i,c; result = {tag:'tr', children:[]}; c = aRowData.length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { var field; field = aRowData[i]; result.children.push({tag:'td', valign:'top', cls:((titleColumnIndex == i) ? 'titleColumn': ''), html:(MochiKit.Base.isNotEmpty(field) ? field.replace(/\n/g, '<br>') : ' ')}); } } return result; }, this), data); MochiKit.Base.map(function(aRowConfig) {Clipperz.YUI.DomHelper.append(anElement, aRowConfig);}, config); Clipperz.Style.applyZebraStylesToTable(this.getId('previewDada')); }, //------------------------------------------------------------------------- 'renderDataHandler': function(anEvent) { var i,c; this.mainComponent().setTitleColumnIndex(anEvent.src().value); c = this.mainComponent().parsedValues()[0].length; for (i=0; i<c; i++) { if (this.mainComponent().isColumnSelected(i)) { this.getElement('th_' + i).removeClass('titleColumn'); } } this.getElement('th_' + anEvent.src().value).addClass('titleColumn'); if (anEvent.src().value != -1) { this.mainComponent().nextButton().enable(); } else { this.mainComponent().nextButton().disable(); } this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js index c1dd1a9..bd305c3 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.CSVImportComponent = function(anElement, args) { args = args || {}; this._steps = this._steps || ['CSV_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; Clipperz.PM.Components.Import.CSVImportComponent.superclass.constructor.call(this, anElement, args); this._step1Component = null; this._step2Component = null; this._step3Component = null; this._step4Component = null; this._step5Component = null; this._isFirstRowHeader = false; this._titleColumnIndex = -1; this._notesColumnIndex = -1; this._fieldSettings = {}; this._skippedColumns = new Clipperz.Set(); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.CSVImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.CSVImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { this.domHelper().append(this.element(), {tag:'div', cls:'csvImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_csv_description']}, {tag:'div', cls:'importOptionsParameters', children:[ {tag:'div', cls:'CSVImportOptionsParameters', children:[ {tag:'ul', children:[ {tag:'li', children:[ {tag:'label', 'for':this.getId('CSV_inputOptions_separator'), html:"separator"}, {tag:'select', name:this.getId('CSV_inputOptions_separator'), id:this.getId('CSV_inputOptions_separator'), children:[ {tag:'option', name:'comma', value:',', html:"comma (,)", selected:true}, {tag:'option', name:'tab', value:'\t', html:"tab"} ]} ]}, {tag:'li', children:[ {tag:'label', 'for':this.getId('CSV_inputOptions_quote'), html:"quote"}, {tag:'select', name:this.getId('CSV_inputOptions_quote'), id:this.getId('CSV_inputOptions_quote'), children:[ {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, {tag:'option', name:'singleQuote', value:'\'', html:"single quote (\')"} ]} ]}, {tag:'li', children:[ {tag:'label', 'for':this.getId('CSV_inputOptions_escape'), html:"escape"}, {tag:'select', name:this.getId('CSV_inputOptions_escape'), id:this.getId('CSV_inputOptions_escape'), children:[ {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, {tag:'option', name:'slash', value:'\/', html:"slash (\/)"}, {tag:'option', name:'backslash', value:'\\', html:"backslash (\\)"} ]} ]} ]} ]} ]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_7', id:this.getId('step_7'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.updateSteps(); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_4').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_5').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_6').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_7').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); // this.backButton().disable(); }, //------------------------------------------------------------------------- 'nextAction': function() { switch (this.currentStep()) { case 0: // -> 1 Clipperz.PM.Components.MessageBox.showProgressPanel( MochiKit.Base.method(this, 'deferredParseValues'), MochiKit.Base.method(this, 'handleParseError'), this.getDom('nextActionButton') ); break; case 1: // -> 2 this.getElement('step_1').hide(); this.step2Component().render(); this.setCurrentStep(2); this.getElement('step_2').show(); break; case 2: // -> 3 this.getElement('step_2').hide(); this.step3Component().render(); this.setCurrentStep(3); this.getElement('step_3').show(); break; case 3: // -> 4 this.getElement('step_3').hide(); this.step4Component().render(); this.setCurrentStep(4); this.getElement('step_4').show(); break; case 4: // -> 5 this.getElement('step_4').hide(); this.step5Component().render(); this.setCurrentStep(5); this.getElement('step_5').show(); break; case 5: // -> 6 this.previewValues(); break; case 6: // -> 7 this.importValues(); break; } }, //------------------------------------------------------------------------- 'deferredParseValues': function() { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("CSVImportComponent.deferredParseValues - 1 " + res.substring(0,50)); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'parseImportData'); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("CSVImportComponent.deferredParseValues - 2 " + res.substring(0,50)); return res;}); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.startProcessing(); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/ClipperzImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/ClipperzImportComponent.js index c3d2fac..d74961b 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/ClipperzImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/ClipperzImportComponent.js @@ -1,209 +1,207 @@ /* -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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.ClipperzImportComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.ClipperzImportComponent.superclass.constructor.call(this, anElement, args); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.ClipperzImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.ClipperzImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.ClipperzImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', cls:'clipperzImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['Clipperz_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_clipperz_description']}, {tag:'div', cls:'importOptionsParameters', children:[]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.updateSteps(); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug("<<< Import.ClipperzImportComponent.render"); }, //------------------------------------------------------------------------- 'nextAction': function() { switch (this.currentStep()) { case 0: // -> 1 this.previewValues(); break; case 1: // -> 2 this.importValues(); break; } }, //------------------------------------------------------------------------- 'deferredPreviewValues': function() { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.startProcessing(); return res; }, this)); deferredResult.addCallback(MochiKit.Base.method(this, 'processClipperzValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'setProcessedValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'previewRecordValues')); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.processingDone(); this.getElement('step_0').hide(); this.getElement('step_1').show(); this.backButton().enable(); return res; }, this)); // deferredResult.addErrback(MochiKit.Base.bind(function() { // this.processingAborted(); // }, this)) deferredResult.callback(this.textAreaContent()); return deferredResult; }, //------------------------------------------------------------------------- 'processClipperzValues': function(someData) { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 1: " + res); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'parseImportData'); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 2: " + res); return res;}); deferredResult.addCallback(Clipperz.Base.evalJSON); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 3: " + res); return res;}); deferredResult.addCallback(function(res) { return Clipperz.NotificationCenter.deferredNotification(this, 'updatedProgressState', {steps:(res.length)}, res); }) //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 4: " + res); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'previewImportData'); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 5: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.bind(function(someClipperzValues) { var innerDeferredResult; var records; var i,c; innerDeferredResult = new MochiKit.Async.Deferred(); records = []; c = someClipperzValues.length; for(i=0; i<c; i++) { innerDeferredResult.addCallback(MochiKit.Async.wait, 0.2); innerDeferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', {}); innerDeferredResult.addCallback(MochiKit.Base.bind(function(someRecords, someData) { var record; var recordVersion; //MochiKit.Logging.logDebug("=== someData: " + Clipperz.Base.serializeJSON(someData)); record = new Clipperz.PM.DataModel.Record({user:this.user()}); record.setLabel(someData['label']); record.setShouldProcessData(true); record.processData(someData); someRecords.push(record); return someRecords; }, this), records, someClipperzValues[i]); } innerDeferredResult.addCallback(MochiKit.Async.succeed, records); innerDeferredResult.callback(); return innerDeferredResult; }, this)); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Record.processClipperzValues - 6: " + res); return res;}); deferredResult.callback(someData); return deferredResult; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js index ad0d985..859c190 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js @@ -1,131 +1,129 @@ /* -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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.ExcelImportComponent = function(anElement, args) { args = args || {}; this._steps = ['EXCEL_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; Clipperz.PM.Components.Import.ExcelImportComponent.superclass.constructor.call(this, anElement, args); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.ExcelImportComponent, Clipperz.PM.Components.Import.CSVImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.ExcelImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.ExcelImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', cls:'excelImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['Excel_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_excel_description']}, {tag:'div', cls:'importOptionsParameters', children:[]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_7', id:this.getId('step_7'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.updateSteps(); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_4').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_5').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_6').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_7').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug("<<< Import.ExcelImportComponent.render"); }, //------------------------------------------------------------------------- 'csvProcessor': function() { return new Clipperz.CSVProcessor({ // quoteChar: this.getDom('CSV_inputOptions_quote').value, // escapeChar: this.getDom('CSV_inputOptions_escape').value, separatorChar: '\t', binary:true }); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/GenericImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/GenericImportComponent.js index a55455a..3c23b1c 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/GenericImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/GenericImportComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.GenericImportComponent = function(anElement, args) { args = args || {}; this._steps = this._steps || ['EDIT', 'PREVIEW', 'IMPORT']; Clipperz.PM.Components.Import.GenericImportComponent.superclass.constructor.call(this, anElement, args); this._user = args['user']; this._currentStep = 0; this._currentStatus = 'IDLE'; // 'PROCESSING' this._parsedValues = null; this._processedValues = null; this._backButton = null; this._nextButton = null; Clipperz.NotificationCenter.register(null, 'importProcessorProgressUpdate', this, 'updateProgressDialogStatus'); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.GenericImportComponent, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.GenericImportComponent component"; }, //------------------------------------------------------------------------- 'user': function() { return this._user; }, //------------------------------------------------------------------------- 'textAreaConfig': function() { return {tag:'textarea', name:this.getId('importTextArea'), cls:'importTextArea', id:this.getId('importTextArea'), cols:60, rows:15, html:""}; }, 'textAreaContent': function() { return this.getDom('importTextArea').value }, //------------------------------------------------------------------------- 'steps': function() { return this._steps; }, 'currentStep': function() { return this._currentStep; }, 'setCurrentStep': function(aValue) { this._currentStep = aValue; this.updateSteps(); }, //------------------------------------------------------------------------- 'currentStatus': function() { return this._currentStatus; }, 'startProcessing': function() { this._currentStatus = 'PROCESSING'; this.updateSteps(); }, 'processingDone': function() { this._currentStatus = 'IDLE'; this.setCurrentStep(this.currentStep() + 1); }, 'processingAborted': function() { this._currentStatus = 'IDLE'; this.updateSteps(); }, //------------------------------------------------------------------------- 'stepsConfig': function() { var result; var i,c; result = []; c = this.steps().length; for (i=0; i<c; i++) { var cls; if (this.currentStep() == i) { if (this.currentStatus() == 'IDLE') { cls = 'current'; } else { cls = 'currentProcessing'; } } else { cls = ""; } result.push({tag:'td', cls:cls, children:[ {tag:'div', children:[{tag:'span', htmlString:Clipperz.PM.Strings['ImportWizard'][this.steps()[i]]}]} ]}) if (i < (c-1)) { if ((this.currentStep() == i) && (this.currentStatus() == 'PROCESSING')) { cls = 'stepSeparatorProcessing'; } else { cls = 'stepSeparator'; } result.push({tag:'td', cls:cls, children:[ {tag:'div', children:[{tag:'span', html:">"}]} ]}); } } result = [{tag:'div', cls:'importWizardStepsBox', children:[ {tag:'div', cls:'importWizardStepsInnerBox', children:[ {tag:'table', cls:'importWizardSteps', children:[ {tag:'tbody', children:[ {tag:'tr', children:result} ]} ]} ]}, {tag:'div', cls:'importWizardStepsBoxFooter'} ]}]; return result; }, 'updateSteps': function() { this.getElement('importSteps').update(""); Clipperz.YUI.DomHelper.append(this.getDom('importSteps'), {tag:'div', children:this.stepsConfig()}); }, //------------------------------------------------------------------------- 'backAction': function() { //MochiKit.Logging.logDebug(">>> backAction"); if (this.currentStep() == 0) { Clipperz.NotificationCenter.notify(this, 'importCancelled'); } else { this.getElement('step_' + this.currentStep()).hide(); this.setCurrentStep(this.currentStep() - 1); this.getElement('step_' + this.currentStep()).show(); this.nextButton().enable(); } //MochiKit.Logging.logDebug("<<< backAction"); }, //------------------------------------------------------------------------- 'backButton': function() { return this._backButton; }, 'setBackButton': function(aValue) { this._backButton = aValue; }, 'nextButton': function() { return this._nextButton; }, 'setNextButton': function(aValue) { this._nextButton = aValue; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.GenericImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', children:[ {tag:'h2', html:this.toString()} ]}); //MochiKit.Logging.logDebug("<<< Import.GenericImportComponent.render"); }, diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js index 5f4fe33..0570704 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.KeePassImportComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.KeePassImportComponent.superclass.constructor.call(this, anElement, args); this._steps = ['EDIT', 'KEEPASS_SETTINGS', 'PREVIEW', 'IMPORT']; this._definedFields = ['Group', 'Group Tree', 'UserName', 'URL', 'Password', 'Notes', 'UUID', 'Icon', 'Creation Time', 'Last Access', 'Last Modification', 'Expires', 'Attachment Description', 'Attachment']; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.KeePassImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.KeePassImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.KeePassImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', cls:'keePassImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['KeePass_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_keePass_description']}, {tag:'div', cls:'importOptionsParameters', children:[]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('settingsDiv'), children:[ {tag:'table', id:'KeePassSettings', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'50%', valign:'top', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group_checkbox'), name:'Group'/*, checked:true*/}]}, {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group_label'), html:"Group"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group Tree_checkbox'), name:'Group Tree'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group Tree_label'), html:"Group Tree"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UserName_checkbox'), name:'UserName', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UserName_label'), html:"UserName"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('URL_checkbox'), name:'URL', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('URL_label'), html:"URL"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Password_checkbox'), name:'Password', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Password_label'), html:"Password"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Notes_checkbox'), name:'Notes', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Notes_label'), html:"Notes"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UUID_checkbox'), name:'UUID'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UUID_label'), html:"UUID"}]} ]} ]} ]} ]}, {tag:'td', width:'50%', valign:'top', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Icon_checkbox'), name:'Icon'/*, checked:true*/}]}, {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Icon_label'), html:"Icon"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Creation Time_checkbox'), name:'Creation Time'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Creation Time_label'), html:"Creation Time"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Access_checkbox'), name:'Last Access'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Access_label'), html:"Last Access"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Modification_checkbox'), name:'Last Modification'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Modification_label'), html:"Last Modification"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Expires_checkbox'), name:'Expires'/*, checked:true*/}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Expires_label'), html:"Expires"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment Description_checkbox'), name:'Attachment Description', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment Description_label'), html:"Attachment Description"}]} ]}, {tag:'tr', children:[ {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment_checkbox'), name:'Attachment', checked:true}]}, {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment_label'), html:"Attachment"}]} ]} ]} ]} ]} ]} ]} ]} ]} ]} ]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.updateSteps(); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug("<<< Import.KeePassImportComponent.render"); }, //------------------------------------------------------------------------- 'nextAction': function() { switch (this.currentStep()) { case 0: // -> 1 Clipperz.PM.Components.MessageBox.showProgressPanel( MochiKit.Base.method(this, 'deferredParseValues'), MochiKit.Base.method(this, 'handleParseError'), this.getDom('nextActionButton') ); break; case 1: // -> 2 this.previewValues(); break; case 2: // -> 3 this.importValues(); break; } }, //------------------------------------------------------------------------- 'deferredParseValues': function() { var deferredResult; diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/MainComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/MainComponent.js index 05baf46..f97ce78 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/MainComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/MainComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.MainComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.MainComponent.superclass.constructor.call(this, anElement, args); this._user = args.user; this._wizardComponent = null; this._backButton = null; this._nextButton = null; this._selectedComponent = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.MainComponent, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.MainComponent component"; }, //------------------------------------------------------------------------- 'user': function() { return this._user; }, //------------------------------------------------------------------------- 'wizardComponent': function() { return this._wizardComponent; }, 'setWizardComponent': function(aValue) { if (this._wizardComponent != null) { this._wizardComponent.remove(); } if (aValue != null) { this.getElement('importCover').hide(); this.getElement('importWizard').show(); } this._wizardComponent = aValue; }, 'resetImportComponent': function() { //MochiKit.Logging.logDebug(">>> resetImportComponent"); this.setWizardComponent(null); this.getElement('wizardComponent').update(""); this.getElement('importCover').show(); this.getElement('importWizard').hide(); //MochiKit.Logging.logDebug("<<< resetImportComponent"); }, //------------------------------------------------------------------------- 'backButton': function() { return this._backButton; }, 'setBackButton': function(aValue) { this._backButton = aValue; }, 'nextButton': function() { return this._nextButton; }, 'setNextButton': function(aValue) { this._nextButton = aValue; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.MainComponent.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); this.domHelper().append(this.element(), {tag:'div', id:this.getId('mainDiv'), children:[ {tag:'div', id:this.getId('importCover'), children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['importTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['importTabDescription']}, {tag:'div', cls:'importFormats', children:[ {tag:'ul', cls:'radioList', children:[ {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('CSV_radio'), type:'radio', name:'importFormat', value:'CSV'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('CSV_title'), htmlString:Clipperz.PM.Strings['importFormats']['CSV']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['CSV']['description']} ]} ]}]}]} ]}, {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('Excel_radio'), type:'radio', name:'importFormat', value:'EXCEL'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('Excel_title'), htmlString:Clipperz.PM.Strings['importFormats']['Excel']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['Excel']['description']} ]} ]}]}]} ]}, {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('KeePass_radio'), type:'radio', name:'importFormat', value:'KEEPASS'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('KeePass_title'), htmlString:Clipperz.PM.Strings['importFormats']['KeePass']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['KeePass']['description']} ]} ]}]}]} ]}, {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('Roboform_radio'), type:'radio', name:'importFormat', value:'ROBOFORM'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('Roboform_title'), htmlString:Clipperz.PM.Strings['importFormats']['Roboform']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['Roboform']['description']} ]} ]}]}]} ]}, {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('PasswordPlus_radio'), type:'radio', name:'importFormat', value:'PASSWORD_PLUS'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('PasswordPlus_title'), htmlString:Clipperz.PM.Strings['importFormats']['PasswordPlus']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['PasswordPlus']['description']} ]} ]}]}]} ]}, {tag:'li', children:[ {tag:'table', children:[{tag:'tbody', children:[{tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId('ClipperzExport_radio'), type:'radio', name:'importFormat', value:'CLIPPERZ_EXPORT'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId('ClipperzExport_title'), htmlString:Clipperz.PM.Strings['importFormats']['ClipperzExport']['label']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['importFormats']['ClipperzExport']['description']} ]} ]}]}]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]} ]}, {tag:'div', id:this.getId('importWizard'), children:[ {tag:'form', id:this.getId('importWizardForm'), children:[ {tag:'div', cls:'wizardComponent', id:this.getId('wizardComponent'), children:[]} diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/PasswordPlusImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/PasswordPlusImportComponent.js index 24dc785..f58d913 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/PasswordPlusImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/PasswordPlusImportComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.PasswordPlusImportComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.PasswordPlusImportComponent.superclass.constructor.call(this, anElement, args); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.PasswordPlusImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.PasswordPlusImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.PasswordPlusImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', cls:'passwordPlusImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['PasswordPlus_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_passwordPlus_description']}, {tag:'div', cls:'importOptionsParameters', children:[]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.updateSteps(); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug("<<< Import.PasswordPlusImportComponent.render"); }, //------------------------------------------------------------------------- /* 'backAction': function() { switch (this.currentStep()) { case 1: // -> 0 this.backButton().disable(); this.getElement('step_1').hide(); this.setCurrentStep(0); this.getElement('step_0').show(); break; } }, */ //------------------------------------------------------------------------- 'nextAction': function() { switch (this.currentStep()) { case 0: // -> 1 this.previewValues(); break; case 1: // -> 2 this.importValues(); break; } }, //------------------------------------------------------------------------- 'deferredPreviewValues': function() { var deferredResult; // this.setFormValues(MochiKit.DOM.formContents(this.getDom('dataForm'))); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.startProcessing(); return res; }, this)); deferredResult.addCallback(MochiKit.Base.method(this, 'processPasswordPlusValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'setProcessedValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'previewRecordValues')); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.processingDone(); this.getElement('step_0').hide(); this.getElement('step_1').show(); this.backButton().enable(); return res; }, this)); // deferredResult.addErrback(MochiKit.Base.bind(function() { // this.processingAborted(); // }, this)) deferredResult.callback(this.textAreaContent()); return deferredResult; }, //------------------------------------------------------------------------- 'processPasswordPlusValues': function(someData) { var deferredResult; var csvProcessor; csvProcessor = new Clipperz.CSVProcessor({binary:true}); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'parseImportData'); deferredResult.addCallback(function(res) { return Clipperz.NotificationCenter.deferredNotification(this, 'updatedProgressState', {steps:(res.length * 2)}, res); }) deferredResult.addCallback(MochiKit.Base.method(csvProcessor, 'deferredParse')); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'previewImportData'); deferredResult.addCallback(function(res) { return Clipperz.NotificationCenter.deferredNotification(this, 'updatedProgressState', {steps:(res.length * 2), step:res.length}, res); }) deferredResult.addCallback(MochiKit.Base.bind(function(someCSVValues) { var innerDeferredResult; var records; var i,c; innerDeferredResult = new MochiKit.Async.Deferred(); records = []; c = someCSVValues.length; i=0; i++; // Dataviz Passwords Plus Export, Version,1, Minimum Version To Read,1 i++; // Is Template,Title,Category,Field 1 Label,Field 1 Value,Field 1 Hidden,Field 2 Label,Field 2 Value,Field 2 Hidden,Field 3 Label,Field 3 Value,Field 3 Hidden,Field 4 Label,Field 4 Value,Field 4 Hidden,Field 5 Label,Field 5 Value,Field 5 Hidden,Field 6 Label,Field 6 Value,Field 6 Hidden,Field 7 Label,Field 7 Value,Field 7 Hidden,Field 8 Label,Field 8 Value,Field 8 Hidden,Field 9 Label,Field 9 Value,Field 9 Hidden,Field 10 Label,Field 10 Value,Field 10 Hidden,Note for( ; i<c; i++) { innerDeferredResult.addCallback(MochiKit.Async.wait, 0.2); innerDeferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', {}); innerDeferredResult.addCallback(MochiKit.Base.bind(function(someRecords, someData) { if (someData[0] == '0') { var record; var recordVersion; var ii, cc; record = new Clipperz.PM.DataModel.Record({user:this.user()}); if (someData[1] != "") { record.setLabel(someData[1]); } else { record.setLabel("imported record [" + (i+1) + "]"); } record.setNotes(someData[33]); recordVersion = record.currentVersion() cc = 10; diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/RoboFormImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/RoboFormImportComponent.js index fe4d45c..443ee17 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/RoboFormImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/RoboFormImportComponent.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.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } //############################################################################# Clipperz.PM.Components.Import.RoboFormImportComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Import.RoboFormImportComponent.superclass.constructor.call(this, anElement, args); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Import.RoboFormImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 'toString': function() { return "Clipperz.PM.Components.Import.RoboFormImportComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> Import.RoboFormImportComponent.render"); this.domHelper().append(this.element(), {tag:'div', cls:'roboFormImportWizard', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['RoboForm_ImportWizard_Title']}, {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, {tag:'div', cls:'importStepBlocks', children:[ {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ {tag:'div', children:[ {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_roboForm_description']}, {tag:'div', cls:'importOptionsParameters', children:[]}, this.textAreaConfig() ]} ]}, {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[ {tag:'div', children:[ {tag:'div', id:this.getId('previewDiv'), html:"preview"} ]} ]}, {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[ {tag:'div', children:[ {tag:'h4', html:"done"} ]} ]} ]}, {tag:'div', cls:'importOptionsButtons', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('backActionButton')} ]}, {tag:'td', html:' '}, {tag:'td', children:[ {tag:'div', id:this.getId('nextActionButton')} ]}, {tag:'td', html:' '} ]} ]} ]} ]} ]}); this.updateSteps(); this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); //MochiKit.Logging.logDebug("<<< Import.RoboFormImportComponent.render"); }, //------------------------------------------------------------------------- 'nextAction': function() { switch (this.currentStep()) { case 0: // -> 1 this.previewValues(); break; case 1: // -> 2 this.importValues(); break; } }, //------------------------------------------------------------------------- 'deferredPreviewValues': function() { var deferredResult; // this.setFormValues(MochiKit.DOM.formContents(this.getDom('dataForm'))); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.startProcessing(); return res; }, this)); deferredResult.addCallback(MochiKit.Base.method(this, 'processRoboFormValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'setProcessedValues')); deferredResult.addCallback(MochiKit.Base.method(this, 'previewRecordValues')); deferredResult.addCallback(MochiKit.Base.bind(function(res) { this.processingDone(); this.getElement('step_0').hide(); this.getElement('step_1').show(); this.backButton().enable(); return res; }, this)); // deferredResult.addErrback(MochiKit.Base.bind(function() { // this.processingAborted(); // }, this)) deferredResult.callback(this.textAreaContent()); return deferredResult; }, //------------------------------------------------------------------------- 'processRoboFormValues': function(someData) { var result; if (someData.match(/^\<HTML\>\<HEAD\>\<TITLE\>RoboForm Passcards List /g)) { result = this.processRoboFormPasscardsValues(someData); } else if (someData.match(/\<HTML\>\<HEAD\>\<TITLE\>RoboForm Safenotes List /g)) { result = this.processRoboFormSafenotesValues(someData); } return result; }, //......................................................................... 'processRoboFormPasscardsValues': function(someData) { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues - 1: "/* + res*/); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'parseImportData'); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues - 2: "/* + res*/); return res;}); deferredResult.addCallback(function(someData) { var result; var data; data = someData.replace(/\r?\n/g, ""); result = data.match(/\<TABLE width\=\"100\%\"\>.*?\<\/TABLE\>/g); return result; }); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues - 3: "/* + res*/); return res;}); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues - 3.1: " + res.length); return res;}); deferredResult.addCallback(function(res) { return Clipperz.NotificationCenter.deferredNotification(this, 'updatedProgressState', {steps:(res.length)}, res); }) //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues - 4: "/* + res*/); return res;}); deferredResult.addCallback(MochiKit.Base.bind(function(someRecordValues) { var innerDeferredResult; var records; var i,c; innerDeferredResult = new MochiKit.Async.Deferred(); records = []; c = someRecordValues.length; for(i=0; i<c; i++) { //innerDeferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues __inner loop__ - 1: " + res); return res;}); innerDeferredResult.addCallback(MochiKit.Async.wait, 0.2); //innerDeferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues __inner loop__ - 2: " + res); return res;}); innerDeferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', {}); //innerDeferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("RoboFormImportComponent.processRoboFormValues __inner loop__ - 3: " + res); return res;}); innerDeferredResult.addCallback(MochiKit.Base.bind(function(someRecords, someData) { var data; var record; var recordVersion; var fields; var ii, cc; var hasNotes; var caption; var subcaption; diff --git a/frontend/beta/js/Clipperz/PM/Components/MessageBox.js b/frontend/beta/js/Clipperz/PM/Components/MessageBox.js index cf9ec86..f9b845e 100644 --- a/frontend/beta/js/Clipperz/PM/Components/MessageBox.js +++ b/frontend/beta/js/Clipperz/PM/Components/MessageBox.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 = {}; } Clipperz.PM.Components.MessageBoxImplementation = function() { this._step = 0; this._steps = 0; return this; }; //YAHOO.extendX(Clipperz.PM.Components.MessageBoxImplementation, Clipperz.PM.Components.BaseComponent, { Clipperz.PM.Components.MessageBoxImplementation.prototype = MochiKit.Base.update(null, { 'toString': function() { return "Clipperz.PM.Components.MessageBox"; }, //----------------------------------------------------- 'step': function() { return this._step; }, 'setStep': function(aValue) { if (aValue == 'next') { this._step = this._step + 1; } else { this._step = aValue; } if (this._step > this.steps()) { //MochiKit.Logging.logDebug("overstepping: " + this._step + " (" + this.steps() + ")"); this._step = this.steps(); } }, //----------------------------------------------------- 'steps': function() { return this._steps; }, 'setSteps': function(aValue) { if (aValue.constructor == String) { if (aValue.charAt(0) == '+') { this._steps += aValue.substring(1)*1; } else if (aValue.charAt(0) == '-') { this._steps -= aValue.substring(1)*1; } else { this._steps = aValue.substring(1)*1; } } else { this._steps = aValue; } }, //----------------------------------------------------- 'deferredShow': function(aConfiguration, anAnimationTargetElement, aValue) { this.show(aConfiguration, anAnimationTargetElement); return aValue; }, 'show': function(aConfiguration, anAnimationTargetElement) { var messageBoxConfiguration; messageBoxConfiguration = MochiKit.Base.clone(aConfiguration); messageBoxConfiguration.msg = messageBoxConfiguration.text; messageBoxConfiguration.animEl = anAnimationTargetElement; messageBoxConfiguration.progress = messageBoxConfiguration.showProgressBar; messageBoxConfiguration.closable = messageBoxConfiguration.showCloseButton; this.setSteps(aConfiguration.steps || 0); this.setStep(aConfiguration.step || 0); delete messageBoxConfiguration.buttons; Clipperz.YUI.MessageBox.show(messageBoxConfiguration); }, //----------------------------------------------------- 'update': function(someValues) { //MochiKit.Logging.logDebug(">>> MessageBox.update"); if (someValues.title) { Clipperz.YUI.MessageBox.getDialog().setTitle(someValues.title); }; if (someValues.text) { Clipperz.YUI.MessageBox.updateText(someValues.text); }; if (typeof(someValues.showProgressBar) != 'undefined') { Clipperz.YUI.MessageBox.progressElement().setDisplayed(someValues.showProgressBar); Clipperz.YUI.MessageBox.updateProgress(0); }; if (typeof(someValues.steps) != 'undefined') { this.setSteps(someValues.steps); }; if (typeof(someValues.step) != 'undefined') { this.setStep(someValues.step); } else { this.setStep('next'); } Clipperz.YUI.MessageBox.updateProgress(this.step() / this.steps()); if (typeof(someValues.fn) != 'undefined') { Clipperz.YUI.MessageBox.opt().fn = someValues.fn; }; if (typeof(someValues.scope) != 'undefined') { Clipperz.YUI.MessageBox.opt().scope = someValues.scope; }; if (someValues.buttons) { Clipperz.YUI.MessageBox.updateButtons(someValues.buttons); }; // if (someValues.title) { // Clipperz.YUI.MessageBox.getDialog().setTitle(someValues.title + " [" + this.step() + " / " + this.steps() + "]"); // }; //MochiKit.Logging.logDebug("--- MessageBox.update - step: " + this.step() + " / " + this.steps() + " - " + someValues.text); //MochiKit.Logging.logDebug("<<< MessageBox.update"); }, //----------------------------------------------------- 'hide': function(anAnimationTargetElement) { if (anAnimationTargetElement) { Clipperz.YUI.MessageBox.getDialog().animateTarget = anAnimationTargetElement; } Clipperz.YUI.MessageBox.hide(); }, //----------------------------------------------------- __syntaxFix__: '__syntaxFix__' }); //########################################################## _clipperz_pm_components_messageBox = null; Clipperz.PM.Components.MessageBox = function() { if (_clipperz_pm_components_messageBox == null) { _clipperz_pm_components_messageBox = new Clipperz.PM.Components.MessageBoxImplementation(); } return _clipperz_pm_components_messageBox; } //--------------------------------------------------------- Clipperz.PM.Components.MessageBox.showProgressPanel = function(aCallback, anErrback, anActivationItem) { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Clipperz.PM.Components.MessageBox.showProgressPanel - 0: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(Clipperz.PM.Components.MessageBox(), 'deferredShow'), { title: "", text: "", width:240, showProgressBar:true, showCloseButton:false, fn:MochiKit.Base.method(deferredResult, 'cancel'), scope:this, buttons:{ // 'ok':Clipperz.PM.Strings['loginMessagePanelInitialButtonLabel'] } }, anActivationItem ); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Clipperz.PM.Components.MessageBox.showProgressPanel - 1: " + res); return res;}); deferredResult.addCallback(aCallback); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Clipperz.PM.Components.MessageBox.showProgressPanel - 2: " + res); return res;}); deferredResult.addCallback(MochiKit.Async.wait, 0.5); deferredResult.addCallback(function(res) { Clipperz.PM.Components.MessageBox().hide(YAHOO.ext.Element.get(anActivationItem)); return res; }); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Clipperz.PM.Components.MessageBox.showProgressPanel - 3: " + res); return res;}); diff --git a/frontend/beta/js/Clipperz/PM/Components/OTP/MainComponent.js b/frontend/beta/js/Clipperz/PM/Components/OTP/MainComponent.js index 7b0b12b..1e94c4b 100644 --- a/frontend/beta/js/Clipperz/PM/Components/OTP/MainComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/OTP/MainComponent.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.OTP) == 'undefined') { Clipperz.PM.Components.OTP = {}; } //############################################################################# Clipperz.PM.Components.OTP.MainComponent = function(anElement, args) { args = args || {}; //MochiKit.Logging.logDebug("new OTP.MainComponent"); Clipperz.PM.Components.OTP.MainComponent.superclass.constructor.call(this, anElement, args); this._user = args.user; this._shouldRender = true; this._deleteButton = null; this._printButton = null; Clipperz.NotificationCenter.register(null, 'tabSelected', this, 'tabSelectedHandler'); // Clipperz.NotificationCenter.register(null, 'oneTimePasswordAdded', this, 'render'); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.OTP.MainComponent, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.OTP.MainComponent component"; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug("### OTP.MainComponent.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { this.element().update(""); this.domHelper().append(this.element(), {tag:'div', cls:'oneTimePasswordReadOnlyMessage', htmlString:Clipperz.PM.Strings['oneTimePasswordReadOnlyMessage']}); } else { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OTP.MainComponent.render - 1: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.bind(function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element(), {tag:'div', htmlString:Clipperz.PM.Strings['oneTimePasswordLoadingMessage']}); }, this)); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OTP.MainComponent.render - 2: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this.user(), 'loadOneTimePasswords')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OTP.MainComponent.render - 3: " + res); return res;}); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OTP.MainComponent.render - 3.1: " + Clipperz.Base.serializeJSON(res.serializedData())); return res;}); deferredResult.addCallback(MochiKit.Base.bind(function(aResult) { var tbodyElement; var oneTimePasswordReferenceKeys; var imageExtension; var isThereAnyActiveOneTimePassword; isThereAnyActiveOneTimePassword = false; this.element().update(""); Clipperz.YUI.DomHelper.append(this.element(), {tag:'div', id:'oneTimePasswordList', children:[ {tag:'div', id:'oneTimePasswords_header', children:[ {tag:'table', width:'100%', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'10%', children:[ {tag:'div', id:this.getId('createNewOneTimePasswordButton')} ]}, {tag:'td', width:'40%', children:[ {tag:'div', id:this.getId('deleteSelectedOneTimePasswordButton')} ]}, {tag:'td', width:'50%', align:'right', children:[ {tag:'div', id:this.getId('printOneTimePasswordButton')} ]} ]} ]} ]}, {tag:'div', children:[ {tag:'ul', children:[ {tag:'li', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['oneTimePasswordSelectionLink_selectLabel']} ]}, {tag:'li', children:[ {tag:'a', href:'#', id:this.getId('selectAllOneTimePasswords_link'), htmlString:Clipperz.PM.Strings['oneTimePasswordSelectionLink_all']} ]}, {tag:'li', children:[ {tag:'a', href:'#', id:this.getId('selectNoneOneTimePasswords_link'), htmlString:Clipperz.PM.Strings['oneTimePasswordSelectionLink_none']} ]}, {tag:'li', children:[ {tag:'a', href:'#', id:this.getId('selectUsedOneTimePasswords_link'), htmlString:Clipperz.PM.Strings['oneTimePasswordSelectionLink_used']} ]}, {tag:'li', children:[ {tag:'a', href:'#', id:this.getId('selectUnusedOneTimePasswords_link'), htmlString:Clipperz.PM.Strings['oneTimePasswordSelectionLink_unused']} ]} ]} ]} ]}, {tag:'form', id:this.getId('oneTimePasswords_form'), children:[ {tag:'table', cls:'oneTimePassword', cellspacing:'0', cellpadding:'2', children:[ {tag:'tbody', id:this.getId('oneTimePasswords_tbody'), children:[ ]} ]} ]} ]}); imageExtension = (Clipperz_IEisBroken == true) ? 'gif': 'png'; tbodyElement = this.getElement('oneTimePasswords_tbody'); oneTimePasswordReferenceKeys = MochiKit.Base.keys(this.user().oneTimePasswordManager().oneTimePasswords()).reverse(); c = oneTimePasswordReferenceKeys.length; if (c>0) { for (i=0; i<c; i++) { var otpReference; var currentOTP; var loginSessionInfoConfig; imageExtension = (Clipperz_IEisBroken == true) ? 'gif': 'png'; otpReference = oneTimePasswordReferenceKeys[i]; currentOTP = this.user().oneTimePasswordManager().oneTimePasswords()[otpReference]; switch (currentOTP.status()) { case 'USED': var loginSessionInfo; loginSessionInfo = currentOTP.connectionInfo(); try { var ip; ip = (currentOTP.connectionInfo()['ip'].match(/^\d{1,3}(.\d{1,3}){3}$/)) ? currentOTP.connectionInfo()['ip'] : Clipperz.PM.Strings['unknown_ip']; loginSessionInfoConfig = [ {tag:'div', cls:'oneTimePassword_usageDateDescription', children:[ {tag:'span', cls:'value', html:Clipperz.PM.Date.getElapsedTimeDescription(currentOTP.usageDate())} ]}, {tag:'div', cls:'oneTimePassword_usageDetails', children:[ {tag:'img', cls:'flag', title:Clipperz.PM.Strings['countries'][ loginSessionInfo['country']], src:Clipperz.PM.Strings['icons_baseUrl'] + "/flags/" + loginSessionInfo['country'].toLowerCase() + "." + imageExtension, width:'32', height:'32'}, {tag:'img', cls:'browser', title:Clipperz.PM.Strings['browsers'][ loginSessionInfo['browser']], src:Clipperz.PM.Strings['icons_baseUrl'] + "/browsers/" + loginSessionInfo['browser'].toLowerCase() + "." + imageExtension, width:'32', height:'32'}, {tag:'img', cls:'operatingSystem', title:Clipperz.PM.Strings['operatingSystems'][loginSessionInfo['operatingSystem']], src:Clipperz.PM.Strings['icons_baseUrl'] + "/operatingSystems/" + loginSessionInfo['operatingSystem'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} ]}, {tag:'div', cls:'oneTimePassword_usageDate', html:Clipperz.PM.Date.formatDateWithTemplate(currentOTP.usageDate(), Clipperz.PM.Strings['fullDate_format'])}, {tag:'div', cls:'oneTimePassword_IP', children:[ {tag:'span', cls:'oneTimePassword_IPLabel', htmlString:Clipperz.PM.Strings['loginHistoryIPLabel']}, {tag:'span', cls:'oneTimePassword_IPValue', html:ip} ]} ]; } catch(exception) { MochiKit.Logging.logWarning("an error occured while showing the One Time Password session details"); loginSessionInfoConfig = []; } break; case 'DISABLED': loginSessionInfoConfig = [ {tag:'span', cls:'disabledOneTimePassword', htmlString:Clipperz.PM.Strings['disabledOneTimePassword_warning']} ]; break; case 'ACTIVE': default: loginSessionInfoConfig = []; break; } if (currentOTP.isExpired() == false) { isThereAnyActiveOneTimePassword = true; }; this.domHelper().append(tbodyElement, {tag:'tr', cls:(currentOTP.isExpired() ? 'oneTimePassword_used': 'oneTimePassword_new'), children:[ {tag:'td', valign:'top', children:[ {tag:'input', type:'checkbox', cls:'otpCheckbox', name:currentOTP.reference()} ]}, {tag:'td', valign:'top', children:[ {tag:'span', cls:'oneTimePassword_value', html:currentOTP.password()} ]}, {tag:'td', valign:'top', children:[ {tag:'div', cls:'oneTimePassword_usageStats', children:loginSessionInfoConfig} ]} ]}); } } else { this.domHelper().append(tbodyElement, {tag:'tr', children:[ {tag:'td', children:[ diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js index f7991f1..defce91 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new AccountPanel"); args = args || {}; Clipperz.PM.Components.Panels.AccountPanel.superclass.constructor.call(this, anElement, args); Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); this._shouldLoadLoginHistory = true; // this.render(); //MochiKit.Logging.logDebug("<<< new AccountPanel"); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.AccountPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.AccountPanel component"; }, //------------------------------------------------------------------------- 'render': function() { var errorMessageActor; var changePasswordButton; var deleteAccountButton; try { //MochiKit.Logging.logDebug(">>> AccountPanel.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', width:'200', children:[ {tag:'ul', id:"accountSubMenu", cls:'subMenu', children:[ {tag:'li', id:'changePassphraseTab', htmlString:Clipperz.PM.Strings['changePasswordTabLabel']}, {tag:'li', id:'manageOTPTab', htmlString:Clipperz.PM.Strings['manageOTPTabLabel']}, {tag:'li', id:'accountPreferencesTab', htmlString:Clipperz.PM.Strings['accountPreferencesLabel']}, {tag:'li', id:'loginHistoryTab', htmlString:Clipperz.PM.Strings['accountLoginHistoryLabel']}, {tag:'li', id:'deleteAccountTab', htmlString:Clipperz.PM.Strings['deleteAccountTabLabel']} // {tag:'li', id:'paidAccountTab'), htmlString:Clipperz.PM.Strings['paidAccountTabLabel']} ]} ]}, {tag:'td', valign:'top', children:[ {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:this.getId('changePassphrasePanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['changePasswordTabTitle']}, {tag:'div', cls:'panelBody', id:'changePassphraseBlock', children:[ {tag:'form', id:this.getId('changePassphraseForm'), children:[ {tag:'h5', cls:'errorMessage', id:this.getId('changePassphrase_errorMessage')}, {tag:'table', cls:'panelBody', children:[ {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormUsernameLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'text', name:'username', id:this.getId('changePassphrase_username')} ]} ]}, {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormOldPassphraseLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'password', name:'oldPassphrase', id:this.getId('changePassphrase_oldPassphrase')} ]} ]}, {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormNewPassphraseLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'password', name:'newPassphrase', id:this.getId('changePassphrase_newPassphrase')} ]} ]}, {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormRetypePassphraseLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'password', name:'renewPassphrase', id:this.getId('changePassphrase_renewPassphrase')} ]} ]}, {tag:'tr', children:[ {tag:'td', align:'right', children:[ {tag:'input', type:'checkbox', id:this.getId('changePassphrase_safetyCheck')} ]}, {tag:'td', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['changePasswordFormSafetyCheckboxLabel']} ]} ]} ]}, {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ {tag:'div', id:this.getId('changePassphraseButton')} ]} ]} ]} ]} ]}, {tag:'li', id:this.getId('manageOTPPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['manageOTPTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['manageOTPTabDescription']}, {tag:'div', id:'OTPComponent'} ]} ]}, {tag:'li', id:this.getId('accountPreferencesPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['accountPreferencesTabTitle']}, {tag:'div', cls:'panelBody', id:this.getId('preferencesPanelBody')} ]} ]}, {tag:'li', id:this.getId('loginHistoryAccountPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['loginHistoryTabTitle']}, {tag:'div', cls:'panelBody', id:'loginHistoryAccountBlock'} ]} ]}, {tag:'li', id:this.getId('deleteAccountPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['deleteAccountTabTitle']}, {tag:'div', cls:'panelBody', id:'deleteAccountBlock', children:[ {tag:'form', id:this.getId('deleteAccountForm'), children:[ {tag:'h5', cls:'errorMessage', id:this.getId('deleteAccount_errorMessage')}, {tag:'table', cls:'panelBody', children:[ {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormUsernameLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'text', name:'username', id:this.getId('deleteAccount_username')} ]} ]}, {tag:'tr', children:[ {tag:'td', children:[ {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormPassphraseLabel']} ]}, {tag:'td', children:[ {tag:'input', type:'password', name:'passphrase', id:this.getId('deleteAccount_passphrase')} ]} ]}, {tag:'tr', children:[ {tag:'td', align:'right', children:[ {tag:'input', type:'checkbox', id:this.getId('deleteAccount_safetyCheck')} ]}, {tag:'td', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['deleteAccountFormSafetyCheckboxLabel']} ]} ]} ]}, {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ {tag:'div', id:this.getId('deleteAccountButton')} ]} ]} ]} ]} ]} /* {tag:'li', id:this.getId('paidAccountPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['upgradeAccountTabTitle']}, {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} ]} ]} */ ]} ]} ]} ]} ]}); //MochiKit.Logging.logDebug("--- AccountPanel.render - 1"); MochiKit.Signal.connect(this.getId('changePassphraseForm'), 'onkeydown', this, 'onkeydown'); diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/BasePanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/BasePanel.js index 15dd622..f36e8b0 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/BasePanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/BasePanel.js @@ -1,93 +1,91 @@ /* -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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //var _Clipperz_PM_Components_Panels_base_id_ = 0; //############################################################################# Clipperz.PM.Components.Panels.BasePanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.BasePanel.superclass.constructor.call(this, anElement, args); this._user = args.user || null; this._delegate = args.delegate || null; this._tabPanelController = null; // Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); // this._ids = {}; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.BasePanel, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.Panels.BasePanel component"; }, //------------------------------------------------------------------------- 'user': function() { return this._user; }, 'setUser': function(aValue) { this._user = aValue; }, //------------------------------------------------------------------------- 'delegate': function() { return this._delegate; }, 'setDelegate': function(aValue) { this._delegate = aValue; }, //------------------------------------------------------------------------- 'tabPanelController': function() { return this._tabPanelController; }, 'switchLanguageHandler': function() { //MochiKit.Logging.logDebug(">>> BasePanel.switchLanguageHandler [" + this.toString() + "]"); this.render(); //MochiKit.Logging.logDebug("<<< BasePanel.switchLanguageHandler [" + this.toString() + "]"); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/ContactsPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/ContactsPanel.js index 5a91d83..3feed3d 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/ContactsPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/ContactsPanel.js @@ -1,102 +1,100 @@ /* -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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.ContactsPanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.ContactsPanel.superclass.constructor.call(this, anElement, args); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.ContactsPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.ContactsPanel component"; }, //------------------------------------------------------------------------- 'render': function() { // var tabPanelControllerConfig; Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', width:'200', children:[ {tag:'ul', id:"dataSubMenu", cls:'subMenu', children:[ {tag:'li', id:this.getId('contacts'), htmlString:Clipperz.PM.Strings['contactsTabLabel']}, ]} ]}, {tag:'td', valign:'top', children:[ {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:this.getId('contactsPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['contactsTabTitle']}, {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} ]} ]} ]} ]} ]} ]} ]}); // tabPanelControllerConfig = {} // tabPanelControllerConfig[this.getId('contacts')] = this.getId('contactsPanel'); // new Clipperz.PM.Components.TabPanel.TabPanelController({ config:tabPanelControllerConfig, selectedTab:this.getId('contacts') }); this.tabPanelController().setUp(); }, //------------------------------------------------------------------------- 'tabPanelController': function() { if (this._tabPanelController == null) { var tabPanelControllerConfig; tabPanelControllerConfig = {} tabPanelControllerConfig[this.getId('contacts')] = this.getId('contactsPanel'); this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ config:tabPanelControllerConfig, selectedTab:this.getId('contacts') }); } return this._tabPanelController; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js index 11d4bd7..520542c 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.DataPanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.DataPanel.superclass.constructor.call(this, anElement, args); this._progressWidth = 400; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.DataPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.DataPanel component"; }, //------------------------------------------------------------------------- 'render': function() { MochiKit.Signal.disconnectAllTo(this); Clipperz.NotificationCenter.unregister(this); this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', width:'200', children:[ {tag:'ul', id:"dataSubMenu", cls:'subMenu', children:[ {tag:'li', id:'offlineCopyTab', htmlString:Clipperz.PM.Strings['offlineCopyTabLabel']}, {tag:'li', id:'sharingTab', htmlString:Clipperz.PM.Strings['sharingTabLabel']}, {tag:'li', id:'importTab', htmlString:Clipperz.PM.Strings['importTabLabel']}, {tag:'li', id:'printingTab', htmlString:Clipperz.PM.Strings['printingTabLabel']} ]} ]}, {tag:'td', valign:'top', children:[ {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:this.getId('offlineCopyPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['offlineCopyTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['offlineCopyTabDescription']}, {tag:'div', id:this.getId('offlineCopyLinkBox'), children:[ {tag:'a', id:'offlineCopyLink', href:'#', htmlString:Clipperz.PM.Strings['offlineCopyDownloadLinkLabel']} ]}, {tag:'div', id:this.getId('offlineCopyLinkBox_read-only'), children:[ {tag:'span', cls:'read-only', htmlString:Clipperz.PM.Strings['offlineCopyDownloadLinkLabel']} ]} ]} ]}, {tag:'li', id:this.getId('sharingPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['sharingTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['sharingTabDescription']} ]} ]}, {tag:'li', id:this.getId('importPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'div', id:this.getId('importPanelMainComponent')} ]} ]}, {tag:'li', id:this.getId('printingPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['printingTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['printingTabDescription']}, {tag:'div', id:this.getId('printingLinkBox'), children:[ {tag:'a', id:'printingLink', href:'#', htmlString:Clipperz.PM.Strings['printingLinkLabel']} ]}, {tag:'hr'}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['exportTabDescription']}, {tag:'div', id:this.getId('exportLinkBox'), children:[ {tag:'a', id:'exportLink', href:'#', htmlString:Clipperz.PM.Strings['exportLinkLabel']} ]} ]} ]} ]} ]} ]} ]} ]}); this.tabPanelController().setUp(); if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { this.getElement('offlineCopyLinkBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); } else { this.getElement('offlineCopyLinkBox_read-only').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); MochiKit.Signal.connect('offlineCopyLink', 'onclick', this, 'downloadOfflineCopy'); } new Clipperz.PM.Components.Import.MainComponent(this.getElement('importPanelMainComponent'), {user:this.user()}); MochiKit.Signal.connect('printingLink', 'onclick', this, 'printAllData'); MochiKit.Signal.connect('exportLink', 'onclick', this, 'exportAllData'); Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); }, //------------------------------------------------------------------------- 'tabPanelController': function() { if (this._tabPanelController == null) { var tabPanelControllerConfig; tabPanelControllerConfig = {} tabPanelControllerConfig['offlineCopyTab'] = this.getId('offlineCopyPanel'); tabPanelControllerConfig['sharingTab'] = this.getId('sharingPanel'); tabPanelControllerConfig['importTab'] = this.getId('importPanel'); tabPanelControllerConfig['printingTab'] = this.getId('printingPanel'); this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ name: 'dataTabPanel', config:tabPanelControllerConfig, selectedTab:'offlineCopyTab' }); } return this._tabPanelController; }, //------------------------------------------------------------------------- 'downloadOfflineCopy': function(anEvent) { var downloadHref; downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; if (Clipperz_IEisBroken == true) { window.open(downloadHref, ""); } else { var deferredResult; var newWindow; newWindow = window.open("", ""); anEvent.preventDefault(); deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); deferredResult.addCallback(function(aWindow) { aWindow.location.href = downloadHref; }, newWindow); deferredResult.callback(); } }, //------------------------------------------------------------------------- 'compareRecords': function(a, b) { return MochiKit.Base.compare(a.label().toLowerCase(), b.label().toLowerCase()); }, 'logo': function() { var result; if (Clipperz_IEisBroken == true) { if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { result = "<span><span class=\"clipperzLogoSpan\">clipper</span><span class=\"clipperzLoggoZSpan\">z</span></span>"; } else { result = "<img src=\"./images/exportLogo.png\" />"; } } else { result = "<img src=\"data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAANYAAABOCAIAAADTtH9XAAANIWlDQ1BJQ0MgUHJvZmlsZQAAeJyV13k0lG8bB/BrFsYyZhhjDyO77LKHLJFItmwp2bdhJiZRypIUIkso2iiSFC0kEtWPLCHJkq2oyJI9kmXeP6R6f+f9ve95rz+ecz3385xz389zzud7nxsAr+FKpZKRABAQSAuyNjEgOTg6kTBdgAJewAEzaLi6B1P1LS3N4R9roRMQAADtcq5UKvmf3/uPhQtycHQCQMgCANF7vd8OAES39d4WAIhHaFQaAMIHAIjuPq4eAIhwAJANsrU2BEAUAADOe70vBwCc23pfDwC4EHdvGgCiG4CREOjhGwiAmQBg1PXwDHYHwMkCgIdHsHsAAC4ZACwCAigeALgPACDlTg2iAeCZAEDOwdGJtL7kffEAW/kAmMx+jx1JByjNAZDa/XtM9BEAtytAbuLvsTlrQAAAgrs12EtFGQAAEFgDAIYBOn1OAgCTCrCaQqcv59Lpq9cBUH0ANWT3w0EhP/8XAtEM8L/u17/5Z6EQAEgAhBgiH3kUFY4OZzjBGImJZjrJbMRcy3Ka9Qw2ju0srozdhyOFkMKZSjzPlc6dzpPJW8tPEcjelC14WaiedFgkd/N10VbxYxL5km3SJ2Rub+mUi5a/o9CjdFr5vsp71bNqZeqDmklaFdrDOmm6T/XG9DMMnhtO7sgyrjOZNb26q9FsYXeuRcue15avrdqsV2wL93bYddp3OXQ7offdc+7b339gwOX9wQ9uWPfHHp88P3sNe4/4fPEd9eciPwv4GjhJmaJOH5oJmg2ep80f/haycGQx9HvY0tEfx1bCV46vRkhHdkQjTiJjUKfQsQynGc9g4pjimRNYzrImYpPYzuGS8SnsqRxphPOc6cQMrkzuCzwXebP4svkvCVzedEXwqtA14RxSrsj1zTdE88TyxW9KFkjekiqUvi1ze7yIfEf2rlyxQoniPaX7Sg+UH24tVS1TK1t4FFKu/lijQqtS+8m2qm1PdZ6uVUfU6D3b/lz/hcFfhrXo2pi6HS+N600aTBtNm1iaEl6ZNZu3WLTiWs+9tmyzemPdTmhPfWvTYdu5t4u7K7Pb/p1Dj1Mvf292n3O/88D+90Lvr35wGTw4JDKU+9Htk/tnj2Hx4fwRry/eoz5j0mOF434T/l/Jk3KTd6cCpykz1Fml2ftzQfPB32gLqgtliyHfQ5fCfoQtay1XrhxbDV/TWXtKpwMgRJE45DSqCX2bIY0xHOPNZMtsyLKVVRIrycaL48HzsvNycBEkOKWIGlzm3Ad4gnmT+Ir5mwRGBTmF1IS9SRdEXooixHTED0nck5ySlpIhb6mUQ8nrK6QoDipLq8Ru7VKTUadq1GrxaIdue6XLrUfZ/txAzPCYUZuxkEnozirTJTMlc8/d6RZtljgrE+tQmzzbt3Ys9tsdDjledqrbN7Vf+MAel6MHc11r3UY9uDz1vBy8T/hc863x6/dfCuAM3EIxovocCg9KDs6llR6uD+k9Mha6cBR1jCOcdFz2hGrE9kizqD3R+04ejPE8RY6lnQ46ExkXGX8yIe5samJCUta5i8mZKSmpl9JSz2ekX8goyLx54e7Fgqzb2cWXnlx+cqX26qtrbTntue3X22/05n3KH7k5VPD51lThzO2posk7s3enisdLJu6N3B98MPSwp7StrOFRTfmjx8UVlypTn0RWBTzdV21Ws+2ZzHPC86UXH/5qrH1Yl/YyqN6mQa1RoJHe1PPqYXN8i1OraOvw6wdtx9/saMe197+91uHXqdK52tXcnfZuf490z1xvRV90v9kAcWDg/a0PwYPaQ+ihxo/nPx34LPl5YrhiJOrLrlGu0f6xG+PkCdWJta8Nk6lT+6bFpidmHsyGz5nME+a7v+UtUBY1v6O+v1xK+bFvWXT560rZauSaKZ2bTgeAk4hQ5FGUNqoCfZxBj6GaMQpzismYqZY5luU0azx2F7aJLRGXiE9i38PeypFMSOVMI6Zx2XK95c7gyeC9wJfFny2QvemSoLNgv9BV4WukHJGczTmi18VuiOdJ5EvelCqQviXjKzO2pVC2SO6O/F2FYsUSpXvK91UebH2oWqZWpl6mEarxXbNCq0K7ctsTnSrdE7pretXba/SfGTw3fGEUswO9o9a4zuTlznrThl2NZgnmWPNXu5stWva0WiZbsVu1Wb+xabd9u7fTLsOe277LodvxnVPPvmxnAee+/f0H3rt8OPjBNcdNxG3I/aPHJ8/PXvneEusJ4jfmf5ssS574txSZ+5Ui5WEaYUtHfxxbDl85vnpiLYIeBdHIX0mCOYOJY4priN+VwHoWm4hNYjuHT2ZP4fiVJdyZPBd4f2bJpj+zJHfouvsN0TyxfImbEhtpUiR7R+6u/B9ZolK6tUz1kXq5+mONCs1K7SfaVdue6lbr/pEjO+qMXxrXmzTsbDRtMnsV0rK51eK1ZZvlG6v24x0ynXZd9t3RPQq9Tn2xAyrv4wZVh85+8hjWHkkZ9R33+0qeoszEzzstnFtKWLWm0wHW9z4AAEY1gIwtAHZZADa5ALFbACRdALgLACzZAGw1AckgBEgdKiB26WzsH4AAdhAEeTAARwiGZCiB7wgSwgwRiihAtCBGkHikCTIKWYVcQemgolB1qBW0CNoRnY/+xmDMcIqhmGGK0YQxh3EYw4VxxlQxYZg0mWKYxpm1mCnMNSxyLJEs5aw41ijWd1giNhD7hW0H20m2QZwr7jkehffCT7BbsWewr3LEccwStAh5nOqceZxTRBfiIpcvVxn3Fu6XPF68GN5CPnG+I3zz/JcFTATmNl0TFBMMF0IIlQr7kURIPSLnN2/eHCmKF20VSxHfK8EvMSR5W8pQ6pa0gQyHzOCWB7Kn5ZzlVRSwCiOKfynlKkereGw1UZVV41RbUR/WyNTEadZolWjnbDuvc0Y3Qu/I9kP6ZANfQx8jnx3+xoEmtJ3HTGN2nTPLNr+1u9yiYU+f5Yw1xkbIVmOvjR3VPsnhruNrpzln3v26B7xckg9Wun5x5/Ew8QzzKvLl9bP0jyfXBiIp+tSoQy+CGWlmh1NDxcIoR5+Esxx3OlEUQY+yjUGeco59dIYz7lB8W2J60lKyS0pdmsL5rMzgCx+zbLJrr9y9Jp5z+TpPPvvNpFu4wnN3MosFS27clys1Kmsrd308U8XztKjG4AWtFl9XVL+rKb5ZrqXtdUh7XQe1S6C7vk+iv/t9/KDep6Jhjy/Coz1f7aa4p7tms+ZdFieWSpcj6Lx0OgAggQV4QBr0wAEOQzqUwwACg1BEuCCSENWIOaQM0gWZhXyLwqN2o86imtFs6D3odHQvA4nBl6GE4TujIeM5xncYccxhzAsmApMHUzkzK7Mz810WNMsBloesLKzurNVYLiwV28wmw5bINoEzxxXj2fAUfCf7dvYbHDiOEI5egjHhHieJM5VzjRhM/MrlxzXGTeae5aHxLPAe5UPwneXn5y8U0BSo22S3aVQwUohPqEzYSniMFCsiIVK/OVCUR/SpmLs4VvyZRKCksOQbqThpA+lVmcot4bI6soty1fJnFGwVRRSnlKqVU1T8thqpCqkuq3WoP9a4rBml5a1tv01HR0FXRI+wHa2P0p81mDGcMhrfMWw8ZzK+89supBnRnGe3koXunj2W1lb+1mE22bb3976y67VfcSQ6KeyzcD60/+KBWpcRV2Y3RXcfjyzPaq9pH2lfT79M/44AgcC9lGzqlyCp4BBaQ4jgkeDQxqOix5LCx044RtRHqUXnxRBOJZ0mnMmI503ITlRNakn2TPmRlpiunvH5wpUsv0t7r0hfY8iZuP48r/TmxVuxt93vOBcb39N4sLVU/pHcY6lK8SqpasVnei921lq9JDccakppvtb6pG2gnd4p3K3T49GXMFDxYeIj32eDkcjRgvFPk/zTXrNX5ocXpZYCl8vWEHQ6ADACOwiCAThCMpTAmw37G+7X1aPxaEf0NwZjhqyf3tcwzkzCTDFM48y2zDUsciyXWHGsUayL2EDsFzYPnCvuI94LP8EezL7KEUfgJuRxqnM2El2Ii1zJv0xb8M3/9GwphBAq/WnZal3yT8ch0gZ/Gv4t+KffN5o1WiW/7f6W+89u/5ta70FfXj/Lv6sN6fm72+jCP+WeVf4tN4Nxw+5lzQ29N9I2/BYRNgQ/KN8wXHlyXfGzng3HDaNN8a/+as5oaXsd8kawva6D2lnSFdtd3xPSJ9HvP2D0Pn5Qb+j0R7dPRZ8Xhtu/CI/6j5mOS01gvtpN5k/FTnvP7JyVmWOdm5x//e3BQsai7eLE95glgx+SP4aXI1Z4V66scqzGrC6u3aAn0OkA6+clAABgMaSQKUEkc0Oj//Ow978qgHx4Yw4kAGA9A/faAAABAKR8aaa2AEAEAC0wBAqQgQJBQAJzMASjn1cSuP964guwfpYDAGBkB7hkDwBQ/f1Y5N/npXmG0gAADCnUsCBfbx8aSZ9KJXuSDCkB1MM0zyBZkmmgu7wsSVlRURUA4F93RgACxGzQPQAAAAlwSFlzAAALEwAACxMBAJqcGAAAC25JREFUeJztnHlUE9cex38JYY2JGhQ14Hae1BSXKoK4C0UtbtRqRUWlomi1NK5Y6tKKQpG2qK0pWo8oPp+ix+rRFlCPyxEVV9TXpx7klOdxKQFERQ1CWMLM+wMfDZk7k5nJMsHez8k/+d3f/d1fJt+5d+6SiEiSBAxGOMRCJ4D5u4MliBEYLEGMwGAJYgQGSxAjMFiCGIHBEsQIDJYgRmCwBDECgyWIERgsQYzAYAliBAZLECMwWIIYgcESxAgMliBGYLAEMQKDJYgRGCxBjMBgCWIEBksQIzASoRN4w+93X25YpWkl8zCyifr37bDsy5mcfDAtDkeRYFFRmVZbbmKsrixeBjM5+WBaHI4yEJNg/ufMbHwwLQ5HkSDmb0uLl6BM1kroFDAW0ZIkqNfXU43FJU/snwnGijjKdIQNUTP6hoelmhjdXEWCJIOxFi1JgiIRtFW4Cp0Fxsq0pIEY81ZitV5QV0nmZOUfz877o/CBkZlQqbpMmDB0TJh/a4UHbWV2NBBQ/PiFi4uzkU3k7ka2UTSbkehr4GnZC2cjt/q6ui7d2gKIAOB5heHg/tyjR85W6l43JRkYqPpkTlhAUA+RmHZYt1FYJNoS/bEjl86culqi/etJVy53DwsLipg+onO39szVmVMFgCfl9ds0x07kXGh8HxTos3VHPAmkqP4uiC0YZ5ze4VFJZPn/CxaX1EVFrqv669LTYUhPX9HHvwey7NDRe5sSt5kYO3s7H87a3PT2n5m3t6XuNPGRy+tO5+4wtiDdzp5Z79FW8WF4crm2lCHFz2PHzZ43Fllko7AmXLqiXRqbYm5sMqSlqQMG+9EVI1PNyV7bTtmhpg6mTjHNtvE6G8iHkp+6s0mSFnUDj3HV0oE4OeXklAkrWOgPACQxMT9GRyYBSfBry93dmWr0UXZg4/bgYfWAAWpmoQDAT2nHRwerkRnaKGwTBgImTkxebl5/ACCJjd2++FPTmRlzqq1kHroqGDGINlsnEaKWHbBIgtMjt/56KIdTlYLCJ0EDFvBWIZXKSjbqh5iYb13YBdTpYHTIEpatWytsTR0MCjAvZWOu5T/6eOIXrN2JoiJd8HC1Ay4f8Jfg0hUHHxQW8arqHj3za97t2gGdDhZ/utFuYQkShg5SO3EP+KdWv3rFD+x8xTExKcL0cubgKcF7RdVXzl2iKw0J6bciLnLs+BF0DgWFr67k3uDXtOXI5a5zosctip3aybsTnc+1/JJnHBe9eYddHneQblYYGKj6LHby8rjZdDHPnrtfdPc+pzzpaCARK/92gOeMeMa0eOTEKXx8/zUb5v5/4gXrEqfuz7ylSc2gen6dsOt0bgC/1i3AkJX9jZdS0fhmzrwRryrh/ZFq5FVYGafJyEyyddjyCkDezEGBXX9IWyaWvOkcp0UOLC6p/2jCcmqfMSsq8dqtPezybIa3dzsSxFptuUzmAQASUTdQmx5EMkICUA0aH8aQfHo0PhJ8XNKA1F9oiO+axLnGFhHArEj/1/r6jLR9Js46HQkkASJ7LkwaLl3eLHFzNza1lsG1G5qgAIRcCgpfNNTVObmYfdizKOyqVbuoEUNDfJM3LTYx+iidcy9rQoZQn+dkL8sr2ngpzOX5hs7erXfsivf0kqEKmZZ7nh+f5MlQrK5imYAJfBSwadMvKHNt8iY10j9qdhBq4cf55dOXPFrnzfa0hSZCaUQihqPZW1A1xKdy8mwattYAd/J/pzjUJ6d+jmxL6gbhEROo9j27s8zm2Uj4+D6Hs5Jo9MeELi/S8/4F2mJ1OQDPdV8+EryIGjji46Y0rXya4OECfQPfk8ulMqMXAOHqbs/dtlr/wX3pyrooJa5yxImbQ7/k2jTsvUId9ZLFRAczDA6fxX5ANR44dAlYHKaUyw1rEheYdaNSdS9B/u8DtMULbzN3n8xwHoiratB1RocFMdRK3xHDtSHrEhriR3eHNKJe8klqYpqdw2ZlX6Ea0zMudvTp+bxCh6pB3ClATpKcSEODSGLm20zfGc/sgISoyJKeWU9bPPM3cO7DI2wTnCX4SkeiLnm9rK3ckjxszfBhtH1VIyNHqlITTY0FhcUAJIPILAx75dJNVCVxUuJu5rAUJM/Kn7enrNI3R9/VtyvHsAD1d8T7w2lLx34HiomcYzaH80AskSC/DwOIHHDV0xh+8x4XMLOBaVFYpRnRcMBZYmbVz0/VkbnDpkKCFn6mv8f6z4AeKzkFRML5Crq7Ih46eHw8O+PX27LdT9uElbZCzGNsRGVlNSd/EqprGZZglO/BsExLcwIAHhKsrEIMxAWF5WwehwXkZn6BA4YtK31mrUwMBjMLy5EzRrOPRgDxTCN1oyt2bwNTqBN5nljrsJYYSNLhx2ImDAa02cIPxSNsUKDyx+2rDAYOtzRBgCutXvhQlu6pZCiOeW7FtjhLsJUUee2cn5U+bUf/ZLNFc/FgxiETY0rytJCwYVwT4EfmgbOTI5mOS2VlXaca/VRK5gcMC8OGhAZlUPbZgwa+KxKDs4tg9/OTI/2UevolW3WVdU86c44llwKyx9+39yRDrb0U/QFAn76+XFvnzZ9aPVFXx+Dwc9q/UGYzJ3osDDsqtB+1bGvaMeZGCQJqa0jjV4PBaiePKvIiO5T8h7ZYXcx7CZoOPnL+YHwo1Xjg0HVDjR7pX1IOqE0ug6dXGx6t80WckriHruzClTLkNtyCBZNsGrZbF1eUdmSPih4xNBkQoB4xZLHxK2zUInN5sqL6v98rGJag5+cDeFulIWP4SHDZMuQXIx46ZBF1UlJvgAlhiI27zt5SkcSuv0X6NefOiaPnqfbScmJl7DeoGobBIxC9lBXDSsQQirqfI6al6GkmsEtXZFJXXzYkzDebp1mIiiyPE/QHEOdeBDebHCvhMx3xUkA3le9DxGFBWZD/or171/Ts1RlEQBCQe+HhquWbkAtW69cLsF+SkHj4+MmbSRsXNv6QpaYG9u2/vDMNfd+HhviCmNX1sSTsV2smncs5S/GSBI+Mnxs9Jnr+OBc3JwAgCLh6rXhJ7LeoPqN28Eh/NnkyQAJZtT+caef48RmoRD5UNGfgDvM+zeE5I965c/Ho4chDCc5RUd+ZrS6XG3r5q/g1bSHX8x+MGcVqn2rdhoV2CCt1g+nRHx/MOEz13J1xanfGKWMLcsxKSZ5jlQNH6Ll7Ewx7dMYM3M51aOWZulwKSZt5r4wTJ05uNu8lKAlfTXGVWvm5my7sMvVI5GkGNvip2oaEDbE4LyHhf/eMDu6SmraaR8Xs7ATk6SYbw2HOOCNi4NiPgu0Z9nzuxvb0Z63pkMshI5Nd5+TAWNSBDx/cKfvM1gbW/n6qDpevbm6vRB7sYbMMxn+pLCV5RvYZDRvPL+I+XPrlbDuHFQFkZ62eH8vhjxInju9/OldjxX1Rof5Yw9JniPYK0Y1bmm3pazt6M+24v6vq9Fv2+ozMtU4u6N30jh0RCzQmu/hsfOh4UVHZXgF51zWTI8LofAID/3Hu/PdTIkexCWiLsDHzBuVe1syKnsS8MTItYnje5S1rmx9QN8YddRATaTTGzLMgWzjfElb4KXsTBAFlZdVFf2hfvdC5uruVasu9vT1VKh+fLgp7ns9H/io+Pm5c0zYGSUJpafWd2w9q9TXV+jpPhZRNkjYKS0dVFfnwwVNt8dMafTUJkhq9vnt3r3d6erdRuDn4iRCuWLP3FYtBqfRQKpv2PHpZMbgVEYka87RyetYNK5WKevX26tXbyyrRHBn8t0YYgcESxAgMliBGYLAEMQKDJYgRmLdQgno90wE+RwuLaUn/Nc2S4UN8n0a8LzXain1dVeMf2Nsxw2KsuTSNwfDgLRyIMS0LLEGMwGAJYgQGSxAjMFiCGIHBEsQIDJYgRmCwBDECgyWIERgsQYzAYAliBOZ/jys2NWyvP3gAAAAASUVORK5CYIIK\" />"; } return result; }, 'progressWidth': function() { return this._progressWidth; }, 'updateProgress': function(aProgressComponent, aPercentage) { }, diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/LoginPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/LoginPanel.js index ef2b91c..3081a9d 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/LoginPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/LoginPanel.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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } Clipperz.PM.Components.Panels.LoginPanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.LoginPanel.superclass.constructor.call(this, anElement, args); this._showLoginFormAnimator = null; this._showRegistrationFormAnimator = null; this._shouldShowRegistrationAlert = true; this._visibleForm = null; // this._isPassphraseVisible = true; Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); this.render(); return this; } //============================================================================= //MochiKit.Base.update(Clipperz.PM.Components.Panels.LoginPanel.prototype, { YAHOO.extendX(Clipperz.PM.Components.Panels.LoginPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.LoginPanel component"; }, //------------------------------------------------------------------------- 'render': function() { var result; var layout; var registerButton; MochiKit.Signal.disconnectAllTo(this); this.element().update(""); //MochiKit.Logging.logDebug(">>> LoginPanel.initPanel"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', id:this.getId('baseDiv'), cls:'LoginPanel', children:[ {tag:'table', children:[ {tag:'thead'}, {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'div', cls:'clipperzServiceDescription', htmlString:Clipperz.PM.Strings['clipperzServiceDescription']} ]}, {tag:'td', valign:'top', align:'right', children:[ {tag:'div', id:this.getId('forms'), cls:'clipperzLoginForm', children:[ {tag:'div', id:this.getId('loginForm'), cls:'loginForm', children:[ {tag:'div', cls:'loginFormHeaderBox', children:[{tag:'h3', htmlString:Clipperz.PM.Strings['loginFormTitle']}]}, {tag:'form', id:this.getId('loginForm_form'), autocomplete:'off', children:[ {tag:'table', cls:'formLayout', children:[ {tag:'thead'}, {tag:'tbody', children:[ {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', width:'90', htmlString:Clipperz.PM.Strings['loginFormUsernameLabel']}, {tag:'td', children:[ {tag:'input', id:this.getId('login_username'), cls:'loginFormField', type:'text', name:'username'} ]} ]}, {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', htmlString:Clipperz.PM.Strings['loginFormPassphraseLabel']}, {tag:'td', children:[ {tag:'div', id:this.getId('passphraseDIV'), children:[ {tag:'input', id:this.getId('login_passphrase'), cls:'loginFormField', type:'password', name:'passphrase'} ]}, {tag:'div', cls:'oneTimePassword', id:this.getId('oneTimePasswordDIV'), children:[ {tag:'input', type:'text', id:this.getId('oneTimePassword_1'), name:'passphrase'}, {tag:'span', html:'-'}, {tag:'input', type:'text', id:this.getId('oneTimePassword_2'), name:'passphrase'}, {tag:'span', html:'-'}, {tag:'input', type:'text', id:this.getId('oneTimePassword_3'), name:'passphrase'}, {tag:'span', html:'-'}, {tag:'input', type:'text', id:this.getId('oneTimePassword_4'), name:'passphrase'} ]} ]} ]}, {tag:'tr', cls:'formFieldTR', id:this.getId('passwordTypeChooserTR'), children:[ {tag:'td', valign:'top', align:'right', children:[ {tag:'input', type:'checkbox', cls:'passwordTypeCheckbox', id:this.getId('useOneTimePasswordCheckbox')} ]}, {tag:'td', children:[ {tag:'div', cls:'passwordTypeChooser', children:[ {tag:'h4', htmlString:Clipperz.PM.Strings['loginFormOneTimePasswordCheckboxLabel']}, {tag:'span', htmlString:Clipperz.PM.Strings['loginFormOneTimePasswordCheckboxDescription']} ]} ]} ]}, {tag:'tr', children:[ {tag:'td'}, {tag:'td', children:[ {tag:'div', id:this.getId('login_submit')} ]} ]} ]}, {tag:'tfoot'} ]} ]}, {tag:'div', cls:'loginFormFooterBox', children:[ {tag:'ul', children:[ {tag:'li', id:this.getId('showRegistrationLI'), children:[ {tag:'span', htmlString:Clipperz.PM.Strings['loginFormDontHaveAnAccountLabel']}, {tag:'a', href:'.', id:this.getId('showRegistration'), cls:'clipperzActionLink', htmlString:Clipperz.PM.Strings['loginFormCreateOneLabel']} ]}, {tag:'li', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['loginFormForgotYourCredentialsLabel']}, {tag:'a', href:Clipperz.PM.Strings['loginFormAarghThatsBadUrl'], target:'Clipperz_Help', htmlString:Clipperz.PM.Strings['loginFormAarghThatsBadLabel']} ]}, {tag:'li', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['loginFormAfraidOfMaliciousScriptsLabel']}, {tag:'a', href:Clipperz.PM.Strings['loginFormVerifyTheCodeUrl'], target:'Clipperz_Help', htmlString:Clipperz.PM.Strings['loginFormVerifyTheCodeLabel']} ]} ]} ]} ]}, {tag:'div', id:this.getId('registrationForm'), cls:'registrationForm', children:[ {tag:'div', cls:'loginFormHeaderBox', children:[{tag:'h3', htmlString:Clipperz.PM.Strings['registrationFormTitle']}]}, {tag:'form', id:this.getId('registrationForm_form'), children:[ {tag:'h5', cls:'errorMessage', id:this.getId('registration_errorMessage')}, {tag:'table', cls:'formLayout', children:[ {tag:'thead'}, {tag:'tbody', children:[ {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', width:'90', htmlString:Clipperz.PM.Strings['registrationFormUsernameLabel']}, {tag:'td', children:[ {tag:'input', id:this.getId('registration_username'), cls:'loginFormField', type:'text', name:'username'} ]} ]}, {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', htmlString:Clipperz.PM.Strings['registrationFormPassphraseLabel']}, {tag:'td', children:[ {tag:'input', id:this.getId('registration_passphrase'), cls:'loginFormField', type:'password', name:'passphrase'} ]} ]}, {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', htmlString:Clipperz.PM.Strings['registrationFormRetypePassphraseLabel']}, {tag:'td', children:[ {tag:'input', id:this.getId('registration_repassphrase'), cls:'loginFormField', type:'password', name:'repeat-passphrase'} ]} ]}, {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', align:'right', valign:'top', children:[ {tag:'input', id:this.getId('registration_check'), type:'checkbox', name:'safetyCheck'} ]}, {tag:'td', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['registrationFormSafetyCheckLabel']} ]} ]}, {tag:'tr', cls:'formFieldTR', children:[ {tag:'td', align:'right', valign:'top', children:[ {tag:'input', id:this.getId('registration_termsOfServiceCheck'), type:'checkbox', name:'termsOfServiceCheck'} ]}, {tag:'td', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['registrationFormTermsOfServiceCheckLabel']} ]} ]}, // {tag:'tr', cls:'formFieldTR', children:[ // {tag:'td', htmlString:Clipperz.PM.Strings['registrationFormInvitationCodeLabel']}, // {tag:'td', children:[ // {tag:'input', id:this.getId('registration_invitationCode'), type:'text', size:'30', name:'invitationCode'} // ]} // ]}, {tag:'tr', children:[ {tag:'td'}, {tag:'td', children:[ {tag:'div', id:this.getId('registration_submit')} ]} ]} ]}, {tag:'tfoot'} ]} ]}, {tag:'div', cls:'loginFormFooterBox', children:[ {tag:'ul', children:[ {tag:'li', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['registrationFormDoYouAlreadyHaveAnAccountLabel']}, {tag:'a', href:'.', id:this.getId('showLogin'), cls:'clipperzActionLink', htmlString:Clipperz.PM.Strings['registrationFormSimplyLoginLabel']} diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/LogoutPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/LogoutPanel.js index b8cc556..17ed8e4 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/LogoutPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/LogoutPanel.js @@ -1,70 +1,68 @@ /* -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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.LogoutPanel = function(args) { args = args || {}; Clipperz.PM.Components.Panels.LogoutPanel.superclass.constructor.call(this, args); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.LogoutPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.LogoutPanel component"; }, //------------------------------------------------------------------------- 'initPanel': function() { var result; var layout; result = new YAHOO.ext.ContentPanel(this.getId('panel'), {title:'logout', closable:false, autoCreate:true}); Clipperz.YUI.DomHelper.append(result.getEl().dom, {tag:'div', children:[ {tag:'h2', html:'Logout panel'} ]} ); return result; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js index 29ef516..c19a8a3 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.MainPanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.MainPanel.superclass.constructor.call(this, anElement, args); this._recordListDataModel = null; this._selectedRecord = null; this._recordDetailComponent = null; this._recordListGrid = null; this._directLinkItemTemplate = null; this._recordItemTemplate = null; this._addNewRecordButton = null; this._deleteRecordButton = null; this._creationWizard = null; Clipperz.NotificationCenter.register(null, 'selectAndEnterEditMode', this, 'selectRecordAndEnterEditModeHandler'); Clipperz.NotificationCenter.register(null, 'recordAdded', this, 'recordAddedHandler'); Clipperz.NotificationCenter.register(null, 'recordUpdated', this, 'recordUpdatedHandler'); Clipperz.NotificationCenter.register(null, 'recordRemoved', this, 'recordRemovedHandler'); Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); Clipperz.NotificationCenter.register(null, 'directLoginUpdated', this, 'directLoginUpdatedHandler'); Clipperz.NotificationCenter.register(null, 'directLoginRemoved', this, 'directLoginRemovedHandler'); Clipperz.NotificationCenter.register(null, 'accountLocked', this, 'accountLockedHandler'); MochiKit.Signal.connect(MochiKit.DOM.currentWindow(), 'onresize', this, 'resizeModalMask'); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.MainPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.Panels.MainPanel component"; }, //------------------------------------------------------------------------- 'render': function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', id:'mainPanelTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'15', children:[ {tag:'div', cls:'mainPanelMinHeightDiv'} ]}, {tag:'td', valign:'top', id:'directLoginsTD', width:'200', children:[ {tag:'div', id:'directLoginsBlock', children:[ {tag:'div', cls:'directLoginsBlockHeaderBox', children:[{tag:'h3', id:'directLoginTitle', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockLabel']}]}, {tag:'div', id:'directLoginsDescription', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockDescription']}, {tag:'ul', id:'directLogins'} ]} ]}, {tag:'td', width:'15', children:[ {tag:'div', cls:'mainPanelMinHeightDiv'} ]}, {tag:'td', valign:'top', children:[ {tag:'div', id:'mainContent', children:[ {tag:'div', id:'recordListBlockHeader'}, {tag:'div', id:'recordListAndDetailBlock', children:[ {tag:'table', id:'recordListAndDetailBlockTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', width:'250', children:[ {tag:'div', id:'recordListBlock', children:[ {tag:'div', id:'recordListFilterHeader'}, {tag:'ul', id:'records'} ]} ]}, {tag:'td', id:'recordDetailSeparatorTD', rowspan:'2', valign:'top', bgcolor:'#ddddff', html:' '}, {tag:'td', valign:'top', children:[ {tag:'div', id:'recordDetailMainBlock', children:[ {tag:'div', id:'recordTitleTopBlock'}, {tag:'div', id:'recordDetailBlock', children:[ {tag:'div', id:'recordDetail'} ]} ]}, {tag:'div', id:'recordCreationWizardMainBlock', children:[ {tag:'div', id:'recordCreationWizard', html:"WIZARD"} ]} ]} ]}, {tag:'tr', children:[ {tag:'td', id:'cardBoxLowerLeftTD', html:' '}, {tag:'td', id:'cardBoxLowerRightTD', html:' '} ]} ]} ]} ]} ]} ]}, {tag:'td', width:'15', html:" "} ]} ]} ]}); this.renderRecordListBlockHeader(); // this.renderRecordListFilterHeader(); YAHOO.ext.Element.get('directLogins').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); this.recordDetailComponent(); YAHOO.ext.Element.get('recordDetailMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show(); YAHOO.ext.Element.get('recordCreationWizardMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); }, //------------------------------------------------------------------------- 'addNewRecordButton': function() { return this._addNewRecordButton; }, 'setAddNewRecordButton': function(aValue) { this._addNewRecordButton = aValue; }, 'deleteRecordButton': function() { return this._deleteRecordButton; }, 'setDeleteRecordButton': function(aValue) { this._deleteRecordButton = aValue; }, //------------------------------------------------------------------------- 'addNewRecord': function(anEvent) { var deferredResult; // var currentNumberOfRecords; deferredResult = new MochiKit.Async.Deferred(); // currentNumberOfRecords = MochiKit.Base.keys(this.user().records()).length; /* // if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords > 0) && ((currentNumberOfRecords%10) == 0)) { // if (true) { if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords >= 5)) { deferredResult.addCallback(Clipperz.PM.showDonationSplashScreen, this.user(), 'recordListAddRecordButton'); } */ deferredResult.addCallback(MochiKit.Base.bind(function() { var currentlySelectedRecord; currentlySelecedRecord = this.selectedRecord(); this.setSelectedRecord(null); YAHOO.ext.Element.get('recordDetailMainBlock').hide(); YAHOO.ext.Element.get('recordCreationWizardMainBlock').show(); this.setCreationWizard(new Clipperz.PM.Components.RecordDetail.CreationWizard(YAHOO.ext.Element.get('recordCreationWizardMainBlock'), {previouslySelectedRecord:currentlySelecedRecord, mainComponent:this})); this.enterModalView(); }, this)); deferredResult.callback(); }, //------------------------------------------------------------------------- 'creationWizard': function() { return this._creationWizard; }, 'setCreationWizard': function(aValue) { this._creationWizard = aValue; }, //------------------------------------------------------------------------- 'exitWizard': function(aSelectedRecord, shouldEnterEditMode) { //MochiKit.Logging.logDebug(">>> MainPanel.exitWizard - " + aSelectedRecord) YAHOO.ext.Element.get('recordCreationWizardMainBlock').hide(); YAHOO.ext.Element.get('recordDetailMainBlock').show(); diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/ToolsPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/ToolsPanel.js index 4f2a015..1c799d0 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/ToolsPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/ToolsPanel.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.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } //############################################################################# Clipperz.PM.Components.Panels.ToolsPanel = function(anElement, args) { args = args || {}; Clipperz.PM.Components.Panels.ToolsPanel.superclass.constructor.call(this, anElement, args); this._generateButtonElement = null; this._needsRenderingUponTabSwitch = false; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.Panels.ToolsPanel, Clipperz.PM.Components.Panels.BasePanel, { 'toString': function() { return "Clipperz.PM.Components.Panels.ToolsPanel component"; }, //------------------------------------------------------------------------- 'render': function() { var bookmarkletUrl; //MochiKit.Logging.logDebug(">>> ToolsPanel.render"); Clipperz.NotificationCenter.unregister(this); MochiKit.Signal.disconnectAllTo(this); if (Clipperz_IEisBroken == true) { bookmarkletUrl = bookmarklet_ie; } else { bookmarkletUrl = bookmarklet; } this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', width:'200', children:[ {tag:'ul', id:"dataSubMenu", cls:'subMenu', children:[ {tag:'li', id:this.getId('passwordGenerator'), htmlString:Clipperz.PM.Strings['passwordGeneratorTabLabel']}, {tag:'li', id:this.getId('bookmarklet'), htmlString:Clipperz.PM.Strings['bookmarkletTabLabel']}, {tag:'li', id:this.getId('compact'), htmlString:Clipperz.PM.Strings['compactTabLabel']}, {tag:'li', id:this.getId('httpAuth'), htmlString:Clipperz.PM.Strings['httpAuthTabLabel']} ]} ]}, {tag:'td', valign:'top', children:[ {tag:'ul', cls:'clipperzTabPanels', children:[ {tag:'li', id:this.getId('passwordGeneratorPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['passwordGeneratorTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['paswordGeneratorTabDescription']}, //--------------------------------------------------- {tag:'div', children:[ {tag:'form', id:this.getId('passwordGeneratorForm'), cls:'passwordGenerator', children:[ {tag:'input', type:'text', cls:'clipperz_passwordGenerator_password', id:this.getId('passwordField')}, {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'lowercase', id:this.getId('lowercase'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLowercaseLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'uppercase', id:this.getId('uppercase'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorUppercaseLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'numbers', id:this.getId('numbers'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorNumberLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'symbols', id:this.getId('symbols'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorSymbolLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'span', cls:'passwordGeneratorLength', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLengthLabel']}, {tag:'span', id:this.getId('passwordLength'), cls:'passwordGeneratorLengthValue', html:'0'} ]} ]} ]} ]} ]} ]}, {tag:'div', id:this.getId('generateRandomPassword')} ]} //--------------------------------------------------- ]} ]}, {tag:'li', id:this.getId('bookmarkletPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['bookmarkletTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['bookmarkletTabDescription']}, {tag:'a', href:bookmarkletUrl, cls:'bookmarkletLink', htmlString:Clipperz.PM.Strings['bookmarkletTabBookmarkletTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['bookmarkletTabInstructions']} ]} ]}, {tag:'li', id:this.getId('compactPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['compactTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['compactTabDescription']} ]} ]}, {tag:'li', id:this.getId('httpAuthPanel'), children:[ {tag:'div', cls:'clipperzSubPanel', children:[ {tag:'h5', htmlString:Clipperz.PM.Strings['httpAuthTabTitle']}, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['httpAuthTabDescription']}, {tag:'div', cls:'bookmarkletConfiguration', children:[Clipperz.PM.Strings['httpAuthBookmarkletConfiguration']]} ]} ]} ]} ]} ]} ]} ]}); new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('passwordField')); MochiKit.Signal.connect(this.getId('lowercase'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('uppercase'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('numbers'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('symbols'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onkeyup', this, 'updatePasswordLengthLabel'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onchange', this, 'updatePasswordLengthLabel'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onblur', this, 'updatePasswordLengthLabel'); this.setGenerateButtonElement(new YAHOO.ext.Button(this.getDom('generateRandomPassword'), {text:Clipperz.PM.Strings['passwordGeneratorTabButtonLabel'], handler:this.updatePasswordValue, scope:this})); this.setNeedsRenderingUponTabSwitch(false); this.tabPanelController().setUp(); Clipperz.NotificationCenter.register(null, 'tabSelected', this, 'tabSelectedHandler'); Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); //MochiKit.Logging.logDebug("<<< ToolsPanel.render"); }, //------------------------------------------------------------------------- 'needsRenderingUponTabSwitch': function() { return this._needsRenderingUponTabSwitch; }, 'setNeedsRenderingUponTabSwitch': function(aValue) { this._needsRenderingUponTabSwitch = aValue; }, 'tabSelectedHandler': function(anEvent) { if (this.needsRenderingUponTabSwitch()) { this.render(); } if (anEvent.parameters() == this.getId('httpAuth')) { var textarea; textarea = document.getElementById("httpAuthDefaultConfiguration"); textarea.focus(); textarea.select(); } }, //------------------------------------------------------------------------- 'tabPanelController': function() { if (this._tabPanelController == null) { var tabPanelControllerConfig; tabPanelControllerConfig = {} tabPanelControllerConfig[this.getId('passwordGenerator')] = this.getId('passwordGeneratorPanel'); tabPanelControllerConfig[this.getId('bookmarklet')] = this.getId('bookmarkletPanel'); tabPanelControllerConfig[this.getId('compact')] = this.getId('compactPanel'); tabPanelControllerConfig[this.getId('httpAuth')] = this.getId('httpAuthPanel'); this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ config:tabPanelControllerConfig, selectedTab:this.getId('passwordGenerator') }); } return this._tabPanelController; }, diff --git a/frontend/beta/js/Clipperz/PM/Components/PasswordEntropyDisplay.js b/frontend/beta/js/Clipperz/PM/Components/PasswordEntropyDisplay.js index 784dce9..b64e0f7 100644 --- a/frontend/beta/js/Clipperz/PM/Components/PasswordEntropyDisplay.js +++ b/frontend/beta/js/Clipperz/PM/Components/PasswordEntropyDisplay.js @@ -1,115 +1,113 @@ /* -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 = {}; } Clipperz.PM.Components.PasswordEntropyDisplay = function(anElement, args) { args = args || {}; //MochiKit.Logging.logDebug(">>> new TextFormField"); Clipperz.PM.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); this._wrapperElement = null; this._entropyElement = null; this.render(); //MochiKit.Logging.logDebug("<<< new TextFormField"); return this; }; YAHOO.extendX(Clipperz.PM.Components.PasswordEntropyDisplay, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.PasswordEntropyDisplay"; }, //----------------------------------------------------- 'wrapperElement': function() { return this._wrapperElement; }, 'setWrapperElement': function(aValue) { this._wrapperElement = aValue; }, //----------------------------------------------------- 'passwordElement': function() { return this.element(); }, //----------------------------------------------------- 'entropyElement': function() { return this._entropyElement; }, 'setEntropyElement': function(aValue) { this._entropyElement = aValue; }, //----------------------------------------------------- 'render': function() { MochiKit.Signal.disconnectAllTo(this); this.setWrapperElement(this.element().wrap({tag:'div'})); this.setEntropyElement(Clipperz.YUI.DomHelper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); // this.entropyElement().setWidth(this.passwordElement().getWidth()); this.updateEntropyElement(); MochiKit.Signal.connect(this.element().dom, 'onkeyup', this, 'updateEntropyElement'); MochiKit.Signal.connect(this.element().dom, 'onchange', this, 'updateEntropyElement'); MochiKit.Signal.connect(this.element().dom, 'onblur', this, 'updateEntropyElement'); }, //----------------------------------------------------- 'computeEntropyForString': function(aValue) { return Clipperz.PM.Crypto.passwordEntropy(aValue); }, //----------------------------------------------------- 'updateEntropyElement': function(anEvent) { //MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement"); var maxExtent; var entropy; entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); //MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy); this.entropyElement().setStyle('background-position', "0px " + -entropy + "px"); this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128)); //MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement"); }, //----------------------------------------------------- __syntaxFix__: '__syntaxFix__' }); diff --git a/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js b/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js index 87c52b2..67db50a 100644 --- a/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.js +++ b/frontend/beta/js/Clipperz/PM/Components/PasswordGenerator.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 = {}; } Clipperz.PM.Components.PasswordGenerator = function(anElement, aFieldValueComponent, args) { args = args || {}; //MochiKit.Logging.logDebug(">>> new TextFormField"); Clipperz.PM.Components.PasswordGenerator.superclass.constructor.call(this, anElement, args); this._fieldValueComponent = aFieldValueComponent; this._panelButton = null; this.render(); //MochiKit.Logging.logDebug("<<< new TextFormField"); return this; }; YAHOO.extendX(Clipperz.PM.Components.PasswordGenerator, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.PasswordGenerator"; }, //----------------------------------------------------- 'fieldValueComponent': function() { return this._fieldValueComponent; }, //----------------------------------------------------- 'render': function() { MochiKit.Signal.disconnectAllTo(this); // this._panelButton = new YAHOO.ext.Button(this.element().dom, {text:Clipperz.PM.Strings['passwordGeneratorButtonLabel'], handler:this.openPasswordPanel, scope:this}); MochiKit.Signal.connect(this.element().dom, 'onmouseenter', this, 'onMouseEnter'); MochiKit.Signal.connect(this.element().dom, 'onmouseleave', this, 'onMouseLeave'); MochiKit.Signal.connect(this.element().dom, 'onclick', this, 'openPasswordPanel'); }, //----------------------------------------------------- 'onMouseEnter': function() { this.element().addClass('hover'); }, 'onMouseLeave': function() { this.element().removeClass('hover'); }, //----------------------------------------------------- 'panelButton': function() { return this._panelButton; }, //----------------------------------------------------- 'openPasswordPanel': function() { var passwordGeneratorElement; var passwordGeneratorDialog; var cancelButton; var okButton; var cancelFunction; var okFunction; //MochiKit.Logging.logDebug(">>> PasswordGenerator.openPasswordPanel"); passwordGeneratorElement = Clipperz.YUI.DomHelper.append(document.body, {tag:'div', id:'passwordGenerator', children:[ {tag:'div', cls:'ydlg-hd', htmlString:Clipperz.PM.Strings['passwordGeneratorPanelTitle']}, {tag:'div', cls:'ydlg-bd', children:[ {tag:'form', id:this.getId('passwordGeneratorForm'), cls:'passwordGenerator', children:[ {tag:'input', type:'text', cls:'clipperz_passwordGenerator_password', id:this.getId('passwordField')}, {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'lowercase', id:this.getId('lowercase'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLowercaseLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'uppercase', id:this.getId('uppercase'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorUppercaseLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'numbers', id:this.getId('numbers'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorNumberLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'input', type:'checkbox', name:'symbols', id:this.getId('symbols'), checked:true}, {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorSymbolLabel']} ]}, {tag:'td', width:'20%', children:[ {tag:'span', cls:'passwordGeneratorLength', children:[ {tag:'span', htmlString:Clipperz.PM.Strings['passwordGeneratorLengthLabel']}, {tag:'span', id:this.getId('passwordLength'), cls:'passwordGeneratorLengthValue', html:'0'} ]} ]} ]} ]} ]} ]} ]}, {tag:'div', cls:'ydlg-ft'} ]}, true); new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('passwordField')); MochiKit.Signal.connect(this.getId('lowercase'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('uppercase'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('numbers'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getId('symbols'), 'onclick', this, 'updatePasswordValue'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onkeyup', this, 'updatePasswordLengthLabel'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onchange', this, 'updatePasswordLengthLabel'); MochiKit.Signal.connect(this.getDom('passwordField'), 'onblur', this, 'updatePasswordLengthLabel'); this.updatePasswordValue(); passwordGeneratorDialog = new YAHOO.ext.BasicDialog( passwordGeneratorElement, { autoCreate:false, closable:false, modal:true, autoTabs:false, resizable:false, fixedcenter:true, constraintoviewport:false, width:320, height:130, shadow:true, minWidth:200, minHeight:100 } ); cancelFunction = MochiKit.Base.partial(MochiKit.Base.bind(this.cancelPasswordPanel, this), passwordGeneratorDialog); passwordGeneratorDialog.addKeyListener(27, cancelFunction); cancelButton = passwordGeneratorDialog.addButton(Clipperz.PM.Strings['passwordGeneratorPanelCancelLabel'], cancelFunction, this); okFunction = MochiKit.Base.partial(MochiKit.Base.bind(this.okPasswordPanel, this), passwordGeneratorDialog); passwordGeneratorDialog.addKeyListener([10, 13], okFunction); okButton = passwordGeneratorDialog.addButton(Clipperz.PM.Strings['passwordGeneratorPanelOkLabel'], okFunction, this); MochiKit.Signal.connect(this.getId('passwordGeneratorForm'), 'onsubmit', okFunction); passwordGeneratorDialog.setDefaultButton(okButton); this.fieldValueComponent().mainComponent().mainPanel().exitModalView(); this.fieldValueComponent().mainComponent().scrollToTop(); // passwordGeneratorDialog.show(this.panelButton().getEl()); passwordGeneratorDialog.show(this.element()); this.onMouseLeave(); }, //----------------------------------------------------- 'cancelPasswordPanel': function(aPasswordGeneratorPanel) { this.fieldValueComponent().mainComponent().mainPanel().enterModalView(); aPasswordGeneratorPanel.hide(MochiKit.Base.bind(function() { aPasswordGeneratorPanel.destroy(true); MochiKit.Signal.disconnectAllTo(this); }, this)); }, //----------------------------------------------------- 'updatePasswordLengthLabel': function() { this.getElement('passwordLength').update(this.getDom('passwordField').value.length); }, //----------------------------------------------------- 'okPasswordPanel': function(aPasswordGeneratorPanel, anEvent) { //MochiKit.Logging.logDebug(">>> PasswordGenerator.okPasswordPanel"); if (anEvent.stop) { anEvent.stop(); } this.fieldValueComponent().inputElement().dom.focus(); this.fieldValueComponent().inputElement().dom.value = this.getElement('passwordField').dom.value; this.getElement('passwordField').dom.focus(); this.cancelPasswordPanel(aPasswordGeneratorPanel); return false; }, diff --git a/frontend/beta/js/Clipperz/PM/Components/Printing/Footer.js b/frontend/beta/js/Clipperz/PM/Components/Printing/Footer.js index b3debad..821dc94 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Printing/Footer.js +++ b/frontend/beta/js/Clipperz/PM/Components/Printing/Footer.js @@ -1,25 +1,23 @@ /* -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/. */ diff --git a/frontend/beta/js/Clipperz/PM/Components/Printing/Header.js b/frontend/beta/js/Clipperz/PM/Components/Printing/Header.js index b3debad..821dc94 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Printing/Header.js +++ b/frontend/beta/js/Clipperz/PM/Components/Printing/Header.js @@ -1,25 +1,23 @@ /* -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/. */ diff --git a/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js b/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js index 5f5c29f..170bd09 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js +++ b/frontend/beta/js/Clipperz/PM/Components/Printing/Record.js @@ -1,92 +1,90 @@ /* -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.Printing) == 'undefined') { Clipperz.PM.Components.Printing = {}; } Clipperz.PM.Components.Printing.Record = function(args) { args = args || {}; this._record = args['record']; return this; } MochiKit.Base.update(Clipperz.PM.Components.Printing.Record.prototype, { 'record': function() { return this._record; }, //------------------------------------------------------------------------- 'deferredDrawToWindow': function(aWindow) { var deferredResult; deferredResult = new MochiKit.Async.Deferred(); deferredResult.addCallback(MochiKit.Base.method(this.record(), 'deferredData')); deferredResult.addCallback(MochiKit.Base.method(this, 'appendToWindow', aWindow)); deferredResult.callback(); return deferredResult; }, //------------------------------------------------------------------------- 'appendToWindow': function(aWindow) { MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function() { var newBlock; var fields; fields = MochiKit.Base.concat( MochiKit.Base.map(MochiKit.Base.bind(function(aField) { var result; var dt, dd; var label, value; label = aField.label(); value = aField.value(); dt = MochiKit.DOM.createDOM('DT', null, label); dd = MochiKit.DOM.createDOM('DD', null, value) result = [dt, dd]; return result }, this), MochiKit.Base.values(this.record().currentVersion().fields())) ); newBlock = MochiKit.DOM.DIV({'class': 'recordBlock'}, MochiKit.DOM.H2(null, this.record().label()), MochiKit.DOM.DIV({'class': 'recordNotes'}, MochiKit.Base.map(MochiKit.Base.partial(MochiKit.DOM.P, null), this.record().notes().split("\n"))), MochiKit.DOM.createDOM('DL', null, fields) ); MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, newBlock); }, this)); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractComponent.js index 5b50284..d6fde5c 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractComponent.js @@ -1,102 +1,100 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.AbstractComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.AbstractComponent.superclass.constructor.call(this, args); this._element = anElement; this._mainComponent = args.mainComponent; return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.AbstractComponent, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.AbstractComponent"; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this._mainComponent; }, //------------------------------------------------------------------------- 'record': function() { return this.mainComponent().record(); }, //------------------------------------------------------------------------- 'editMode': function() { return this.mainComponent().editMode(); }, //------------------------------------------------------------------------- 'render': function() { this.element().update(""); this.update(); }, //------------------------------------------------------------------------- 'update': function(anEvent) { if (this.editMode() == 'EDIT') { this.updateEditMode(); } else if (this.editMode() == 'VIEW') { this.updateViewMode(); } }, //------------------------------------------------------------------------- 'updateViewMode': function() {}, 'updateEditMode': function() {}, 'synchronizeComponentValues': function() {}, //------------------------------------------------------------------------- 'destroy': function() { this.element().remove(); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractFieldSubComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractFieldSubComponent.js index ad733aa..ede42c2 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractFieldSubComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/AbstractFieldSubComponent.js @@ -1,74 +1,72 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent.superclass.constructor.call(this, anElement, args); this._fieldComponent = args.fieldComponent || null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent"; }, //------------------------------------------------------------------------- 'fieldComponent': function() { return this._fieldComponent; }, //------------------------------------------------------------------------- 'mainComponent': function() { return this.fieldComponent().mainComponent(); }, //------------------------------------------------------------------------- 'recordField': function() { return this.fieldComponent().recordField(); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/CreationWizard.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/CreationWizard.js index d4c7837..c703db4 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/CreationWizard.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/CreationWizard.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.CreationWizard = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.CreationWizard.superclass.constructor.call(this, anElement, args); this._mainComponent = args.mainComponent; this._previouslySelectedRecord = args.previouslySelectedRecord; //MochiKit.Logging.logDebug("--- new CreationWizard - previouslySelectedRecord: " + args.previouslySelectedRecord); this._createButton_header = null; this._createButton_footer = null; this._cancelButton_header = null; this._cancelButton_footer = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.CreationWizard, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.CreationWizard component"; }, //------------------------------------------------------------------------- 'previouslySelectedRecord': function() { return this._previouslySelectedRecord; }, //------------------------------------------------------------------------- 'render': function() { var templateListElement; var templates; this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'form', cls:'recordDataFORM', id:this.getId('form'), children:[ {tag:'div', id:'recordDetailDataBox', cls:'recordDetailDataBox', children:[ {tag:'div', id:this.getId('wizardBox'), cls:'recordCreationWizard', children:[ {tag:'div', id:this.getId('recordCreationWizardTitleBox'), cls:'recordCreationWizardTitleBox', htmlString:Clipperz.PM.Strings['newRecordWizardTitleBox']}, {tag:'ul', id:this.getId('templateList'), cls:'radioList'} ]} ]} ]} ); Clipperz.YUI.DomHelper.append(this.getDom('recordCreationWizardTitleBox'), {tag:'div', cls:'newRecordWizardHeader', children:[ {tag:'table', width:'100%', cellpadding:'5', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'49%', align:'right', children:[ {tag:'div', id:this.getId('cancelButton_header')} ]}, {tag:'td', width:'10', html:' '}, {tag:'td', width:'49%', align:'left', children:[ {tag:'div', id:this.getId('createButton_header')} ]} ]} ]} ]} ]}); templateListElement = this.getElement('templateList'); templates = Clipperz.PM.Strings['recordTemplates']; MochiKit.Iter.forEach(MochiKit.Base.keys(templates), MochiKit.Base.bind(function(aTemplateKey) { Clipperz.YUI.DomHelper.append(templateListElement.dom, {tag:'li', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', id:this.getId(aTemplateKey+"_radio"), type:'radio', name:'recordTemplate', value:"aTemplateKey"} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', id:this.getId(aTemplateKey+"_title"), html:templates[aTemplateKey]['title']}, {tag:'div', cls:'templateDescription', htmlString:templates[aTemplateKey]['description']} ]} ]} ]} ]} ]}); this.getElement(aTemplateKey+"_radio").dom.value = aTemplateKey; MochiKit.Signal.connect(this.getDom(aTemplateKey+"_title"), 'onclick', MochiKit.Base.partial(function(aRadioButton) {aRadioButton.click();}, this.getDom(aTemplateKey+"_radio"))); }, this)); Clipperz.YUI.DomHelper.append(templateListElement.dom, {tag:'li', children:[ {tag:'table', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', type:'radio', name:'recordTemplate', id:this.getId('bookmarkletRadioButton'), value:'BookmarkletConfigurationTemplate'} ]}, {tag:'td', valign:'top', children:[ {tag:'h4', htmlString:Clipperz.PM.Strings['newRecordWizardBookmarkletConfigurationTitle']}, {tag:'div', cls:'templateDescription', htmlString:Clipperz.PM.Strings['newRecordWizardBookmarkletConfigurationDescription']}, {tag:'div', cls:'bookmarkletConfiguration', children:[ // {tag:'span', htmlString:Clipperz.PM.Strings['newRecordWizardBookmarkletConfigurationLabel']}, {tag:'div', htmlString:Clipperz.PM.Strings['recordDetailNewDirectLoginDescription']}, {tag:'textarea', id:this.getId('bookmarkletConfiguration')} ]} ]} ]} ]} ]} ]}); Clipperz.YUI.DomHelper.append(this.getDom('wizardBox'), {tag:'div', cls:'newRecordWizardFooter', children:[ {tag:'table', width:'100%', cellpadding:'5', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'49%', align:'right', children:[ {tag:'div', id:this.getId('cancelButton_footer')} ]}, {tag:'td', width:'10', html:' '}, {tag:'td', width:'49%', align:'left', children:[ {tag:'div', id:this.getId('createButton_footer')} ]} ]} ]} ]} ]}); this.setCreateButton_header(new YAHOO.ext.Button(this.getDom('createButton_header'), {text:Clipperz.PM.Strings['newRecordWizardCreateButtonLabel'], handler:this.createRecord, scope:this})); this.setCreateButton_footer(new YAHOO.ext.Button(this.getDom('createButton_footer'), {text:Clipperz.PM.Strings['newRecordWizardCreateButtonLabel'], handler:this.createRecord, scope:this})); this.setCancelButton_header(new YAHOO.ext.Button(this.getDom('cancelButton_header'), {text:Clipperz.PM.Strings['newRecordWizardCancelButtonLabel'], handler:this.exitWizard, scope:this})); this.setCancelButton_footer(new YAHOO.ext.Button(this.getDom('cancelButton_footer'), {text:Clipperz.PM.Strings['newRecordWizardCancelButtonLabel'], handler:this.exitWizard, scope:this})); this.createButton_header().disable(); this.createButton_footer().disable(); MochiKit.Iter.forEach(this.getElement('form').getChildrenByTagName('input'), MochiKit.Base.bind(function(anInput) { // MochiKit.Signal.connect(anInput.dom, 'onchange', this, 'enableCreateButton'); MochiKit.Signal.connect(anInput.dom, 'onclick', this, 'enableCreateButton'); // for Safari },this)); MochiKit.Signal.connect(this.getDom('bookmarkletConfiguration'), 'onkeyup', this, 'enableCreateButton'); MochiKit.Signal.connect(this.getDom('bookmarkletConfiguration'), 'onkeydown', this, 'enableCreateButton'); // for Safari }, //------------------------------------------------------------------------- 'createButton_header': function() { return this._createButton_header; }, 'setCreateButton_header': function(aValue) { this._createButton_header = aValue; }, //......................................................................... 'createButton_footer': function() { return this._createButton_footer; }, 'setCreateButton_footer': function(aValue) { this._createButton_footer = aValue; }, //------------------------------------------------------------------------- 'cancelButton_header': function() { return this._cancelButton_header; }, 'setCancelButton_header': function(aValue) { this._cancelButton_header = aValue; }, //......................................................................... 'cancelButton_footer': function() { return this._cancelButton_footer; }, diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginBindingComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginBindingComponent.js index 36dd9a8..0e4640e 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginBindingComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginBindingComponent.js @@ -1,171 +1,169 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.DirectLoginBindingComponent = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new DirectLoginBindingComponent"); args = args || {}; Clipperz.PM.Components.RecordDetail.DirectLoginBindingComponent.superclass.constructor.call(this, anElement, args); this._directLoginBinding = args.directLoginBinding || null; this.render(); Clipperz.NotificationCenter.register(this.record(), 'addNewRecordField', this, 'syncAndUpdateEditMode'); Clipperz.NotificationCenter.register(this.record(), 'removedField', this, 'syncAndUpdateEditMode'); Clipperz.NotificationCenter.register(this.record(), 'updatedFieldLabel', this, 'syncAndUpdateEditMode'); //MochiKit.Logging.logDebug("<<< new DirectLoginBindingComponent"); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginBindingComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.DirectLoginBindingComponent component"; }, //------------------------------------------------------------------------- 'directLoginBinding': function() { return this._directLoginBinding; }, //------------------------------------------------------------------------- 'render': function() { // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', style:'font-weight:bold;', html:this.directLoginBinding().key()}) // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.directLoginBinding().value()}) //MochiKit.Logging.logDebug(">>> DirectLoginBindingComponent.render"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', cls:'directLoginBindingLabelTD', children:[ {tag:'span', html:this.directLoginBinding().key()} ]}); //MochiKit.Logging.logDebug("--- DirectLoginBindingComponent.render - 1"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', cls:'directLoginBindingValueTD', children:[ {tag:'div', id:this.getId('editModeBox'), children:[ {tag:'select', id:this.getId('select'), children:this.recordFieldOptions()} ]}, {tag:'div', id:this.getId('viewModeBox'), children:[ {tag:'span', id:this.getId('viewValue'), html:""} ]} ]}); //MochiKit.Logging.logDebug("--- DirectLoginBindingComponent.render - 2"); this.getElement('editModeBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('viewModeBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.update(); //MochiKit.Logging.logDebug("<<< DirectLoginBindingComponent.render"); }, //------------------------------------------------------------------------- 'recordFieldOptions': function() { var result; var option; var recordFieldKey; var recordFields; //MochiKit.Logging.logDebug(">>> DirectLoginBindingComponent.recordFieldOptions"); recordFields = this.directLoginBinding().directLogin().record().currentVersion().fields(); result = []; option = {tag:'option', value:null, html:'---'}; result.push(option); for (recordFieldKey in recordFields) { // TODO: remove the value: field and replace it with element.dom.value = <some value> option = {tag:'option', value:recordFieldKey, html:recordFields[recordFieldKey].label()} if (recordFieldKey == this.directLoginBinding().fieldKey()) { option['selected'] = true; } result.push(option); } //MochiKit.Logging.logDebug("<<< DirectLoginBindingComponent.recordFieldOptions"); return result; }, //------------------------------------------------------------------------- 'syncAndUpdateEditMode': function() { this.synchronizeComponentValues(); this.updateEditMode(); }, 'updateEditMode': function() { var selectElementBox; //MochiKit.Logging.logDebug(">>> DirectLoginBindingComponent.updateEditMode"); this.getElement('viewModeBox').hide(); selectElementBox = this.getElement('editModeBox'); selectElementBox.update(""); Clipperz.YUI.DomHelper.append(selectElementBox.dom, {tag:'select', id:this.getId('select'), children:this.recordFieldOptions()}); /* selectElement = this.getElement('select'); selectElement.update(""); MochiKit.Iter.forEach(this.recordFieldOptions(), function(anOption) { Clipperz.YUI.DomHelper.append(selectElement.dom, anOption); }); */ this.getElement('editModeBox').show(); //MochiKit.Logging.logDebug("<<< DirectLoginBindingComponent.updateEditMode"); }, //------------------------------------------------------------------------- 'updateViewMode': function() { //MochiKit.Logging.logDebug(">>> DirectLoginBindingComponent.updateViewMode"); this.getElement('editModeBox').hide(); this.getElement('viewModeBox').show(); this.getElement('viewValue').update(this.directLoginBinding().field().label()); //MochiKit.Logging.logDebug("<<< DirectLoginBindingComponent.updateViewMode"); }, //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { //MochiKit.Logging.logDebug(">>> DirectLoginBindingComponent.synchronizeComponentValues") //MochiKit.Logging.logDebug("--- DirectLoginBindingComponent.synchronizeComponentValues - 1 - " + this.getId('select')); this.directLoginBinding().setFieldKey(this.getDom('select').value); //MochiKit.Logging.logDebug("<<< DirectLoginBindingComponent.synchronizeComponentValues"); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js index 69cad79..883c45c 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.DirectLoginComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.DirectLoginComponent.superclass.constructor.call(this, anElement, args); this._directLogin = args.directLogin || null; // this._titleElement = null; this._structureElement = null; this._removeButton = null; this._directLoginBindingComponents = null; this._collapser = null; this.mainComponent().addEditComponent(this); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.DirectLoginComponent component"; }, //------------------------------------------------------------------------- 'directLogin': function() { return this._directLogin; }, 'directLoginBindingComponents': function() { return this._directLoginBindingComponents; }, //------------------------------------------------------------------------- 'removeDirectLogin': function() { //MochiKit.Logging.logDebug(">>> DirectLoginComponent.removeDirectLogin"); this.mainComponent().synchronizeComponentValues(); this.directLogin().remove(); this.mainComponent().removeEditComponent(this); this.mainComponent().render(); //MochiKit.Logging.logDebug("<<< DirectLoginComponent.removeDirectLogin"); }, //------------------------------------------------------------------------- /* 'formDataValue': function() { return Clipperz.Base.serializeJSON(this.directLogin().formData()); }, 'setFormDataValue': function(aValue) { }, */ //------------------------------------------------------------------------- 'removeButton': function() { return this._removeButton; }, 'setRemoveButton': function(aValue) { this._removeButton = aValue; }, //------------------------------------------------------------------------- /* 'titleElement': function() { return this._titleElement; }, 'setTitleElement': function(aValue) { this._titleElement = aValue; }, */ //------------------------------------------------------------------------- 'structureElement': function() { return this._structureElement; }, 'setStructureElement': function(aValue) { this._structureElement = aValue; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> DirectLoginComponent.render"); try { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'li', children:[ {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', rowspan:'2', width:'30', valign:'top', html:' ', children:[ {tag:'div', id:this.getId('removeDirectLogin'), children:[ {tag:'div', id:this.getId('removeDirectLoginButton')} ]}, {tag:'div', id:this.getId('collapseLink'), cls:'directLoginCollapseLink'} ]}, {tag:'td', valign:'top', children:[ {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'20', valign:'top', children:[ {tag:'a', href:'#', id:this.getId('directLogin'), children:[ {tag:'img', id:this.getId('faviconImage'), width:'16', height:'16', src:this.directLogin().fixedFavicon()} ]} ]}, {tag:'td', valign:'top', children:[ {tag:'div', cls:'directLoginDetailTitle', children:[ {tag:'div', id:this.getId('titleViewBox'), children:[ {tag:'a', href:'#', id:this.getId('titleLink')} ]}, {tag:'div', id:this.getId('titleEditBox'), children:[ {tag:'input', type:'text', id:this.getId('titleInput')} ]} ]} ]} ]} ]} ]} ]} ]}, {tag:'tr', children:[ {tag:'td', /*colspan:'2',*/ children:[ {tag:'div', id:this.getId('details'), children:[ {tag:'table', cls:'directLoginBindings', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', id:this.getId('tbodyBindings'), children:[]} ]} ]} ]} ]} ]} ]} ]} ); MochiKit.Signal.connect(this.getId('faviconImage'), 'onload', this, 'handleLoadedFaviconImage'); MochiKit.Signal.connect(this.getId('faviconImage'), 'onerror', this.directLogin(), 'handleMissingFaviconImage'); MochiKit.Signal.connect(this.getId('faviconImage'), 'onabort', this.directLogin(), 'handleMissingFaviconImage'); this.getElement('removeDirectLogin').setVisibilityMode(YAHOO.ext.Element.DISPLAY); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 1"); this.getElement('collapseLink').addClassOnOver('hover'); this._collapser = new Clipperz.YUI.Collapser(this.getElement('collapseLink'), this.getElement('details'), true); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 2"); MochiKit.Signal.connect(this.getId('directLogin'), 'onclick', this, 'runDirectLogin'); // this.getElement('directLogin').on('click', this.runDirectLogin, this, false); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 3"); // this.setTitleElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), { // editMode:this.editMode(), // value:this.directLogin().label() // })); this.getElement('titleViewBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('titleEditBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); //- this.getElement('titleLink').on('click', this.runDirectLogin, this, false); MochiKit.Signal.connect(this.getId('titleLink'), 'onclick', this, 'runDirectLogin'); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 4"); //- this.setStructureElement(new Clipperz.PM.Components.TextFormField(this.getElement('formStructure'), { //- editMode:this.editMode(), //- value:this.formDataValue(), multiline:true //- })); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 5"); { var bindingKey; var valueName; var inputsRequiringAdditionalValues; var bindingsElement; var i,c; //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 6"); this._directLoginBindingComponents = []; //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 7"); bindingsElement = this.getElement('tbodyBindings'); //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 8"); for (bindingKey in this.directLogin().bindings()) { diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginValueComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginValueComponent.js index d210100..b478d94 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginValueComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginValueComponent.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.DirectLoginValueComponent = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new DirectLoginValueComponent"); args = args || {}; Clipperz.PM.Components.RecordDetail.DirectLoginValueComponent.superclass.constructor.call(this, anElement, args); this._directLoginInputValue = args.directLoginInputValue || null; this._value = this.directLoginInputValue().directLogin().formValues()[this.directLoginInputValue().name()]; this.render(); //MochiKit.Logging.logDebug("<<< new DirectLoginValueComponent - record: " + this.record()); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginValueComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.DirectLoginValueComponent component - " + this.directLoginInputValue().name(); }, //------------------------------------------------------------------------- 'directLoginInputValue': function() { return this._directLoginInputValue; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> DirectLoginValueComponent.render"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', cls:'directLoginDataLabelTD', children:[ {tag:'span', html:this.directLoginInputValue().name()} ]}); //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.render - 1"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', cls:'directLoginDataValueTD', children:[ {tag:'span', id:this.getId('inputElement')} ]}); //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.render - 2"); this.update(); //MochiKit.Logging.logDebug("<<< DirectLoginValueComponent.render"); }, //------------------------------------------------------------------------- 'inputElementConfiguration': function() { var result; var currentValue; //MochiKit.Logging.logDebug(">>> DirectLoginValueComponent.inputElementConfiguration - " + this.directLoginInputValue().name()); result = []; currentValue = this.value(); switch (this.directLoginInputValue().type()) { case 'checkbox': var checkbox; //{"type":"checkbox", "name":"rememberUsernameChk", "value":"checkbox"} checkbox = {tag:'input', id:this.getId('checkbox'), type:'checkbox'} if (currentValue == true) { checkbox.checked = true; } result.push(checkbox); break; case 'select': var input; //{"type":"select", "name":"DOMAIN", "options":[{"selected":true, "label":"@tin.it", "value":"tin.it"}, {"selected":false, "label":"@virgilio.it", "value":"virgilio.it"}]} input = {tag:'select', id:this.getId('select'), name:this.directLoginInputValue().name(), children:[]}; input.children.push({tag:'option', value:null, html:"---"}); MochiKit.Iter.forEach(this.directLoginInputValue().args()['options'], function(anOption) { var option; // TODO: remove the value: field and replace it with element.dom.value = <some value> option = {tag:'option', value:anOption['value'], html:anOption['label']} if (currentValue == anOption['value']) { option.selected = true; } input.children.push(option); }) result.push(input); break; case 'radio': var name; var radioBox; //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3"); name = this.getId(this.directLoginInputValue().name()); radioBox = {tag:'div', id:this.getId('radioBox'), children:[]}; result.push(radioBox); //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1 - options.length: " + this.directLoginInputValue().args()['options'].length); //{"name":"dominio", "type":"radio", "options":[{"value":"@alice.it", "checked":true}, {"value":"@tin.it", "checked":false}, {"value":"@virgilio.it", "checked":false}, {"value":"@tim.it", "checked":false}]} MochiKit.Iter.forEach(this.directLoginInputValue().args()['options'], function(anOption) { var radio; //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.1"); // TODO: remove the value: field and replace it with element.dom.value = <some value> radio = {tag:'input', type:'radio', name:name, value:anOption['value']}; //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.2"); if (currentValue == anOption['value']) { //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.3"); radio.checked = true; //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.4"); } //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.5"); radioBox.children.push({tag:'div', children:[ radio, {tag:'span', html:anOption['value']} ]}) //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.1.6"); }) //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.inputElementConfiguration - 3.2"); break; } //MochiKit.Logging.logDebug("<<< DirectLoginValueComponent.inputElementConfiguration"); return result; }, //------------------------------------------------------------------------- 'inputValue': function() { var result; switch (this.directLoginInputValue().type()) { case 'checkbox': result = this.getDom('checkbox').checked; break; case 'select': result = this.getDom('select').value; break; case 'radio': var checkedRadioButtons; checkedRadioButtons = MochiKit.Base.filter( function(aRadioButton) { return aRadioButton.dom.checked }, this.getElement('radioBox').getChildrenByTagName('input')); if (checkedRadioButtons.length == 0) { result = null; } else { result = checkedRadioButtons[0].dom.value; } break; } return result; }, //------------------------------------------------------------------------- 'value': function() { return this._value; }, 'setValue': function(aValue) { this._value = aValue; }, //------------------------------------------------------------------------- 'updateEditMode': function() { //MochiKit.Logging.logDebug(">>> DirectLoginValueComponent.updateEditMode - " + this); this.getElement('inputElement').update(""); //MochiKit.Logging.logDebug("--- DirectLoginValueComponent.updateEditMode - 1"); Clipperz.YUI.DomHelper.append(this.getDom('inputElement'), {tag:'div', children:this.inputElementConfiguration()}); //MochiKit.Logging.logDebug("<<< DirectLoginValueComponent.updateEditMode"); }, //------------------------------------------------------------------------- 'updateViewMode': function() { //MochiKit.Logging.logDebug(">>> DirectLoginValueComponent.updateViewMode"); // this.getElement('inputElement').update(this.directLoginInputValue().value()); this.getElement('inputElement').update(""); switch (this.directLoginInputValue().type()) { case 'checkbox': if (this.value() == true) { this.getElement('inputElement').update(Clipperz.PM.Strings['directLoginConfigurationCheckBoxFieldSelectedValue']); } else { this.getElement('inputElement').update(Clipperz.PM.Strings['directLoginConfigurationCheckBoxFieldNotSelectedValue']) diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginsComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginsComponent.js index 1396bd8..878adce 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginsComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginsComponent.js @@ -1,196 +1,194 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.DirectLoginsComponent = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent"); args = args || {}; //MochiKit.Logging.logDebug("--- new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent - 0"); Clipperz.PM.Components.RecordDetail.DirectLoginsComponent.superclass.constructor.call(this, anElement, args); //MochiKit.Logging.logDebug("--- new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent - 1"); this._addDirectLoginButton = null; //MochiKit.Logging.logDebug("--- new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent - 2"); this.mainComponent().addEditComponent(this); //MochiKit.Logging.logDebug("--- new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent - 3"); this.render(); //MochiKit.Logging.logDebug("<<< new Clipperz.PM.Components.RecordDetail.DirectLoginsComponent"); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginsComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.DirectLoginsComponent component"; }, //------------------------------------------------------------------------- 'addDirectLoginButton': function() { return this._addDirectLoginButton; }, 'setAddDirectLoginButton': function(aValue) { this._addDirectLoginButton = aValue; }, //------------------------------------------------------------------------- 'render': function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', cls:'directLoginsRecordBox', children:[ {tag:'h3', htmlString:Clipperz.PM.Strings['recordDetailDirectLoginBlockTitle']}, {tag:'ul', id:this.getId('directLogins')}, {tag:'div', cls:'addDirectLoginBox', id:this.getId('addDirectLogin'), children:[ {tag:'div', cls:'addDirectLoginBoxContent', children:[ {tag:'div', cls:'bookmarkletConfiguration', children:[ // {tag:'span', htmlString:Clipperz.PM.Strings['newRecordWizardBookmarkletConfigurationLabel']}, {tag:'div', htmlString:Clipperz.PM.Strings['recordDetailNewDirectLoginDescription']}, {tag:'textarea', id:this.getId('addDirectLoginTextarea')} ]}, {tag:'div', id:this.getId('addDirectLoginButton')} ]} ]} ]} ); if (MochiKit.Base.keys(this.record().directLogins()).length == 0) { //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 3"); Clipperz.YUI.DomHelper.append(this.getElement('directLogins'), {tag:'li', children:[ // {tag:'span', htmlString:Clipperz.PM.Strings['recordDetailDirectLoginBlockNoDirectLoginConfiguredLabel']} {tag:'div', cls:'recordDetailNoDirectLoginDescriptionBox', htmlString:Clipperz.PM.Strings['recordDetailDirectLoginBlockNoDirectLoginConfiguredDescription']} ]} ); //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 4"); } else { //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 5"); for (directLoginReference in this.record().directLogins()) { //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 6"); this.addDirectLogin(this.record().directLogins()[directLoginReference]); //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 7"); } //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 8"); } //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 9"); this.setAddDirectLoginButton(new YAHOO.ext.Button(this.getDom('addDirectLoginButton'), { text:Clipperz.PM.Strings['recordDetailAddNewDirectLoginButtonLabel'], handler:this.addNewDirectLogin, scope:this })); MochiKit.Signal.connect(this.getId('addDirectLoginTextarea'), 'onkeydown', this, 'onkeydown'); //MochiKit.Logging.logDebug("--- DirectLoginsComponent.render - 11"); this.update(); //MochiKit.Logging.logDebug("<<< DirectLoginsComponent.render"); }, //------------------------------------------------------------------------- 'addDirectLogin': function(aDirectLogin) { //MochiKit.Logging.logDebug(">>> DirectLoginsComponent.addDirectLogin"); new Clipperz.PM.Components.RecordDetail.DirectLoginComponent( Clipperz.YUI.DomHelper.append(this.getDom('directLogins'), {tag:'div'}, true), { mainComponent:this.mainComponent(), directLogin:aDirectLogin } ); //MochiKit.Logging.logDebug("<<< DirectLoginsComponent.addDirectLogin"); }, //------------------------------------------------------------------------- 'addNewDirectLogin': function() { var newDirectLogin; var configuration; //MochiKit.Logging.logDebug(">>> DirectLoginsComponent.addNewDirectLogin"); if (MochiKit.Base.keys(this.record().directLogins()).length == 0) { this.getElement('directLogins').update(""); } this.mainComponent().synchronizeComponentValues(); this.mainComponent().exitModalView(); configuration = Clipperz.PM.BookmarkletProcessor.checkBookmarkletConfiguration( this.getDom('addDirectLoginTextarea').value, this.getDom('addDirectLoginButton'), MochiKit.Base.method(this.mainComponent(), 'enterModalView') ); this.mainComponent().enterModalView(); newDirectLogin = new Clipperz.PM.DataModel.DirectLogin({record:this.record(), label:configuration['page']['title'], bookmarkletVersion:'0.2', // bookmarkletVersion:configuration['version'], formData:configuration['form']}); this.record().addDirectLogin(newDirectLogin); this.addDirectLogin(newDirectLogin); this.getDom('addDirectLoginTextarea').value = ""; //MochiKit.Logging.logDebug("<<< DirectLoginsComponent.addNewDirectLogin"); }, //------------------------------------------------------------------------- 'updateViewMode': function() { this.getElement('addDirectLogin').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('addDirectLogin').hide(); }, //------------------------------------------------------------------------- 'updateEditMode': function() { this.getElement('addDirectLogin').show(); }, //------------------------------------------------------------------------- 'onkeydown': function(anEvent) { //MochiKit.Logging.logDebug(">>> onkeydown - " + anEvent.src().id + ": " + anEvent.key().code); if (anEvent.key().code == 13) { this.addNewDirectLogin(); } }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldButtonComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldButtonComponent.js index b79c365..661f94d 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldButtonComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldButtonComponent.js @@ -1,114 +1,112 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldButtonComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.FieldButtonComponent.superclass.constructor.call(this, anElement, args); this._button = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldButtonComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldButtonComponent"; }, //------------------------------------------------------------------------- 'buttonText': function() { var result; if (this.recordField() == null) { // TODO: this is never used. It is just an obsolete legacy chunk of code result = Clipperz.PM.Strings['recordDetailAddFieldButtonLabel']; } else { result = Clipperz.PM.Strings['recordDetailRemoveFieldButtonLabel']; } return result; }, //------------------------------------------------------------------------- 'button': function() { return this._button; }, 'setButton': function(aValue) { this._button = aValue; }, //------------------------------------------------------------------------- 'render': function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', id:this.getId('button')}) this.setButton(new YAHOO.ext.Button(this.getDom('button'), {text:this.buttonText(), handler:this.handleButtonClick, scope:this})); this.update(); }, //------------------------------------------------------------------------- 'handleButtonClick': function() { if (this.recordField() == null) { this.mainComponent().addNewField(); } else { this.mainComponent().removeField(this.fieldComponent()); } }, //------------------------------------------------------------------------- 'updateEditMode': function() { this.button().show(); }, //------------------------------------------------------------------------- 'updateViewMode': function() { this.button().hide(); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldComponent.js index 978a54e..bfa4658 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldComponent.js @@ -1,186 +1,184 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldComponent = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new FieldComponent"); args = args || {}; Clipperz.PM.Components.RecordDetail.FieldComponent.superclass.constructor.call(this, anElement, args); this._element = anElement; this._recordField = args.recordField || null; this._buttonComponent = null; this._labelComponent = null; this._dragHandler = null; this._valueComponent = null; this._typeComponent = null; this.mainComponent().addEditComponent(this); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldComponent component"; }, //------------------------------------------------------------------------- 'recordField': function() { return this._recordField; }, //------------------------------------------------------------------------- 'buttonComponent': function() { return this._buttonComponent; }, 'setButtonComponent': function(aValue) { this._buttonComponent = aValue; }, //------------------------------------------------------------------------- 'labelComponent': function() { return this._labelComponent; }, 'setLabelComponent': function(aValue) { this._labelComponent = aValue; }, //------------------------------------------------------------------------- 'dragHandler': function() { return this._dragHandler; }, 'setDragHandler': function(aValue) { this._dragHandler = aValue; }, //------------------------------------------------------------------------- 'valueComponent': function() { return this._valueComponent; }, 'setValueComponent': function(aValue) { this._valueComponent = aValue; }, //------------------------------------------------------------------------- 'typeComponent': function() { return this._typeComponent; }, 'setTypeComponent': function(aValue) { this._typeComponent = aValue; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> RecordDetail.FieldComponent.render"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td',/* width:'32',*/ height:'24', cls:'removeFieldButton', align:'left', valign:'top', id:this.getId('button')}); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td',/* width:'25%',*/ valign:'top', id:this.getId('label')}); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td',/* width:'3',*/ valign:'top', id:this.getId('dragHandler')}); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td',/* width:'50%',*/ valign:'top', children:[ {tag:'div', cls:'Clipperz_recordFieldData', id:this.getId('value')} ]}); this.setButtonComponent(new Clipperz.PM.Components.RecordDetail.FieldButtonComponent(this.getElement('button'), {fieldComponent:this})); this.setLabelComponent(new Clipperz.PM.Components.RecordDetail.FieldLabelComponent(this.getElement('label'), {fieldComponent:this})); this.setDragHandler(new Clipperz.PM.Components.RecordDetail.FieldDragHandler(this.getElement('dragHandler'), {fieldComponent:this})); this.setValueComponent(new Clipperz.PM.Components.RecordDetail.FieldValueComponent(this.getElement('value'), {fieldComponent:this})); if (this.editMode() == 'EDIT') { Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td',/* width:'60',*/ align:'left', cls:'fieldTypeTD', valign:'top', id:this.getId('type')}); this.setTypeComponent(new Clipperz.PM.Components.RecordDetail.FieldTypeComponent(this.getElement('type'), {fieldComponent:this})); } this.update(); //MochiKit.Logging.logDebug("<<< RecordDetail.FieldComponent.render"); }, //------------------------------------------------------------------------- 'handleButtonClick': function() { this.mainComponent().record().removeField(this.recordField()); // if (this.recordField() == null) { // this.mainComponent().record().addNewField(); // } else { // this.mainComponent().record().removeField(this.recordField()); // } }, //------------------------------------------------------------------------- 'update': function(anEvent) { //MochiKit.Logging.logDebug(">>> RecordDetail.FieldComponent.update"); this.buttonComponent().update(); this.labelComponent().update(); this.dragHandler().update(); this.valueComponent().update(); if (this.editMode() == 'EDIT') { this.typeComponent().update(); } //MochiKit.Logging.logDebug("<<< RecordDetail.FieldComponent.update"); }, //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { //MochiKit.Logging.logDebug(">>> FieldComponent.synchronizeComponentValues"); this.labelComponent().synchronizeComponentValues(); this.valueComponent().synchronizeComponentValues(); if (this.editMode() == 'EDIT') { this.typeComponent().synchronizeComponentValues(); } //MochiKit.Logging.logDebug("<<< FieldComponent.synchronizeComponentValues"); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldDragHandler.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldDragHandler.js index f7c5e21..7fea132 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldDragHandler.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldDragHandler.js @@ -1,56 +1,54 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldDragHandler = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.FieldDragHandler.superclass.constructor.call(this, anElement, args); this._element = anElement; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldDragHandler, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldDragHandler component"; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldLabelComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldLabelComponent.js index c58a7e2..c6f8cbf 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldLabelComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldLabelComponent.js @@ -1,138 +1,136 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldLabelComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.FieldLabelComponent.superclass.constructor.call(this, anElement, args); this._inputElement = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldLabelComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldLabelComponent component"; }, //------------------------------------------------------------------------- 'value': function() { return this.recordField().label(); }, //------------------------------------------------------------------------- 'inputElement': function() { return this._inputElement; }, 'setInputElement': function(aValue) { this._inputElement = aValue; }, //------------------------------------------------------------------------- 'render': function() { var newTextFormField; this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', cls:'Clipperz_recordFieldLabel', id:this.getId('label')}); // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', style:'font-size:8pt;', html:this.recordField().key()}); // this.setInputElement(new Clipperz.PM.Components.TextFormField(this.getElement('label'), {editMode:this.editMode(), value:this.value()})); newTextFormField = new Clipperz.PM.Components.TextFormField(this.getElement('label'), {editMode:this.editMode(), value:this.value()}); // newTextFormField.inputElement().setStyle({border:'3px solid cyan;'}); newTextFormField.on('change', this.notifyChanges, this, true) // this.inputElement().on('change', function() {alert("CHANGE");}); // this.inputElement().getElement('editComponent_input').on('change', function() {alert("CHANGE");}) // this.inputElement().on('blur', this.notifyChanges, this, true); this.setInputElement(newTextFormField); this.update(); }, 'notifyChanges': function() { //MochiKit.Logging.logDebug(">>> FieldLabelComponent.notifyChanges - " + this); this.synchronizeComponentValues(); Clipperz.NotificationCenter.notify(this.recordField().recordVersion().record(), 'updatedFieldLabel'); //MochiKit.Logging.logDebug("<<< FieldLabelComponent.notifyChanges"); }, //------------------------------------------------------------------------- 'update': function() { //MochiKit.Logging.logDebug(">>> FieldLabelComponent.update"); this.inputElement().update({editMode:this.editMode(), value:this.value()}); //MochiKit.Logging.logDebug("<<< FieldLabelComponent.update"); }, //------------------------------------------------------------------------- /* 'updateViewMode': function() { var width; var element; this.element().update(""); width = this.element().getWidth(); element = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', html:this.value()}, true); element.setWidth(width-1); }, //------------------------------------------------------------------------- 'updateEditMode': function() { var width; this.element().update(""); width = this.element().getWidth(true); this.setInputElement(Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:this.value()}, true)); this.inputElement().setWidth(width-1); }, */ //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { if (this.inputElement() != null) { this.recordField().setLabel(this.inputElement().value()); } }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldTypeComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldTypeComponent.js index 489258a..3108885 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldTypeComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldTypeComponent.js @@ -1,154 +1,152 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldTypeComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.FieldTypeComponent.superclass.constructor.call(this, anElement, args); this._inputElement = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldTypeComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldTypeComponent component"; }, //------------------------------------------------------------------------- 'inputElement': function() { return this._inputElement; }, 'setInputElement': function(aValue) { this._inputElement = aValue; }, //------------------------------------------------------------------------- 'value': function() { return this.recordField().type(); }, 'canChangeType': function() { var value; var result; value = this.value(); result = ((value == 'TXT') || (value == 'PWD') || (value == 'URL') || (value == 'DATE') || (value == 'ADDR')); return result }, //------------------------------------------------------------------------- 'updateViewMode': function() { this.element().update(""); if (this.canChangeType()) { var width; var element; width = this.element().getWidth(true); element = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', html:this.recordField().typeShortDescription()}, true); element.setWidth(width-1); } }, //------------------------------------------------------------------------- 'updateEditMode': function() { this.element().update(""); if (this.canChangeType()) { var width; width = this.element().getWidth(true); this.setInputElement(Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'select', children:[ {tag:'option', value:'TXT', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['TXT']['shortDescription']}, {tag:'option', value:'PWD', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['PWD']['shortDescription']}, {tag:'option', value:'URL', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['URL']['shortDescription']}, {tag:'option', value:'DATE', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['DATE']['shortDescription']}, {tag:'option', value:'ADDR', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['ADDR']['shortDescription']} // {tag:'option', value:'CHECK', html:Clipperz.PM.DataModel.RecordField.TypeDescriptions['CHECK']['shortDescription']}, // {tag:'option', value:'RADIO', html:Clipperz.PM.DataModel.RecordField.TypeDescriptions['RADIO']['shortDescription']}, // {tag:'option', value:'CHECK', html:Clipperz.PM.DataModel.RecordField.TypeDescriptions['SELECT']['shortDescription']} // {tag:'option', value:'NOTE', html:Clipperz.PM.DataModel.RecordField.TypeDescriptions['NOTE']['shortDescription']} ]}, true)); this.inputElement().setWidth(width-1); this.inputElement().addHandler('change', true, this.onChange, this, true); // this.selectCorrectOption(); Clipperz.DOM.selectOptionMatchingValue(this.inputElement().dom, this.value()); } }, //------------------------------------------------------------------------- 'onChange': function() { this.synchronizeComponentValues(); this.fieldComponent().valueComponent().handleTypeChange(); }, //------------------------------------------------------------------------- /* 'selectCorrectOption': function() { var options; var i,c; options = this.inputElement().getChildrenByTagName('option'); c = options.length; for (i=0; i<c; i++) { if (options[i].dom.value == this.value()) { options[i].dom.selected = true; } } }, */ //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { if (this.inputElement() != null) { this.recordField().setType(this.inputElement().dom.value); } }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js index 8621397..f2c70aa 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.FieldValueComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.FieldValueComponent.superclass.constructor.call(this, anElement, args); this._inputElement = null; this._scrambledStatus = 'SCRAMBLED'; // 'UNSCRAMBLED' this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldValueComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.FieldValueComponent component"; }, //------------------------------------------------------------------------- 'value': function() { return this.recordField().value(); }, 'setValue': function(aValue) { this.recordField().setValue(aValue); }, //------------------------------------------------------------------------- 'inputElement': function() { return this._inputElement; }, 'setInputElement': function(aValue) { this._inputElement = aValue; }, //------------------------------------------------------------------------- 'scrambledStatus': function() { return this._scrambledStatus; }, 'setScrambledStatus': function(aValue) { this._scrambledStatus = aValue; }, //------------------------------------------------------------------------- 'handleTypeChange': function() { //MochiKit.Logging.logDebug(">>> handling type change - " + this.recordField().type()); this.synchronizeComponentValues(); this.update(); }, //------------------------------------------------------------------------- 'addrUrl': function() { var result; result = "http://maps.google.com/maps?q=" + this.value().split(' ').join('+'); return result; }, //------------------------------------------------------------------------- 'updateViewMode': function() { var scarmbledStatus; scrambledStatus = this.scrambledStatus() || 'SCRAMBLED'; this.element().update(""); if (this.recordField().hidden() == false) { switch(this.recordField().type()) { case 'TXT': case 'PWD': Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()}); break; case 'URL': var urlLocation; urlLocation = Clipperz.Base.sanitizeString(this.value()); if (! (/^(https?|ftp|svn):\/\//.test(urlLocation))) { urlLocation = 'http://' + urlLocation; } Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:urlLocation, html:this.value(), target:'_blank'}); break; case 'DATE': Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()}); break; case 'ADDR': Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:this.addrUrl(), html:this.value(), target:'_blank'}); break; } } else { var tableElement; var tdElement; var inputElement; var passwordElementConfiguration; if (scrambledStatus == 'SCRAMBLED') { var scrambledInputElement; if ((Clipperz_IEisBroken === true) && (Clipperz.PM.Proxy.defaultProxy.isReadOnly())) { scrambledInputElement = {tag:'input', type:'password', value:"this.value()"}; } else { scrambledInputElement = {tag:'input', type:'text', cls:'scrambledField', title:Clipperz.PM.Strings['recordDetailPasswordFieldTooltipLabel'], value:"this.value()"}; } passwordElementConfiguration = {tag:'table', border:'0', cellspacing:'2', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[ scrambledInputElement, {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel']} ]}, {tag:'td', valign:'top', children:[ {tag:'span', cls:'scrambledFieldLabel', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldHelpLabel']} ]} ]} ]} ]}; } else { passwordElementConfiguration = {tag:'div', children:[ {tag:'input', type:'text', cls:'unscrambledField', value:"this.value()"}, {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel']} ]}; } tableElement = Clipperz.YUI.DomHelper.append(this.element().dom, passwordElementConfiguration, true); inputElement = tableElement.getChildrenByTagName('input')[0]; inputElement.dom.value = this.value(); inputElement.wrap({tag:'div', cls:'passwordBackground'}).setStyle('background-position', "0px -" + Math.min(128, Clipperz.PM.Crypto.passwordEntropy(this.value())) + "px"); MochiKit.Signal.connect(inputElement.dom, 'onfocus', this, 'selectHiddenFieldOnFocus'); MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble'); } }, //------------------------------------------------------------------------- 'updateEditMode': function() { var inputElement; var scarmbledStatus; scrambledStatus = this.scrambledStatus() || 'SCRAMBLED'; this.element().update(""); switch(this.recordField().type()) { case 'TXT': case 'URL': case 'ADDR': inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:"this.value()"}, true); inputElement.dom.value = this.value(); break; case 'PWD': Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', width:'100%', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', valign:'top', children:[ {tag:'input', type:((scrambledStatus == 'SCRAMBLED') ? 'password' : 'text'), id:this.getId('passwordInputElement'), value:"this.value()"}, {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', html:(scrambledStatus == 'SCRAMBLED' ? Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel'] : Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel'])} ]}, {tag:'td', valign:'top', children:[ {tag:'div', id:this.getId('passwordGenerator'), cls:'Clipperz_PasswordGenerator_button', html:' '} ]} ]} ]} ]}) inputElement = this.getElement('passwordInputElement'); inputElement.dom.value = this.value(); new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('passwordInputElement')); new Clipperz.PM.Components.PasswordGenerator(this.getElement('passwordGenerator'), this); MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble'); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/HeaderComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/HeaderComponent.js index 46f456b..4f12c88 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/HeaderComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/HeaderComponent.js @@ -1,162 +1,160 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.HeaderComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.HeaderComponent.superclass.constructor.call(this, anElement, args); this.mainComponent().addEditComponent(this); this._saveButton = null; this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.HeaderComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.HeaderComponent component"; }, //------------------------------------------------------------------------- 'render': function() { var editButton; //MochiKit.Logging.logDebug(">>> RecordDetail.HeaderComponent.appendTo"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', cls:'recordDetailButtonsBox', children:[ {tag:'div', id:this.getId('editButtonBox'), children:[ {tag:'table', cls:'recordDetailButtonsTABLE', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', align:'center', children:[ {tag:'div', id:this.getId('editButton')} ]} ]} ]} ]} ]}, {tag:'div', id:this.getId('saveCancelButtonBox'), children:[ {tag:'table', cls:'recordDetailButtonsTABLE', border:'0', cellpadding:'0', cellspacing:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', width:'49%', align:'right', children:[ {tag:'div', id:this.getId('saveButton')} ]}, {tag:'td', html:' '}, {tag:'td', width:'49%', align:'left', children:[ {tag:'div', id:this.getId('cancelButton')} ]} ]} ]} ]} ]} ]}); this.getElement('editButtonBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('saveCancelButtonBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); editButton = new YAHOO.ext.Button(this.getDom('editButton'), {text:Clipperz.PM.Strings['recordDetailEditButtonLabel'], handler:this.editButtonHandler, scope:this}); this.setSaveButton(new YAHOO.ext.Button(this.getDom('saveButton'), {text:Clipperz.PM.Strings['recordDetailSaveButtonLabel'], handler:this.saveButtonHandler, scope:this})); new YAHOO.ext.Button(this.getDom('cancelButton'), {text:Clipperz.PM.Strings['recordDetailCancelButtonLabel'], handler:this.cancelButtonHandler, scope:this}); if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { editButton.disable(); } this.update(); //MochiKit.Logging.logDebug("<<< RecordDetail.HeaderComponent.appendTo"); }, //------------------------------------------------------------------------- 'updateViewMode': function() { //MochiKit.Logging.logDebug(">>> HeaderComponent.updateViewMode"); this.getElement('editButtonBox').show(); this.getElement('saveCancelButtonBox').hide(); //MochiKit.Logging.logDebug("<<< HeaderComponent.updateViewMode"); }, //------------------------------------------------------------------------- 'updateEditMode': function() { this.getElement('editButtonBox').hide(); this.getElement('saveCancelButtonBox').show(); if (this.mainComponent().enableSaveButton() == true) { //MochiKit.Logging.logDebug("--- HeaderComponent.updateViewMode - ENABLE"); this.saveButton().enable(); } else { this.saveButton().disable(); } }, //------------------------------------------------------------------------- 'saveButton': function() { return this._saveButton; }, 'setSaveButton': function(aValue) { this._saveButton = aValue; }, //------------------------------------------------------------------------- 'editButtonHandler': function(anEvent) { this.mainComponent().setEditMode('EDIT'); }, //------------------------------------------------------------------------- 'saveButtonHandler': function(anEvent) { //MochiKit.Logging.logDebug(">>> RecordDetail.HeaderComponent.saveButtonHandler"); this.mainComponent().setEditMode('VIEW', this.getElement('saveButton')); //MochiKit.Logging.logDebug("<<< RecordDetail.HeaderComponent.saveButtonHandler"); }, //------------------------------------------------------------------------- 'cancelButtonHandler': function(anEvent) { this.record().cancelChanges(); //MochiKit.Logging.logDebug("--- HeaderComponent.cancelButtonHandler - " + Clipperz.Base.serializeJSON(this.record().currentDataSnapshot())); this.mainComponent().setEditMode('VIEW', null, true); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/MainComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/MainComponent.js index d6a03d7..47ed3e6 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/MainComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/MainComponent.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.MainComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.MainComponent.superclass.constructor.call(this, anElement, args); // this._element = args.element; this._user = args.user; this._editMode = args.editMode || 'VIEW'; // [ 'VIEW' | 'EDIT' ] this._mainPanel = args.mainPanel; this._record = null; this._editComponents = []; this._addFieldButton = null; this._enableSaveButton = true; this._shouldShowLoginInfo = (Clipperz.PM.Proxy.defaultProxy.isReadOnly() ? false : true); // this._mainLayoutManager = null; // this._layoutRegion = null; Clipperz.NotificationCenter.register(null, 'loadingRecordData', this, 'render'); Clipperz.NotificationCenter.register(null, 'decryptingRecordData', this, 'render'); Clipperz.NotificationCenter.register(null, 'loadingRecordVersionData', this, 'render'); Clipperz.NotificationCenter.register(null, 'decryptingRecordVersionData', this, 'render'); Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'render'); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.MainComponent, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.MainComponent component"; }, //------------------------------------------------------------------------- 'editMode': function() { return this._editMode; }, 'setEditMode': function(aValue, aButtonElement, shouldSkipComponentSynchronization) { //MochiKit.Logging.logDebug(">>> MainComponent.setEditingMode"); this.scrollToTop(); if (aValue == 'VIEW') { if (shouldSkipComponentSynchronization == true) { this.exitModalView(); } else { this.synchronizeComponentValues(); if (this.record().hasPendingChanges()) { if (this.record().isBrandNew()) { this.record().removeEmptyFields(); } this.saveCurrentRecordChanges(aButtonElement); } else { if (this.record().isBrandNew()) { this.record().user().removeRecord(this.record()); } this.exitModalView(); } } } else if (aValue == 'EDIT') { this.enterModalView(); } else { // ???? } this._editMode = aValue; this.render(); }, //------------------------------------------------------------------------- 'user': function() { return this._user; }, //------------------------------------------------------------------------- 'mainPanel': function() { return this._mainPanel; }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> RecordDetail.MainComponent.render"); this.setEnableSaveButton(true); this.element().update(""); if (this.record() == null) { if (MochiKit.Base.keys(this.user().records()).length == 0) { this.renderWithNoRecordAtAll(); } else { this.renderWithNoSelectedRecord(); } } else { this.renderWithSelectedRecord(); } //MochiKit.Logging.logDebug("<<< RecordDetail.MainComponent.render"); }, //------------------------------------------------------------------------- 'renderWithNoRecordAtAll': function() { //MochiKit.Logging.logDebug(">>> RecordDetail.MainComponent.renderWithNoRecordAtAll"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'form', cls:'noRecordAtAllFORM', children:[ {tag:'div', cls:'recordTitleBlock', children:[ {tag:'h2', id:'recordTitle', htmlString:Clipperz.PM.Strings['recordDetailNoRecordAtAllTitle']} ]}, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', colspan:'5', children:[ {tag:'div', cls:'recordDetailDescriptionBox', htmlString:Clipperz.PM.Strings['recordDetailNoRecordAtAllDescription']} ]} ]} ]} ]} ]} ); //MochiKit.Logging.logDebug("<<< RecordDetail.MainComponent.renderWithNoRecordAtAll"); }, //------------------------------------------------------------------------- 'renderWithNoSelectedRecord': function() { //MochiKit.Logging.logDebug(">>> RecordDetail.MainComponent.renderWithNoSelectedRecord"); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'form', cls:'noRecordSelectedFORM', children:[ {tag:'div', cls:'recordTitleBlock', children:[ {tag:'h2', id:'recordTitle', htmlString:Clipperz.PM.Strings['recordDetailNoRecordSelectedTitle']} ]}, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ {tag:'tbody', children:[ {tag:'tr', children:[ {tag:'td', colspan:'5', children:[ {tag:'div', cls:'recordDetailDescriptionBox', htmlString:Clipperz.PM.Strings['recordDetailNoRecordSelectedDescription']} ]} ]}, {tag:'tr', colspan:'5', children:[ {tag:'td', colspan:'5', children:this.loginInfo()} ]} ]} ]} ]} ); //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithNoSelectedRecord - 1"); if (MochiKit.DOM.getElement('fullLoginHistoryLink') != null) { MochiKit.Signal.connect('fullLoginHistoryLink', 'onclick', this, 'showLoginHistoryPanel'); } //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithNoSelectedRecord - 2"); if (MochiKit.DOM.getElement('offlineCopyDownloadWarningLink') != null) { MochiKit.Signal.connect('offlineCopyDownloadWarningLink', 'onclick', this, 'showDownloadOfflineCopyPanel'); } //MochiKit.Logging.logDebug("<<< RecordDetail.MainComponent.renderWithNoSelectedRecord"); }, //------------------------------------------------------------------------- 'renderWithSelectedRecord': function() { //MochiKit.Logging.logDebug(">>> RecordDetail.MainComponent.renderWithSelectedRecord"); if (this.record().shouldLoadData() === true) { // this.renderWithSelectedRecordLoading(); //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithSelectedRecord - 1.1"); this.renderWhileProcessingWithMessage(Clipperz.PM.Strings['recordDetailLoadingRecordMessage']); //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithSelectedRecord - 1.2"); } else if (this.record().shouldDecryptData() === true) { // this.renderWithSelectedRecordDecrypting(); //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithSelectedRecord - 2.1"); this.renderWhileProcessingWithMessage(Clipperz.PM.Strings['recordDetailDecryptingRecordMessage']); //MochiKit.Logging.logDebug("--- RecordDetail.MainComponent.renderWithSelectedRecord - 2.2"); } else if (this.record().currentVersion().shouldLoadData() === true) { diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/NotesComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/NotesComponent.js index 2066543..bb23e8d 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/NotesComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/NotesComponent.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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.NotesComponent = function(anElement, args) { //MochiKit.Logging.logDebug(">>> new NotesComponent"); args = args || {}; Clipperz.PM.Components.RecordDetail.NotesComponent.superclass.constructor.call(this, anElement, args); this.mainComponent().addEditComponent(this); this._staticOffset = null; this._componentHeight = 50; this._mouseMoveIdentifier = null; this._mouseUpIdentifier = null; this.element().setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.render(); //MochiKit.Logging.logDebug("<<< new NotesComponent"); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.NotesComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.NotesComponent component"; }, //------------------------------------------------------------------------- 'value': function() { return this.record().notes(); }, 'setValue': function(aValue) { this.record().setNotes(aValue); }, //------------------------------------------------------------------------- 'render': function() { //MochiKit.Logging.logDebug(">>> NotesComponent.render"); /* Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', colspan:'5', children:[ {tag:'span', cls:'noteFieldLabel', htmlString:Clipperz.PM.Strings['recordDetailNotesLabel']}, {tag:'div', cls:'noteFieldContent', id:this.getId('notes')} ]}); */ Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', cls:'noteFieldLabel', htmlString:Clipperz.PM.Strings['recordDetailNotesLabel']}); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', cls:'noteFieldContent', id:this.getId('notes'), children:[ {tag:'div', id:this.getId('resizableDiv'), cls:'resizable-textarea', children:[ {tag:'div', id:this.getId('contentView'), cls:'viewMode', html:""}, {tag:'div', id:this.getId('contentEdit'), children:[ {tag:'span', children:[ {tag:'textarea', id:this.getId('textarea'), html:""} ]} ]}, {tag:'div', id:this.getId('grippie'), cls:'grippie'} ]} ]}); this.getElement('contentView').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('contentEdit').setVisibilityMode(YAHOO.ext.Element.DISPLAY); MochiKit.Signal.connect(this.getId('grippie'), 'onmousedown', this, 'startResize'); this.update(); //MochiKit.Logging.logDebug("<<< NotesComponent.render"); }, //------------------------------------------------------------------------- 'updateViewMode': function() { //MochiKit.Logging.logDebug(">>> NotesComponent.updateViewMode"); // this.getElement('notes').update(this.value().replace(/\n/g, '<br>')); this.getElement('contentView').update(Clipperz.Base.sanitizeString(this.value()).replace(/\n/g, '<br>')); if (this.isNoteEmpty()) { this.element().hide(); } else { this.getElement('contentView').show(); this.getElement('contentView').setHeight(this.componentHeight()); } this.getElement('contentEdit').hide(); //MochiKit.Logging.logDebug("<<< NotesComponent.updateViewMode"); }, //------------------------------------------------------------------------- 'updateEditMode': function() { //MochiKit.Logging.logDebug(">>> NotesComponent.updateEditMode"); this.getDom('textarea').value = this.value().replace(/\n/g, Clipperz_normalizedNewLine); this.getElement('contentView').hide(); this.getElement('contentEdit').show(); this.getElement('textarea').setHeight(this.componentHeight()); //MochiKit.Logging.logDebug("<<< NotesComponent.updateEditMode"); }, //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { //MochiKit.Logging.logDebug(">>> NotesComponent.synchronizeComponentValues"); if (this.getElement('textarea') != null) { this.setValue(this.getDom('textarea').value.replace(/(\x0a\x0d|\x0d\x0a)/g,'\n')); } //MochiKit.Logging.logDebug("<<< NotesComponent.synchronizeComponentValues"); }, //------------------------------------------------------------------------- 'componentHeight': function() { return this._componentHeight; }, 'setComponentHeight': function(aValue) { this._componentHeight = aValue; }, //------------------------------------------------------------------------- 'isNoteEmpty': function() { return !/[^ \n]/.test(this.value()); }, //------------------------------------------------------------------------- 'staticOffset': function() { return this._staticOffset; }, 'setStaticOffset': function(aValue) { this._staticOffset = aValue; }, //------------------------------------------------------------------------- 'startResize': function(anEvent) { //MochiKit.Logging.logDebug(">>> startResize"); if (this.editMode() == 'VIEW') { this.setStaticOffset(this.getElement('contentView').getHeight() - anEvent.mouse().page['y']) } else { this.setStaticOffset(this.getElement('textarea').getHeight() - anEvent.mouse().page['y']) // this.getElement('textarea').setStyle('opacity', 0.25); } this.setMouseMoveIdentifier(MochiKit.Signal.connect(MochiKit.DOM.currentDocument(), 'onmousemove', this, 'whileResizing')); this.setMouseUpIdentifier(MochiKit.Signal.connect(MochiKit.DOM.currentDocument(), 'onmouseup', this, 'endResize')); anEvent.stop(); //MochiKit.Logging.logDebug("<<< startResize"); }, //------------------------------------------------------------------------- 'whileResizing': function(anEvent) { //MochiKit.Logging.logDebug(">>> whileResizing"); this.getElement('textarea').setHeight(Math.max(32, this.staticOffset() + anEvent.mouse().page['y']) + 'px'); this.getElement('contentView').setHeight(Math.max(32, this.staticOffset() + anEvent.mouse().page['y']) + 'px'); anEvent.stop(); //MochiKit.Logging.logDebug("<<< whileResizing"); }, //------------------------------------------------------------------------- 'endResize': function(anEvent) { //MochiKit.Logging.logDebug(">>> endResize"); MochiKit.Signal.disconnect(this.mouseMoveIdentifier()); this.setMouseMoveIdentifier(null); MochiKit.Signal.disconnect(this.mouseUpIdentifier()); this.setMouseUpIdentifier(null); // this.getElement('textarea').setStyle('opacity', 1); this.setComponentHeight(this.getElement('textarea').getHeight()); //MochiKit.Logging.logDebug("<<< endResize"); }, //------------------------------------------------------------------------- diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js index 29fe972..d114eaa 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js @@ -1,134 +1,132 @@ /* -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.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } //############################################################################# Clipperz.PM.Components.RecordDetail.TitleComponent = function(anElement, args) { args = args || {}; Clipperz.PM.Components.RecordDetail.TitleComponent.superclass.constructor.call(this, anElement, args); // this._inputElement = null; this.mainComponent().addEditComponent(this); this.render(); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.RecordDetail.TitleComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { 'toString': function() { return "Clipperz.PM.Components.RecordDetail.TitleComponent component"; }, //------------------------------------------------------------------------- 'value': function() { return this.record().label(); }, 'setValue': function(aValue) { this.record().setLabel(aValue); }, //------------------------------------------------------------------------- /* 'inputElement': function() { return this._inputElement; }, 'setInputElement': function(aValue) { this._inputElement = aValue; }, */ //------------------------------------------------------------------------- 'render': function() { // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', colspan:"3", html:' ', children:[ // {tag:'div', /*style:'border: 1px solid green;',*/ id:this.getId('title')} // ]}); // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); // // this.setInputElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), {editMode:this.editMode(), value:this.value()})); this.update(); }, //------------------------------------------------------------------------- /* 'update': function() { this.inputElement().update({value:this.value(), editMode:this.editMode()}); }, */ //------------------------------------------------------------------------- 'updateViewMode': function() { this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'h2', html:this.value()}); }, //------------------------------------------------------------------------- 'updateEditMode': function() { //MochiKit.Logging.logDebug(">>> TitleComponent.updateEditMode"); // this.getElement('title').update(""); // Clipperz.YUI.DomHelper.append(this.getDom('title'), {tag:'div', id:this.getId('title_input')}); // this.setInputElement(Clipperz.YUI.DomHelper.append(this.getDom('title_input'), {tag:'input', type:'text', value:this.value()}, true)); this.element().update(""); Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', id:this.getId('titleField'), type:'text', value:"this.value()"}); this.getElement('titleField').dom.value = this.value(); //MochiKit.Logging.logDebug("<<< TitleComponent.updateEditMode"); }, //------------------------------------------------------------------------- 'synchronizeComponentValues': function() { var inputElement; //MochiKit.Logging.logDebug(">>> TitleComponent.synchronizeComponentValues"); inputElement = this.element().getChildrenByTagName('input')[0]; if (inputElement != null) { this.setValue(inputElement.dom.value); } //MochiKit.Logging.logDebug("<<< TitleComponent.synchronizeComponentValues"); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js b/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js index b300ba6..d30f514 100644 --- a/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js +++ b/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js @@ -1,155 +1,153 @@ /* -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.TabPanel) == 'undefined') { Clipperz.PM.Components.TabPanel = {}; } Clipperz.PM.Components.TabPanel.TabPanelController = function(args) { args = args || {}; Clipperz.PM.Components.TabPanel.TabPanelController.superclass.constructor.call(this); this._name = args.name || 'undefined'; this._config = args.config; this._selectedTab = args.selectedTab || ((MochiKit.Base.keys(args.config).length > 0) ? MochiKit.Base.keys(args.config)[0] : null); this._tabs = {}; this._panels = {}; Clipperz.NotificationCenter.register(null, 'selectTab', this, 'handleSelectTabNotification'); return this; } //============================================================================= YAHOO.extendX(Clipperz.PM.Components.TabPanel.TabPanelController, YAHOO.ext.util.Observable, { //------------------------------------------------------------------------- 'name': function() { return this._name; }, //------------------------------------------------------------------------- 'tabs': function() { return this._tabs; }, //------------------------------------------------------------------------- 'panels': function() { return this._panels; }, //------------------------------------------------------------------------- 'config': function() { return this._config; }, //------------------------------------------------------------------------- 'selectedTab': function() { return this._selectedTab; }, 'setSelectedTab': function(aValue) { this._selectedTab = aValue; }, //------------------------------------------------------------------------- 'setUp': function() { var tabId; //MochiKit.Logging.logDebug(">>> TabPanelController.setUp - config: " + Clipperz.Base.serializeJSON(this.config())); for (tabId in this.config()) { var tabElement; var panelElement; //MochiKit.Logging.logDebug("--- TabPanelController.setUp - tabId: " + tabId); //MochiKit.Logging.logDebug("--- TabPanelController.setUp - panelId: " + this.config()[tabId]); tabElement = YAHOO.ext.Element.get(tabId); tabElement.addClassOnOver("hover"); MochiKit.Signal.connect(tabId, 'onclick', this, 'selectTabHandler'); panelElement = YAHOO.ext.Element.get(this.config()[tabId]); this._tabs[tabId] = tabElement; this._panels[tabId] = panelElement; if (tabId == this.selectedTab()) { tabElement.addClass('selectedTab'); panelElement.addClass('selectedPanel'); } else { panelElement.addClass('hiddenPanel'); } } //MochiKit.Logging.logDebug("<<< TabPanelController.setUp"); }, //------------------------------------------------------------------------- 'selectTab': function(aTab) { if (aTab != this.selectedTab()) { this.tabs()[this.selectedTab()].removeClass('selectedTab'); this.panels()[this.selectedTab()].removeClass('selectedPanel').addClass('hiddenPanel'); this.tabs()[aTab].addClass('selectedTab'); this.panels()[aTab].addClass('selectedPanel').removeClass('hiddenPanel'); this.setSelectedTab(aTab); Clipperz.NotificationCenter.notify(this, 'tabSelected', aTab); } }, //------------------------------------------------------------------------- 'selectTabHandler': function(anEvent) { this.selectTab(anEvent.src().id); }, //------------------------------------------------------------------------- 'handleSelectTabNotification': function(aNotificationEvent) { var parameters; var splittedParamters; var targetTabPanel; parameters = aNotificationEvent.parameters(); splittedParamters = parameters.split('.'); targetTabPanel = splittedParamters[0]; if (targetTabPanel == this.name()) { this.selectTab(splittedParamters[1]) } }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/beta/js/Clipperz/PM/Components/TextFormField.js b/frontend/beta/js/Clipperz/PM/Components/TextFormField.js index c6f0349..2b383ce 100644 --- a/frontend/beta/js/Clipperz/PM/Components/TextFormField.js +++ b/frontend/beta/js/Clipperz/PM/Components/TextFormField.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 = {}; } Clipperz.PM.Components.TextFormField = function(anElement, args) { args = args || {}; //MochiKit.Logging.logDebug(">>> new TextFormField"); Clipperz.PM.Components.TextFormField.superclass.constructor.call(this, args); this._element = anElement; this._editMode = args.editMode || 'VIEW'; this._value = args.value || ""; this._inputElement = null; this._wrapper = null; this._multiline = args.multiline || false; // this.multiline = args.multiline || true; // this.editing = true; // this.completeOnBlur = true; // this.autoSizeTask = new YAHOO.ext.util.DelayedTask(this.autoSize, this); // this.textSizeEl = Clipperz.YUI.DomHelper.append(document.body, { // tag: 'div', // cls: 'yinline-editor-sizer ' + (this.cls || '') // }); this.render(); //MochiKit.Logging.logDebug("<<< new TextFormField"); return this; }; YAHOO.extendX(Clipperz.PM.Components.TextFormField, Clipperz.PM.Components.BaseComponent, { 'toString': function() { return "Clipperz.PM.Components.TextFormField"; }, //----------------------------------------------------- 'value': function() { if (this.inputElement() != null) { this._value = this.inputElement().dom.value; } return this._value; // return this.inlineEditor().getValue(); }, 'setValue': function(aValue) { this._value = aValue; // this.getElement('viewComponent_Content').update(aValue); // this.inlineEditor().setValue(aValue); }, //----------------------------------------------------- 'multiline': function() { return this._multiline; }, //----------------------------------------------------- 'editMode': function() { return this._editMode; }, 'setEditMode': function(aValue) { this._editMode = aValue; }, //----------------------------------------------------- 'inputElement': function() { return this._inputElement; }, 'setInputElement': function(aValue) { this._inputElement = aValue; }, //----------------------------------------------------- 'on': function(anEventName, anHandler, aScope, shouldOverride) { //MochiKit.Logging.logDebug(">>> TextFormField.on - inputElement: " + this.inputElement()); return this.inputElement().on(anEventName, anHandler, aScope, shouldOverride); //MochiKit.Logging.logDebug("<<< TextFormField.on - inputElement: " + this.inputElement()); }, //----------------------------------------------------- 'wrapper': function() { return this._wrapper; }, //----------------------------------------------------- 'render': function() { var editModeConfiguration; var viewModeConfiguration; editModeConfiguration = {tag:'div', id:this.getId('editComponent'), children:[]}; if (this.multiline() == false) { editModeConfiguration.children.push({tag:'input', type:'text', id:this.getId('editComponent_input'), value:"this.value(1)"}); } else { editModeConfiguration.children.push({tag:'textarea', id:this.getId('editComponent_input'), html:"this.value(2)"}); } viewModeConfiguration = {tag:'div', id:this.getId('viewComponent'), /*style:'border: 1px solid blue;',*/ children:[ {tag:'span', id:this.getId('viewComponent_Content'), html:this.value()} ]} //MochiKit.Logging.logDebug(">>> TextFormField.render"); this._wrapper = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', id:this.getId('wrapper'), children:[ {tag:'div', id:this.getId('editModeBox'), children:[editModeConfiguration]}, {tag:'div', id:this.getId('viewModeBox'), children:[viewModeConfiguration]} ]}, true); this.getElement('editModeBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('viewModeBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); this.getElement('editComponent_input').dom.value = this.value(); this.setInputElement(this.getElement('editComponent_input')); this.update(); //MochiKit.Logging.logDebug("<<< TextFormField.render"); }, //----------------------------------------------------- 'update': function(args) { args = args || {}; //MochiKit.Logging.logDebug(">>> TextFormField.update"); if (typeof(args.value) != 'undefined') { this.setValue(args.value); } if (typeof(args.editMode) != 'undefined') { this.setEditMode(args.editMode) } if (this.editMode() == 'VIEW') { this.updateViewMode(); } else if (this.editMode() == 'EDIT') { this.updateEditMode(); } else { // ????? } //MochiKit.Logging.logDebug("<<< TextFormField.update"); }, //----------------------------------------------------- 'updateEditMode': function() { //MochiKit.Logging.logDebug(">>> TextFormField.updateEditMode"); this.getElement('viewModeBox').hide(); this.getElement('editModeBox').show(); if (this.multiline() == false) { this.getElement('editComponent_input').dom.value = this.value(); } else { this.getElement('editComponent_input').update(Clipperz.Base.sanitizeString(this.value())); } //MochiKit.Logging.logDebug("<<< TextFormField.updateEditMode"); }, //----------------------------------------------------- 'updateViewMode': function() { //MochiKit.Logging.logDebug(">>> TextFormField.updateViewMode"); this.getElement('editModeBox').hide(); this.getElement('viewModeBox').show(); this.getElement('viewComponent_Content').update(Clipperz.Base.sanitizeString(this.value())); //MochiKit.Logging.logDebug("<<< TextFormField.updateViewMode"); }, //##################################################### //##################################################### //##################################################### //##################################################### /* 'onEnter': function(k, e) { MochiKit.Logging.logDebug(">>> TextFormField.onEnter"); if (this.multiline && (e.ctrlKey || e.shiftKey)) { return; } else { this.completeEdit(); e.stopEvent(); |