summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js178
1 files changed, 0 insertions, 178 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js
deleted file mode 100644
index 5341878..0000000
--- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js
+++ b/dev/null
@@ -1,178 +0,0 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz Community Edition.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please
8refer to http://www.clipperz.com.
9
10* Clipperz Community Edition is free software: you can redistribute
11 it and/or modify it under the terms of the GNU Affero General Public
12 License as published by the Free Software Foundation, either version
13 3 of the License, or (at your option) any later version.
14
15* Clipperz Community Edition is distributed in the hope that it will
16 be useful, but WITHOUT ANY WARRANTY; without even the implied
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details.
19
20* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see
22 <http://www.gnu.org/licenses/>.
23
24*/
25
26Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components');
27
28Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) {
29 args = args || {};
30
31 Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments);
32
33 return this;
34}
35
36//=============================================================================
37
38Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, {
39
40 //-------------------------------------------------------------------------
41
42 'toString': function () {
43 return "Clipperz.PM.UI.iPhone.Components.LoginForm component";
44 },
45
46 //-------------------------------------------------------------------------
47
48 'focusOnUsername': function () {
49 this.getElement('username').focus();
50 },
51
52 //-------------------------------------------------------------------------
53
54 'username': function () {
55 return this.getElement('username').value;
56 },
57
58 'passphrase': function () {
59 return this.getElement('passphrase').value;
60 },
61
62 //-------------------------------------------------------------------------
63
64 'renderSelf': function(/*aContainer, aPosition*/) {
65 this.append(this.element(), [
66 {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[
67 {tag:'h1', id:'pageTitle', html:'Clipperz'},
68 {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"}
69 ]},
70 {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[
71 {tag:'fieldset', id:this.getId('fieldset'), children:[
72 {tag:'div', cls:'row', children:[
73 {tag:'label', html:"username"},
74 {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')}
75 ]},
76 {tag:'div', cls:'row', children:[
77 {tag:'label', html:"passphrase"},
78 {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')}
79 ]}
80 ]},
81 {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')}
82 ]},
83 {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[
84 {tag:'div', id:this.getId('progressBar')} //,
85 // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')}
86 ]},
87 {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[
88 {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[
89 {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"}
90 ]}
91 ]}
92 ]);
93
94 MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler');
95 MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler');
96
97 // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler');
98 MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler');
99
100 this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')}));
101
102 // MochiKit.Style.hideElement(this.getElement('errorMessage'));
103
104 this.showLoginForm();
105 // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername'));
106 },
107
108 //-------------------------------------------------------------------------
109
110 'showLoginForm': function () {
111 MochiKit.Style.showElement(this.getElement('loginFormPanel'));
112 MochiKit.Style.hideElement(this.getElement('loginProgressPanel'));
113 MochiKit.Style.hideElement(this.getElement('loginErrorPanel'));
114 MochiKit.Style.hideElement('backButton');
115 },
116
117 'slideInLoginForm': function () {
118 varoffset;
119
120 offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480);
121
122 MochiKit.Style.showElement(this.getElement('loginFormPanel'));
123 MochiKit.Style.setElementPosition(this.getElement('loginFormPanel'), {x:-offset, y:0});
124
125 new MochiKit.Visual.Sequence([
126 new MochiKit.Visual.Parallel([
127 new MochiKit.Visual.Move(this.getElement('loginErrorPanel'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}),
128 new MochiKit.Visual.Move(this.getElement('loginFormPanel'), {x:0, y:0, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}),
129 MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true})
130 ], {duration:0.5, sync:true}),
131 MochiKit.Visual.fade(this.getElement('loginErrorPanel'), {duration:0, sync:true})
132 ], {})
133 },
134
135 'showLoginProgress': function () {
136 MochiKit.Style.hideElement(this.getElement('loginFormPanel'));
137 MochiKit.Style.showElement(this.getElement('loginProgressPanel'));
138 },
139
140 'showLoginError': function (anError) {
141 this.getElement('errorMessage').innerHTML = "Login error";
142
143 MochiKit.Style.showElement('backButton');
144 MochiKit.Style.hideElement(this.getElement('loginProgressPanel'));
145 MochiKit.Style.showElement(this.getElement('loginErrorPanel'));
146 MochiKit.Style.setElementPosition(this.getElement('loginErrorPanel'), {x:0, y:45});
147 },
148
149 //-------------------------------------------------------------------------
150/*
151 'disableCancelButton': function () {
152 MochiKit.DOM.hideElement(this.getElement('cancel'));
153 },
154*/
155 //-------------------------------------------------------------------------
156
157 'submitHandler': function (anEvent) {
158 anEvent.preventDefault();
159
160 MochiKit.Signal.signal(this, 'doLogin', {'username':this.username(), 'passphrase':this.passphrase()});
161 },
162
163 'cancelHandler': function (anEvent) {
164 anEvent.preventDefault();
165
166//console.log("CANCEL");
167 },
168
169 'backHandler': function (anEvent) {
170 anEvent.preventDefault();
171
172 this.slideInLoginForm();
173 },
174
175 //-------------------------------------------------------------------------
176
177 __syntaxFix__: "syntax fix"
178});