6
6
* Note : Apps > File
7
7
* License : GNU GPLv3 with Visual Python special exception
8
8
* Date : 2021. 11. 18
9
- * Change Date :
9
+ * Change Date : 2022. 09. 03
10
10
*/
11
11
12
12
//============================================================================
@@ -147,7 +147,13 @@ define([
147
147
_bindEventByType ( pageType ) {
148
148
var that = this ;
149
149
var prefix = '#vp_file' + pageType + ' ' ;
150
-
150
+ var fileExtensionArr = [ that . state . fileExtension ] ;
151
+
152
+ // add tsv dsv ssv extension to csv option
153
+ if ( that . state . fileExtension === 'csv' ) {
154
+ fileExtensionArr = fileExtensionArr . concat ( [ 'tsv' , 'dsv' , 'ssv' ] ) ;
155
+ }
156
+
151
157
// select file type
152
158
$ ( this . wrapSelector ( prefix + '#fileType' ) ) . change ( function ( ) {
153
159
var value = $ ( this ) . val ( ) ;
@@ -157,18 +163,18 @@ define([
157
163
that . renderPage ( pageType ) ;
158
164
that . _bindEventByType ( pageType ) ;
159
165
} ) ;
160
-
166
+
161
167
// open file navigation
162
168
$ ( this . wrapSelector ( prefix + '#vp_openFileNavigationBtn' ) ) . click ( function ( ) {
163
169
164
170
let type = 'save' ;
165
171
if ( pageType == 'Read' ) {
166
172
type = 'open' ;
167
173
}
168
-
174
+
169
175
let fileNavi = new FileNavigation ( {
170
176
type : type ,
171
- extensions : [ that . state . fileExtension ] ,
177
+ extensions : fileExtensionArr ,
172
178
finish : function ( filesPath , status , error ) {
173
179
let { file, path} = filesPath [ 0 ] ;
174
180
that . state . selectedFile = file ;
@@ -244,7 +250,7 @@ define([
244
250
renderPage ( pageType ) {
245
251
var that = this ;
246
252
var prefix = '#vp_file' + pageType + ' ' ;
247
-
253
+
248
254
// clear
249
255
$ ( this . wrapSelector ( prefix + '#vp_inputOutputBox table tbody' ) ) . html ( '' ) ;
250
256
$ ( this . wrapSelector ( prefix + '#vp_optionBox table tbody' ) ) . html ( '' ) ;
@@ -368,7 +374,7 @@ define([
368
374
var sbCode = new com_String ;
369
375
370
376
this . saveState ( ) ;
371
-
377
+
372
378
var prefix = '#vp_file' + pageType + ' ' ;
373
379
var userOption = new com_String ( ) ;
374
380
var userOptValue = $ ( this . wrapSelector ( prefix + '#userOption' ) ) . val ( ) ;
@@ -386,6 +392,8 @@ define([
386
392
name : 'fileType' ,
387
393
type : 'var'
388
394
} ) ;
395
+
396
+
389
397
var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileRead' , thisPkg , userOption . toString ( ) ) ;
390
398
sbCode . append ( result ) ;
391
399
} else if ( pageType == 'Write' ) {
@@ -394,6 +402,8 @@ define([
394
402
name : 'fileType' ,
395
403
type : 'var'
396
404
} ) ;
405
+
406
+
397
407
var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileWrite' , thisPkg , userOption . toString ( ) ) ;
398
408
sbCode . append ( result ) ;
399
409
}
0 commit comments