diff --git a/pages/updates/updates.css b/pages/updates/updates.css index 0caa49f9..67071067 100644 --- a/pages/updates/updates.css +++ b/pages/updates/updates.css @@ -37,3 +37,13 @@ input[type=radio], label { display: inline-flex; width: 100%; } + +#history { + cursor: pointer; + font-size: 24px; + font-weight: bold; +} + +#history-release-notes { + +} diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 63e0ffda..78c235bd 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -29,6 +29,7 @@
  • Fixed: Wrong version selection of AngularUI Bootstrap (#50)
  • Implemented: Monochrome icons (#52)
  • Fixed: Bootstrap JS v4.4.1 (#54)
  • +
  • Implemented: Collapsible changelog for previous versions(reported by email)
  • Generate rule sets for uBlock or uMatrix @@ -50,310 +51,312 @@

    -

    History

    -

    2020-07-05 (v2.2.12)

    - -

    2020-06-28 (v2.2.10)

    - -

    2020-06-21 (v2.2.9)

    - -

    2020-06-12 (v2.2.8)

    - -

    2020-06-06 (v2.2.7)

    - -

    2020-06-02 (v2.2.6)

    - -

    2020-05-30 (v2.2.5)

    - -

    2020-05-30 (v2.2.4)

    - -

    2020-05-23 (v2.2.3)

    - -

    2020-05-21 (v2.2.2)

    - -

    2020-05-16 (v2.2.1)

    - -

    2020-05-10 (v2.2.0)

    - -

    2020-04-26 (v2.1.14)

    - -

    2020-04-19 (v2.1.13)

    - -

    2020-04-13 (v2.1.12)

    - -

    2020-04-08 (v2.1.11)

    - -

    2020-04-05 (v2.1.10)

    - -

    2020-03-29 (v2.1.9)

    - -

    2020-03-25 (v2.1.7)

    - -

    2020-03-25 (v2.1.7)

    - -

    2020-03-22 (v2.1.6)

    - -

    2020-03-17 (v2.1.5)

    - -

    2020-03-13 (v2.1.4)

    - -

    2020-03-12 (v2.1.3)

    - -

    2020-03-12 (v2.1.2)

    - -

    2020-03-08 (v2.1.1)

    - -

    2020-03-03 (v2.0.24)

    - -

    2020-03-01 (v2.0.22)

    - -

    2020-02-29 (v2.0.20)

    - -

    2020-02-28 (v2.0.19)

    - -

    2020-02-28 (v2.0.17)

    - +
    + Previous Versions
    + diff --git a/pages/updates/updates.js b/pages/updates/updates.js index 0cc1159d..5a638959 100644 --- a/pages/updates/updates.js +++ b/pages/updates/updates.js @@ -26,51 +26,70 @@ var updates = {}; */ updates._openRuleSet = function({target}) { - let urls = mappings; - let updateKey = target.getAttribute('data-option'); + let urls = mappings; + let updateKey = target.getAttribute('data-option'); - let textArea = document.getElementById("generated-rules"); - let btnCopy = document.getElementById("button-copy-rule-set"); + let textArea = document.getElementById("generated-rules"); + let btnCopy = document.getElementById("button-copy-rule-set"); - let content = ""; + let content = ""; - textArea.style.display = "block"; - btnCopy.style.display = "block"; + textArea.style.display = "block"; + btnCopy.style.display = "block"; - for (var domain in urls) { - if (updateKey === "uMatrix") { - content += "* " + domain + " script allow" + '\n'; - content += "* " + domain + " css allow" + '\n'; - } else if (updateKey === "uBlock") { - content += "* " + domain + " * noop" + '\n'; - } - } - textArea.value = content.replace(/\n+$/, ""); - } + for (var domain in urls) { + if (updateKey === "uMatrix") { + content += "* " + domain + " script allow" + '\n'; + content += "* " + domain + " css allow" + '\n'; + } else if (updateKey === "uBlock") { + content += "* " + domain + " * noop" + '\n'; + } + } + textArea.value = content.replace(/\n+$/, ""); +}; - updates._copyRuleSet = function() { - let textArea = document.getElementById("generated-rules"); - navigator.clipboard.writeText(textArea.value).then(function() { - textArea.select(); - }, function() { - alert("Rule set cannot be copied!"); - }); - } +updates._copyRuleSet = function() { - updates._onDocumentLoaded = function () { + let textArea = document.getElementById("generated-rules"); + navigator.clipboard.writeText(textArea.value).then(function() { + textArea.select(); + }, function() { + alert("Rule set cannot be copied!"); + }); +}; - document.getElementById('generate-ublock-rules').checked = false; - document.getElementById('generate-umatrix-rules').checked = false; +updates._openHistoryReleaseNotes = function() { - let updateElements = { - ['ruleSets']: document.getElementsByName("rule-sets"), - ['copyRuleSet']: document.getElementById("button-copy-rule-set") - }; + let container = document.getElementById('history-release-notes'); + let toggle = document.getElementById('history-indicator'); + + if (container.style.display === 'none') { + container.style.display = 'block'; + toggle.textContent = '–'; + } else { + container.style.display = 'none'; + toggle.textContent = '+'; + } +}; + +updates._onDocumentLoaded = function () { + + document.getElementById('generate-ublock-rules').checked = false; + document.getElementById('generate-umatrix-rules').checked = false; + + let updateElements = { + ['ruleSets']: document.getElementsByName("rule-sets"), + ['copyRuleSet']: document.getElementById("button-copy-rule-set") + }; + + for(let i = 0; i < updateElements.ruleSets.length; i++) { + updateElements.ruleSets[i].addEventListener('change', updates._openRuleSet); + } + + updateElements.copyRuleSet.addEventListener('click', updates._copyRuleSet); + + document.getElementById('history').addEventListener('click', updates._openHistoryReleaseNotes); +}; - for(let i = 0; i < updateElements.ruleSets.length; i++) { - updateElements.ruleSets[i].addEventListener('change', updates._openRuleSet); - } - updateElements.copyRuleSet.addEventListener('click', updates._copyRuleSet); - }; document.addEventListener('DOMContentLoaded', updates._onDocumentLoaded);