diff --git a/src/Mod/Start/StartPage/CMakeLists.txt b/src/Mod/Start/StartPage/CMakeLists.txt index b09ccbea0e..969b66b260 100644 --- a/src/Mod/Start/StartPage/CMakeLists.txt +++ b/src/Mod/Start/StartPage/CMakeLists.txt @@ -68,4 +68,3 @@ INSTALL(FILES ${StartPage_PythonResources} INSTALL(FILES ${StartPage_ImageResources} DESTINATION ${CMAKE_INSTALL_DATADIR}/Mod/Start/StartPage/images ) - diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 60bb15dfc1..34b8695771 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -382,4 +382,4 @@ ul.addonslist { background: TEXTCOLOR; background-clip: content-box; border: 6px solid transparent; -} \ No newline at end of file +} diff --git a/src/Mod/Start/StartPage/StartPage.html b/src/Mod/Start/StartPage/StartPage.html index e852d2b616..febbc2d379 100644 --- a/src/Mod/Start/StartPage/StartPage.html +++ b/src/Mod/Start/StartPage/StartPage.html @@ -191,4 +191,4 @@ - \ No newline at end of file + diff --git a/src/Mod/Start/StartPage/StartPage.js b/src/Mod/Start/StartPage/StartPage.js index 286d1cb7c6..27fd0d3953 100644 --- a/src/Mod/Start/StartPage/StartPage.js +++ b/src/Mod/Start/StartPage/StartPage.js @@ -2,7 +2,8 @@ var allowDownloads = 0; var showForum = 0; var wblist = []; -function toggle(tab) { +function toggle(tab) +{ // switch to the given tab ID ("tab1", "tab2", etc...) @@ -18,46 +19,53 @@ function toggle(tab) { } -function load() { +function load() +{ // run at startup if (localStorage["notepad"]) { - document.getElementById("notepad").value = localStorage["notepad"]; // Load notepad from local storage + 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 + document.getElementById("notepad").addEventListener("input", function() { + localStorage.setItem("notepad", + document.getElementById("notepad").value);// Save notepad on type }, false); if (allowDownloads == 1) { // load latest commits var ddiv = document.getElementById("commits"); ddiv.innerHTML = "Connecting..."; - var tobj = new JSONscriptRequest('https://api.github.com/repos/FreeCAD/FreeCAD/commits?callback=printCommits'); - tobj.buildScriptTag(); // Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + var tobj = new JSONscriptRequest( + 'https://api.github.com/repos/FreeCAD/FreeCAD/commits?callback=printCommits'); + tobj.buildScriptTag();// Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading latest news..."; // load addons list ddiv = document.getElementById("addons"); ddiv.innerHTML = "Connecting..."; - var tobj = new JSONscriptRequest('https://api.github.com/repos/FreeCAD/FreeCAD-addons/contents?callback=printAddons'); - tobj.buildScriptTag(); // Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + var tobj = new JSONscriptRequest( + 'https://api.github.com/repos/FreeCAD/FreeCAD-addons/contents?callback=printAddons'); + tobj.buildScriptTag();// Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading addons list..."; if (showForum == 1) { // load forum recent posts ddiv = document.getElementById("forum"); ddiv.innerHTML = "Connecting..."; - var tobj = new JSONscriptRequest('https://www.freecad.org/xml-to-json.php?callback=printForum&url=https://forum.freecad.org/feed.php'); - tobj.buildScriptTag(); // Build the script tag - tobj.addScriptTag(); // Execute (add) the script tag + var tobj = new JSONscriptRequest( + 'https://www.freecad.org/xml-to-json.php?callback=printForum&url=https://forum.freecad.org/feed.php'); + tobj.buildScriptTag();// Build the script tag + tobj.addScriptTag(); // Execute (add) the script tag ddiv.innerHTML = "Downloading addons list..."; } } } -function printCommits(data) { +function printCommits(data) +{ // json callback for git commits @@ -65,14 +73,23 @@ function printCommits(data) { ddiv.innerHTML = "Received"; var html = [''); ddiv.innerHTML = html.join(''); } -function printAddons(data) { +function printAddons(data) +{ // json callback for addons list @@ -83,9 +100,18 @@ function printAddons(data) { for (var i = 0; i < data.data.length; i++) { if ((data.data[i].name[0] != ".") && (blacklist.indexOf(data.data[i].name) < 0)) { if (wblist.indexOf(data.data[i].name.toLowerCase()) == -1) { - html.push('
  • ', data.data[i].name, '
  • '); - } else { - html.push('
  • ', data.data[i].name, ' 
  • '); + html.push('
  • ', + data.data[i].name, + '
  • '); + } + else { + html.push('
  • ', + data.data[i].name, + ' 
  • '); } } } @@ -94,7 +120,8 @@ function printAddons(data) { } -function printForum(data) { +function printForum(data) +{ // json callback for forum posts @@ -103,7 +130,13 @@ function printForum(data) { var html = [''); @@ -114,7 +147,8 @@ function printForum(data) { // below are JSON helper functions -function JSONscriptRequest(fullUrl) { +function JSONscriptRequest(fullUrl) +{ // REST request path this.fullUrl = fullUrl; @@ -129,8 +163,8 @@ function JSONscriptRequest(fullUrl) { JSONscriptRequest.scriptCounter = 1; -JSONscriptRequest.prototype.buildScriptTag = function () { - +JSONscriptRequest.prototype.buildScriptTag = + function() { // Create the script tag this.scriptObj = document.createElement("script"); // Add script object attributes @@ -141,12 +175,13 @@ JSONscriptRequest.prototype.buildScriptTag = function () { } -JSONscriptRequest.prototype.removeScriptTag = function () { + JSONscriptRequest.prototype.removeScriptTag = + function() { // Destroy the script tag this.headLoc.removeChild(this.scriptObj); } -JSONscriptRequest.prototype.addScriptTag = function () { + JSONscriptRequest.prototype.addScriptTag = function() { // Create the script tag this.headLoc.appendChild(this.scriptObj); } diff --git a/src/Mod/Start/start.dox b/src/Mod/Start/start.dox index 00d0df3869..0d1fe3c8c0 100644 --- a/src/Mod/Start/start.dox +++ b/src/Mod/Start/start.dox @@ -5,4 +5,3 @@ See \ref src/Mod/Draft/draft.dox as an example of how to populate this page */ -