summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js
index 5f4fe33..0570704 100644
--- a/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js
+++ b/frontend/beta/js/Clipperz/PM/Components/Import/KeePassImportComponent.js
@@ -1,214 +1,212 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } 26if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; }
29if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } 27if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; }
30 28
31//############################################################################# 29//#############################################################################
32 30
33Clipperz.PM.Components.Import.KeePassImportComponent = function(anElement, args) { 31Clipperz.PM.Components.Import.KeePassImportComponent = function(anElement, args) {
34 args = args || {}; 32 args = args || {};
35 33
36 Clipperz.PM.Components.Import.KeePassImportComponent.superclass.constructor.call(this, anElement, args); 34 Clipperz.PM.Components.Import.KeePassImportComponent.superclass.constructor.call(this, anElement, args);
37 35
38 this._steps = ['EDIT', 'KEEPASS_SETTINGS', 'PREVIEW', 'IMPORT']; 36 this._steps = ['EDIT', 'KEEPASS_SETTINGS', 'PREVIEW', 'IMPORT'];
39 this._definedFields = ['Group', 'Group Tree', 'UserName', 'URL', 'Password', 'Notes', 'UUID', 'Icon', 'Creation Time', 'Last Access', 'Last Modification', 'Expires', 'Attachment Description', 'Attachment']; 37 this._definedFields = ['Group', 'Group Tree', 'UserName', 'URL', 'Password', 'Notes', 'UUID', 'Icon', 'Creation Time', 'Last Access', 'Last Modification', 'Expires', 'Attachment Description', 'Attachment'];
40 38
41 this.render(); 39 this.render();
42 40
43 return this; 41 return this;
44} 42}
45 43
46//============================================================================= 44//=============================================================================
47 45
48YAHOO.extendX(Clipperz.PM.Components.Import.KeePassImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { 46YAHOO.extendX(Clipperz.PM.Components.Import.KeePassImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, {
49 47
50 'toString': function() { 48 'toString': function() {
51 return "Clipperz.PM.Components.Import.KeePassImportComponent component"; 49 return "Clipperz.PM.Components.Import.KeePassImportComponent component";
52 }, 50 },
53 51
54 //------------------------------------------------------------------------- 52 //-------------------------------------------------------------------------
55 53
56 'render': function() { 54 'render': function() {
57//MochiKit.Logging.logDebug(">>> Import.KeePassImportComponent.render"); 55//MochiKit.Logging.logDebug(">>> Import.KeePassImportComponent.render");
58 this.domHelper().append(this.element(), {tag:'div', cls:'keePassImportWizard', children:[ 56 this.domHelper().append(this.element(), {tag:'div', cls:'keePassImportWizard', children:[
59 {tag:'h3', htmlString:Clipperz.PM.Strings['KeePass_ImportWizard_Title']}, 57 {tag:'h3', htmlString:Clipperz.PM.Strings['KeePass_ImportWizard_Title']},
60 {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, 58 {tag:'div', cls:'importSteps', id:this.getId('importSteps')},
61 {tag:'div', cls:'importStepBlocks', children:[ 59 {tag:'div', cls:'importStepBlocks', children:[
62 {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ 60 {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[
63 {tag:'div', children:[ 61 {tag:'div', children:[
64 {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_keePass_description']}, 62 {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_keePass_description']},
65 {tag:'div', cls:'importOptionsParameters', children:[]}, 63 {tag:'div', cls:'importOptionsParameters', children:[]},
66 this.textAreaConfig() 64 this.textAreaConfig()
67 ]} 65 ]}
68 ]}, 66 ]},
69 {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[ 67 {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[
70 {tag:'div', children:[ 68 {tag:'div', children:[
71 {tag:'div', id:this.getId('settingsDiv'), children:[ 69 {tag:'div', id:this.getId('settingsDiv'), children:[
72 {tag:'table', id:'KeePassSettings', children:[ 70 {tag:'table', id:'KeePassSettings', children:[
73 {tag:'tbody', children:[ 71 {tag:'tbody', children:[
74 {tag:'tr', children:[ 72 {tag:'tr', children:[
75 {tag:'td', width:'50%', valign:'top', children:[ 73 {tag:'td', width:'50%', valign:'top', children:[
76 {tag:'table', children:[ 74 {tag:'table', children:[
77 {tag:'tbody', children:[ 75 {tag:'tbody', children:[
78 {tag:'tr', children:[ 76 {tag:'tr', children:[
79 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group_checkbox'), name:'Group'/*, checked:true*/}]}, 77 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group_checkbox'), name:'Group'/*, checked:true*/}]},
80 {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group_label'), html:"Group"}]} 78 {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group_label'), html:"Group"}]}
81 ]}, 79 ]},
82 {tag:'tr', children:[ 80 {tag:'tr', children:[
83 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group Tree_checkbox'), name:'Group Tree'/*, checked:true*/}]}, 81 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Group Tree_checkbox'), name:'Group Tree'/*, checked:true*/}]},
84 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group Tree_label'), html:"Group Tree"}]} 82 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Group Tree_label'), html:"Group Tree"}]}
85 ]}, 83 ]},
86 {tag:'tr', children:[ 84 {tag:'tr', children:[
87 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UserName_checkbox'), name:'UserName', checked:true}]}, 85 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UserName_checkbox'), name:'UserName', checked:true}]},
88 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UserName_label'), html:"UserName"}]} 86 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UserName_label'), html:"UserName"}]}
89 ]}, 87 ]},
90 {tag:'tr', children:[ 88 {tag:'tr', children:[
91 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('URL_checkbox'), name:'URL', checked:true}]}, 89 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('URL_checkbox'), name:'URL', checked:true}]},
92 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('URL_label'), html:"URL"}]} 90 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('URL_label'), html:"URL"}]}
93 ]}, 91 ]},
94 {tag:'tr', children:[ 92 {tag:'tr', children:[
95 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Password_checkbox'), name:'Password', checked:true}]}, 93 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Password_checkbox'), name:'Password', checked:true}]},
96 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Password_label'), html:"Password"}]} 94 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Password_label'), html:"Password"}]}
97 ]}, 95 ]},
98 {tag:'tr', children:[ 96 {tag:'tr', children:[
99 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Notes_checkbox'), name:'Notes', checked:true}]}, 97 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Notes_checkbox'), name:'Notes', checked:true}]},
100 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Notes_label'), html:"Notes"}]} 98 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Notes_label'), html:"Notes"}]}
101 ]}, 99 ]},
102 {tag:'tr', children:[ 100 {tag:'tr', children:[
103 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UUID_checkbox'), name:'UUID'/*, checked:true*/}]}, 101 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('UUID_checkbox'), name:'UUID'/*, checked:true*/}]},
104 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UUID_label'), html:"UUID"}]} 102 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('UUID_label'), html:"UUID"}]}
105 ]} 103 ]}
106 ]} 104 ]}
107 ]} 105 ]}
108 ]}, 106 ]},
109 {tag:'td', width:'50%', valign:'top', children:[ 107 {tag:'td', width:'50%', valign:'top', children:[
110 {tag:'table', children:[ 108 {tag:'table', children:[
111 {tag:'tbody', children:[ 109 {tag:'tbody', children:[
112 {tag:'tr', children:[ 110 {tag:'tr', children:[
113 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Icon_checkbox'), name:'Icon'/*, checked:true*/}]}, 111 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Icon_checkbox'), name:'Icon'/*, checked:true*/}]},
114 {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Icon_label'), html:"Icon"}]} 112 {tag:'td', width:'150', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Icon_label'), html:"Icon"}]}
115 ]}, 113 ]},
116 {tag:'tr', children:[ 114 {tag:'tr', children:[
117 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Creation Time_checkbox'), name:'Creation Time'/*, checked:true*/}]}, 115 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Creation Time_checkbox'), name:'Creation Time'/*, checked:true*/}]},
118 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Creation Time_label'), html:"Creation Time"}]} 116 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Creation Time_label'), html:"Creation Time"}]}
119 ]}, 117 ]},
120 {tag:'tr', children:[ 118 {tag:'tr', children:[
121 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Access_checkbox'), name:'Last Access'/*, checked:true*/}]}, 119 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Access_checkbox'), name:'Last Access'/*, checked:true*/}]},
122 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Access_label'), html:"Last Access"}]} 120 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Access_label'), html:"Last Access"}]}
123 ]}, 121 ]},
124 {tag:'tr', children:[ 122 {tag:'tr', children:[
125 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Modification_checkbox'), name:'Last Modification'/*, checked:true*/}]}, 123 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Last Modification_checkbox'), name:'Last Modification'/*, checked:true*/}]},
126 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Modification_label'), html:"Last Modification"}]} 124 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Last Modification_label'), html:"Last Modification"}]}
127 ]}, 125 ]},
128 {tag:'tr', children:[ 126 {tag:'tr', children:[
129 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Expires_checkbox'), name:'Expires'/*, checked:true*/}]}, 127 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Expires_checkbox'), name:'Expires'/*, checked:true*/}]},
130 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Expires_label'), html:"Expires"}]} 128 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Expires_label'), html:"Expires"}]}
131 ]}, 129 ]},
132 {tag:'tr', children:[ 130 {tag:'tr', children:[
133 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment Description_checkbox'), name:'Attachment Description', checked:true}]}, 131 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment Description_checkbox'), name:'Attachment Description', checked:true}]},
134 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment Description_label'), html:"Attachment Description"}]} 132 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment Description_label'), html:"Attachment Description"}]}
135 ]}, 133 ]},
136 {tag:'tr', children:[ 134 {tag:'tr', children:[
137 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment_checkbox'), name:'Attachment', checked:true}]}, 135 {tag:'td', valign:'top', children:[{tag:'input', type:'checkbox', id:this.getId('Attachment_checkbox'), name:'Attachment', checked:true}]},
138 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment_label'), html:"Attachment"}]} 136 {tag:'td', valign:'top', children:[{tag:'span', cls:'keePassFieldLabel', id:this.getId('Attachment_label'), html:"Attachment"}]}
139 ]} 137 ]}
140 ]} 138 ]}
141 ]} 139 ]}
142 ]} 140 ]}
143 ]} 141 ]}
144 ]} 142 ]}
145 ]} 143 ]}
146 ]} 144 ]}
147 ]} 145 ]}
148 ]}, 146 ]},
149 {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[ 147 {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[
150 {tag:'div', children:[ 148 {tag:'div', children:[
151 {tag:'div', id:this.getId('previewDiv'), html:"preview"} 149 {tag:'div', id:this.getId('previewDiv'), html:"preview"}
152 ]} 150 ]}
153 ]}, 151 ]},
154 {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[ 152 {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[
155 {tag:'div', children:[ 153 {tag:'div', children:[
156 {tag:'h4', html:"done"} 154 {tag:'h4', html:"done"}
157 ]} 155 ]}
158 ]} 156 ]}
159 ]}, 157 ]},
160 {tag:'div', cls:'importOptionsButtons', children:[ 158 {tag:'div', cls:'importOptionsButtons', children:[
161 {tag:'table', children:[ 159 {tag:'table', children:[
162 {tag:'tbody', children:[ 160 {tag:'tbody', children:[
163 {tag:'tr', children:[ 161 {tag:'tr', children:[
164 {tag:'td', html:'&nbsp;'}, 162 {tag:'td', html:'&nbsp;'},
165 {tag:'td', children:[ 163 {tag:'td', children:[
166 {tag:'div', id:this.getId('backActionButton')} 164 {tag:'div', id:this.getId('backActionButton')}
167 ]}, 165 ]},
168 {tag:'td', html:'&nbsp;'}, 166 {tag:'td', html:'&nbsp;'},
169 {tag:'td', children:[ 167 {tag:'td', children:[
170 {tag:'div', id:this.getId('nextActionButton')} 168 {tag:'div', id:this.getId('nextActionButton')}
171 ]}, 169 ]},
172 {tag:'td', html:'&nbsp;'} 170 {tag:'td', html:'&nbsp;'}
173 ]} 171 ]}
174 ]} 172 ]}
175 ]} 173 ]}
176 ]} 174 ]}
177 ]}); 175 ]});
178 176
179 this.updateSteps(); 177 this.updateSteps();
180 178
181 this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this})); 179 this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this}));
182 this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this})); 180 this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this}));
183 181
184 this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show() 182 this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show()
185 this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); 183 this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
186 this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); 184 this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
187 this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); 185 this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
188//MochiKit.Logging.logDebug("<<< Import.KeePassImportComponent.render"); 186//MochiKit.Logging.logDebug("<<< Import.KeePassImportComponent.render");
189 }, 187 },
190 188
191 //------------------------------------------------------------------------- 189 //-------------------------------------------------------------------------
192 190
193 'nextAction': function() { 191 'nextAction': function() {
194 switch (this.currentStep()) { 192 switch (this.currentStep()) {
195 case 0: //-> 1 193 case 0: //-> 1
196 Clipperz.PM.Components.MessageBox.showProgressPanel( 194 Clipperz.PM.Components.MessageBox.showProgressPanel(
197 MochiKit.Base.method(this, 'deferredParseValues'), 195 MochiKit.Base.method(this, 'deferredParseValues'),
198 MochiKit.Base.method(this, 'handleParseError'), 196 MochiKit.Base.method(this, 'handleParseError'),
199 this.getDom('nextActionButton') 197 this.getDom('nextActionButton')
200 ); 198 );
201 break; 199 break;
202 case 1: //-> 2 200 case 1: //-> 2
203 this.previewValues(); 201 this.previewValues();
204 break; 202 break;
205 case 2: //-> 3 203 case 2: //-> 3
206 this.importValues(); 204 this.importValues();
207 break; 205 break;
208 } 206 }
209 }, 207 },
210 208
211 //------------------------------------------------------------------------- 209 //-------------------------------------------------------------------------
212 210
213 'deferredParseValues': function() { 211 'deferredParseValues': function() {
214 var deferredResult; 212 var deferredResult;