Skip to content

Commit

Permalink
Update gw.filebrowser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuragVanam committed Mar 16, 2021
1 parent e6c5636 commit e70c794
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 e70c794

Please sign in to comment.