|
|
|
@ -137,6 +137,10 @@ function fileExplorer (appAPI, files) { |
|
|
|
|
function loadFile () { |
|
|
|
|
var fileReader = new FileReader() |
|
|
|
|
fileReader.onload = function (event) { |
|
|
|
|
if (files.checkSpecialChars(name)) { |
|
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
var success = files.set(name, event.target.result) |
|
|
|
|
if (!success) modalDialogCustom.alert('Failed to create file ' + name) |
|
|
|
|
else events.trigger('focus', [name]) |
|
|
|
@ -228,7 +232,7 @@ function fileExplorer (appAPI, files) { |
|
|
|
|
if (label.innerText === '') { |
|
|
|
|
modalDialogCustom.alert('File name cannot be empty') |
|
|
|
|
label.innerText = textUnderEdit |
|
|
|
|
} else if (label.innerText.match(/(\/|:|\*|\?|"|<|>|\\|\||')/) !== null) { |
|
|
|
|
} else if (files.checkSpecialChars(label.innerText)) { |
|
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
|
label.innerText = textUnderEdit |
|
|
|
|
} else if (!files.exists(newPath)) { |
|
|
|
|