|
@@ -42,6 +42,7 @@
|
|
|
var lastSave = "";
|
|
|
var fontsize = 12;
|
|
|
var theme = "github";
|
|
|
+ var tabid = "";
|
|
|
var editor = undefined;
|
|
|
|
|
|
window.onhashchange = function(e){
|
|
@@ -58,11 +59,19 @@
|
|
|
filename = basename;
|
|
|
fontsize = payload.fontsize;
|
|
|
theme = payload.theme;
|
|
|
+ tabid = payload.tabid;
|
|
|
|
|
|
console.log("NotepadA editor loaded: ", payload);
|
|
|
|
|
|
//Load the content of the file
|
|
|
$.get("../../media?file=" + filepath, function(fileContent){
|
|
|
+ if (fileContent.error !== undefined){
|
|
|
+ //Failed to get file
|
|
|
+ setTimeout(function(){
|
|
|
+ parent.removeTab(tabid);
|
|
|
+ },300);
|
|
|
+ return
|
|
|
+ }
|
|
|
$("#editor").text(fileContent);
|
|
|
|
|
|
//Start the editor if not started
|
|
@@ -145,6 +154,7 @@
|
|
|
console.log("%c[NotepadA] " + filename + " -> Saved!","color:#1265ea");
|
|
|
lastSave = code;
|
|
|
}else{
|
|
|
+ alert(data.error);
|
|
|
console.log(data);
|
|
|
}
|
|
|
})
|