Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js index c1dd1a9..bd305c3 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer 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 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
29 | if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } | 27 | if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } |
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.Components.Import.CSVImportComponent = function(anElement, args) { | 31 | Clipperz.PM.Components.Import.CSVImportComponent = function(anElement, args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._steps = this._steps || ['CSV_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; | 34 | this._steps = this._steps || ['CSV_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; |
37 | 35 | ||
38 | Clipperz.PM.Components.Import.CSVImportComponent.superclass.constructor.call(this, anElement, args); | 36 | Clipperz.PM.Components.Import.CSVImportComponent.superclass.constructor.call(this, anElement, args); |
39 | 37 | ||
40 | this._step1Component = null; | 38 | this._step1Component = null; |
41 | this._step2Component = null; | 39 | this._step2Component = null; |
42 | this._step3Component = null; | 40 | this._step3Component = null; |
43 | this._step4Component = null; | 41 | this._step4Component = null; |
44 | this._step5Component = null; | 42 | this._step5Component = null; |
45 | 43 | ||
46 | this._isFirstRowHeader = false; | 44 | this._isFirstRowHeader = false; |
47 | this._titleColumnIndex = -1; | 45 | this._titleColumnIndex = -1; |
48 | this._notesColumnIndex = -1; | 46 | this._notesColumnIndex = -1; |
49 | this._fieldSettings = {}; | 47 | this._fieldSettings = {}; |
50 | this._skippedColumns = new Clipperz.Set(); | 48 | this._skippedColumns = new Clipperz.Set(); |
51 | 49 | ||
52 | this.render(); | 50 | this.render(); |
53 | 51 | ||
54 | return this; | 52 | return this; |
55 | } | 53 | } |
56 | 54 | ||
57 | //============================================================================= | 55 | //============================================================================= |
58 | 56 | ||
59 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { | 57 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { |
60 | 58 | ||
61 | 'toString': function() { | 59 | 'toString': function() { |
62 | return "Clipperz.PM.Components.Import.CSVImportComponent component"; | 60 | return "Clipperz.PM.Components.Import.CSVImportComponent component"; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'render': function() { | 65 | 'render': function() { |
68 | this.domHelper().append(this.element(), {tag:'div', cls:'csvImportWizard', children:[ | 66 | this.domHelper().append(this.element(), {tag:'div', cls:'csvImportWizard', children:[ |
69 | {tag:'h3', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, | 67 | {tag:'h3', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, |
70 | {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, | 68 | {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, |
71 | {tag:'div', cls:'importStepBlocks', children:[ | 69 | {tag:'div', cls:'importStepBlocks', children:[ |
72 | {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ | 70 | {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ |
73 | {tag:'div', children:[ | 71 | {tag:'div', children:[ |
74 | {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_csv_description']}, | 72 | {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_csv_description']}, |
75 | {tag:'div', cls:'importOptionsParameters', children:[ | 73 | {tag:'div', cls:'importOptionsParameters', children:[ |
76 | {tag:'div', cls:'CSVImportOptionsParameters', children:[ | 74 | {tag:'div', cls:'CSVImportOptionsParameters', children:[ |
77 | {tag:'ul', children:[ | 75 | {tag:'ul', children:[ |
78 | {tag:'li', children:[ | 76 | {tag:'li', children:[ |
79 | {tag:'label', 'for':this.getId('CSV_inputOptions_separator'), html:"separator"}, | 77 | {tag:'label', 'for':this.getId('CSV_inputOptions_separator'), html:"separator"}, |
80 | {tag:'select', name:this.getId('CSV_inputOptions_separator'), id:this.getId('CSV_inputOptions_separator'), children:[ | 78 | {tag:'select', name:this.getId('CSV_inputOptions_separator'), id:this.getId('CSV_inputOptions_separator'), children:[ |
81 | {tag:'option', name:'comma', value:',', html:"comma (,)", selected:true}, | 79 | {tag:'option', name:'comma', value:',', html:"comma (,)", selected:true}, |
82 | {tag:'option', name:'tab', value:'\t', html:"tab"} | 80 | {tag:'option', name:'tab', value:'\t', html:"tab"} |
83 | ]} | 81 | ]} |
84 | ]}, | 82 | ]}, |
85 | 83 | ||
86 | {tag:'li', children:[ | 84 | {tag:'li', children:[ |
87 | {tag:'label', 'for':this.getId('CSV_inputOptions_quote'), html:"quote"}, | 85 | {tag:'label', 'for':this.getId('CSV_inputOptions_quote'), html:"quote"}, |
88 | {tag:'select', name:this.getId('CSV_inputOptions_quote'), id:this.getId('CSV_inputOptions_quote'), children:[ | 86 | {tag:'select', name:this.getId('CSV_inputOptions_quote'), id:this.getId('CSV_inputOptions_quote'), children:[ |
89 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, | 87 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, |
90 | {tag:'option', name:'singleQuote', value:'\'', html:"single quote (\')"} | 88 | {tag:'option', name:'singleQuote', value:'\'', html:"single quote (\')"} |
91 | ]} | 89 | ]} |
92 | ]}, | 90 | ]}, |
93 | 91 | ||
94 | {tag:'li', children:[ | 92 | {tag:'li', children:[ |
95 | {tag:'label', 'for':this.getId('CSV_inputOptions_escape'), html:"escape"}, | 93 | {tag:'label', 'for':this.getId('CSV_inputOptions_escape'), html:"escape"}, |
96 | {tag:'select', name:this.getId('CSV_inputOptions_escape'), id:this.getId('CSV_inputOptions_escape'), children:[ | 94 | {tag:'select', name:this.getId('CSV_inputOptions_escape'), id:this.getId('CSV_inputOptions_escape'), children:[ |
97 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, | 95 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, |
98 | {tag:'option', name:'slash', value:'\/', html:"slash (\/)"}, | 96 | {tag:'option', name:'slash', value:'\/', html:"slash (\/)"}, |
99 | {tag:'option', name:'backslash', value:'\\', html:"backslash (\\)"} | 97 | {tag:'option', name:'backslash', value:'\\', html:"backslash (\\)"} |
100 | ]} | 98 | ]} |
101 | ]} | 99 | ]} |
102 | ]} | 100 | ]} |
103 | ]} | 101 | ]} |
104 | ]}, | 102 | ]}, |
105 | this.textAreaConfig() | 103 | this.textAreaConfig() |
106 | ]} | 104 | ]} |
107 | ]}, | 105 | ]}, |
108 | {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, | 106 | {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, |
109 | {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, | 107 | {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, |
110 | {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, | 108 | {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, |
111 | {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, | 109 | {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, |
112 | {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, | 110 | {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, |
113 | {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ | 111 | {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ |
114 | {tag:'div', children:[ | 112 | {tag:'div', children:[ |
115 | {tag:'div', id:this.getId('previewDiv'), html:"preview"} | 113 | {tag:'div', id:this.getId('previewDiv'), html:"preview"} |
116 | ]} | 114 | ]} |
117 | ]}, | 115 | ]}, |
118 | {tag:'div', cls:'step_7', id:this.getId('step_7'), children:[ | 116 | {tag:'div', cls:'step_7', id:this.getId('step_7'), children:[ |