diff --git a/brutaldon/static/js/brutaldon-enhancements.js b/brutaldon/static/js/brutaldon-enhancements.js index c74a338..8d5bcbe 100644 --- a/brutaldon/static/js/brutaldon-enhancements.js +++ b/brutaldon/static/js/brutaldon-enhancements.js @@ -64,3 +64,32 @@ function menuPrepare() { } } + +function expandCWButtonPrepare() +{ + var theButton = document.createElement('p'); + theButton.textContent = "Expand CWs"; + theButton.classList.toggle('button'); + document.querySelector('#title').insertAdjacentElement('afterend', theButton); + var details = document.querySelectorAll('details'); + var openState = false; + + if (details != null) { + theButton.addEventListener('click', function() { + openState = details.item(0).hasAttribute('open'); + details.forEach(function ($el) { + if (openState) + { + $el.removeAttribute('open'); + } else + { + $el.setAttribute('open', ''); + } + }); + openState = !openState; + if (openState) { theButton.textContent = 'Collapse CWs'; } + else { theButton.textContent = "Expand CWs"; }; + theButton.classList.toggle('is-active'); + }); + }; +} diff --git a/brutaldon/templates/main/thread.html b/brutaldon/templates/main/thread.html index a31e338..fd432b1 100644 --- a/brutaldon/templates/main/thread.html +++ b/brutaldon/templates/main/thread.html @@ -29,37 +29,15 @@ mastodon.status_context() {% endfor %} - + {% if not preferences.theme.is_brutalist %} + + {% endif %} {% endblock %} {% block page_scripts_inline %} {% endblock %} diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html index 8dfd6d2..76473df 100644 --- a/brutaldon/templates/main/toot_partial.html +++ b/brutaldon/templates/main/toot_partial.html @@ -144,7 +144,7 @@ ic-target="#main" ic-select-from-response="#main" ic-push-url="true" - ic-on-success="afterPage('{{ own_acct.username }}', 'thread');" + ic-on-success="afterPage('{{ own_acct.username }}', 'thread')" ic-indicator="#page-load-indicator""> thread