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//============================================================================
@@ -147,7 +147,13 @@ define([
147147_bindEventByType ( pageType ) {
148148var that = this ;
149149var 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+
151157// select file type
152158$ ( this . wrapSelector ( prefix + '#fileType' ) ) . change ( function ( ) {
153159var value = $ ( this ) . val ( ) ;
@@ -157,18 +163,18 @@ define([
157163that . renderPage ( pageType ) ;
158164that . _bindEventByType ( pageType ) ;
159165} ) ;
160-
166+
161167// open file navigation
162168$ ( this . wrapSelector ( prefix + '#vp_openFileNavigationBtn' ) ) . click ( function ( ) {
163169
164170let type = 'save' ;
165171if ( pageType == 'Read' ) {
166172type = 'open' ;
167173}
168-
174+
169175let fileNavi = new FileNavigation ( {
170176type :type ,
171- extensions :[ that . state . fileExtension ] ,
177+ extensions :fileExtensionArr ,
172178finish :function ( filesPath , status , error ) {
173179let { file, path} = filesPath [ 0 ] ;
174180that . state . selectedFile = file ;
@@ -244,7 +250,7 @@ define([
244250renderPage ( pageType ) {
245251var that = this ;
246252var prefix = '#vp_file' + pageType + ' ' ;
247-
253+
248254// clear
249255$ ( this . wrapSelector ( prefix + '#vp_inputOutputBox table tbody' ) ) . html ( '' ) ;
250256$ ( this . wrapSelector ( prefix + '#vp_optionBox table tbody' ) ) . html ( '' ) ;
@@ -368,7 +374,7 @@ define([
368374var sbCode = new com_String ;
369375
370376this . saveState ( ) ;
371-
377+
372378var prefix = '#vp_file' + pageType + ' ' ;
373379var userOption = new com_String ( ) ;
374380var userOptValue = $ ( this . wrapSelector ( prefix + '#userOption' ) ) . val ( ) ;
@@ -386,6 +392,8 @@ define([
386392name :'fileType' ,
387393type :'var'
388394} ) ;
395+
396+
389397var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileRead' , thisPkg , userOption . toString ( ) ) ;
390398sbCode . append ( result ) ;
391399} else if ( pageType == 'Write' ) {
@@ -394,6 +402,8 @@ define([
394402name :'fileType' ,
395403type :'var'
396404} ) ;
405+
406+
397407var result = pdGen . vp_codeGenerator ( this . uuid + ' #vp_fileWrite' , thisPkg , userOption . toString ( ) ) ;
398408sbCode . append ( result ) ;
399409}