Skip to content

Commit

Permalink
Merge pull request #123 from AnuragVanam/master
Browse files Browse the repository at this point in the history
Merge pull request #34 from Anurag
  • Loading branch information
ZihengSun authored Mar 17, 2021
2 parents e6c5636 + e70c794 commit 0b46fcf
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/main/resources/static/js/gw.filebrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 0b46fcf

Please sign in to comment.