From 1573fad58d3ddbc9051cd4ba8d44782af2157220 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 8 May 2022 19:22:15 +0300 Subject: [PATCH] annotate template strings for syntax hightlight and format --- components/fill-box.js | 10 +- main.js | 14 +- modules/burgs-and-states.js | 4 +- modules/cultures-generator.js | 10 +- modules/io/auto-update.js | 4 +- modules/io/load.js | 14 +- modules/ui/biomes-editor.js | 49 ++++-- modules/ui/burg-editor.js | 10 +- modules/ui/burgs-overview.js | 46 +++--- modules/ui/coastline-editor.js | 79 ++++++--- modules/ui/cultures-editor.js | 81 +++++++--- modules/ui/diplomacy-editor.js | 6 +- modules/ui/editors.js | 50 +++--- modules/ui/emblems-editor.js | 264 ++++++++++++++++++++----------- modules/ui/general.js | 19 ++- modules/ui/heightmap-editor.js | 21 ++- modules/ui/ice-editor.js | 41 +++-- modules/ui/labels-editor.js | 7 +- modules/ui/lakes-editor.js | 73 ++++++--- modules/ui/military-overview.js | 60 ++++--- modules/ui/namesbase-editor.js | 8 +- modules/ui/options.js | 16 +- modules/ui/provinces-editor.js | 49 +++--- modules/ui/regiments-overview.js | 8 +- modules/ui/relief-editor.js | 2 +- modules/ui/religions-editor.js | 65 +++++--- modules/ui/rivers-overview.js | 18 ++- modules/ui/routes-editor.js | 130 +++++++++------ modules/ui/states-editor.js | 87 +++++++--- modules/ui/style.js | 4 +- modules/ui/submap.js | 3 +- modules/ui/tools.js | 2 +- modules/ui/units-editor.js | 5 +- modules/ui/world-configurator.js | 8 +- modules/ui/zones-editor.js | 9 +- 35 files changed, 816 insertions(+), 460 deletions(-) diff --git a/components/fill-box.js b/components/fill-box.js index 02912f3b..b4d075c3 100644 --- a/components/fill-box.js +++ b/components/fill-box.js @@ -1,7 +1,5 @@ -// fill-box cannot use Shadow DOM as it needs access to svg hatches -// append stylesheet { - const style = ` + const style = /* css */ ` fill-box:not([disabled]) { cursor: pointer; } @@ -14,7 +12,8 @@ fill-box > svg > rect { stroke: #666666; stroke-width: 2; - }`; + } + `; const styleElement = document.createElement("style"); styleElement.setAttribute("type", "text/css"); @@ -24,7 +23,7 @@ { const template = document.createElement("template"); - template.innerHTML = ` + template.innerHTML = /* html */ ` @@ -70,5 +69,6 @@ } } + // cannot use Shadow DOM here as need an access to svg hatches customElements.define("fill-box", FillBox); } diff --git a/main.js b/main.js index cdb329af..39a70d29 100644 --- a/main.js +++ b/main.js @@ -176,8 +176,8 @@ oceanLayers.append("rect").attr("id", "oceanBase").attr("x", 0).attr("y", 0).att document.addEventListener("DOMContentLoaded", async () => { if (!location.hostname) { const wiki = "https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Run-FMG-locally"; - alertMessage.innerHTML = `Fantasy Map Generator cannot run serverless. - Follow the instructions on how you can easily run a local web-server`; + alertMessage.innerHTML = /* html */ `Fantasy Map Generator cannot run serverless. Follow the instructions on how you can + easily run a local web-server`; $("#alert").dialog({ resizable: false, @@ -455,9 +455,10 @@ function showWelcomeMessage() { const discord = link("https://discordapp.com/invite/X7E84HU", "Discord server"); const patreon = link("https://www.patreon.com/azgaar", "Patreon"); - alertMessage.innerHTML = `The Fantasy Map Generator is updated up to version ${version}. - This version is compatible with ${changelog}, loaded .map files will be auto-updated. -