Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js index 23fd236..5380aa1 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.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 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { | 28 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._cardReference = null; | 33 | this._cardReference = null; |
37 | 34 | ||
38 | return this; | 35 | return this; |
39 | } | 36 | } |
40 | 37 | ||
41 | //============================================================================= | 38 | //============================================================================= |
42 | 39 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 41 | ||
45 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; | 45 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'cardReference': function () { | 50 | 'cardReference': function () { |
54 | return this._cardReference; | 51 | return this._cardReference; |
55 | }, | 52 | }, |
56 | 53 | ||
57 | 'setCardReference': function (aValue) { | 54 | 'setCardReference': function (aValue) { |
58 | this._cardReference = aValue; | 55 | this._cardReference = aValue; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
62 | 59 | ||
63 | 'renderSelf': function(/*aContainer, aPosition*/) { | 60 | 'renderSelf': function(/*aContainer, aPosition*/) { |
64 | this.append(this.element(), [ | 61 | this.append(this.element(), [ |
65 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ | 62 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ |
66 | {tag:'div', id:this.getId('progressBar')} //, | 63 | {tag:'div', id:this.getId('progressBar')} //, |
67 | // {tag:'h1', cls:'loading', html:"loading"} | 64 | // {tag:'h1', cls:'loading', html:"loading"} |
68 | ]} | 65 | ]} |
69 | ]); | 66 | ]); |
70 | 67 | ||
71 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 68 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
72 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); | 69 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //========================================================================= | 72 | //========================================================================= |
76 | 73 | ||
77 | 'showCardDetails': function (someData) { | 74 | 'showCardDetails': function (someData) { |
78 | this.element().innerHTML = ''; | 75 | this.element().innerHTML = ''; |
79 | this.append(this.element(), [ | 76 | this.append(this.element(), [ |
80 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { | 77 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { |
81 | return {tag:'div', cls:'row', children:[ | 78 | return {tag:'div', cls:'row', children:[ |
82 | {tag:'label', html:aFieldData['label']}, | 79 | {tag:'label', html:aFieldData['label']}, |
83 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} | 80 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} |
84 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ | 81 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ |
85 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} | 82 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} |
86 | ]} | 83 | ]} |
87 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} | 84 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} |
88 | 85 | ||
89 | ]} | 86 | ]} |
90 | }, someData['fields'])} | 87 | }, someData['fields'])} |
91 | ]); | 88 | ]); |
92 | 89 | ||
93 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { | 90 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { |
94 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) | 91 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) |
95 | }, this)); | 92 | }, this)); |
96 | 93 | ||
97 | if (someData['directLogins'].length > 0) { | 94 | if (someData['directLogins'].length > 0) { |
98 | this.append(this.element(), [ | 95 | this.append(this.element(), [ |
99 | {tag:'h2', html:"Direct logins"}, | 96 | {tag:'h2', html:"Direct logins"}, |
100 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { | 97 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { |
101 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ | 98 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ |
102 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, | 99 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, |
103 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} | 100 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} |
104 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} | 101 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} |
105 | ]} | 102 | ]} |
106 | }, someData['directLogins'])} | 103 | }, someData['directLogins'])} |
107 | ]); | 104 | ]); |
108 | 105 | ||
109 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { | 106 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { |
110 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); | 107 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); |
111 | }, this), | 108 | }, this), |
112 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) | 109 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) |
113 | ) | 110 | ) |
114 | }; | 111 | }; |
115 | 112 | ||
116 | if (someData['notes'] != '') { | 113 | if (someData['notes'] != '') { |
117 | this.append(this.element(), [ | 114 | this.append(this.element(), [ |
118 | {tag:'h2', html:"Notes"}, | 115 | {tag:'h2', html:"Notes"}, |
119 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | 116 | {tag:'fieldset', id:this.getId('fieldset'), children:[ |
120 | {tag:'div', cls:'row notes', children:[ | 117 | {tag:'div', cls:'row notes', children:[ |