Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js index 673d5ee..8188389 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | 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 | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | //############################################################################# | 30 | //############################################################################# |
34 | 31 | ||
35 | Clipperz.PM.DataModel.DirectLoginInput = function(args) { | 32 | Clipperz.PM.DataModel.DirectLoginInput = function(args) { |
36 | this._args = args; | 33 | this._args = args; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { | 38 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { |
42 | 39 | ||
43 | 'args': function() { | 40 | 'args': function() { |
44 | return this._args; | 41 | return this._args; |
45 | }, | 42 | }, |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'name': function() { | 46 | 'name': function() { |
50 | return this.args()['name']; | 47 | return this.args()['name']; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'type': function() { | 52 | 'type': function() { |
56 | var result; | 53 | var result; |
57 | 54 | ||
58 | result = this.args()['type']; | 55 | result = this.args()['type']; |
59 | 56 | ||
60 | if (result != null) { | 57 | if (result != null) { |
61 | result = result.toLowerCase(); | 58 | result = result.toLowerCase(); |
62 | } | 59 | } |
63 | return result; | 60 | return result; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'options': function() { | 65 | 'options': function() { |
69 | return this.args()['options']; | 66 | return this.args()['options']; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'value': function() { | 71 | 'value': function() { |
75 | return this.args()['value']; | 72 | return this.args()['value']; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | /* | 76 | /* |
80 | 'formConfiguration': function(someFormValues, someBindings, someFields) { | 77 | 'formConfiguration': function(someFormValues, someBindings, someFields) { |
81 | var result; | 78 | var result; |
82 | //console.log("### DirectLoginInput.formConfiguration", someFields); | 79 | //console.log("### DirectLoginInput.formConfiguration", someFields); |
83 | if (this.shouldSetValue()) { | 80 | if (this.shouldSetValue()) { |
84 | switch (this.type()) { | 81 | switch (this.type()) { |
85 | case 'select': | 82 | case 'select': |
86 | var currentValue; | 83 | var currentValue; |
87 | var options; | 84 | var options; |
88 | 85 | ||
89 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; | 86 | // currentValue = this.directLogin()._configuration['formValues'][this.name()]; |
90 | currentValue = someFormValues[this.name()]; | 87 | currentValue = someFormValues[this.name()]; |
91 | options = this.args()['options']; | 88 | options = this.args()['options']; |
92 | 89 | ||
93 | result = MochiKit.DOM.SELECT({name:this.name()}, | 90 | result = MochiKit.DOM.SELECT({name:this.name()}, |
94 | MochiKit.Base.map(function(anOption) { | 91 | MochiKit.Base.map(function(anOption) { |
95 | var options; | 92 | var options; |
96 | 93 | ||
97 | options = {value:anOption['value']}; | 94 | options = {value:anOption['value']}; |
98 | if (currentValue == anOption['value']) { | 95 | if (currentValue == anOption['value']) { |
99 | options.selected = true; | 96 | options.selected = true; |
100 | } | 97 | } |
101 | 98 | ||
102 | return MochiKit.DOM.OPTION(options, anOption['label']) | 99 | return MochiKit.DOM.OPTION(options, anOption['label']) |
103 | }, options) | 100 | }, options) |
104 | ) | 101 | ) |
105 | break; | 102 | break; |
106 | case 'checkbox': | 103 | case 'checkbox': |
107 | var options; | 104 | var options; |
108 | 105 | ||
109 | options = {type:'checkbox', name: this.name()}; | 106 | options = {type:'checkbox', name: this.name()}; |
110 | // if (this.directLogin()._configuration['formValues'][this.name()] == true) { | 107 | // if (this.directLogin()._configuration['formValues'][this.name()] == true) { |
111 | if (someFormValues[this.name()] == true) { | 108 | if (someFormValues[this.name()] == true) { |
112 | options['checked'] = true; | 109 | options['checked'] = true; |
113 | }; | 110 | }; |
114 | 111 | ||
115 | result = MochiKit.DOM.INPUT(options, null); | 112 | result = MochiKit.DOM.INPUT(options, null); |
116 | break; | 113 | break; |
117 | case 'radio': | 114 | case 'radio': |
118 | var currentName; | 115 | var currentName; |
119 | var currentValue; | 116 | var currentValue; |
120 | var options; | 117 | var options; |