summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js155
1 files changed, 155 insertions, 0 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
new file mode 100644
index 0000000..03c7b9e
--- a/dev/null
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
@@ -0,0 +1,155 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz's Javascript Crypto Library.
6Javascript Crypto Library provides web developers with an extensive
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please
11refer to http://www.clipperz.com
12
13* Javascript Crypto Library is free software: you can redistribute
14 it and/or modify it under the terms of the GNU Affero General Public
15 License as published by the Free Software Foundation, either version
16 3 of the License, or (at your option) any later version.
17
18* Javascript Crypto Library is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details.
22
23* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see
25 <http://www.gnu.org/licenses/>.
26
27*/
28
29Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
30
31Clipperz.PM.UI.Web.Components.LoginProgress = function(args) {
32 args = args || {};
33
34 Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments);
35
36 this._deferred = null;
37
38 return this;
39}
40
41//=============================================================================
42
43Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, {
44
45 //-------------------------------------------------------------------------
46
47 'toString': function () {
48 return "Clipperz.PM.UI.Web.Components.LoginProgress component";
49 },
50
51 //-------------------------------------------------------------------------
52
53 'deferred': function() {
54 return this._deferred;
55 },
56
57 'setDeferred': function(aValue) {
58 this._deferred = aValue;
59 },
60
61 //-------------------------------------------------------------------------
62
63 'renderSelf': function() {
64 // var loginProgressElement;
65 //
66 // loginProgressElement = MochiKit.DOM.getElement('loginProgress');
67 //
68 // if (loginProgressElement == null) {
69 // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true);
70 // }
71
72//console.log(">> LoginProgress.renderSelf", this.element());
73 this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [
74 // this.append(loginProgressElement, [
75 {tag:'div', cls:'header', children:[
76 {tag:'h3', id:this.getId('title'), html:"login progress"}
77 ]},
78 {tag:'div', cls:'body', children:[
79 {tag:'div', id:this.getId('progressBar')},
80 {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[
81 // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]},
82 {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]},
83 {tag:'p', html:"Login failed"}
84 ]}
85 ]},
86 {tag:'div', cls:'footer', children:[
87 {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[
88 {tag:'div', cls:'button', id:this.getId('button'), children:[
89 {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"}
90 ]}
91 ]}
92 ]}
93 ]});
94 // ]);
95
96 Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff");
97
98 this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')}));
99 MochiKit.Style.hideElement(this.getElement('errorBox'));
100
101 MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler');
102 },
103
104 //-------------------------------------------------------------------------
105
106 'displayElement': function() {
107 return MochiKit.DOM.getElement('loginProgress');
108 },
109
110 //-------------------------------------------------------------------------
111
112 'cancelEventHandler': function(anEvent) {
113 anEvent.preventDefault();
114
115 MochiKit.Signal.signal(this, 'cancelEvent');
116 },
117
118 //-------------------------------------------------------------------------
119
120 'disableCancel': function() {
121 MochiKit.Style.hideElement(this.getElement('buttonArea'));
122 },
123
124 //-------------------------------------------------------------------------
125
126 'showErrorMessage': function() {
127 this.getElement('buttonLink').innerHTML = "close";
128
129 MochiKit.Style.hideElement(this.getElement('progressBar'));
130
131 this.getElement('title').innerHTML = "Error";
132 MochiKit.Style.showElement(this.getElement('errorBox'));
133 MochiKit.Style.showElement(this.getElement('buttonArea'));
134 },
135
136 //-------------------------------------------------------------------------
137
138 'deferredHideModalAndRemove': function(someParameters, aResult) {
139 vardeferredResult;
140
141 deferredResult = new Clipperz.Async.Deferred("LoginProgress.deferredHideModalAndRemove", {trace:false});
142 deferredResult.addMethod(this, 'deferredHideModal');
143 deferredResult.addMethod(this, 'remove');
144 deferredResult.addCallback(function () {
145 return aResult;
146 });
147 deferredResult.callback(someParameters);
148
149 return deferredResult;
150 },
151
152 //-------------------------------------------------------------------------
153
154 __syntaxFix__: "syntax fix"
155});