summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Mobile/Components') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js29
3 files changed, 30 insertions, 51 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
index 32dfa63..abf4758 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
@@ -1,34 +1,32 @@
/*
-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.Mobile.Components');
Clipperz.PM.UI.Mobile.Components.CardDetail = function(args) {
args = args || {};
Clipperz.PM.UI.Mobile.Components.CardDetail.superclass.constructor.apply(this, arguments);
// this._cardReference = null;
@@ -49,25 +47,24 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI
/*
'cardReference': function () {
return this._cardReference;
},
'setCardReference': function (aValue) {
this._cardReference = aValue;
},
*/
//-------------------------------------------------------------------------
'renderSelf': function () {
-console.log("CardDetail.renderSelf");
this.append(this.element(), {tag:'div', cls:'cardDetail', children:[
{tag:'div', cls:'toolbar', children:[
{tag:'a', href:'#', cls:'back', html:"List"},
{tag:'h1', id:this.getId('cardTitle'), html:"…"}
]},
{tag:'div', cls:'scroll', id:this.getId('cardDetails'), children:[
]}
]});
},
/*
'renderSelf': function() {
this.append(this.element(), [
@@ -146,35 +143,33 @@ console.log("CardDetail.renderSelf");
}
return result;
},
'addDirectLogin': function (aDirectLogin) {
this.append(this.directLoginElement(), {tag:'li', cls:'directLogin forward', children:[
{tag:'a', href:'#', html:"direct login", children:[
{tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:'http://www.clipperz.com/favicon.ico'}]}
]}
]})
-console.log("ADD DIRECT LOGIN", aDirectLogin);
},
//=========================================================================
'showCard': function (aCard) {
var deferredResult;
// this.render();
-console.log("CardDetail.showCard", aCard);
deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false});
deferredResult.addMethod(aCard, 'label');
deferredResult.addMethod(this, 'setTitle');
deferredResult.addMethod(aCard, 'fields');
deferredResult.addCallback(MochiKit.Base.values);
deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addField'));
deferredResult.addMethod(aCard, 'directLogins');
deferredResult.addCallback(MochiKit.Base.values);
deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addDirectLogin'));
@@ -257,25 +252,24 @@ console.log("CardDetail.showCard", aCard);
]);
};
return true;
},
//-------------------------------------------------------------------------
/*
'toggleClickHandler': function (anEvent) {
var nextState;
var fieldValue;
-//console.log("TOGGLE");
anEvent.preventDefault;
fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0];
nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true');
if (nextState) {
MochiKit.DOM.removeElementClass(fieldValue, 'clear');
} else {
MochiKit.DOM.addElementClass(fieldValue, 'clear');
}
MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState);
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
index a4aa212..a0e4879 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
@@ -1,34 +1,32 @@
/*
-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.Mobile.Components');
Clipperz.PM.UI.Mobile.Components.CardList = function(args) {
args = args || {};
Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments);
this._cardDetail = null;
@@ -81,56 +79,53 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C
};
cardListElement = this.getElement('list')
cardInfo = {
'_rowObject': MochiKit.Async.succeed,
'_reference': MochiKit.Base.methodcaller('reference'),
'_searchableContent': MochiKit.Base.methodcaller('searchableContent'),
'label': MochiKit.Base.methodcaller('label'),
'favicon': MochiKit.Base.methodcaller('favicon')
};
-//console.log("someCards", someCards);
deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false});
deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false}));
deferredResult.addCallback(Clipperz.Async.collectAll);
deferredResult.addCallback(MochiKit.Base.methodcaller('sort', Clipperz.Base.caseInsensitiveKeyComparator('label')));
deferredResult.addCallbackPass(MochiKit.DOM.replaceChildNodes, cardListElement);
// deferredResult.addCallbackPass(MochiKit.DOM.removeElementClass, cardListElement, 'loading');
deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'appendCardToList', cardListElement));
deferredResult.callback(someCards);
},
'appendCardToList': function (aCardListElement, aCardInfo) {
-//console.log("appendCardToList", aCardInfo);
this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[
{tag:'a', href:'#', html:aCardInfo['label'], children:[
{tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]}
]}
]});
},
'cardSelectionHandler': function (anEvent) {
var listElement;
var cardReference;
anEvent.preventDefault();
listElement = anEvent.target();
if (MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') == null) {
listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem');
}
cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference');
-console.log("###", listElement, cardReference);
// TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected
MochiKit.Signal.signal(this, 'selectedCard', cardReference);
},
//-------------------------------------------------------------------------
/*
'searchHandler': function (anEvent) {
if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { // RETURN
anEvent.preventDefault();
} else {
if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) {
anEvent.target().value = "";
@@ -162,25 +157,24 @@ console.log("###", listElement, cardReference);
MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler');
}
},
'cardListClickHandler': function (anEvent) {
anEvent.preventDefault();
if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) {
var cardListReference;
cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2];
-//console.log("Showing detail for card named", cardListReference);
MochiKit.Signal.signal(this, 'selectedCard', cardListReference);
}
},
//=========================================================================
'cardDetail': function (someData) {
if (this._cardDetail == null) {
this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:this.getElement('cardDetail')});
}
return this._cardDetail;
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
index eafcdbc..3aeac0c 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
@@ -1,34 +1,32 @@
/*
-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.Mobile.Components');
Clipperz.PM.UI.Mobile.Components.LoginForm = function(args) {
args = args || {};
this._pin = '';
this._message = null;
this._steps = 0;
@@ -130,25 +128,24 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
this._setMessage(aValue);
MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error');
},
//-------------------------------------------------------------------------
'setCallbacks': function (args) {
this._callback = args['callback'];
this._errorCallback = args['errorCallback'];
},
'showErrors': function (args) {
-//console.log("LoginForm.showErrors", args);
if (args['previousFailedAttempt'] == 'LOGIN') {
this.setErrorMessage("Wrong credentials");
} else if (args['previousFailedAttempt'] == 'PIN') {
if (args['failedAttempts'] == -1) {
this.setErrorMessage("Wrong PIN - Resetted");
} else {
this.setErrorMessage("Wrong PIN");
}
} else {
this.setMessage(null);
}
},
@@ -290,25 +287,24 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
var pin;
this.setMessage(null);
pin = this.getElement('PIN').value;
// $(this.getAnchor('PIN')).blur();
this.getElement('PIN').blur();
credentials = Clipperz.PM.PIN.credentialsWithPIN(pin);
this.loginWithCredentials(credentials);
},
'submitCredentialsHandler': function (anEvent) {
-//console.log("submitCredentialsHandler");
var credentials;
this.setMessage(null);
credentials = {};
credentials['username'] = this.getElement('usernameField').value;
credentials['passphrase'] = this.getElement('passphraseField').value;
// $(this.getAnchor('passphraseField')).blur();
this.getElement('passphraseField').blur();
this.loginWithCredentials(credentials);
},
@@ -322,35 +318,30 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
args['credentials'] = someCredentials;
args['errorCallback'] = this.errorCallback();
MochiKit.Style.hideElement(this.getElement('credentialsBody'));
MochiKit.Style.showElement(this.getElement('validating'));
MochiKit.Async.callLater(0.1, this.callback(), args);
},
//-------------------------------------------------------------------------
'initProgressHandle': function (anEvent) {
-//console.log("** initProgressHandle", anEvent);
this._steps = anEvent['steps'];
this._actualSteps = 0;
},
'updateProgressHandle': function (anEvent) {
-//console.log("** updateProgressHandle", anEvent);
this._steps += anEvent['extraSteps'];
},
'advanceProgressHandle': function (anEvent) {
-//console.log("** advanceProgressHandle", anEvent);
this._actualSteps ++;
-//console.log("STEPS: " + this._actualSteps + "/" + this._steps);
},
'progressDoneHandle': function (anEvent) {
-//console.log("** progressDoneHandle", anEvent);
},
//-------------------------------------------------------------------------
__syntaxFix__: "syntax fix"
});