Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Import/CSVImport') (more/less context) (ignore whitespace changes)
5 files changed, 50 insertions, 60 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js index 3f4952d..fef8e9e 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportColumns.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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 28 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.Components.Import.CSVImport.CSVImportColumns = function(anElement, args) { | 32 | Clipperz.PM.Components.Import.CSVImport.CSVImportColumns = function(anElement, args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportColumns.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Import.CSVImport.CSVImportColumns.superclass.constructor.call(this, anElement, args); |
38 | this._mainComponent = args.mainComponent; | 36 | this._mainComponent = args.mainComponent; |
39 | 37 | ||
40 | return this; | 38 | return this; |
41 | } | 39 | } |
42 | 40 | ||
43 | //============================================================================= | 41 | //============================================================================= |
44 | 42 | ||
45 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportColumns, Clipperz.PM.Components.BaseComponent, { | 43 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportColumns, Clipperz.PM.Components.BaseComponent, { |
46 | 44 | ||
47 | 'toString': function() { | 45 | 'toString': function() { |
48 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportColumns component"; | 46 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportColumns component"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'mainComponent': function() { | 51 | 'mainComponent': function() { |
54 | return this._mainComponent; | 52 | return this._mainComponent; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'render': function() { | 57 | 'render': function() { |
60 | var i,c; | 58 | var i,c; |
61 | var columnSelectorCheckboxCells; | 59 | var columnSelectorCheckboxCells; |
62 | var checkboxes; | 60 | var checkboxes; |
63 | var data; | 61 | var data; |
64 | 62 | ||
65 | //MochiKit.Logging.logDebug(">>> CSVImportColumns.render"); | 63 | //MochiKit.Logging.logDebug(">>> CSVImportColumns.render"); |
66 | Clipperz.NotificationCenter.unregister(this); | 64 | Clipperz.NotificationCenter.unregister(this); |
67 | MochiKit.Signal.disconnectAllTo(this); | 65 | MochiKit.Signal.disconnectAllTo(this); |
68 | 66 | ||
69 | this.element().update(""); | 67 | this.element().update(""); |
70 | 68 | ||
71 | data = this.mainComponent().parsedValues(); | 69 | data = this.mainComponent().parsedValues(); |
72 | columnSelectorCheckboxCells = []; | 70 | columnSelectorCheckboxCells = []; |
73 | 71 | ||
74 | c =data[0].length; | 72 | c =data[0].length; |
75 | for (i=0; i<c; i++) { | 73 | for (i=0; i<c; i++) { |
76 | columnSelectorCheckboxCells.push({tag:'th', valign:'top', cls:(this.mainComponent().isColumnSelected(i) ? 'selectedColumn': 'skippedColumn'), children:[ | 74 | columnSelectorCheckboxCells.push({tag:'th', valign:'top', cls:(this.mainComponent().isColumnSelected(i) ? 'selectedColumn': 'skippedColumn'), children:[ |
77 | {tag:'input', type:'checkbox', id:this.getId('columnCheckbox_' + i), value:i} | 75 | {tag:'input', type:'checkbox', id:this.getId('columnCheckbox_' + i), value:i} |
78 | ]}) | 76 | ]}) |
79 | } | 77 | } |
80 | 78 | ||
81 | this.domHelper().append(this.element(), {tag:'div', children:[ | 79 | this.domHelper().append(this.element(), {tag:'div', children:[ |
82 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Columns']}, | 80 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Columns']}, |
83 | {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ | 81 | {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ |
84 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview columns', cellspacing:'0', children:[ | 82 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview columns', cellspacing:'0', children:[ |
85 | {tag:'thead', id:this.getId('previewData_thead'), children:[ | 83 | {tag:'thead', id:this.getId('previewData_thead'), children:[ |
86 | {tag:'tr', children:columnSelectorCheckboxCells} | 84 | {tag:'tr', children:columnSelectorCheckboxCells} |
87 | ]}, | 85 | ]}, |
88 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} | 86 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} |
89 | ]} | 87 | ]} |
90 | ]} | 88 | ]} |
91 | ]}); | 89 | ]}); |
92 | 90 | ||
93 | c =data[0].length; | 91 | c =data[0].length; |
94 | for (i=0; i<c; i++) { | 92 | for (i=0; i<c; i++) { |
95 | if (this.mainComponent().isColumnSelected(i)) { | 93 | if (this.mainComponent().isColumnSelected(i)) { |
96 | this.getDom('columnCheckbox_' + i).checked = true; | 94 | this.getDom('columnCheckbox_' + i).checked = true; |
97 | } | 95 | } |
98 | } | 96 | } |
99 | 97 | ||
100 | this.renderData(this.getElement('previewData_tbody'), data); | 98 | this.renderData(this.getElement('previewData_tbody'), data); |
101 | 99 | ||
102 | checkboxes = MochiKit.DOM.getElementsByTagAndClassName('input', null, this.getDom('previewData_thead')); | 100 | checkboxes = MochiKit.DOM.getElementsByTagAndClassName('input', null, this.getDom('previewData_thead')); |
103 | c = checkboxes.length; | 101 | c = checkboxes.length; |
104 | for (i=0; i<c; i++) { | 102 | for (i=0; i<c; i++) { |
105 | MochiKit.Signal.connect(checkboxes[i], 'onclick', this, 'renderDataHandler'); | 103 | MochiKit.Signal.connect(checkboxes[i], 'onclick', this, 'renderDataHandler'); |
106 | } | 104 | } |
107 | //MochiKit.Logging.logDebug("<<< CSVImportColumns.render"); | 105 | //MochiKit.Logging.logDebug("<<< CSVImportColumns.render"); |
108 | }, | 106 | }, |
109 | 107 | ||
110 | //------------------------------------------------------------------------- | 108 | //------------------------------------------------------------------------- |
111 | 109 | ||
112 | 'renderData': function(anElement, someData) { | 110 | 'renderData': function(anElement, someData) { |
113 | var config; | 111 | var config; |
114 | var i,c; | 112 | var i,c; |
115 | 113 | ||
116 | //MochiKit.Logging.logDebug(">>> CSVImportColumns.renderData"); | 114 | //MochiKit.Logging.logDebug(">>> CSVImportColumns.renderData"); |
117 | // anElement.update(""); | 115 | // anElement.update(""); |
118 | MochiKit.DOM.replaceChildNodes(anElement.dom); | 116 | MochiKit.DOM.replaceChildNodes(anElement.dom); |
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js index f7dbd5d..e816380 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportFields.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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 28 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.Components.Import.CSVImport.CSVImportFields = function(anElement, args) { | 32 | Clipperz.PM.Components.Import.CSVImport.CSVImportFields = function(anElement, args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportFields.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Import.CSVImport.CSVImportFields.superclass.constructor.call(this, anElement, args); |
38 | this._mainComponent = args.mainComponent; | 36 | this._mainComponent = args.mainComponent; |
39 | 37 | ||
40 | return this; | 38 | return this; |
41 | } | 39 | } |
42 | 40 | ||
43 | //============================================================================= | 41 | //============================================================================= |
44 | 42 | ||
45 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportFields, Clipperz.PM.Components.BaseComponent, { | 43 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportFields, Clipperz.PM.Components.BaseComponent, { |
46 | 44 | ||
47 | 'toString': function() { | 45 | 'toString': function() { |
48 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportFields component"; | 46 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportFields component"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'mainComponent': function() { | 51 | 'mainComponent': function() { |
54 | return this._mainComponent; | 52 | return this._mainComponent; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'render': function() { | 57 | 'render': function() { |
60 | varfieldsHeaderCells; | 58 | varfieldsHeaderCells; |
61 | var titleColumnIndex; | 59 | var titleColumnIndex; |
62 | var notesColumnIndex; | 60 | var notesColumnIndex; |
63 | var i,c; | 61 | var i,c; |
64 | 62 | ||
65 | Clipperz.NotificationCenter.unregister(this); | 63 | Clipperz.NotificationCenter.unregister(this); |
66 | MochiKit.Signal.disconnectAllTo(this); | 64 | MochiKit.Signal.disconnectAllTo(this); |
67 | 65 | ||
68 | this.element().update(""); | 66 | this.element().update(""); |
69 | 67 | ||
70 | titleColumnIndex = this.mainComponent().titleColumnIndex() | 68 | titleColumnIndex = this.mainComponent().titleColumnIndex() |
71 | notesColumnIndex = this.mainComponent().notesColumnIndex() | 69 | notesColumnIndex = this.mainComponent().notesColumnIndex() |
72 | 70 | ||
73 | fieldsHeaderCells = []; | 71 | fieldsHeaderCells = []; |
74 | fieldsHeaderCells.push({tag:'td', valign:'top', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}); | 72 | fieldsHeaderCells.push({tag:'td', valign:'top', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}); |
75 | 73 | ||
76 | c =this.mainComponent().parsedValues()[0].length; | 74 | c =this.mainComponent().parsedValues()[0].length; |
77 | for (i=0; i<c; i++) { | 75 | for (i=0; i<c; i++) { |
78 | if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { | 76 | if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { |
79 | var trimmedLabel; | 77 | var trimmedLabel; |
80 | 78 | ||
81 | trimmedLabel = Clipperz.Base.trim(this.mainComponent().labelForColumn(i)); | 79 | trimmedLabel = Clipperz.Base.trim(this.mainComponent().labelForColumn(i)); |
82 | fieldsHeaderCells.push({tag:'td', valign:'top', id:this.getId('fieldHeaderTD_' + i), cls:((trimmedLabel == "") ? 'missingLabelWarning' : (this.isColumnSetup(i) ? 'configuredColumn': 'unconfiguredColumn')), children:[ | 80 | fieldsHeaderCells.push({tag:'td', valign:'top', id:this.getId('fieldHeaderTD_' + i), cls:((trimmedLabel == "") ? 'missingLabelWarning' : (this.isColumnSetup(i) ? 'configuredColumn': 'unconfiguredColumn')), children:[ |
83 | {tag:'span', html:((trimmedLabel == "") ? Clipperz.PM.Strings['CSV_ImportWizard_Fields_MissingLabelWarning'] : trimmedLabel)/*, cls:((trimmedLabel == "") ? 'missingLabelWarning' : '')*/}, | 81 | {tag:'span', html:((trimmedLabel == "") ? Clipperz.PM.Strings['CSV_ImportWizard_Fields_MissingLabelWarning'] : trimmedLabel)/*, cls:((trimmedLabel == "") ? 'missingLabelWarning' : '')*/}, |
84 | {tag:'select', id:this.getId('select_' + i), name:i, children:[ | 82 | {tag:'select', id:this.getId('select_' + i), name:i, children:[ |
85 | {tag:'option', value:'UNDEFINED', html:"select data type", cls:'disabledOption'}, | 83 | {tag:'option', value:'UNDEFINED', html:"select data type", cls:'disabledOption'}, |
86 | {tag:'option', value:'TXT', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['TXT']['shortDescription']}, | 84 | {tag:'option', value:'TXT', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['TXT']['shortDescription']}, |
87 | {tag:'option', value:'PWD', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['PWD']['shortDescription']}, | 85 | {tag:'option', value:'PWD', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['PWD']['shortDescription']}, |
88 | {tag:'option', value:'URL', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['URL']['shortDescription']}, | 86 | {tag:'option', value:'URL', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['URL']['shortDescription']}, |
89 | {tag:'option', value:'DATE', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['DATE']['shortDescription']}, | 87 | {tag:'option', value:'DATE', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['DATE']['shortDescription']}, |
90 | {tag:'option', value:'ADDR', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['ADDR']['shortDescription']} | 88 | {tag:'option', value:'ADDR', htmlString:Clipperz.PM.Strings['recordFieldTypologies']['ADDR']['shortDescription']} |
91 | ]} | 89 | ]} |
92 | ]}) | 90 | ]}) |
93 | } | 91 | } |
94 | } | 92 | } |
95 | 93 | ||
96 | if (notesColumnIndex != -1) { | 94 | if (notesColumnIndex != -1) { |
97 | fieldsHeaderCells.push({tag:'td', valign:'top', cls:'notes', html:this.mainComponent().labelForColumn(notesColumnIndex)}); | 95 | fieldsHeaderCells.push({tag:'td', valign:'top', cls:'notes', html:this.mainComponent().labelForColumn(notesColumnIndex)}); |
98 | } | 96 | } |
99 | 97 | ||
100 | this.domHelper().append(this.element(), {tag:'div', children:[ | 98 | this.domHelper().append(this.element(), {tag:'div', children:[ |
101 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Fields']}, | 99 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Fields']}, |
102 | {tag:'div', id:this.getId('dataDiv'), children:[ | 100 | {tag:'div', id:this.getId('dataDiv'), children:[ |
103 | {tag:'div', children:[ | 101 | {tag:'div', children:[ |
104 | ]}, | 102 | ]}, |
105 | {tag:'div', cls:'csvImportPreview', children:[ | 103 | {tag:'div', cls:'csvImportPreview', children:[ |
106 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ | 104 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ |
107 | {tag:'thead', id:this.getId('previewData_thead'), children:[ | 105 | {tag:'thead', id:this.getId('previewData_thead'), children:[ |
108 | {tag:'tr', cls:'CSV_previewData_header', children:fieldsHeaderCells} | 106 | {tag:'tr', cls:'CSV_previewData_header', children:fieldsHeaderCells} |
109 | ]}, | 107 | ]}, |
110 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} | 108 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} |
111 | ]} | 109 | ]} |
112 | ]} | 110 | ]} |
113 | ]} | 111 | ]} |
114 | ]}); | 112 | ]}); |
115 | 113 | ||
116 | for (i=0; i<c; i++) { | 114 | for (i=0; i<c; i++) { |
117 | if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { | 115 | if ((i != titleColumnIndex) && (i != notesColumnIndex) && (this.mainComponent().isColumnSelected(i))) { |
118 | Clipperz.DOM.selectOptionMatchingValue(this.getDom('select_' + i), this.mainComponent().typeForColumn(i)); | 116 | Clipperz.DOM.selectOptionMatchingValue(this.getDom('select_' + i), this.mainComponent().typeForColumn(i)); |
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js index 5cb8679..dbde138 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 28 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader = function(anElement, args) { | 32 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader = function(anElement, args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader.superclass.constructor.call(this, anElement, args); |
38 | this._mainComponent = args.mainComponent; | 36 | this._mainComponent = args.mainComponent; |
39 | 37 | ||
40 | this._pendingDeferredLabelFieldHandlerEvents = 0; | 38 | this._pendingDeferredLabelFieldHandlerEvents = 0; |
41 | 39 | ||
42 | return this; | 40 | return this; |
43 | } | 41 | } |
44 | 42 | ||
45 | //============================================================================= | 43 | //============================================================================= |
46 | 44 | ||
47 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportHeader, Clipperz.PM.Components.BaseComponent, { | 45 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportHeader, Clipperz.PM.Components.BaseComponent, { |
48 | 46 | ||
49 | 'toString': function() { | 47 | 'toString': function() { |
50 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportHeader component"; | 48 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportHeader component"; |
51 | }, | 49 | }, |
52 | 50 | ||
53 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
54 | 52 | ||
55 | 'mainComponent': function() { | 53 | 'mainComponent': function() { |
56 | return this._mainComponent; | 54 | return this._mainComponent; |
57 | }, | 55 | }, |
58 | 56 | ||
59 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
60 | 58 | ||
61 | 'render': function() { | 59 | 'render': function() { |
62 | var thConfigs; | 60 | var thConfigs; |
63 | var i,c; | 61 | var i,c; |
64 | 62 | ||
65 | //MochiKit.Logging.logDebug(">>> CSVImportHeader.render"); | 63 | //MochiKit.Logging.logDebug(">>> CSVImportHeader.render"); |
66 | Clipperz.NotificationCenter.unregister(this); | 64 | Clipperz.NotificationCenter.unregister(this); |
67 | MochiKit.Signal.disconnectAllTo(this); | 65 | MochiKit.Signal.disconnectAllTo(this); |
68 | 66 | ||
69 | thConfigs = []; | 67 | thConfigs = []; |
70 | c = this.mainComponent().parsedValues()[0].length; | 68 | c = this.mainComponent().parsedValues()[0].length; |
71 | for (i=0; i<c; i++) { | 69 | for (i=0; i<c; i++) { |
72 | if (this.mainComponent().isColumnSelected(i)) { | 70 | if (this.mainComponent().isColumnSelected(i)) { |
73 | // thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:this.mainComponent().labelForColumn(i)}]}); | 71 | // thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:this.mainComponent().labelForColumn(i)}]}); |
74 | thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:""}]}); | 72 | thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:""}]}); |
75 | } | 73 | } |
76 | } | 74 | } |
77 | 75 | ||
78 | this.element().update(""); | 76 | this.element().update(""); |
79 | this.domHelper().append(this.element(), {tag:'div', children:[ | 77 | this.domHelper().append(this.element(), {tag:'div', children:[ |
80 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header']}, | 78 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header']}, |
81 | {tag:'div', cls:'importStepParameters', children:[ | 79 | {tag:'div', cls:'importStepParameters', children:[ |
82 | {tag:'input', type:'checkbox', name:'isFistRowHeader', id:this.getId('isFirstRowHeader_checkbox')}, | 80 | {tag:'input', type:'checkbox', name:'isFistRowHeader', id:this.getId('isFirstRowHeader_checkbox')}, |
83 | {tag:'span', id:this.getId('isFirstRowHeader_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header_Settings_firstRowHeaderLabel']} | 81 | {tag:'span', id:this.getId('isFirstRowHeader_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header_Settings_firstRowHeaderLabel']} |
84 | ]}, | 82 | ]}, |
85 | {tag:'div', id:this.getId('dataDiv'), children:[ | 83 | {tag:'div', id:this.getId('dataDiv'), children:[ |
86 | {tag:'div', cls:'csvImportPreview', children:[ | 84 | {tag:'div', cls:'csvImportPreview', children:[ |
87 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview header', cellspacing:'0', children:[ | 85 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview header', cellspacing:'0', children:[ |
88 | {tag:'thead', children:[{tag:'tr', children:thConfigs}]}, | 86 | {tag:'thead', children:[{tag:'tr', children:thConfigs}]}, |
89 | {tag:'tbody', id:this.getId('previewData_tbody')} | 87 | {tag:'tbody', id:this.getId('previewData_tbody')} |
90 | ]} | 88 | ]} |
91 | ]} | 89 | ]} |
92 | ]} | 90 | ]} |
93 | ]}); | 91 | ]}); |
94 | 92 | ||
95 | for (i=0; i<c; i++) { | 93 | for (i=0; i<c; i++) { |
96 | if (this.mainComponent().isColumnSelected(i)) { | 94 | if (this.mainComponent().isColumnSelected(i)) { |
97 | this.getElement('headerTextField_' + i).dom.value = this.mainComponent().labelForColumn(i); | 95 | this.getElement('headerTextField_' + i).dom.value = this.mainComponent().labelForColumn(i); |
98 | } | 96 | } |
99 | } | 97 | } |
100 | 98 | ||
101 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); | 99 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); |
102 | 100 | ||
103 | if (this.mainComponent().isFirstRowHeader()) { | 101 | if (this.mainComponent().isFirstRowHeader()) { |
104 | this.getDom('isFirstRowHeader_checkbox').click(); | 102 | this.getDom('isFirstRowHeader_checkbox').click(); |
105 | } | 103 | } |
106 | 104 | ||
107 | c = this.mainComponent().parsedValues()[0].length; | 105 | c = this.mainComponent().parsedValues()[0].length; |
108 | for (i=0; i<c; i++) { | 106 | for (i=0; i<c; i++) { |
109 | if (this.mainComponent().isColumnSelected(i)) { | 107 | if (this.mainComponent().isColumnSelected(i)) { |
110 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onchange', MochiKit.Base.partial(MochiKit.Base.method(this, 'labelFieldHandler'), i)); | 108 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onchange', MochiKit.Base.partial(MochiKit.Base.method(this, 'labelFieldHandler'), i)); |
111 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onkeypress', MochiKit.Base.partial(MochiKit.Base.method(this, 'deferredLabelFieldHandler'), i)); | 109 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onkeypress', MochiKit.Base.partial(MochiKit.Base.method(this, 'deferredLabelFieldHandler'), i)); |
112 | } | 110 | } |
113 | } | 111 | } |
114 | 112 | ||
115 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_checkbox'), 'onclick', this, 'toggleFirstRowHeaderCheckboxHandler'); | 113 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_checkbox'), 'onclick', this, 'toggleFirstRowHeaderCheckboxHandler'); |
116 | if (Clipperz_IEisBroken != true) { | 114 | if (Clipperz_IEisBroken != true) { |
117 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_span'), 'onclick', this.getDom('isFirstRowHeader_checkbox'), 'click'); | 115 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_span'), 'onclick', this.getDom('isFirstRowHeader_checkbox'), 'click'); |
118 | } | 116 | } |
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js index 6344e06..ccfdeca 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportNotes.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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 28 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.Components.Import.CSVImport.CSVImportNotes = function(anElement, args) { | 32 | Clipperz.PM.Components.Import.CSVImport.CSVImportNotes = function(anElement, args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportNotes.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Import.CSVImport.CSVImportNotes.superclass.constructor.call(this, anElement, args); |
38 | this._mainComponent = args.mainComponent; | 36 | this._mainComponent = args.mainComponent; |
39 | 37 | ||
40 | return this; | 38 | return this; |
41 | } | 39 | } |
42 | 40 | ||
43 | //============================================================================= | 41 | //============================================================================= |
44 | 42 | ||
45 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportNotes, Clipperz.PM.Components.BaseComponent, { | 43 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportNotes, Clipperz.PM.Components.BaseComponent, { |
46 | 44 | ||
47 | 'toString': function() { | 45 | 'toString': function() { |
48 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportNotes component"; | 46 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportNotes component"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'mainComponent': function() { | 51 | 'mainComponent': function() { |
54 | return this._mainComponent; | 52 | return this._mainComponent; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'render': function() { | 57 | 'render': function() { |
60 | varnotesSelectorCheckboxCells; | 58 | varnotesSelectorCheckboxCells; |
61 | var totalNumberOfColumns; | 59 | var totalNumberOfColumns; |
62 | var titleColumnIndex; | 60 | var titleColumnIndex; |
63 | var notesColumnIndex; | 61 | var notesColumnIndex; |
64 | var i,c; | 62 | var i,c; |
65 | 63 | ||
66 | Clipperz.NotificationCenter.unregister(this); | 64 | Clipperz.NotificationCenter.unregister(this); |
67 | MochiKit.Signal.disconnectAllTo(this); | 65 | MochiKit.Signal.disconnectAllTo(this); |
68 | 66 | ||
69 | this.element().update(""); | 67 | this.element().update(""); |
70 | 68 | ||
71 | titleColumnIndex = this.mainComponent().titleColumnIndex() | 69 | titleColumnIndex = this.mainComponent().titleColumnIndex() |
72 | notesColumnIndex = this.mainComponent().notesColumnIndex() | 70 | notesColumnIndex = this.mainComponent().notesColumnIndex() |
73 | 71 | ||
74 | totalNumberOfColumns = this.mainComponent().parsedValues()[0].length; | 72 | totalNumberOfColumns = this.mainComponent().parsedValues()[0].length; |
75 | 73 | ||
76 | notesSelectorCheckboxCells = [{tag:'th', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}]; | 74 | notesSelectorCheckboxCells = [{tag:'th', cls:'title', html:this.mainComponent().labelForColumn(titleColumnIndex)}]; |
77 | c =totalNumberOfColumns; | 75 | c =totalNumberOfColumns; |
78 | for (i=0; i<c; i++) { | 76 | for (i=0; i<c; i++) { |
79 | if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { | 77 | if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { |
80 | notesSelectorCheckboxCells.push({tag:'th', id:this.getId('th_' + i), valign:'top', children:[ | 78 | notesSelectorCheckboxCells.push({tag:'th', id:this.getId('th_' + i), valign:'top', children:[ |
81 | {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportNotesColumn', value:i}, | 79 | {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportNotesColumn', value:i}, |
82 | {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} | 80 | {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} |
83 | ]}) | 81 | ]}) |
84 | } | 82 | } |
85 | } | 83 | } |
86 | 84 | ||
87 | this.domHelper().append(this.element(), {tag:'div', children:[ | 85 | this.domHelper().append(this.element(), {tag:'div', children:[ |
88 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes']}, | 86 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes']}, |
89 | {tag:'div', id:this.getId('dataDiv'), children:[ | 87 | {tag:'div', id:this.getId('dataDiv'), children:[ |
90 | {tag:'div', cls:'importStepParameters', children:[ | 88 | {tag:'div', cls:'importStepParameters', children:[ |
91 | {tag:'input', id:this.getId('doNotSetNotes_radio'), type:'radio', name:'CSVImportNotesColumn', value:-1}, | 89 | {tag:'input', id:this.getId('doNotSetNotes_radio'), type:'radio', name:'CSVImportNotesColumn', value:-1}, |
92 | {tag:'span', id:this.getId('doNotSetNotes_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes_Settings_noSelectionLabel']} | 90 | {tag:'span', id:this.getId('doNotSetNotes_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Notes_Settings_noSelectionLabel']} |
93 | ]}, | 91 | ]}, |
94 | {tag:'div', cls:'csvImportPreview', children:[ | 92 | {tag:'div', cls:'csvImportPreview', children:[ |
95 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ | 93 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ |
96 | {tag:'thead', id:this.getId('previewData_thead'), children:[ | 94 | {tag:'thead', id:this.getId('previewData_thead'), children:[ |
97 | {tag:'tr', children:notesSelectorCheckboxCells} | 95 | {tag:'tr', children:notesSelectorCheckboxCells} |
98 | ]}, | 96 | ]}, |
99 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} | 97 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} |
100 | ]} | 98 | ]} |
101 | ]} | 99 | ]} |
102 | ]} | 100 | ]} |
103 | ]}); | 101 | ]}); |
104 | 102 | ||
105 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); | 103 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); |
106 | 104 | ||
107 | if ((notesColumnIndex >= totalNumberOfColumns) || (notesColumnIndex == titleColumnIndex) || !(this.mainComponent().isColumnSelected(notesColumnIndex))) { | 105 | if ((notesColumnIndex >= totalNumberOfColumns) || (notesColumnIndex == titleColumnIndex) || !(this.mainComponent().isColumnSelected(notesColumnIndex))) { |
108 | this.mainComponent().setNotesColumnIndex(-1); | 106 | this.mainComponent().setNotesColumnIndex(-1); |
109 | notesColumnIndex = -1; | 107 | notesColumnIndex = -1; |
110 | } | 108 | } |
111 | 109 | ||
112 | c =totalNumberOfColumns; | 110 | c =totalNumberOfColumns; |
113 | for (i=0; i<c; i++) { | 111 | for (i=0; i<c; i++) { |
114 | if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { | 112 | if ((i != titleColumnIndex) && (this.mainComponent().isColumnSelected(i))) { |
115 | MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); | 113 | MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); |
116 | if (Clipperz_IEisBroken != true) { | 114 | if (Clipperz_IEisBroken != true) { |
117 | MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); | 115 | MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); |
118 | } | 116 | } |
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js index aa57580..4b2149a 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportTitle.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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 28 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.Components.Import.CSVImport.CSVImportTitle = function(anElement, args) { | 32 | Clipperz.PM.Components.Import.CSVImport.CSVImportTitle = function(anElement, args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportTitle.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Import.CSVImport.CSVImportTitle.superclass.constructor.call(this, anElement, args); |
38 | this._mainComponent = args.mainComponent; | 36 | this._mainComponent = args.mainComponent; |
39 | 37 | ||
40 | return this; | 38 | return this; |
41 | } | 39 | } |
42 | 40 | ||
43 | //============================================================================= | 41 | //============================================================================= |
44 | 42 | ||
45 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportTitle, Clipperz.PM.Components.BaseComponent, { | 43 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportTitle, Clipperz.PM.Components.BaseComponent, { |
46 | 44 | ||
47 | 'toString': function() { | 45 | 'toString': function() { |
48 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportTitle component"; | 46 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportTitle component"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'mainComponent': function() { | 51 | 'mainComponent': function() { |
54 | return this._mainComponent; | 52 | return this._mainComponent; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'render': function() { | 57 | 'render': function() { |
60 | vartitleSelectorCheckboxCells; | 58 | vartitleSelectorCheckboxCells; |
61 | var titleColumnIndex; | 59 | var titleColumnIndex; |
62 | var i,c; | 60 | var i,c; |
63 | 61 | ||
64 | Clipperz.NotificationCenter.unregister(this); | 62 | Clipperz.NotificationCenter.unregister(this); |
65 | MochiKit.Signal.disconnectAllTo(this); | 63 | MochiKit.Signal.disconnectAllTo(this); |
66 | 64 | ||
67 | this.element().update(""); | 65 | this.element().update(""); |
68 | 66 | ||
69 | titleColumnIndex = this.mainComponent().titleColumnIndex() | 67 | titleColumnIndex = this.mainComponent().titleColumnIndex() |
70 | titleSelectorCheckboxCells = []; | 68 | titleSelectorCheckboxCells = []; |
71 | c =this.mainComponent().parsedValues()[0].length; | 69 | c =this.mainComponent().parsedValues()[0].length; |
72 | for (i=0; i<c; i++) { | 70 | for (i=0; i<c; i++) { |
73 | if (this.mainComponent().isColumnSelected(i)) { | 71 | if (this.mainComponent().isColumnSelected(i)) { |
74 | titleSelectorCheckboxCells.push({tag:'th', valign:'top', id:this.getId('th_' + i), children:[ | 72 | titleSelectorCheckboxCells.push({tag:'th', valign:'top', id:this.getId('th_' + i), children:[ |
75 | {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportTitleColumn', value:i}, | 73 | {tag:'input', type:'radio', id:this.getId('radio_' + i), name:'CSVImportTitleColumn', value:i}, |
76 | {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} | 74 | {tag:'span', cls:'clickableSpan', id:this.getId('columnLabel_' + i), html:this.mainComponent().labelForColumn(i)} |
77 | ]}) | 75 | ]}) |
78 | } | 76 | } |
79 | } | 77 | } |
80 | 78 | ||
81 | if (titleColumnIndex >= titleSelectorCheckboxCells.length) { | 79 | if (titleColumnIndex >= titleSelectorCheckboxCells.length) { |
82 | this.mainComponent().setTitleColumnIndex(-1); | 80 | this.mainComponent().setTitleColumnIndex(-1); |
83 | } | 81 | } |
84 | 82 | ||
85 | this.domHelper().append(this.element(), {tag:'div', children:[ | 83 | this.domHelper().append(this.element(), {tag:'div', children:[ |
86 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, | 84 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Title']}, |
87 | {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ | 85 | {tag:'div', id:this.getId('dataDiv'), cls:'csvImportPreview', children:[ |
88 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ | 86 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview', cellspacing:'0', children:[ |
89 | {tag:'thead', id:this.getId('previewData_thead'), children:[ | 87 | {tag:'thead', id:this.getId('previewData_thead'), children:[ |
90 | {tag:'tr', children:titleSelectorCheckboxCells} | 88 | {tag:'tr', children:titleSelectorCheckboxCells} |
91 | ]}, | 89 | ]}, |
92 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} | 90 | {tag:'tbody', id:this.getId('previewData_tbody'), children:[]} |
93 | ]} | 91 | ]} |
94 | ]} | 92 | ]} |
95 | ]}); | 93 | ]}); |
96 | 94 | ||
97 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); | 95 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); |
98 | 96 | ||
99 | c =this.mainComponent().parsedValues()[0].length; | 97 | c =this.mainComponent().parsedValues()[0].length; |
100 | for (i=0; i<c; i++) { | 98 | for (i=0; i<c; i++) { |
101 | if (this.mainComponent().isColumnSelected(i)) { | 99 | if (this.mainComponent().isColumnSelected(i)) { |
102 | MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); | 100 | MochiKit.Signal.connect(this.getDom('radio_' + i), 'onclick', this, 'renderDataHandler'); |
103 | if (Clipperz_IEisBroken != true) { | 101 | if (Clipperz_IEisBroken != true) { |
104 | MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); | 102 | MochiKit.Signal.connect(this.getDom('columnLabel_' + i), 'onclick', this.getDom('radio_' + i), 'click'); |
105 | } | 103 | } |
106 | } | 104 | } |
107 | } | 105 | } |
108 | 106 | ||
109 | if (titleColumnIndex != -1) { | 107 | if (titleColumnIndex != -1) { |
110 | this.getDom('radio_' + titleColumnIndex).click(); | 108 | this.getDom('radio_' + titleColumnIndex).click(); |
111 | } else { | 109 | } else { |
112 | this.mainComponent().nextButton().disable(); | 110 | this.mainComponent().nextButton().disable(); |
113 | } | 111 | } |
114 | 112 | ||
115 | }, | 113 | }, |
116 | 114 | ||
117 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
118 | 116 | ||