From 6922e11e91b5a46507258c0e0050cdd39a925857 Mon Sep 17 00:00:00 2001 From: Coppertine <37494321+Coppertine@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:20:35 +1000 Subject: [PATCH 1/2] Implement BBCode parsing to medal solution --- medals/js/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/medals/js/functions.js b/medals/js/functions.js index 76b7d6b..40403ec 100644 --- a/medals/js/functions.js +++ b/medals/js/functions.js @@ -382,8 +382,8 @@ async function loadMedal(strMedalName, updateAdminPanel = true) { for (let i = 0; i < document.querySelectorAll("[selector='oMedalIcon']").length; i++) { document.querySelectorAll("[selector='oMedalIcon']")[i].src = colMedals[strMedalName].Link; } - document.getElementById("strMedalSolution").innerHTML = colMedals[strMedalName].Solution; - document.getElementById("strMedalSolution").innerHTML = document.getElementById("strMedalSolution").innerHTML.replace(/\n/g, "
") + document.getElementById("strMedalSolution").innerHTML = BBCodeParser.process(colMedals[strMedalName].Solution); + document.getElementById("strMedalSolution").innerHTML = document.getElementById("strMedalSolution").innerHTML.replace(/\n/g, "
"); var rarity = parseFloat(colMedals[strMedalName].Rarity); //console.log(rarity); document.getElementById("strMedalRarity").innerHTML = "rarity " + Math.round(rarity * 100) / 100 + "%"; From 6cb42b366719c0495def5708b465ad1f3869c88e Mon Sep 17 00:00:00 2001 From: Coppertine <37494321+Coppertine@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:21:13 +1000 Subject: [PATCH 2/2] Stylise / implement code and blockcode tags --- global/css/main.css | 22 ++++++++++++++++++++++ global/js/bbcode/bbcode-config.js | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/global/css/main.css b/global/css/main.css index 5168a5e..071a444 100644 --- a/global/css/main.css +++ b/global/css/main.css @@ -4718,4 +4718,26 @@ input[type='range']:focus::-ms-fill-upper { .osekai__3col_col1{ overflow: scroll; +} + +code { + background-color: rgba(var(--genericaccent),0.5); + padding: 0 5px; + text-wrap: nowrap; +} + +blockquote { + display: flex; + background-color: rgba(var(--genericaccent), 0.5); + border-radius: 6px; + padding: 5px 0; +} + +blockquote::before { + content: ""; + border-left: 7px solid rgb(var(--accent)); + margin-right: 4px; + border-radius: 6px; + margin: -5px 5px; + margin-left: 0; } \ No newline at end of file diff --git a/global/js/bbcode/bbcode-config.js b/global/js/bbcode/bbcode-config.js index 1bae77d..3602cda 100755 --- a/global/js/bbcode/bbcode-config.js +++ b/global/js/bbcode/bbcode-config.js @@ -98,6 +98,14 @@ var parserTags = { return ''; } }, + 'blockquote': { + openTag: function(params, content) { + return '
'; + }, + closeTag: function(params, content) { + return '
'; + } + }, 's': { openTag: function(params,content) { return '';