|
@@ -407,16 +407,19 @@ class Main {
|
|
}.bind(this));
|
|
}.bind(this));
|
|
}
|
|
}
|
|
// Safe mode
|
|
// Safe mode
|
|
|
|
+ this.parent.settingsPG.restoreSafeMode();
|
|
this.parent.utils.setToMultipleID("safemodeToggle", 'click', function () {
|
|
this.parent.utils.setToMultipleID("safemodeToggle", 'click', function () {
|
|
document.getElementById("safemodeToggle1280").classList.toggle('checked');
|
|
document.getElementById("safemodeToggle1280").classList.toggle('checked');
|
|
- if (document.getElementById("safemodeToggle1280").classList.contains('checked')) {
|
|
|
|
- this.parent.utils.setToMultipleID("safemodeToggle", "innerHTML", 'Safe mode <i class="fa fa-check-square" aria-hidden="true"></i>');
|
|
|
|
- } else {
|
|
|
|
- this.parent.utils.setToMultipleID("safemodeToggle", "innerHTML", 'Safe mode <i class="fa fa-square" aria-hidden="true"></i>');
|
|
|
|
- }
|
|
|
|
|
|
+ this.parent.settingsPG.setSafeMode(document.getElementById("safemodeToggle1280").classList.contains('checked'));
|
|
}.bind(this));
|
|
}.bind(this));
|
|
// Editor
|
|
// Editor
|
|
this.parent.utils.setToMultipleID("editorButton", "click", this.toggleEditor.bind(this));
|
|
this.parent.utils.setToMultipleID("editorButton", "click", this.toggleEditor.bind(this));
|
|
|
|
+ // CTRL + S
|
|
|
|
+ this.parent.settingsPG.restoreCTRLS();
|
|
|
|
+ this.parent.utils.setToMultipleID("ctrlsToggle", 'click', function () {
|
|
|
|
+ document.getElementById("ctrlsToggle1280").classList.toggle('checked');
|
|
|
|
+ this.parent.settingsPG.setCTRLS(document.getElementById("ctrlsToggle1280").classList.contains('checked'));
|
|
|
|
+ }.bind(this));
|
|
// FullScreen
|
|
// FullScreen
|
|
this.parent.utils.setToMultipleID("fullscreenButton", "click", function () {
|
|
this.parent.utils.setToMultipleID("fullscreenButton", "click", function () {
|
|
this.parent.menuPG.removeAllOptions();
|
|
this.parent.menuPG.removeAllOptions();
|
|
@@ -457,7 +460,7 @@ class Main {
|
|
this.parent.menuPG.resizeBigCanvas();
|
|
this.parent.menuPG.resizeBigCanvas();
|
|
|
|
|
|
// HotKeys
|
|
// HotKeys
|
|
- document.onkeydown = function (e) {
|
|
|
|
|
|
+ document.onkeydown = (e) => {
|
|
// Alt+Enter to Run
|
|
// Alt+Enter to Run
|
|
if (e.altKey && (e.key === 'Enter' || event.which === 13)) {
|
|
if (e.altKey && (e.key === 'Enter' || event.which === 13)) {
|
|
handleRun();
|
|
handleRun();
|
|
@@ -476,6 +479,9 @@ class Main {
|
|
(e.key === 'S' || event.which === 83)
|
|
(e.key === 'S' || event.which === 83)
|
|
) {
|
|
) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
+ if (!this.checkCTRLSMode()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
handleSave();
|
|
handleSave();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -763,6 +769,14 @@ class Main {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ checkCTRLSMode() {
|
|
|
|
+ if (document.getElementById("ctrlsToggle" + this.parent.utils.getCurrentSize()) &&
|
|
|
|
+ document.getElementById("ctrlsToggle" + this.parent.utils.getCurrentSize()).classList.contains('checked')) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ };
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Metadatas form
|
|
* Metadatas form
|
|
*/
|
|
*/
|