author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2011-10-06 00:36:10 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2011-10-06 00:36:10 (UTC) |
commit | 6ba274c79e60e417132b260bd0117c5a68121387 (patch) (unidiff) | |
tree | 57c1f95d0fbf9b80312c5c6b6f4a4f951e31c770 /frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js | |
parent | 13ebf1b1987a1566d081ff1ba89b4dca197b7d2e (diff) | |
download | clipperz-6ba274c79e60e417132b260bd0117c5a68121387.zip clipperz-6ba274c79e60e417132b260bd0117c5a68121387.tar.gz clipperz-6ba274c79e60e417132b260bd0117c5a68121387.tar.bz2 |
Fixed the copyright headers
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js | 15 |
1 files changed, 6 insertions, 9 deletions
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 ebd243a..5cb8679 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js +++ b/frontend/beta/js/Clipperz/PM/Components/Import/CSVImport/CSVImportHeader.js | |||
@@ -1,152 +1,149 @@ | |||
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 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } | 30 | if (typeof(Clipperz.PM.Components.Import.CSVImport) == 'undefined') { Clipperz.PM.Components.Import.CSVImport = {}; } |
34 | 31 | ||
35 | //############################################################################# | 32 | //############################################################################# |
36 | 33 | ||
37 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader = function(anElement, args) { | 34 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader = function(anElement, args) { |
38 | args = args || {}; | 35 | args = args || {}; |
39 | 36 | ||
40 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader.superclass.constructor.call(this, anElement, args); | 37 | Clipperz.PM.Components.Import.CSVImport.CSVImportHeader.superclass.constructor.call(this, anElement, args); |
41 | this._mainComponent = args.mainComponent; | 38 | this._mainComponent = args.mainComponent; |
42 | 39 | ||
43 | this._pendingDeferredLabelFieldHandlerEvents = 0; | 40 | this._pendingDeferredLabelFieldHandlerEvents = 0; |
44 | 41 | ||
45 | return this; | 42 | return this; |
46 | } | 43 | } |
47 | 44 | ||
48 | //============================================================================= | 45 | //============================================================================= |
49 | 46 | ||
50 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportHeader, Clipperz.PM.Components.BaseComponent, { | 47 | YAHOO.extendX(Clipperz.PM.Components.Import.CSVImport.CSVImportHeader, Clipperz.PM.Components.BaseComponent, { |
51 | 48 | ||
52 | 'toString': function() { | 49 | 'toString': function() { |
53 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportHeader component"; | 50 | return "Clipperz.PM.Components.Import.CSVImport.CSVImportHeader component"; |
54 | }, | 51 | }, |
55 | 52 | ||
56 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
57 | 54 | ||
58 | 'mainComponent': function() { | 55 | 'mainComponent': function() { |
59 | return this._mainComponent; | 56 | return this._mainComponent; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'render': function() { | 61 | 'render': function() { |
65 | var thConfigs; | 62 | var thConfigs; |
66 | var i,c; | 63 | var i,c; |
67 | 64 | ||
68 | //MochiKit.Logging.logDebug(">>> CSVImportHeader.render"); | 65 | //MochiKit.Logging.logDebug(">>> CSVImportHeader.render"); |
69 | Clipperz.NotificationCenter.unregister(this); | 66 | Clipperz.NotificationCenter.unregister(this); |
70 | MochiKit.Signal.disconnectAllTo(this); | 67 | MochiKit.Signal.disconnectAllTo(this); |
71 | 68 | ||
72 | thConfigs = []; | 69 | thConfigs = []; |
73 | c = this.mainComponent().parsedValues()[0].length; | 70 | c = this.mainComponent().parsedValues()[0].length; |
74 | for (i=0; i<c; i++) { | 71 | for (i=0; i<c; i++) { |
75 | if (this.mainComponent().isColumnSelected(i)) { | 72 | if (this.mainComponent().isColumnSelected(i)) { |
76 | // thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:this.mainComponent().labelForColumn(i)}]}); | 73 | // thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:this.mainComponent().labelForColumn(i)}]}); |
77 | thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:""}]}); | 74 | thConfigs.push({tag:'th', children:[{tag:'input', type:'text', id:this.getId('headerTextField_' + i), value:""}]}); |
78 | } | 75 | } |
79 | } | 76 | } |
80 | 77 | ||
81 | this.element().update(""); | 78 | this.element().update(""); |
82 | this.domHelper().append(this.element(), {tag:'div', children:[ | 79 | this.domHelper().append(this.element(), {tag:'div', children:[ |
83 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header']}, | 80 | {tag:'div', cls:'importStepDescription', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header']}, |
84 | {tag:'div', cls:'importStepParameters', children:[ | 81 | {tag:'div', cls:'importStepParameters', children:[ |
85 | {tag:'input', type:'checkbox', name:'isFistRowHeader', id:this.getId('isFirstRowHeader_checkbox')}, | 82 | {tag:'input', type:'checkbox', name:'isFistRowHeader', id:this.getId('isFirstRowHeader_checkbox')}, |
86 | {tag:'span', id:this.getId('isFirstRowHeader_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header_Settings_firstRowHeaderLabel']} | 83 | {tag:'span', id:this.getId('isFirstRowHeader_span'), cls:'clickableSpan', htmlString:Clipperz.PM.Strings['CSV_ImportWizard_Header_Settings_firstRowHeaderLabel']} |
87 | ]}, | 84 | ]}, |
88 | {tag:'div', id:this.getId('dataDiv'), children:[ | 85 | {tag:'div', id:this.getId('dataDiv'), children:[ |
89 | {tag:'div', cls:'csvImportPreview', children:[ | 86 | {tag:'div', cls:'csvImportPreview', children:[ |
90 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview header', cellspacing:'0', children:[ | 87 | {tag:'table', id:this.getId('previewDada'), cls:'csvImportPreview header', cellspacing:'0', children:[ |
91 | {tag:'thead', children:[{tag:'tr', children:thConfigs}]}, | 88 | {tag:'thead', children:[{tag:'tr', children:thConfigs}]}, |
92 | {tag:'tbody', id:this.getId('previewData_tbody')} | 89 | {tag:'tbody', id:this.getId('previewData_tbody')} |
93 | ]} | 90 | ]} |
94 | ]} | 91 | ]} |
95 | ]} | 92 | ]} |
96 | ]}); | 93 | ]}); |
97 | 94 | ||
98 | for (i=0; i<c; i++) { | 95 | for (i=0; i<c; i++) { |
99 | if (this.mainComponent().isColumnSelected(i)) { | 96 | if (this.mainComponent().isColumnSelected(i)) { |
100 | this.getElement('headerTextField_' + i).dom.value = this.mainComponent().labelForColumn(i); | 97 | this.getElement('headerTextField_' + i).dom.value = this.mainComponent().labelForColumn(i); |
101 | } | 98 | } |
102 | } | 99 | } |
103 | 100 | ||
104 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); | 101 | this.renderData(this.getElement('previewData_tbody'), this.mainComponent().parsedValues()); |
105 | 102 | ||
106 | if (this.mainComponent().isFirstRowHeader()) { | 103 | if (this.mainComponent().isFirstRowHeader()) { |
107 | this.getDom('isFirstRowHeader_checkbox').click(); | 104 | this.getDom('isFirstRowHeader_checkbox').click(); |
108 | } | 105 | } |
109 | 106 | ||
110 | c = this.mainComponent().parsedValues()[0].length; | 107 | c = this.mainComponent().parsedValues()[0].length; |
111 | for (i=0; i<c; i++) { | 108 | for (i=0; i<c; i++) { |
112 | if (this.mainComponent().isColumnSelected(i)) { | 109 | if (this.mainComponent().isColumnSelected(i)) { |
113 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onchange', MochiKit.Base.partial(MochiKit.Base.method(this, 'labelFieldHandler'), i)); | 110 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onchange', MochiKit.Base.partial(MochiKit.Base.method(this, 'labelFieldHandler'), i)); |
114 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onkeypress', MochiKit.Base.partial(MochiKit.Base.method(this, 'deferredLabelFieldHandler'), i)); | 111 | MochiKit.Signal.connect(this.getDom('headerTextField_' + i), 'onkeypress', MochiKit.Base.partial(MochiKit.Base.method(this, 'deferredLabelFieldHandler'), i)); |
115 | } | 112 | } |
116 | } | 113 | } |
117 | 114 | ||
118 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_checkbox'), 'onclick', this, 'toggleFirstRowHeaderCheckboxHandler'); | 115 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_checkbox'), 'onclick', this, 'toggleFirstRowHeaderCheckboxHandler'); |
119 | if (Clipperz_IEisBroken != true) { | 116 | if (Clipperz_IEisBroken != true) { |
120 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_span'), 'onclick', this.getDom('isFirstRowHeader_checkbox'), 'click'); | 117 | MochiKit.Signal.connect(this.getDom('isFirstRowHeader_span'), 'onclick', this.getDom('isFirstRowHeader_checkbox'), 'click'); |
121 | } | 118 | } |
122 | //MochiKit.Logging.logDebug("<<< CSVImportHeader.render"); | 119 | //MochiKit.Logging.logDebug("<<< CSVImportHeader.render"); |
123 | }, | 120 | }, |
124 | 121 | ||
125 | //------------------------------------------------------------------------- | 122 | //------------------------------------------------------------------------- |
126 | 123 | ||
127 | 'renderData': function(anElement, someData) { | 124 | 'renderData': function(anElement, someData) { |
128 | var trConfigs; | 125 | var trConfigs; |
129 | var data; | 126 | var data; |
130 | var i,c; | 127 | var i,c; |
131 | 128 | ||
132 | // anElement.update(""); | 129 | // anElement.update(""); |
133 | MochiKit.DOM.replaceChildNodes(anElement.dom); | 130 | MochiKit.DOM.replaceChildNodes(anElement.dom); |
134 | 131 | ||
135 | if (this.mainComponent().isFirstRowHeader()) { | 132 | if (this.mainComponent().isFirstRowHeader()) { |
136 | data = someData.slice(1); | 133 | data = someData.slice(1); |
137 | } else { | 134 | } else { |
138 | data = someData; | 135 | data = someData; |
139 | } | 136 | } |
140 | 137 | ||
141 | trConfigs = MochiKit.Base.map(MochiKit.Base.bind(function(aRowData) { | 138 | trConfigs = MochiKit.Base.map(MochiKit.Base.bind(function(aRowData) { |
142 | var result; | 139 | var result; |
143 | var i,c; | 140 | var i,c; |
144 | 141 | ||
145 | result = {tag:'tr', children:[]}; | 142 | result = {tag:'tr', children:[]}; |
146 | c = aRowData.length; | 143 | c = aRowData.length; |
147 | for (i=0; i<c; i++) { | 144 | for (i=0; i<c; i++) { |
148 | if (this.mainComponent().isColumnSelected(i)) { | 145 | if (this.mainComponent().isColumnSelected(i)) { |
149 | result.children.push({tag:'td', valign:'top', html:(MochiKit.Base.isNotEmpty(aRowData[i]) ? aRowData[i].replace(/\n/g, '<br>') : ' ')}); | 146 | result.children.push({tag:'td', valign:'top', html:(MochiKit.Base.isNotEmpty(aRowData[i]) ? aRowData[i].replace(/\n/g, '<br>') : ' ')}); |
150 | } | 147 | } |
151 | } | 148 | } |
152 | 149 | ||