From e70c7946740b74a5292fda5bd4112015c72f503b Mon Sep 17 00:00:00 2001 From: AnuragVanam Date: Tue, 16 Mar 2021 19:55:55 -0400 Subject: [PATCH] Update gw.filebrowser.js --- .../resources/static/js/gw.filebrowser.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/js/gw.filebrowser.js b/src/main/resources/static/js/gw.filebrowser.js index 90d61fb8c..8e2826939 100644 --- a/src/main/resources/static/js/gw.filebrowser.js +++ b/src/main/resources/static/js/gw.filebrowser.js @@ -249,19 +249,28 @@ GW.filebrowser = { var patt1 = /\.([0-9a-z]+)(?:[\?#]|$)/i; var suffix = file_name.match(patt1); - - if(Number(file_size) < 10*1024*1024 && GW.filebrowser.isIn(suffix[1],["txt", "py", "sh", "java", "log", "js", "r", "c", "cpp", "f", "go", "sql", "php", "perl", "js"]) ){ - - //edit the file - GW.filebrowser.openFileEditor(file_name); + + if(suffix !== null){ + if(Number(file_size) < 10*1024*1024 && GW.filebrowser.isIn(suffix[1],["txt", "py", "sh", "java", "log", "js", "r", "c", "cpp", "f", "go", "sql", "php", "perl", "js"]) ){ + //edit the file + GW.filebrowser.openFileEditor(file_name); + + }else{ + + //directly download the file + GW.filebrowser.downloadFile(file_name); + + } }else{ - + //directly download the file GW.filebrowser.downloadFile(file_name); } + + }, continuebrowser: function(file_name){