Notepad reliability

Notepad save/load functionality should work without the need to enable "Authorize FreeCAD to access the internet".

https://forum.freecadweb.org/viewtopic.php?f=10&t=30340&start=110#p269908
This commit is contained in:
triplus
2018-11-22 00:25:14 +01:00
committed by Yorik van Havre
parent eead77a897
commit b4fa7e855c

View File

@@ -22,6 +22,13 @@ function load() {
// run at startup
if (localStorage["notepad"]) {
document.getElementById("notepad").value = localStorage["notepad"]; // Load notepad from local storage
}
document.getElementById("notepad").addEventListener( "input", function () {
localStorage.setItem("notepad", document.getElementById("notepad").value); // Save notepad on type
}, false);
if (allowDownloads == 1) {
// load latest commits
ddiv = document.getElementById("commits");
@@ -46,12 +53,6 @@ function load() {
tobj.addScriptTag(); // Execute (add) the script tag
ddiv.innerHTML = "Downloading addons list...";
}
if (localStorage["notepad"]) {
document.getElementById("notepad").value = localStorage["notepad"]; // Load notepad from local storage
}
document.getElementById("notepad").addEventListener( "input", function () {
localStorage.setItem("notepad", document.getElementById("notepad").value); // Save notepad on type
}, false);
}
}