|
|
|
@ -10,7 +10,6 @@ class Controller {
|
|
|
|
|
var settingsBtn = document.getElementsByClassName("settingsBtn")[0];
|
|
|
|
|
var settingsClose = document.getElementsByClassName("close");
|
|
|
|
|
var settingsSubmit = document.getElementById("settingsSubmit");
|
|
|
|
|
var textArea = document.getElementsByTagName("textarea")[0];
|
|
|
|
|
var saveBtn = document.getElementById("saveBtn");
|
|
|
|
|
|
|
|
|
|
cloneBtn.addEventListener("click", this.cloneRep.bind(this));
|
|
|
|
@ -20,17 +19,14 @@ class Controller {
|
|
|
|
|
settingsClose[i].addEventListener("click", view.closeSettings.bind(this));
|
|
|
|
|
}
|
|
|
|
|
settingsSubmit.addEventListener("click", this.saveSettings.bind(this));
|
|
|
|
|
textArea.addEventListener("keyup", this.saveButton.bind(this));
|
|
|
|
|
view.simplemde.codemirror.on("change", this.saveButton.bind(this));
|
|
|
|
|
saveBtn.addEventListener("click", this.saveFile.bind(this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveButton() {
|
|
|
|
|
var textArea = document.getElementsByTagName("textarea")[0];
|
|
|
|
|
if (textArea.value != this.openedFileValue) {
|
|
|
|
|
this.view.showSaveButton(true);
|
|
|
|
|
} else {
|
|
|
|
|
this.view.showSaveButton(false);
|
|
|
|
|
}
|
|
|
|
|
var textArea = this.view.simplemde;
|
|
|
|
|
|
|
|
|
|
this.view.showSaveButton(textArea.value() == this.openedFileValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wipeFS() {
|
|
|
|
@ -99,9 +95,9 @@ class Controller {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveFile() {
|
|
|
|
|
var textArea = document.getElementsByTagName("textarea")[0];
|
|
|
|
|
this.model.saveFile(this.openedFile, textArea.value);
|
|
|
|
|
this.openedFileValue = textArea.value;
|
|
|
|
|
var textArea = this.view.simplemde;
|
|
|
|
|
this.model.saveFile(this.openedFile, textArea.value());
|
|
|
|
|
this.openedFileValue = textArea.value();
|
|
|
|
|
this.saveButton();
|
|
|
|
|
|
|
|
|
|
this.updateFileStats();
|
|
|
|
|