author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-21 15:55:07 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-21 15:55:07 (UTC) |
commit | 959c262afc598c4eeb58fe8fccf90ea8305c0eec (patch) (side-by-side diff) | |
tree | aae9cb7821e59704240751e5b2878a374d21ea91 /frontend/gamma/js/Clipperz/PM/UI/Mobile | |
parent | 1906ddfb5d3887edeedaf8e07d14ad89abbd214d (diff) | |
download | clipperz-959c262afc598c4eeb58fe8fccf90ea8305c0eec.zip clipperz-959c262afc598c4eeb58fe8fccf90ea8305c0eec.tar.gz clipperz-959c262afc598c4eeb58fe8fccf90ea8305c0eec.tar.bz2 |
Updated mobile prototype
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Mobile') (more/less context) (ignore whitespace changes)
7 files changed, 707 insertions, 139 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/BaseComponent.js new file mode 100644 index 0000000..1e7b69f --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/BaseComponent.js @@ -0,0 +1,249 @@ +/* + +Copyright 2008-2013 Clipperz Srl + +This file is part of Clipperz, the online password manager. +For further information about its features and functionalities please +refer to http://www.clipperz.com. + +* Clipperz is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +* Clipperz is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + +* You should have received a copy of the GNU Affero General Public + License along with Clipperz. If not, see http://www.gnu.org/licenses/. + +*/ + +Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); + +//############################################################################# + +var _Clipperz_PM_Components_base_id_ = 0; + +//############################################################################# + +Clipperz.PM.UI.Mobile.Components.BaseComponent = function(args) { + args = args || {}; + Clipperz.PM.UI.Mobile.Components.BaseComponent.superclass.constructor.call(this, args); + + this._element = args.element || null; + this._ids = {}; + + this._isFullyRendered = false; +// this._renderingWaitingQueue = []; + + return this; +} + +//============================================================================= + +//MochiKit.Base.update(Clipperz.PM.UI.Mobile.Components.BaseComponent, Object, { +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.BaseComponent, Object, { + + 'isClipperzPMComponent': true, + + //------------------------------------------------------------------------- + + 'toString': function () { + return "Clipperz.PM.UI.Mobile.Components.BaseComponent component"; + }, + + 'componentId': function () { + return this.getId('_id_'); + }, + + //------------------------------------------------------------------------- + + 'element': function() { + return MochiKit.DOM.getElement(this._element); + }, + + 'setElement': function(aNode) { + this._element = aNode; + }, + + //----------------------------------------------------- + + 'displayElement': function() { + return this.element(); + }, + + //------------------------------------------------------------------------- + + 'renderInNode': function(aDomNode) { + this.setElement(aDomNode); + this.render(); + }, + + 'render': function() { + this.clear(); + this.renderSelf(); +// this.renderComponents(); +// if (this.shouldShowTranslationHints()) { +// this.renderTranslationHints(); +// } + if (this.shouldShowElementWhileRendering()) { + MochiKit.Style.showElement(this.displayElement()); + }; + + this._isFullyRendered = true; + +// MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); +// this.resetRenderingWaitingQueue(); + }, + + 'renderSelf': function() { + throw Clipperz.Base.exception.AbstractMethod; + }, + +// 'renderComponents': function() { +// var slotName; +// +// for (slotName in this.slotComponents()) { +// this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); +// } +// }, + + //......................................................................... + + 'shouldShowElementWhileRendering': function() { + return false; + }, + + //......................................................................... + + 'isFullyRendered': function () { + return this._isFullyRendered; + }, + + //......................................................................... +/* + 'renderingWaitingQueue': function () { + return this._renderingWaitingQueue; + }, + + 'resetRenderingWaitingQueue': function () { + this._renderingWaitingQueue = []; + }, + + //......................................................................... + + 'waitUntilFullyRendered': function () { + var deferredResult; + + if (this.isFullyRendered() == true) { + deferredResult = MochiKit.Async.succeed + } else { + deferredResult = new Clipperz.Async.Deferred("BaseComponent.waitUntilFullyRendered", {trace:false}); + this.renderingWaitingQueue().push(deferredResult); + } + + return deferredResult; + }, +*/ + //----------------------------------------------------- +/* + 'update': function(args) { + throw Clipperz.Base.exception.AbstractMethod; + }, + + 'updateSelf': function(args) { + throw Clipperz.Base.exception.AbstractMethod; + }, + + 'updateComponents': function(args) { + throw Clipperz.Base.exception.AbstractMethod; + }, +*/ + //----------------------------------------------------- +/* + 'refresh': function() { + throw Clipperz.Base.exception.AbstractMethod; + }, + + 'refreshSelf': function() { + throw Clipperz.Base.exception.AbstractMethod; + }, + + 'refreshComponents': function(args) { + throw Clipperz.Base.exception.AbstractMethod; + }, +*/ + //----------------------------------------------------- + + 'clear': function() { + var slotName; + var componentId; + + MochiKit.Signal.disconnectAllTo(this); + + if (this.displayElement() != null) { + if (this.element() != this.displayElement()) { + MochiKit.DOM.removeElement(this.displayElement()); + } else { + this.displayElement().innerHTML = ""; + } + } + }, + + 'remove': function() { + this.clear(); + MochiKit.Signal.disconnectAll(this); + }, + + 'append': function(aNode, aValue) { + return Clipperz.DOM.Helper.append(aNode, aValue); + }, + + 'insertBefore': function (aNode, aValue) { + return Clipperz.DOM.Helper.insertBefore(aNode, aValue); + }, + + 'insertAfter': function (aNode, aValue) { + return Clipperz.DOM.Helper.insertAfter(aNode, aValue); + }, + + //------------------------------------------------------------------------- + + 'getId': function(aValue) { + var result; + + if (typeof(aValue) != 'undefined') { + result = this._ids[aValue]; + + if (typeof(result) == 'undefined') { + _Clipperz_PM_Components_base_id_ ++; + + result = "Clipperz_PM_Components_" + aValue + "_" + _Clipperz_PM_Components_base_id_; + this._ids[aValue] = result; + } + } else { +// result = Clipperz.PM.UI.Common.Components.BaseComponent.superclass.getId.call(this); + throw "call to BaseComponent.getId with an undefined value"; + } + + return result; + }, + + 'getAnchor': function (aValue) { + return '#' + this.getId(aValue); + }, + + //------------------------------------------------------------------------- + + 'getElement': function(aValue) { + return Clipperz.DOM.get(this.getId(aValue)); + }, + + //------------------------------------------------------------------------- + + __syntaxFix__: "syntax fix" + +}); 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 a0e4879..dbab41b 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js @@ -1,152 +1,173 @@ /* Copyright 2008-2013 Clipperz Srl This file is part of Clipperz, the online password manager. For further information about its features and functionalities please refer to http://www.clipperz.com. * Clipperz is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * Clipperz is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ 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; - + this.render(); + return this; } //============================================================================= -Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Mobile.Components.BaseComponent, { //------------------------------------------------------------------------- 'toString': function () { return "Clipperz.PM.UI.Mobile.Components.CardList component"; }, //------------------------------------------------------------------------- 'renderSelf': function () { + var headerElement; + + headerElement = MochiKit.Selector.findChildElements(this.element().parentNode, ['div[data-role=header]'])[0]; + this.append(this.element(), + {tag:'div', /*cls:'scroll',*/ id:this.getId('listBox'), children:[ + {tag:'ul', /*cls:'rounded',*/ id:this.getId('list'), children:[ + {tag:'li', html:'loading'} + ]} + ]} + ); + + this.append(headerElement, +// {tag:'a', href:"#", 'data-icon':'gear', cls:'ui-btn-right', html:"Options" } + {tag:'a', href:"#", id:this.getId('preferences'), cls:'ui-btn-right', html:"options" } + ); + + MochiKit.Signal.connect(this.getElement('preferences'), 'onclick', MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'showPreferences')); + +/* this.append(this.element(), {tag:'div', cls:'cardList', children:[ {tag:'div', cls:'toolbar', children:[ {tag:'h1', html:"clipperz"}, // {tag:'input', name:'search', type:'search', autocomplete:'off', placeholder:"search", id:this.getId('search')}, {tag:'a', href:'#', id:'settings', cls:'button', html:"*"} ]}, {tag:'div', cls:'scroll', id:this.getId('listBox'), children:[ {tag:'ul', cls:'rounded', id:this.getId('list'), children:[ {tag:'li', html:'loading'} ]} ]} ]}); MochiKit.Signal.connect(this.getElement('list'), 'onclick', this, 'cardSelectionHandler'); MochiKit.Signal.connect(this.getElement('list'), 'ontouchstart', this, 'cardSelectionHandler'); // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this, 'searchHandler'); // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this, 'searchHandler'); // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this, 'searchHandler'); // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this, 'cardListClickHandler'); // MochiKit.Signal.connect('backButton', 'onclick', this, 'backButtonClickHandler'); // MochiKit.Style.hideElement('backButton'); // MochiKit.Style.hideElement(this.getElement('cardDetail')); +*/ }, 'showCards': function (someCards) { var cardListElement; if (this.isFullyRendered() == false) { this.render(); }; 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') }; 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) { 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']}]} +// {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'); // 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 = ""; } if (anEvent.type() == 'keyup') { MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); } } }, //------------------------------------------------------------------------- 'update': function (someObjects) { var cardListPanel; var i,c; cardListPanel = this.getElement('cardListPanel'); cardListPanel.innerHTML = ''; c = someObjects.length; for (i=0; i<c; i++) { this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ 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 3aeac0c..da864eb 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js @@ -1,347 +1,373 @@ /* Copyright 2008-2013 Clipperz Srl This file is part of Clipperz, the online password manager. For further information about its features and functionalities please refer to http://www.clipperz.com. * Clipperz is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * Clipperz is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ 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; this._actualSteps = 0; this._callback = null; this._errorCallback = null; this._mode = 'CREDENTIALS'; Clipperz.PM.UI.Mobile.Components.LoginForm.superclass.constructor.apply(this, arguments); return this; } //============================================================================= -Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { +//Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.Mobile.Components.BaseComponent, { //------------------------------------------------------------------------- 'toString': function () { return "Clipperz.PM.UI.Mobile.Components.LoginForm component"; }, //------------------------------------------------------------------------- 'callback': function () { return this._callback; }, 'errorCallback': function () { return this._errorCallback; }, //------------------------------------------------------------------------- 'mode': function () { return this._mode; }, 'setMode': function (aValue) { this._mode = aValue; }, //.......................................................................... 'pin': function () { return this._pin; }, 'setPin': function (aValue) { this._pin = aValue; }, //.......................................................................... 'username': function () { return this._username; }, 'setUsername': function (aValue) { this._username = aValue; }, //.......................................................................... 'passphrase': function () { return this._passphrase; }, 'setPassphrase': function (aValue) { this._passphrase = aValue; }, //------------------------------------------------------------------------- 'message': function () { return this._message; }, '_setMessage': function (aValue) { this._message = aValue; - if (aValue == null) { - MochiKit.Style.hideElement(this.getElement('credentialsMessage')); - } else { - this.getElement('message').innerHTML = aValue; - MochiKit.Style.showElement(this.getElement('credentialsMessage')); - } +// if (aValue == null) { +// MochiKit.Style.hideElement(this.getElement('credentialsMessage')); +// } else { +// this.getElement('message').innerHTML = aValue; +// MochiKit.Style.showElement(this.getElement('credentialsMessage')); +// } }, 'setMessage': function (aValue) { this._setMessage(aValue); - MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error'); +// MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error'); }, 'setErrorMessage': function (aValue) { this._setMessage(aValue); - MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error'); +// MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error'); }, //------------------------------------------------------------------------- 'setCallbacks': function (args) { this._callback = args['callback']; this._errorCallback = args['errorCallback']; }, + 'show': function (args) { + this.updateWithArgs(args); + + if (this.mode() == 'PIN') { + this.setPin(''); + this.getElement('PIN').focus(); + } else if (this.mode() == 'CREDENTIALS') { + if (this.getElement('usernameField').value.length == 0) { + this.getElement('usernameField').focus(); + } else { + this.getElement('passphraseField').focus(); + this.getElement('passphraseField').select(); + } + } + }, + 'showErrors': function (args) { if (args['previousFailedAttempt'] == 'LOGIN') { + $(this.getAnchor('credentialsSubmitButton')).button('enable'); 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); } }, 'updateWithArgs': function (args) { - this.renderIfNeeded(); + this.renderOnlyOnce(); this.setCallbacks(args); this.showErrors(args); - this.updateRendering(); - }, - - 'showPinLogin': function (args) { - this.setPin(''); - this.setMode('PIN'); - this.updateWithArgs(args); - -// $(this.getAnchor('PIN')).focus(); - this.getElement('PIN').focus(); - }, - - 'showCredentialsLogin': function (args) { - this.setMode('CREDENTIALS'); - this.updateWithArgs(args); - - if (this.getElement('usernameField').value.length == 0) { -// $(this.getAnchor('usernameField')).focus(); - this.getElement('usernameField').focus(); - } else { -// $(this.getAnchor('passphraseField')).focus(); - this.getElement('passphraseField').focus(); - this.getElement('passphraseField').select(); - } +// this.updateRendering(); }, //------------------------------------------------------------------------- - 'renderIfNeeded': function () { + 'renderOnlyOnce': function () { if (this.isFullyRendered() == false) { this.render(); }; - this.updateRendering(); +// this.updateRendering(); }, - +/* 'updateRendering': function () { MochiKit.Style.showElement(this.getElement('credentialsBody')); MochiKit.Style.hideElement(this.getElement('validating')); // this.hideAllPanes(); MochiKit.Base.map(function (aNode) { MochiKit.Style.hideElement(aNode); }, MochiKit.Selector.findDocElements('div.credentialsBody > div')); if (this.mode() == 'CREDENTIALS') { - selectedPanel = this.getElement('credentials') + selectedPanel = this.getElement('credentials'); + $(this.getAnchor('credentialsSubmitButton')).button('enable'); } else if (this.mode() == 'PIN') { selectedPanel = this.getElement('pin') // this.updatePinDisplay(); } else { throw 'Unhandled login form mode'; } - MochiKit.Style.showElement(selectedPanel); + MochiKit.Style.showElement(selectedPanel); MochiKit.Style.hideElement(this.getElement('validating')); }, - - 'renderSelf': function() { +*/ +/* + '_renderSelf': function() { var selectedPanel; this.append(this.element(), {tag:'div', id:'login', children:[ - {tag:'div', cls:'toolbar', children:[ - {tag:'h1', html:"clipperz"} + {tag:'div', cls:'toolbar text-center', children:[ + {tag:'h1', cls:'clipperz', html:"clipperz"} ]}, - {tag:'div', cls:'scroll', children:[ + {tag:'div', cls:'', children:[ //================================================================== {tag:'div', cls:'credentialsMessage', id:this.getId('credentialsMessage'), children:[ {tag:'h1', cls:'message', id:this.getId('message'), html:"Message"} ]}, //================================================================== {tag:'div', cls:'credentialsBody', id:this.getId('credentialsBody'), children:[ //-------------------------------------------------------------- {tag:'div', cls:'pin', id:this.getId('pin'), children:[ - {tag:'form', cls:'scroll', id:this.getId('pinForm'), children:[ + {tag:'form', cls:'', id:this.getId('pinForm'), children:[ {tag:'ul', cls:'edit rounded', children:[ {tag:'li', children:[{tag:'input', type:'number', name:'PIN', placeholder:"PIN", id:this.getId('PIN') }]}, ]}, {tag:'a', href:'#', cls:'greenButton', id:this.getId('pinSubmitButton'), html:"Login"} ]} ]}, //-------------------------------------------------------------- {tag:'div', cls:'credentials', id:this.getId('credentials'), children:[ - {tag:'form', cls:'scroll', id:this.getId('credentialsForm'), children:[ - {tag:'ul', cls:'edit rounded', children:[ - {tag:'li', children:[{tag:'input', type:'email', name:'name', /*value:'joe',*/ placeholder:"username", id:this.getId('usernameField') }]}, - {tag:'li', children:[{tag:'input', type:'password', name:'passphrase', /*value:'clipperz',*/ placeholder:"passphrase", id:this.getId('passphraseField') }]} + {tag:'form', cls:'text-center', id:this.getId('credentialsForm'), children:[ + {tag:'fieldset', children:[ +// {tag:'legend', html:"Legend"}, + {tag:'input', type:'email', name:'name', /*value:'joe',* / placeholder:"username", id:this.getId('usernameField') }, +// {tag:'span', cls:'help-block', html:"Example of help text here"}, + {tag:'input', type:'password', name:'passphrase', /*value:'clipperz',* / placeholder:"passphrase", id:this.getId('passphraseField') }, ]}, - {tag:'a', href:'#', cls:'greenButton', id:this.getId('credentialsSubmitButton'), html:"Login"} -// {tag:'input', type:'submit', cls:'greenButton', id:this.getId('credentialsSubmitButton'), value:"Login"} + {tag:'button', cls:'btn btn-primary btn-large', type:'submit', id:this.getId('credentialsSubmitButton'), html:"Login"} ]} ]}, //-------------------------------------------------------------- ]}, //================================================================== {tag:'div', cls:'validating', id:this.getId('validating'), children:[ {tag:'div', cls:'loading', children:[ {tag:'div', cls:'spinner', children:[ {tag:'div', cls:'bar01'}, {tag:'div', cls:'bar02'}, {tag:'div', cls:'bar03'}, {tag:'div', cls:'bar04'}, {tag:'div', cls:'bar05'}, {tag:'div', cls:'bar06'}, {tag:'div', cls:'bar07'}, {tag:'div', cls:'bar08'}, {tag:'div', cls:'bar09'}, {tag:'div', cls:'bar10'}, {tag:'div', cls:'bar11'}, {tag:'div', cls:'bar12'} ]} ]}, {tag:'div', id:this.getId('loadingMessage')}, {tag:'a', href:'#', cls:'grayButton', id:this.getId('loginCancelButton'), html:"Cancel"} ]} //================================================================== ]} ]}); MochiKit.Signal.connect(this.getElement('credentialsForm'), 'onsubmit', this, 'submitCredentialsHandler'); MochiKit.Signal.connect(this.getElement('credentialsSubmitButton'), 'onclick', this, 'submitCredentialsHandler'); MochiKit.Signal.connect(this.getElement('pinForm'), 'onsubmit', this, 'submitPinHandler'); MochiKit.Signal.connect(this.getElement('pinSubmitButton'), 'onclick', this, 'submitPinHandler'); MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress', this, 'updateProgressHandle'); MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress', this, 'advanceProgressHandle'); MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); }, +*/ + 'renderSelf': function() { + if (this.isFullyRendered() == false) { + this.append(this.element(), // [ +// {tag:'div', 'data-role':'header', children:[ +// {tag:'h1', html:'clipperz'} +// ]}, +// {tag:'div', 'data-role':'content', children:[ + {tag:'form', id:this.getId('credentialsForm'), children:[ + {tag:'div', 'data-role':'fieldcontain', cls:'ui-hide-label', children:[ + {tag:'label', 'for':'name', cls:'ui-input-text', html:"username"}, + {tag:'input', type:'email', name:'name', /*value:'joe',*/ placeholder:"username", id:this.getId('usernameField') }, + {tag:'label', 'for':'passphrase', cls:'ui-input-text', html:"passphrase"}, + {tag:'input', type:'password', name:'passphrase', /*value:'clipperz',*/ placeholder:"passphrase", id:this.getId('passphraseField') } + ]}, + {tag:'button', type:'submit', id:this.getId('credentialsSubmitButton'), html:"login"} + ]} +// ]} +// ] + ); + + MochiKit.Signal.connect(this.getElement('credentialsForm'), 'onsubmit', this, 'submitCredentialsHandler'); + MochiKit.Signal.connect(this.getElement('credentialsSubmitButton'), 'onclick', this, 'submitCredentialsHandler'); + } + }, //------------------------------------------------------------------------- 'submitPinHandler': function (anEvent) { var pin; this.setMessage(null); pin = this.getElement('PIN').value; -// $(this.getAnchor('PIN')).blur(); - this.getElement('PIN').blur(); + $(this.getAnchor('PIN')).blur(); +// this.getElement('PIN').blur(); credentials = Clipperz.PM.PIN.credentialsWithPIN(pin); this.loginWithCredentials(credentials); }, 'submitCredentialsHandler': function (anEvent) { var credentials; - this.setMessage(null); + anEvent.preventDefault(); + +// this.setMessage(null); + $(this.getAnchor('usernameField')).blur(); + $(this.getAnchor('passphraseField')).blur(); + $(this.getAnchor('credentialsSubmitButton')).button('disable'); credentials = {}; credentials['username'] = this.getElement('usernameField').value; credentials['passphrase'] = this.getElement('passphraseField').value; -// $(this.getAnchor('passphraseField')).blur(); - this.getElement('passphraseField').blur(); this.loginWithCredentials(credentials); }, //------------------------------------------------------------------------- 'loginWithCredentials': function (someCredentials) { var args; args = {}; args['credentials'] = someCredentials; args['errorCallback'] = this.errorCallback(); - MochiKit.Style.hideElement(this.getElement('credentialsBody')); - MochiKit.Style.showElement(this.getElement('validating')); +// MochiKit.Style.hideElement(this.getElement('credentialsBody')); +// MochiKit.Style.showElement(this.getElement('validating')); MochiKit.Async.callLater(0.1, this.callback(), args); }, //------------------------------------------------------------------------- 'initProgressHandle': function (anEvent) { this._steps = anEvent['steps']; this._actualSteps = 0; }, 'updateProgressHandle': function (anEvent) { this._steps += anEvent['extraSteps']; }, 'advanceProgressHandle': function (anEvent) { this._actualSteps ++; }, 'progressDoneHandle': function (anEvent) { }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Overlay.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Overlay.js new file mode 100644 index 0000000..da08d0f --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Overlay.js @@ -0,0 +1,136 @@ +/* + +Copyright 2008-2013 Clipperz Srl + +This file is part of Clipperz, the online password manager. +For further information about its features and functionalities please +refer to http://www.clipperz.com. + +* Clipperz is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +* Clipperz is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + +* You should have received a copy of the GNU Affero General Public + License along with Clipperz. If not, see http://www.gnu.org/licenses/. + +*/ + +Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); + +Clipperz.PM.UI.Mobile.Components.Overlay = function(args) { + args = args || {}; + + this._defaultDelay = 2; + + Clipperz.PM.UI.Mobile.Components.Overlay.superclass.constructor.apply(this, arguments); + + this.render(); + MochiKit.Style.hideElement(this.element()); + + return this; +} + +//============================================================================= + +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.Overlay, Clipperz.PM.UI.Mobile.Components.BaseComponent, { + + //------------------------------------------------------------------------- + + 'toString': function () { + return "Clipperz.PM.UI.Mobile.Components.Overlay component"; + }, + + //------------------------------------------------------------------------- + + 'show': function (aMessage) { + this.resetStatus(); + this.setMessage(aMessage); + MochiKit.DOM.removeElementClass(this.element(), 'ios-overlay-hide'); + MochiKit.DOM.addElementClass(this.element(), 'ios-overlay-show'); + }, + + 'done': function (aMessage, aDelayBeforeHiding) { + this.completed(this.showDoneIcon, aMessage, aDelayBeforeHiding); + }, + + 'failed': function (aMessage, aDelayBeforeHiding) { + this.completed(this.showFailIcon, aMessage, aDelayBeforeHiding); + }, + + //------------------------------------------------------------------------- + + 'resetStatus': function () { + MochiKit.Style.showElement(this.element()); + MochiKit.Style.showElement(this.getElement('spinner')); + MochiKit.Style.hideElement(this.getElement('done')); + MochiKit.Style.hideElement(this.getElement('failed')); + }, + + 'setMessage': function (aMessage) { + if (typeof(aMessage) != 'undefined') { + this.getElement('title').innerHTML = aMessage; + } + }, + + 'completed': function (aFunctionToShowResult, aMessage, aDelayBeforeHiding) { + var delay = aDelayBeforeHiding || this.defaultDelay(); + + this.hideSpinner(); + MochiKit.Base.bind(aFunctionToShowResult, this)(); + this.setMessage(aMessage); + + MochiKit.Async.callLater(delay, MochiKit.Base.bind(this.hide, this)) + }, + + 'hide': function () { + MochiKit.DOM.removeElementClass(this.element(), 'ios-overlay-show'); + MochiKit.DOM.addElementClass(this.element(), 'ios-overlay-hide'); + MochiKit.Async.callLater(1, MochiKit.Style.hideElement, this.element()); + }, + + 'hideSpinner': function () { + MochiKit.Style.hideElement(this.getElement('spinner')); + }, + + 'showDoneIcon': function () { + MochiKit.Style.showElement(this.getElement('done')); + }, + + 'showFailIcon': function () { + MochiKit.Style.showElement(this.getElement('failed')); + }, + + //------------------------------------------------------------------------- + + 'defaultDelay': function () { + return this._defaultDelay; + }, + + //------------------------------------------------------------------------- + + 'renderSelf': function () { + this.setElement(Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, + {tag:'div', id:'ui-ios-overlay', cls:'ui-ios-overlay', children:[ + {tag:'div', cls:'spinner', id:this.getId('spinner'), children:[ + {tag:'div', cls:'bar01'}, {tag:'div', cls:'bar02'}, {tag:'div', cls:'bar03'}, {tag:'div', cls:'bar04'}, {tag:'div', cls:'bar05'}, {tag:'div', cls:'bar06'}, {tag:'div', cls:'bar07'}, {tag:'div', cls:'bar08'}, {tag:'div', cls:'bar09'}, {tag:'div', cls:'bar10'}, {tag:'div', cls:'bar11'}, {tag:'div', cls:'bar12'} + ]}, + +// {tag:'span', cls:'icon', id:this.getId('done'), html:''}, + {tag:'span', cls:'icon', id:this.getId('done'), html:'done'}, +// {tag:'span', cls:'icon', id:this.getId('failed'), html:''}, + {tag:'span', cls:'icon', id:this.getId('failed'), html:'failed'}, + + {tag:'span', cls:'title', id:this.getId('title'), html:""} + ]} + )); + }, + + //------------------------------------------------------------------------- + __syntaxFix__: "syntax fix" +}); diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Preferences.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Preferences.js new file mode 100644 index 0000000..839069a --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/Preferences.js @@ -0,0 +1,77 @@ +/* + +Copyright 2008-2013 Clipperz Srl + +This file is part of Clipperz, the online password manager. +For further information about its features and functionalities please +refer to http://www.clipperz.com. + +* Clipperz is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +* Clipperz is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + +* You should have received a copy of the GNU Affero General Public + License along with Clipperz. If not, see http://www.gnu.org/licenses/. + +*/ + +Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); + +Clipperz.PM.UI.Mobile.Components.Preferences = function(args) { + args = args || {}; + + Clipperz.PM.UI.Mobile.Components.Preferences.superclass.constructor.apply(this, arguments); + + this.render(); + + return this; +} + +//============================================================================= + +Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.Preferences, Clipperz.PM.UI.Mobile.Components.BaseComponent, { + + //------------------------------------------------------------------------- + + 'toString': function () { + return "Clipperz.PM.UI.Mobile.Components.Preferences component"; + }, + + //------------------------------------------------------------------------- + + 'renderSelf': function () { +// var pageElement; + var headerElement; + var titleElement; + +// pageElement = this.element().parentNode; +// MochiKit.DOM.updateNodeAttributes(pageElement, {'data-add-back-btn': 'true'}) + headerElement = MochiKit.Selector.findChildElements(this.element().parentNode, ['div[data-role=header]'])[0]; +// headerElement.innerHTML = "Preferences"; + titleElement = MochiKit.Selector.findChildElements(headerElement, ['h1'])[0]; + titleElement.innerHTML = "Preferences"; + this.append(this.element(), + {tag:'div', id:this.getId('listBox'), children:[ + {tag:'h1', html:"Preferences"} + ]} + ); + + this.append(headerElement, [ + // 'data-direction':'reverse', 'data-rel':'back', + {tag:'a', href:"#", id:this.getId('back'), cls:'ui-btn-left', html:"back" }, + {tag:'a', href:"#", id:this.getId('save'), cls:'ui-btn-right', html:"save" } + ]); + + MochiKit.Signal.connect(this.getElement('back'), 'onclick', MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'back')); + MochiKit.Signal.connect(this.getElement('save'), 'onclick', MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'savePreferences')); + }, + + //========================================================================= + __syntaxFix__: "syntax fix" +}); diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js index 9951f44..245874a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js @@ -1,381 +1,390 @@ /* Copyright 2008-2013 Clipperz Srl This file is part of Clipperz, the online password manager. For further information about its features and functionalities please refer to http://www.clipperz.com. * Clipperz is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * Clipperz is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers'); Clipperz.PM.UI.Mobile.Controllers.MainController = function() { // this._jQTouch = null; this._user = null; this._proxy = null; +// this._overlay = null; this._loginForm = null; this._cardList = null; this._cardDetail = null; + this._preferences = null; return this; } MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype, { 'toString': function () { return "Clipperz.PM.UI.Mobile.Controllers.MainController"; }, //------------------------------------------------------------------------- 'user': function () { return this._user; }, 'setUser': function (aValue) { this._user = aValue; }, - //------------------------------------------------------------------------- -/* - 'jQTouch': function () { - return this._jQTouch; - }, - - 'setJQTouch': function (aValue) { - this._jQTouch = aValue; - }, -*/ //========================================================================= 'run': function () { - MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin')); - Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[ - {tag:'div', id:'loginForm'}, - {tag:'div', id:'cardList'}, - {tag:'div', id:'cardDetail'}, - {tag:'div', id:'preferences'} - ]}); - + var defaultPageStructure; + + MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin')); + MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'showPreferences', MochiKit.Base.method(this, 'showPreferences')); + + MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'savePreferences', MochiKit.Base.method(this, 'savePreferences')); + MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'back', MochiKit.Base.method(this, 'back')); + + defaultPageStructure = [ + {tag:'div', 'data-role':'header', 'data-position':'fixed', children:[ + {tag:'h1', html:'clipperz'} + ]}, + {tag:'div', 'data-role':'content'} + ]; + Clipperz.DOM.Helper.insertAfter(MochiKit.DOM.getElement('loadingPage'), [ + {tag:'div', 'data-role':'page', id:'loginPage', children:defaultPageStructure}, + {tag:'div', 'data-role':'page', id:'cardListPage', children:defaultPageStructure}, + {tag:'div', 'data-role':'page', id:'cardDetailPage', children:defaultPageStructure}, + {tag:'div', 'data-role':'page', id:'preferencesPage', children:defaultPageStructure} + ]) +// $.mobile.initializePage(); this.showLoginForm(); - -// this.initjQTouch(); - - -// this.showAddToHomeScreenBaloon(); -// this.selectInitialProxy(); - }, -/* - 'initjQTouch': function () { - var jqt; - - jqt = new $.jQTouch({ - icon: 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAIAAAAAvxIqAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAKJGNVd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJGWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19HvFpgJSpO64PIN5G+fAp30Hc8TziHS4miFhheJbjLMMzHB8POFPqKGKWi6TXtSriJcT9MzH5bAzzHIK1I08t6hq6zHpRdu2aYdJYuk9Q/881bzZa8Xrx6fLmJo/iu4/VXnfH1BB/rmu5ScQvI77m+BkmfxXxvcZcJY14L0DymZp7pML5yTcW61PvIN6JuGr4halQvmjNlCa4bXJ5zj6qhpxrujeKPYMXEd+q00KR5yNAlWZzrF+Ie+uNsdC/MO4tTOZafhbroyXuR3Df08bLiHsQf+ja6gTPWVimZl7l/oUrjl8OcxDWLbNU5D6JRL2gxkDu16fGuC054OMhclsyXTOOFEL+kmMGs4i5kfNuQ62EnBuam8tzP+Q+tSqhz9SuqpZlvR1EfBiOJTSgYMMM7jpYsAEyqJCHDL4dcFFTAwNMlFDUUpQYiadhDmX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YCp1V277+ZPy1nW+P07+FG7+JmPRe55nfH8W8m9ZPr07YeiJlskiKSRyne5ltk6O2fuMJ58LFykx7KcPJsxfrpy++qSHSnzCFYLEEjp5ljoDCyF8/7YWLi/7m3w+eO3duPE7tYXynDff3x17YdU5qWr1kTg1Lnzcs9CWY7SDg9/3f/a0v7By/WdHU0RlbvWJJI85GkoimGAP5ZG7XLf2nndU//tVu0xjHya24CpPcXcfae+D48cSU5cuWVotuy7RUiR1NXvfQ4+ccp8Izn4phW8a7vcqWldOYfoERgqGqTrnta4/3vrn3ICqUdL8MrsZKFwBnz51/9VBm+oL1cxuMjKt+8zfifE/Fxr6GQl8kmvHNXD9HSP7a57pv/NvtHd3dw82N/SGBy75P/cmW//rA6qv1xAwwSf2fn77z3ttXXBP/FGiccTXW2L1/p5vABCYwgQlMYAL/2fH/AdkCEQl+/Ar/AAAAAElFTkSuQmCCCg==', -// icon4: 'jqtouch4.png', -// startupScreen: null, // Pass a string path to a 320px x 460px startup screen for full screen apps. - statusBar: 'black-translucent', // Styles the status bar when running as a fullscreen app. Other options are `default`, `black`, and `black-translucent`. -// addGlossToIcon: true, // Set to 'false' to prevent automatic glossy button effect on icon. - preloadImages: false, // Pass an array of image paths to load them before page loads. Ex: `['images/link_over.png', 'images/link_select.png']` - fixedViewport: true, // Removes the user's ability to scale the page. Ensures the site behaves more like an application. -// fullScreen: true, // The website will become a fullscreen application when saved to a user's home screen. Set to `false` to disable. -// fullScreenClass: 'fullscreen' // Adds a class to the `<body>` when running in full-screen mode, to allow for easy detection and styling. Set to `false` to disable. -// themeSelectionSelector: '#jqt #themes ul', // ??? - -// useAnimations: true, // Set to `false` to disable all animations. -// useFastTouch: true, // Removes ~350ms onClick delay when tapping a link (use in conjunction with the .tap() event) **Experimental** -// useTouchScroll: true, // Adds support for iOS5 scrolling. Set to false to disable. **Experimental** - - cacheGetRequests: false, // Automatically caches GET requests, so subsequent taps reference the pre-loaded views. (default: true) - -// backSelector: '.back, .cancel, .goback', // A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used. - -// cubeSelector: '.cube', // Link selector for a cube animation. -// dissolveSelector: '.dissolve', // Link selector for a dissolve animation. -// fadeSelector: '.fade', // Link selector for a fade animation. -// flipSelector: '.flip', // Link selector for a 3d flip animation. - formSelector: null, // Sets which forms are automatically submitted via Ajax. (default: 'form') -// popSelector: '.pop', // Link selector for a pop animation. (default: '.pop') -// slideSelector: 'body > * > ul li a', // Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector `'li > a, a:not(.dontslide)'`, etc. (default: 'body > * > ul li a') -// slideupSelector: '.slideup', // Link selector for a slide up animation. (default: '.slideup') -// submitSelector: '.submit', // Selector which, when clicked, will submit its parent form (and close keyboard if open). (default: '.submit') -// swapSelector: '.swap', // Link selector for 3d swap animation. (default: '.swap') -// touchSelector: 'a, .touch', // Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like `swipe` (default: 'a, .touch') - - debug: false - }); - - this.setJQTouch(jqt); }, -*/ + //========================================================================= 'showAddToHomeScreenBaloon': function () { }, //------------------------------------------------------------------------- 'selectInitialProxy': function () { if (this.isOnline()) { this._proxy = Clipperz.PM.Proxy.defaultProxy; } else { if (this.hasLocalData()) { this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false}); } else { this.showOfflineError(); } } }, //------------------------------------------------------------------------- 'showLoginForm': function (args) { args = args || {}; args['callback'] = MochiKit.Base.method(this, 'doLogin'); if (Clipperz.PM.PIN.isSet()) { args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedPinLogin'); - this.loginForm().showPinLogin(args); + this.loginForm().setMode('PIN'); +// this.loginForm().showPinLogin(args); } else { args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedCredentialsLogin'); - this.loginForm().showCredentialsLogin(args); + this.loginForm().setMode('CREDENTIALS'); + //this.loginForm().showCredentialsLogin(args); } + this.loginForm().show(args); + +// MochiKit.Async.callLater(0.1, $.mobile.changePage, $('#loginPage'), {changeHash:false, showLoadMsg:false, role:'page', fromPage:$('#loadingPage'), 'data-transition':'slide'}); + MochiKit.Async.callLater(0.1, $.mobile.changePage, $('#loginPage')); }, //......................................................................... 'handleFailedCredentialsLogin': function () { + this.overlay().failed("Failed login", 1); this.showLoginForm({'previousFailedAttempt':'LOGIN'}); }, //......................................................................... 'handleFailedPinLogin': function () { var failedAttempts; var status; + this.overlay().failed("Failed login", 1); failedAttempts = Clipperz.PM.PIN.recordFailedAttempt(); this.showLoginForm({'previousFailedAttempt':'PIN', 'failedAttempts': failedAttempts}); }, //------------------------------------------------------------------------- 'doLogin': function (someArgs) { var deferredResult; var credentials; var errorCallback; var user; var getPassphraseDelegate; credentials = someArgs['credentials']; errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop; + this.overlay().show("logging in"); getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, credentials.passphrase); user = new Clipperz.PM.DataModel.User({'username':credentials.username, 'getPassphraseFunction':getPassphraseDelegate}); deferredResult = new Clipperz.Async.Deferred('MainController.doLogin', {trace:false}); deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); deferredResult.addCallback(MochiKit.Async.wait, 0.1); deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); deferredResult.addMethod(user, 'login'); deferredResult.addCallbacks( MochiKit.Base.method(this, 'processSuccessfulLogin', user), errorCallback ); deferredResult.callback(); return deferredResult; }, //.......................................................................... 'processSuccessfulLogin': function (aUser) { var deferredResult; deferredResult = new Clipperz.Async.Deferred('MainController.processSuccessfulLogin', {trace:false}); deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); + deferredResult.addMethod(this.overlay(), 'done', "", 1); // deferredResult.addMethod(this, 'removeLoginForm'); deferredResult.addMethod(this, 'setUser', aUser); deferredResult.addMethod(this, 'setupApplication'); deferredResult.addMethod(this, 'runApplication'); deferredResult.callback(); return deferredResult; }, //------------------------------------------------------------------------- 'setupApplication': function () { var deferredResult; deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false}); deferredResult.addMethod(this, 'welcomeFirstTimeUser'); deferredResult.addMethod(this, 'showPaymentReminder'); deferredResult.addMethod(this, 'copyDataLocally'); deferredResult.callback(arguments); return deferredResult; }, - //.......................................................................... 'isFirstTimeUser': function () { return false; }, 'welcomeFirstTimeUser': function () { var deferredResult; deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false}); if (this.isFirstTimeUser()) { deferredResult.addCallback(function () { Clipperz.log("--> welcome"); }); } deferredResult.callback(); return deferredResult; }, //.......................................................................... 'shouldShowPaymentReminder': function () { return true; }, 'showPaymentReminder': function () { var deferredResult; deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false}); if (this.shouldShowPaymentReminder()) { deferredResult.addCallback(function () { Clipperz.log("--> payment reminder"); }); } deferredResult.callback(); return deferredResult; }, //.......................................................................... 'canCopyDataLocally': function () { return false; }, 'copyDataLocally': function () { var deferredResult; deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false}); if (this.canCopyDataLocally()) { deferredResult.addCallback(function () { Clipperz.log("--> copy data locally"); }); } deferredResult.callback(); return deferredResult; }, //------------------------------------------------------------------------- 'runApplication': function () { var deferredResult; - deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true}); + deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:false}); + deferredResult.addMethod(this, 'showCardListPage'); + deferredResult.addCallback(MochiKit.Async.wait, 0.5); deferredResult.addMethod(this.user(), 'getRecords'); - deferredResult.addMethod(this, 'showCards'); +// deferredResult.addMethod(this, 'showCards'); + deferredResult.addMethod(this.cardList(), 'showCards'); deferredResult.callback(); return deferredResult; }, //========================================================================= 'showOfflineError': function (anException) { alert("Error: " + anException); throw anException; }, //========================================================================= 'isOnline': function() { return navigator.onLine; }, 'hasLocalData': function() { return false; }, //========================================================================= - 'loginForm': function() { + 'overlay': function () { + if (this._overlay == null) { + this._overlay = new Clipperz.PM.UI.Mobile.Components.Overlay(); + } + + return this._overlay; + }, + + //------------------------------------------------------------------------- + + 'contentElementForPage': function (aPageName) { + return MochiKit.Selector.findDocElements('#' + aPageName + ' div[data-role="content"]')[0]; + }, + + 'loginForm': function () { if (this._loginForm == null) { - this._loginForm = new Clipperz.PM.UI.Mobile.Components.LoginForm({element:MochiKit.DOM.getElement('loginForm')}); + this._loginForm = new Clipperz.PM.UI.Mobile.Components.LoginForm({element:this.contentElementForPage('loginPage')}); } return this._loginForm; }, 'removeLoginForm': function () { if (this._loginForm != null) { this._loginForm.remove(); this._loginForm = null; } }, //------------------------------------------------------------------------- 'cardList': function () { if (this._cardList == null) { - this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:MochiKit.DOM.getElement('cardList')}); + this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:this.contentElementForPage('cardListPage')}); MochiKit.Signal.connect(this._cardList, 'selectedCard', this, 'selectCardHandler'); } return this._cardList; }, - 'showCards': function (someCards) { - this.cardList().showCards(someCards); -// this.jQTouch().goTo('#cardList', 'slideleft'); + 'showCardListPage': function (someCards) { +// this.cardList().render(); + $.mobile.changePage($('#cardListPage'), {'transition':'flow'}); // slide, flow, pop }, //------------------------------------------------------------------------- 'cardDetail': function () { if (this._cardDetail == null) { this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:MochiKit.DOM.getElement('cardDetail')}); } return this._cardDetail; }, 'selectCardHandler': function (aCardReference) { var deferredResult; deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true}); deferredResult.addMethod(this.cardDetail(), 'render'); -// deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft'); deferredResult.addMethod(this.user(), 'getRecord', aCardReference); deferredResult.addMethod(this.cardDetail(), 'showCard'); deferredResult.callback(); return deferredResult; }, //========================================================================= + + 'preferences': function () { + if (this._preferences == null) { + this._preferences = new Clipperz.PM.UI.Mobile.Components.Preferences({element:this.contentElementForPage('preferencesPage')}); + } + + return this._preferences; + }, + + 'showPreferences': function (anEvent) { +//console.log("MainController.showPreferences", anEvent); + this.preferences(); +// MochiKit.Async.callLater(0.1, $.mobile.changePage, $('#preferencesPage'), {transition:'flip'}); + $.mobile.changePage($('#preferencesPage'), {transition:'flip'}); + }, + + 'savePreferences': function (anEvent) { +console.log("MainController.savePreferences", anEvent); + }, + + 'back': function (anEvent) { +// MochiKit.Async.callLater(0.1, $.mobile.changePage, $('#cardListPage'), {transition:'flip', reverse:true}); + $.mobile.changePage($('#cardListPage'), {transition:'flip', reverse:true}); + }, + + //========================================================================= __syntaxFix__: "syntax fix" }); diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/CustomizeJQueryMobile.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/CustomizeJQueryMobile.js new file mode 100644 index 0000000..68d8a5b --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/CustomizeJQueryMobile.js @@ -0,0 +1,50 @@ +/* + +Copyright 2008-2013 Clipperz Srl + +This file is part of Clipperz, the online password manager. +For further information about its features and functionalities please +refer to http://www.clipperz.com. + +* Clipperz is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + +* Clipperz is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Affero General Public License for more details. + +* You should have received a copy of the GNU Affero General Public + License along with Clipperz. If not, see http://www.gnu.org/licenses/. + +*/ + +$(document).on("mobileinit", function() { + $.extend($.mobile, { +// activeBtnClass: 'ui-btn-active', +// activePageClass: 'ui-page-active', + ajaxEnabled: false, +// allowCrossDomainPages: false, +// autoInitializePage: true, +// buttonMarkup.hoverDelay: 200, +// defaultDialogTransition: 'pop', +// defaultPageTransition: 'fade, +// getMaxScrollForTransition: 3, +// gradeA: …, +// hashListeningEnabled: true, + ignoreContentEnabled: true, +// linkBindingEnabled: true, +// maxTransitionWidth: false, +// minScrollBack: 250, +// ns: '', +// pageLoadErrorMessage: "Error Loading Page", +// pageLoadErrorMessageTheme: 'e', +// phonegapNavigationEnabled: false, +// pushStateEnabled: true, +// subPageUrlKey: 'ui-page', +// transitionFallbacks.[transition]: 'fade', + __syntaxFix__: "syntax fix" + }) +}); |