From b4fa7e855c81531a9918012322eb980b1f191a6e Mon Sep 17 00:00:00 2001 From: triplus Date: Thu, 22 Nov 2018 00:25:14 +0100 Subject: [PATCH] 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 --- src/Mod/Start/StartPage/StartPage.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Mod/Start/StartPage/StartPage.js b/src/Mod/Start/StartPage/StartPage.js index 1742a5253c..b94158eec0 100644 --- a/src/Mod/Start/StartPage/StartPage.js +++ b/src/Mod/Start/StartPage/StartPage.js @@ -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); } }