summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js') (more/less context) (show whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js134
1 files changed, 134 insertions, 0 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js b/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js
new file mode 100644
index 0000000..ecdf509
--- a/dev/null
+++ b/frontend/beta/js/Clipperz/PM/Components/Import/ExcelImportComponent.js
@@ -0,0 +1,134 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz's Javascript Crypto Library.
6Javascript Crypto Library provides web developers with an extensive
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please
11refer to http://www.clipperz.com
12
13* Javascript Crypto Library is free software: you can redistribute
14 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
16 3 of the License, or (at your option) any later version.
17
18* Javascript Crypto Library is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details.
22
23* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see
25 <http://www.gnu.org/licenses/>.
26
27*/
28
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; }
32if (typeof(Clipperz.PM.Components.Import) == 'undefined') { Clipperz.PM.Components.Import = {}; }
33
34//#############################################################################
35
36Clipperz.PM.Components.Import.ExcelImportComponent = function(anElement, args) {
37 args = args || {};
38
39 this._steps = ['EXCEL_EDIT', 'CSV_COLUMNS', 'CSV_HEADER', 'CSV_TITLE', 'CSV_NOTES', 'CSV_FIELDS', 'PREVIEW', 'IMPORT'];
40
41 Clipperz.PM.Components.Import.ExcelImportComponent.superclass.constructor.call(this, anElement, args);
42
43 return this;
44}
45
46//=============================================================================
47
48YAHOO.extendX(Clipperz.PM.Components.Import.ExcelImportComponent, Clipperz.PM.Components.Import.CSVImportComponent, {
49
50 'toString': function() {
51 return "Clipperz.PM.Components.Import.ExcelImportComponent component";
52 },
53
54 //-------------------------------------------------------------------------
55
56 'render': function() {
57//MochiKit.Logging.logDebug(">>> Import.ExcelImportComponent.render");
58 this.domHelper().append(this.element(), {tag:'div', cls:'excelImportWizard', children:[
59 {tag:'h3', htmlString:Clipperz.PM.Strings['Excel_ImportWizard_Title']},
60 {tag:'div', cls:'importSteps', id:this.getId('importSteps')},
61 {tag:'div', cls:'importStepBlocks', children:[
62 {tag:'div', cls:'step_0', id:this.getId('step_0'), children:[
63 {tag:'div', children:[
64 {tag:'div', cls:'importOptionsDescription', htmlString:Clipperz.PM.Strings['importOptions_excel_description']},
65 {tag:'div', cls:'importOptionsParameters', children:[]},
66 this.textAreaConfig()
67 ]}
68 ]},
69 {tag:'div', cls:'step_1', id:this.getId('step_1'), children:[]},
70 {tag:'div', cls:'step_2', id:this.getId('step_2'), children:[]},
71 {tag:'div', cls:'step_3', id:this.getId('step_3'), children:[]},
72 {tag:'div', cls:'step_4', id:this.getId('step_4'), children:[]},
73 {tag:'div', cls:'step_5', id:this.getId('step_5'), children:[]},
74 {tag:'div', cls:'step_6', id:this.getId('step_6'), children:[
75 {tag:'div', children:[
76 {tag:'div', id:this.getId('previewDiv'), html:"preview"}
77 ]}
78 ]},
79 {tag:'div', cls:'step_7', id:this.getId('step_7'), children:[
80 {tag:'div', children:[
81 {tag:'h4', html:"done"}
82 ]}
83 ]}
84 ]},
85 {tag:'div', cls:'importOptionsButtons', children:[
86 {tag:'table', children:[
87 {tag:'tbody', children:[
88 {tag:'tr', children:[
89 {tag:'td', html:'&nbsp;'},
90 {tag:'td', children:[
91 {tag:'div', id:this.getId('backActionButton')}
92 ]},
93 {tag:'td', html:'&nbsp;'},
94 {tag:'td', children:[
95 {tag:'div', id:this.getId('nextActionButton')}
96 ]},
97 {tag:'td', html:'&nbsp;'}
98 ]}
99 ]}
100 ]}
101 ]}
102 ]});
103
104 this.updateSteps();
105
106 this.setBackButton(new YAHOO.ext.Button(this.getDom('backActionButton'), {text:"back", handler:this.backAction, scope:this}));
107 this.setNextButton(new YAHOO.ext.Button(this.getDom('nextActionButton'), {text:"next", handler:this.nextAction, scope:this}));
108
109 this.getElement('step_0').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show()
110 this.getElement('step_1').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
111 this.getElement('step_2').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
112 this.getElement('step_3').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
113 this.getElement('step_4').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
114 this.getElement('step_5').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
115 this.getElement('step_6').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
116 this.getElement('step_7').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide();
117//MochiKit.Logging.logDebug("<<< Import.ExcelImportComponent.render");
118 },
119
120 //-------------------------------------------------------------------------
121
122 'csvProcessor': function() {
123 return new Clipperz.CSVProcessor({
124 // quoteChar: this.getDom('CSV_inputOptions_quote').value,
125 // escapeChar: this.getDom('CSV_inputOptions_escape').value,
126 separatorChar:'\t',
127 binary:true
128 });
129 },
130
131 //-------------------------------------------------------------------------
132 __syntaxFix__: "syntax fix"
133});
134