summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
index 5114b1d..55d2c01 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
@@ -1,300 +1,297 @@
/*
-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/.
*/
Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) {
args = args || {};
Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments);
this._tabPanelController = null;
this._initiallySelectedTab = args.selected || 'TYPE';
this._tabPanelControllerConfiguration = {
'LABEL': {
tab: 'labelTab',
panel: 'labelTabpanel'
},
'TYPE': {
tab: 'typeTab',
panel: 'typeTabpanel'
},
'CONFIGURATION': {
tab: 'configurationTab',
panel: 'configurationTabpanel'
},
'BINDINGS': {
tab: 'bindingsTab',
panel: 'bindingsTabpanel'
},
'FAVICON': {
tab: 'faviconTab',
panel: 'faviconTabpanel'
},
'DONE': {
tab: 'doneTab',
panel: 'doneTabpanel'
}
};
this._directLoginReference = null;
this._directLoginFavicon = null;
this._updateFaviconCounter = 0;
this._faviconComponent = null;
this._bindingComponents = [];
this._formValueComponents = [];
return this;
}
//=============================================================================
//Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, {
Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, {
//-------------------------------------------------------------------------
'toString': function () {
return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component";
},
//=========================================================================
'directLoginReference': function () {
return this._directLoginReference;
},
//-------------------------------------------------------------------------
'setDirectLoginReference': function (aDirectLoginReference) {
this._directLoginReference = aDirectLoginReference;
return this._directLoginReference;
},
//=========================================================================
'label': function () {
return this.getElement('label').value
},
'setLabel': function (aValue) {
-//console.log("##> LABEL: " + aValue);
this.getElement('label').value = (aValue ? aValue : '');
},
//-------------------------------------------------------------------------
'favicon': function () {
return this.getElement('faviconURL').value;
},
'setFavicon': function (aValue) {
var regexp;
var displayValue;
regexp = new RegExp('^data\:\/\/.*', 'i');
if (regexp.test(aValue)) {
displayValue = ''
} else {
displayValue = (aValue ? aValue : '');
}
this.getElement('faviconURL').value = displayValue;
this.faviconComponent().setSrc(aValue);
},
// 'setFaviconData': function (aValue) {
// this.getElement('faviconIcon').src = aValue;
// },
'directLoginFavicon': function () {
return this._directLoginFavicon;
},
'setDirectLoginFavicon': function (aValue) {
this._directLoginFavicon = aValue;
this.setFavicon(aValue);
},
//-------------------------------------------------------------------------
'bookmarkletConfiguration': function () {
return this.getElement('bookmarkletConfiguration').value
},
'setBookmarkletConfiguration': function (aValue) {
this.getElement('bookmarkletConfiguration').value = aValue;
},
'highlightConfigurationSyntaxError': function () {
MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error');
},
'removeHighlightConfigurationSyntaxError': function () {
MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error');
},
//=========================================================================
'disableAllPanels': function () {
this.getElement('label').disabled = true;
MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled');
this.tabPanelController().selectTab(null);
},
//-------------------------------------------------------------------------
// 'disableLabelField': function () {
// this.getElement('label').disabled = true;
// MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled');
// },
'enableLabelField': function () {
this.getElement('label').disabled = false;
MochiKit.DOM.removeElementClass(this.getElement('label').parentNode, 'disabled');
this.tabPanelController().selectTab('LABEL');
},
//-------------------------------------------------------------------------
// 'disableTypeField': function () {
// this.tabPanelController().selectTab(null);
// },
'enableTypeField': function () {
this.tabPanelController().selectTab('TYPE');
},
//-------------------------------------------------------------------------
// 'disableConfigurationField': function () {
// this.tabPanelController().selectTab(null);
// },
'enableConfigurationField': function () {
this.tabPanelController().selectTab('CONFIGURATION');
},
//-------------------------------------------------------------------------
// 'disableBindingFields': function () {
// this.tabPanelController().selectTab(null);
// },
'enableBindingFields': function () {
this.tabPanelController().selectTab('BINDINGS');
},
//-------------------------------------------------------------------------
// 'disableFaviconField': function () {
// this.tabPanelController().selectTab(null);
// },
'enableFaviconField': function () {
this.tabPanelController().selectTab('FAVICON');
},
//-------------------------------------------------------------------------
'enableDonePanel': function () {
this.tabPanelController().selectTab('DONE');
},
//=========================================================================
'shouldShowElementWhileRendering': function() {
return false;
},
//=========================================================================
'faviconComponent': function () {
if (this._faviconComponent == null) {
this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')});
}
return this._faviconComponent;
},
//=========================================================================
'tabPanelController': function () {
if (this._tabPanelController == null) {
this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({
component:this,
configuration:this._tabPanelControllerConfiguration
});
MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected')
}
return this._tabPanelController;
},
//-------------------------------------------------------------------------
'renderSelf': function() {
var bookmarkletComponent;
this.append(this.element(), {tag:'div', cls:'directLoginEditing', id:this.getId('panel'), children: [
// {tag:'div', cls:'back', children:[
// {tag:'a', href:'#', id:this.getId('back'), html:"&nbsp;"}
// ]},
{tag:'form', id:this.getId('form'), cls:'directLoginEditingForm', children:[
{tag:'div', cls:'title', children:[
{tag:'img', id:this.getId('favicon'), cls:'favicon'},
{tag:'input', type:'text', id:this.getId('label')} //,
// {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.LABEL.description')}]},
]},
{tag:'div', cls:'tabContainer', children:[
{tag:'ul', cls:'tabs', children:[
{tag:'li', id:this.getId('labelTab'), children:[{tag:'span', html:"label"}]},
{tag:'li', id:this.getId('typeTab'), children:[{tag:'span', html:"type"}]},
{tag:'li', id:this.getId('configurationTab'), children:[{tag:'span', html:"configuration"}]},
{tag:'li', id:this.getId('bindingsTab'), children:[{tag:'span', html:"bindings"}]},
{tag:'li', id:this.getId('faviconTab'), children:[{tag:'span', html:"favicon"}]},
{tag:'li', id:this.getId('doneTab'), children:[{tag:'span', html:"done"}]}
]},
{tag:'ul', cls:'tabPanels', children:[
{tag:'li', id:this.getId('labelTabpanel'), cls:'tabPanel label', children:[
{tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.LABEL.description')}]}
]},
{tag:'li', id:this.getId('typeTabpanel'), cls:'tabPanel type', children:[
{tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.TYPE.description')}]},
{tag:'h2', html:"type"}
]},
{tag:'li', id:this.getId('configurationTabpanel'), cls:'tabPanel configuration', children:[
{tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.CONFIGURATION.description')}]},
{tag:'div', cls:'bookmarkletConfigurationWrapper', children:[
{tag:'textarea', id:this.getId('bookmarkletConfiguration'), value:""},
// {tag:'div', cls:'bookmarkletComponentWrapper', children:[{tag:'div', id:this.getId('bookmarkletComponent'), cls:'bookmarkletComponent'}]}
{tag:'div', id:this.getId('bookmarkletComponent'), cls:'bookmarkletComponent'}