From 65a7b89a9e84d7e97c8e28b25949b19555c51402 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 5 May 2024 00:50:28 +0700 Subject: [PATCH] Added support for attribute to ignoring auto spoilers opening (#1466) * Added support for attribute to ignoring auto spoilers opening * Update CHANGELOG.md --- CHANGELOG.md | 1 + styles/js/bbcode.js | 3 ++- styles/templates/default/viewtopic.tpl | 4 +++- styles/templates/default/viewtopic_attach.tpl | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b7c384d..900d50162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Added updates checker ⚙️ [\#1451](https://github.com/torrentpier/torrentpier/pull/1451) ([belomaxorka](https://github.com/belomaxorka)) - Added preview for country flags while editing [\#1448](https://github.com/torrentpier/torrentpier/pull/1448) ([belomaxorka](https://github.com/belomaxorka)) - Added support for APCu caching method [\#1442](https://github.com/torrentpier/torrentpier/pull/1442) ([belomaxorka](https://github.com/belomaxorka)) +- Added support for attribute to ignoring auto spoilers opening [\#1466](https://github.com/torrentpier/torrentpier/pull/1466) ([belomaxorka](https://github.com/belomaxorka)) - Some enhancements [\#1445](https://github.com/torrentpier/torrentpier/pull/1445) ([belomaxorka](https://github.com/belomaxorka)) - Guests can view polls [\#1464](https://github.com/torrentpier/torrentpier/pull/1464) ([belomaxorka](https://github.com/belomaxorka)) - Improved app debug [\#1438](https://github.com/torrentpier/torrentpier/pull/1438) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/styles/js/bbcode.js b/styles/js/bbcode.js index f15ddfa9c..3863408af 100644 --- a/styles/js/bbcode.js +++ b/styles/js/bbcode.js @@ -380,8 +380,9 @@ function initSpoilers(context) { $('div.sp-body', context).each(function () { var $sp_body = $(this); var name = $.trim(this.title) || '' + bbl['spoiler_head'] + ''; + var no_sp_open = ($.trim($sp_body.attr('no-sp-open')) === "true") ? ' ignore-sp-open' : ''; this.title = ''; - var $sp_head = $('
' + name + '
'); + var $sp_head = $('
' + name + '
'); $sp_head.insertBefore($sp_body).click(function (e) { if (!$sp_body.hasClass('inited')) { initPostImages($sp_body); diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index c6f81bff6..175e73322 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -8,7 +8,9 @@ diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 89007d951..66a46e854 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -465,7 +465,7 @@ $('#tor-filelist-btn').click(function () {
-
+