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 | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js index 707a3d2..c1dd1a9 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImportComponent.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.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
32 | if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } | 29 | if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; } |
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.Components.Import.CSVImportComponent = function(anElement, args) { | 33 | Clipperz.PM.Components.Import.CSVImportComponent = function(anElement, args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | this._steps = this._steps || ['CSV_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; | 36 | this._steps = this._steps || ['CSV_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT']; |
40 | 37 | ||
41 | Clipperz.PM.Components.Import.CSVImportComponent.superclass.constructor.call(this, anElement, args); | 38 | Clipperz.PM.Components.Import.CSVImportComponent.superclass.constructor.call(this, anElement, args); |
42 | 39 | ||
43 | this._step1Component = null; | 40 | this._step1Component = null; |
44 | this._step2Component = null; | 41 | this._step2Component = null; |
45 | this._step3Component = null; | 42 | this._step3Component = null; |
46 | this._step4Component = null; | 43 | this._step4Component = null; |
47 | this._step5Component = null; | 44 | this._step5Component = null; |
48 | 45 | ||
49 | this._isFirstRowHeader = false; | 46 | this._isFirstRowHeader = false; |
50 | this._titleColumnIndex = -1; | 47 | this._titleColumnIndex = -1; |
51 | this._notesColumnIndex = -1; | 48 | this._notesColumnIndex = -1; |
52 | this._fieldSettings = {}; | 49 | this._fieldSettings = {}; |
53 | this._skippedColumns = new Clipperz.Set(); | 50 | this._skippedColumns = new Clipperz.Set(); |
54 | 51 | ||
55 | this.render(); | 52 | this.render(); |
56 | 53 | ||
57 | return this; | 54 | return this; |
58 | } | 55 | } |
59 | 56 | ||
60 | //============================================================================= | 57 | //============================================================================= |
61 | 58 | ||
62 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { | 59 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImportComponent, Clipperz.PM.Components.Import.GenericImportComponent, { |
63 | 60 | ||
64 | 'toString': function() { | 61 | 'toString': function() { |
65 | return "Clipperz.PM.Components.Import.CSVImportComponent component"; | 62 | return "Clipperz.PM.Components.Import.CSVImportComponent component"; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'render': function() { | 67 | 'render': function() { |
71 | this.domHelper().append(this.element(), {tag:'div', cls:'csvImportWizard', children:[ | 68 | this.domHelper().append(this.element(), {tag:'div', cls:'csvImportWizard', children:[ |
72 | {tag:'h3', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, | 69 | {tag:'h3', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, |
73 | {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, | 70 | {tag:'div', cls:'importSteps', id:this.getId('importSteps')}, |
74 | {tag:'div', cls:'importStepBlocks', children:[ | 71 | {tag:'div', cls:'importStepBlocks', children:[ |
75 | {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ | 72 | {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[ |
76 | {tag:'div', children:[ | 73 | {tag:'div', children:[ |
77 | {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_csv_description']}, | 74 | {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_csv_description']}, |
78 | {tag:'div', cls:'importOptionsParameters', children:[ | 75 | {tag:'div', cls:'importOptionsParameters', children:[ |
79 | {tag:'div', cls:'CSVImportOptionsParameters', children:[ | 76 | {tag:'div', cls:'CSVImportOptionsParameters', children:[ |
80 | {tag:'ul', children:[ | 77 | {tag:'ul', children:[ |
81 | {tag:'li', children:[ | 78 | {tag:'li', children:[ |
82 | {tag:'label', 'for':this.getId('CSV_inputOptions_separator'), html:"separator"}, | 79 | {tag:'label', 'for':this.getId('CSV_inputOptions_separator'), html:"separator"}, |
83 | {tag:'select', name:this.getId('CSV_inputOptions_separator'), id:this.getId('CSV_inputOptions_separator'), children:[ | 80 | {tag:'select', name:this.getId('CSV_inputOptions_separator'), id:this.getId('CSV_inputOptions_separator'), children:[ |
84 | {tag:'option', name:'comma', value:',', html:"comma (,)", selected:true}, | 81 | {tag:'option', name:'comma', value:',', html:"comma (,)", selected:true}, |
85 | {tag:'option', name:'tab', value:'\t', html:"tab"} | 82 | {tag:'option', name:'tab', value:'\t', html:"tab"} |
86 | ]} | 83 | ]} |
87 | ]}, | 84 | ]}, |
88 | 85 | ||
89 | {tag:'li', children:[ | 86 | {tag:'li', children:[ |
90 | {tag:'label', 'for':this.getId('CSV_inputOptions_quote'), html:"quote"}, | 87 | {tag:'label', 'for':this.getId('CSV_inputOptions_quote'), html:"quote"}, |
91 | {tag:'select', name:this.getId('CSV_inputOptions_quote'), id:this.getId('CSV_inputOptions_quote'), children:[ | 88 | {tag:'select', name:this.getId('CSV_inputOptions_quote'), id:this.getId('CSV_inputOptions_quote'), children:[ |
92 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, | 89 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, |
93 | {tag:'option', name:'singleQuote', value:'\'', html:"single quote (\')"} | 90 | {tag:'option', name:'singleQuote', value:'\'', html:"single quote (\')"} |
94 | ]} | 91 | ]} |
95 | ]}, | 92 | ]}, |
96 | 93 | ||
97 | {tag:'li', children:[ | 94 | {tag:'li', children:[ |
98 | {tag:'label', 'for':this.getId('CSV_inputOptions_escape'), html:"escape"}, | 95 | {tag:'label', 'for':this.getId('CSV_inputOptions_escape'), html:"escape"}, |
99 | {tag:'select', name:this.getId('CSV_inputOptions_escape'), id:this.getId('CSV_inputOptions_escape'), children:[ | 96 | {tag:'select', name:this.getId('CSV_inputOptions_escape'), id:this.getId('CSV_inputOptions_escape'), children:[ |
100 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, | 97 | {tag:'option', name:'doubleQuote', value:'\"', html:"double quote (\")", selected:true}, |
101 | {tag:'option', name:'slash', value:'\/', html:"slash (\/)"}, | 98 | {tag:'option', name:'slash', value:'\/', html:"slash (\/)"}, |
102 | {tag:'option', name:'backslash', value:'\\', html:"backslash (\\)"} | 99 | {tag:'option', name:'backslash', value:'\\', html:"backslash (\\)"} |
103 | ]} | 100 | ]} |
104 | ]} | 101 | ]} |
105 | ]} | 102 | ]} |
106 | ]} | 103 | ]} |
107 | ]}, | 104 | ]}, |
108 | this.textAreaConfig() | 105 | this.textAreaConfig() |
109 | ]} | 106 | ]} |
110 | ]}, | 107 | ]}, |
111 | {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, | 108 | {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]}, |
112 | {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, | 109 | {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]}, |
113 | {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, | 110 | {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]}, |
114 | {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, | 111 | {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]}, |
115 | {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, | 112 | {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]}, |
116 | {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ | 113 | {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[ |
117 | {tag:'div', children:[ | 114 | {tag:'div', children:[ |
118 | {tag:'div', id:this.getId('previewDiv'), html:"preview"} | 115 | {tag:'div', id:this.getId('previewDiv'), html:"preview"} |
119 | ]} | 116 | ]} |
120 | ]}, | 117 | ]}, |