From d5527e874527ccc80555583c1b87cace1daf12c3 Mon Sep 17 00:00:00 2001 From: ferricles Date: Wed, 16 Jun 2021 22:53:23 -0700 Subject: [PATCH] new changelog section in wynnfo, empty cache + reload button added --- builder.js | 2 +- loadheader.js | 28 +++++++++++++++++-- media/icons/new/reload.png | Bin 0 -> 608 bytes media/icons/old/reload.png | Bin 0 -> 608 bytes utils.js | 11 ++++++++ wynnfo/index.html | 3 +- wynnfo/scripts/main.js | 56 ++++++++++++++++++++++++++++++++++--- wynnfo/styles/index.css | 10 +++++++ 8 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 media/icons/new/reload.png create mode 100644 media/icons/old/reload.png diff --git a/builder.js b/builder.js index ff1990f..a9742ee 100644 --- a/builder.js +++ b/builder.js @@ -3,7 +3,7 @@ const url_tag = location.hash.slice(1); // console.log(url_tag); -const BUILD_VERSION = "7.0.7"; +const BUILD_VERSION = "7.0.8"; function setTitle() { let text; diff --git a/loadheader.js b/loadheader.js index 46924d6..49a4539 100644 --- a/loadheader.js +++ b/loadheader.js @@ -32,7 +32,7 @@ */ -let header_icon_map = new Map([ +let header_icon_map_left = new Map([ ["index",["builder","WynnBuilder"]], ["crafter",["crafter","WynnCrafter"]], ["items",["searcher","WynnAtlas"]], @@ -45,7 +45,7 @@ function setHeaders() { let headerleft = document.getElementById("headerleft"); let headerright = document.getElementById("headerright"); - for (const [name,data] of header_icon_map) { + for (const [name,data] of header_icon_map_left) { let a_elem = document.createElement("a"); let img = document.createElement("img"); let div = document.createElement("div"); @@ -72,6 +72,30 @@ function setHeaders() { toggle_icon_button.onclick = function() {toggleIcons()}; toggle_icon_button.textContent = "Use Old Icons"; headerright.appendChild(toggle_icon_button); + + let reload_div = document.createElement("div"); + let reload_button = document.createElement("button"); + reload_button.classList.add("button"); + reload_button.style.left = '0px'; + reload_button.style.top = '0px'; + reload_button.style.width = '48px'; + reload_button.style.height = '48px'; + reload_button.style.padding = '0px'; + reload_button.onclick = hardReload; + let reload_img = document.createElement("img"); + reload_img.src = "/media/icons/new/reload.png" + reload_img.style.width = "100%"; + let reload_tooltip; + reload_tooltip = createTooltip(reload_tooltip, "p", "Reload", reload_button, ["center","reloadtooltip"]); + //reload_tooltip.style.position = "relative"; + reload_tooltip.style.left = "-50%"; + reload_tooltip.style.top = "70%"; + + reload_div.appendChild(reload_button); + reload_button.appendChild(reload_img); + headerright.appendChild(reload_div); + + console.log("Set Header"); } diff --git a/media/icons/new/reload.png b/media/icons/new/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..356c19e334dd692484389b5273a31ac2ccbe48f1 GIT binary patch literal 608 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-HD>V3P85aSW-L z^LExoFJ?!9HvOcDegYG33veW9-eB$9(=c~Ie`4bNL#LGX@-Ir5F3!Qu$bB%#Wx|^z z#Ty;1Pjcq|PdT0_%y#qVuG4SN@*O@ifA36fuEPdJ%bM*?d?%+|u)JA}TgQ<$(eUQbI{pWADU46*3FYQl__C4f_jdwn~xb4TP zMdz=V-m#ld%ND_~MfQSQ4c~-oe-8U9q`&XCzFBwp^rVacZ{Zfx{*?KQVhp+LTN10A z>MQoEC7jI<-!x6(ojI@Lmp@`FqFA4I2{e6Wu1jLPQ05^0G3LSAzU?oUn)Z8`x_4zV zB!EO`hdEA9-FZza=IfgGPqXx^_SgS&S(j_Z0k*g8ExXG3Z!`AoxiRm{9D~BZvnTDC zbr^2(WgPy_vhaD^W=od)`{ipre%((`pZH+@<7a#h-z34NN{2DO6aP5N{>{Zm*>7*Z z%kGQbvQN23X|Ai7MR&>xs3FSpcptsV=aM>@dFa89kS+5|#4PtOc;5Fb_TG& z1i!Nsek(5!ir1g}R&i~955tV3P85aSW-L z^LExoFJ?!9HvOcDegYG33veW9-eB$9(=c~Ie`4bNL#LGX@-Ir5F3!Qu$bB%#Wx|^z z#Ty;1Pjcq|PdT0_%y#qVuG4SN@*O@ifA36fuEPdJ%bM*?d?%+|u)JA}TgQ<$(eUQbI{pWADU46*3FYQl__C4f_jdwn~xb4TP zMdz=V-m#ld%ND_~MfQSQ4c~-oe-8U9q`&XCzFBwp^rVacZ{Zfx{*?KQVhp+LTN10A z>MQoEC7jI<-!x6(ojI@Lmp@`FqFA4I2{e6Wu1jLPQ05^0G3LSAzU?oUn)Z8`x_4zV zB!EO`hdEA9-FZza=IfgGPqXx^_SgS&S(j_Z0k*g8ExXG3Z!`AoxiRm{9D~BZvnTDC zbr^2(WgPy_vhaD^W=od)`{ipre%((`pZH+@<7a#h-z34NN{2DO6aP5N{>{Zm*>7*Z z%kGQbvQN23X|Ai7MR&>xs3FSpcptsV=aM>@dFa89kS+5|#4PtOc;5Fb_TG& z1i!Nsek(5!ir1g}R&i~955t { window.indexedDB.deleteDatabase(db.name) }); + + location.reload(); +} \ No newline at end of file diff --git a/wynnfo/index.html b/wynnfo/index.html index 2fddca4..49671e8 100644 --- a/wynnfo/index.html +++ b/wynnfo/index.html @@ -29,7 +29,8 @@ + - + diff --git a/wynnfo/scripts/main.js b/wynnfo/scripts/main.js index e3e28d2..6524e07 100644 --- a/wynnfo/scripts/main.js +++ b/wynnfo/scripts/main.js @@ -1,12 +1,28 @@ // ['Title', ["type of paper","file name"]] const pdfs = new Map([ - ["Wynncraft Damage Calculation",["mechanics", "Damage_calculation", "hppeng, ferricles, et al.", "A complete guide to Wynncraft's damage calculations. Includes formulas, tested game values, and worked examples."]], - ["Crafted Weapon Powder Mechanics",["mechanics", "Crafted_Weapon_Powder_Mechanics", "ferricles", "A short guide to the mechanics of powder application on crafted weapons. Includes formulas and a worked example."]], - ["Spell Costs",["mechanics", "Spell_Costs", "Bart MC, ferricles", "A documentation of spell costs and the mechanics of spell cost reduction."]], + ["Wynncraft Damage Calculation", + ["Mechanics", "Damage_calculation", "hppeng, ferricles, et al.", "A complete guide to Wynncraft's damage calculations. Includes formulas, tested game values, and worked examples." + ]], + ["Crafted Weapon Powder Mechanics", + ["Mechanics", "Crafted_Weapon_Powder_Mechanics", "ferricles", "A short guide to the mechanics of powder application on crafted weapons. Includes formulas and a worked example." + ]], + ["Spell Costs", + ["Mechanics", "Spell_Costs", "Bart MC, ferricles", "A documentation of spell costs and the mechanics of spell cost reduction." + ]], //[title ,[genre, filename, author(s), abstract/desc]] ]); -const sections = ["mechanics", "documentation", "history"] + +const changelog = new Map([ + ["7.0.8", + [" + Created Changelog section in Wynnfo", + " + Added an empty cache + reload button to the right header", + " - Deleted lack of on-page documentation", + ]], + //[title ,[genre, filename, author(s), abstract/desc]] +]); + +const sections = ["Changelog", "Mechanics", "History" ] function init() { initSections(); @@ -62,6 +78,38 @@ function init() { console.log("Invalid paper type for " + title + ": " + pdf[0]); } } + + let sec = document.getElementById("Changelog-section"); + for ([version, changes] of changelog) { + let pre = document.createElement("pre"); + let firstline = document.createElement("div"); + firstline.style.display = "flex"; + firstline.style.justifyContent = "space-between"; + + let titleElem = document.createElement("p"); + titleElem.textContent = "Version " + version; + + pre.appendChild(firstline); + firstline.appendChild(titleElem); + sec.appendChild(document.createElement("br")); + sec.appendChild(pre); + + let ul = document.createElement("ul"); + ul.style.listStyle = "none"; + for (change of changes) { + let li = document.createElement("li"); + li.textContent = change; + if (change.substring(0,3) === " + ") { + li.classList.add("positive"); + } else if (change.substring(0,3) === " - ") { + li.classList.add("negative"); + } else { + } + ul.appendChild(li); + } + + pre.appendChild(ul); + } } function initSections() { diff --git a/wynnfo/styles/index.css b/wynnfo/styles/index.css index 6238ed5..ad3bee8 100644 --- a/wynnfo/styles/index.css +++ b/wynnfo/styles/index.css @@ -341,4 +341,14 @@ ul{ word-wrap: break-word; word-break: break-word; white-space: pre-wrap; +} + +.positive { + color: #5f5; + /*text-shadow: 2px 2px 0 #153f15;*/ +} + +.negative { + color: #f55; + /*text-shadow: 2px 2px 0 #1f1515;*/ } \ No newline at end of file