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 | 163 |
1 files changed, 0 insertions, 163 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 deleted file mode 100644 index 5380aa1..0000000 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js +++ b/dev/null | |||
@@ -1,163 +0,0 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz Community Edition. | ||
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | ||
8 | refer 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 | |||
26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | ||
27 | |||
28 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { | ||
29 | args = args || {}; | ||
30 | |||
31 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); | ||
32 | |||
33 | this._cardReference = null; | ||
34 | |||
35 | return this; | ||
36 | } | ||
37 | |||
38 | //============================================================================= | ||
39 | |||
40 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
41 | |||
42 | //------------------------------------------------------------------------- | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; | ||
46 | }, | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'cardReference': function () { | ||
51 | return this._cardReference; | ||
52 | }, | ||
53 | |||
54 | 'setCardReference': function (aValue) { | ||
55 | this._cardReference = aValue; | ||
56 | }, | ||
57 | |||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
61 | this.append(this.element(), [ | ||
62 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ | ||
63 | {tag:'div', id:this.getId('progressBar')} //, | ||
64 | // {tag:'h1', cls:'loading', html:"loading"} | ||
65 | ]} | ||
66 | ]); | ||
67 | |||
68 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | ||
69 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); | ||
70 | }, | ||
71 | |||
72 | //========================================================================= | ||
73 | |||
74 | 'showCardDetails': function (someData) { | ||
75 | this.element().innerHTML = ''; | ||
76 | this.append(this.element(), [ | ||
77 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { | ||
78 | return {tag:'div', cls:'row', children:[ | ||
79 | {tag:'label', html:aFieldData['label']}, | ||
80 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} | ||
81 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ | ||
82 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} | ||
83 | ]} | ||
84 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} | ||
85 | |||
86 | ]} | ||
87 | }, someData['fields'])} | ||
88 | ]); | ||
89 | |||
90 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { | ||
91 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) | ||
92 | }, this)); | ||
93 | |||
94 | if (someData['directLogins'].length > 0) { | ||
95 | this.append(this.element(), [ | ||
96 | {tag:'h2', html:"Direct logins"}, | ||
97 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { | ||
98 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ | ||
99 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, | ||
100 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} | ||
101 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} | ||
102 | ]} | ||
103 | }, someData['directLogins'])} | ||
104 | ]); | ||
105 | |||
106 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { | ||
107 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); | ||
108 | }, this), | ||
109 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) | ||
110 | ) | ||
111 | }; | ||
112 | |||
113 | if (someData['notes'] != '') { | ||
114 | this.append(this.element(), [ | ||
115 | {tag:'h2', html:"Notes"}, | ||
116 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | ||
117 | {tag:'div', cls:'row notes', children:[ | ||
118 | {tag:'span', html:someData['notes']} | ||
119 | ]} | ||
120 | ]} | ||
121 | ]); | ||
122 | }; | ||
123 | |||
124 | return true; | ||
125 | }, | ||
126 | |||
127 | //------------------------------------------------------------------------- | ||
128 | /* | ||
129 | 'toggleClickHandler': function (anEvent) { | ||
130 | varnextState; | ||
131 | varfieldValue; | ||
132 | |||
133 | //console.log("TOGGLE"); | ||
134 | anEvent.preventDefault; | ||
135 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; | ||
136 | |||
137 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); | ||
138 | if (nextState) { | ||
139 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); | ||
140 | } else { | ||
141 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); | ||
142 | } | ||
143 | |||
144 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); | ||
145 | }, | ||
146 | */ | ||
147 | //========================================================================= | ||
148 | |||
149 | 'directLoginClickHandler': function (anEvent) { | ||
150 | anEvent.preventDefault(); | ||
151 | |||
152 | if (/(directLogin_)/.test(anEvent.src().id)) { | ||
153 | var directLoginReference; | ||
154 | |||
155 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; | ||
156 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); | ||
157 | } | ||
158 | }, | ||
159 | |||
160 | //========================================================================= | ||
161 | |||
162 | __syntaxFix__: "syntax fix" | ||
163 | }); | ||