66 * Note : Apps > File
77 * License : GNU GPLv3 with Visual Python special exception
88 * Date : 2021. 11. 18
9- * Change Date :
9+ * Change Date : 2022. 09. 03
1010 */
1111
1212//============================================================================
@@ -39,7 +39,6 @@ define([
3939
4040this . fileExtensions = {
4141'csv' :'csv' ,
42- 'tsv' :'tsv' ,
4342'excel' :'xlsx' ,
4443'json' :'json' ,
4544'pickle' :''
@@ -73,7 +72,6 @@ define([
7372'Read' :{
7473fileTypeId :{
7574'csv' :'pd004' ,
76- 'tsv' :'pd004' ,
7775'excel' :'pd123' ,
7876'json' :'pd076' ,
7977'pickle' :'pd079'
@@ -88,7 +86,6 @@ define([
8886'Write' :{
8987fileTypeId :{
9088'csv' :'pd005' ,
91- 'tsv' :'pd005' ,
9289'excel' :'pd124' ,
9390'json' :'pd077' ,
9491'pickle' :'pd078'
@@ -150,7 +147,13 @@ define([
150147_bindEventByType ( pageType ) {
151148var that = this ;
152149var prefix = '#vp_file' + pageType + ' ' ;
150+ var fileExtensionArr = [ that . state . fileExtension ] ;
153151
152+ // add tsv dsv ssv extension to csv option
153+ if ( that . state . fileExtension === 'csv' ) {
154+ fileExtensionArr = fileExtensionArr . concat ( [ 'tsv' , 'dsv' , 'ssv' ] ) ;
155+ }
156+
154157// select file type
155158$ ( this . wrapSelector ( prefix + '#fileType' ) ) . change ( function ( ) {
156159var value = $ ( this ) . val ( ) ;
@@ -160,18 +163,18 @@ define([
160163that . renderPage ( pageType ) ;
161164that . _bindEventByType ( pageType ) ;
162165} ) ;
163-
166+
164167// open file navigation
165168$ ( this . wrapSelector ( prefix + '#vp_openFileNavigationBtn' ) ) . click ( function ( ) {
166169
167170let type = 'save' ;
168171if ( pageType == 'Read' ) {
169172type = 'open' ;
170173}
171-
174+
172175let fileNavi = new FileNavigation ( {
173176type :type ,
174- extensions :[ that . state . fileExtension ] ,
177+ extensions :fileExtensionArr ,
175178finish :function ( filesPath , status , error ) {
176179let { file, path} = filesPath [ 0 ] ;
177180that . state . selectedFile = file ;
@@ -371,7 +374,7 @@ define([
371374var sbCode = new com_String ;
372375
373376this . saveState ( ) ;
374-
377+
375378var prefix = '#vp_file' + pageType + ' ' ;
376379var userOption = new com_String ( ) ;
377380var userOptValue = $ ( this . wrapSelector ( prefix + '#userOption' ) ) . val ( ) ;
@@ -390,9 +393,6 @@ define([
390393type :'var'
391394} ) ;
392395
393- if ( $ ( "#fileType" ) . val ( ) === "tsv" ) {
394- $ ( "#delimiter" ) . val ( '\\' + "t" ) ;
395- }
396396
397397var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileRead' , thisPkg , userOption . toString ( ) ) ;
398398sbCode . append ( result ) ;
@@ -403,9 +403,6 @@ define([
403403type :'var'
404404} ) ;
405405
406- if ( $ ( "#fileType" ) . val ( ) === "tsv" ) {
407- $ ( "#delimiter" ) . val ( '\\' + "t" ) ;
408- }
409406
410407var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileWrite' , thisPkg , userOption . toString ( ) ) ;
411408sbCode . append ( result ) ;