From 5d1f9f988a97769a52395c12765db4e59e104495 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 9 Apr 2014 19:57:51 +0200 Subject: [PATCH] Change spoiler toggle text to "Hide Spoiler" if spoiler is visible --- com.woltlab.wcf/templates/spoilerBBCodeTag.tpl | 14 ++++++++++++-- wcfsetup/install/lang/de.xml | 1 + wcfsetup/install/lang/en.xml | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/spoilerBBCodeTag.tpl b/com.woltlab.wcf/templates/spoilerBBCodeTag.tpl index 0d00ed2a86..513ca9b3b8 100644 --- a/com.woltlab.wcf/templates/spoilerBBCodeTag.tpl +++ b/com.woltlab.wcf/templates/spoilerBBCodeTag.tpl @@ -14,15 +14,25 @@ $(function() { var $spoilerBox = $('.jsSpoilerBox').removeClass('jsSpoilerBox'); $spoilerBox.find('> header > .jsSpoilerToggle').click(function() { - $(this).toggleClass('active').parent().next().slideToggle({ + var $spoilerToggle = $(this); + $spoilerToggle.toggleClass('active').parent().next().slideToggle({ complete: function() { if ($(this).is(':visible')) { WCF.DOMNodeInsertedHandler.execute(); } + + {if !$buttonTitle} + if ($(this).is(':visible')) { + $spoilerToggle.text('{lang}wcf.bbcode.spoiler.hide{/lang}'); + } + else { + $spoilerToggle.text('{lang}wcf.bbcode.spoiler.show{/lang}'); + } + {/if} } }); }); }); //]]> - \ No newline at end of file + diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index f751d89f69..3c429a1143 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1451,6 +1451,7 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExt + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 2b46c08c13..ce27102e86 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1450,6 +1450,7 @@ Allowed extensions: {', '|implode:$attachmentHandler->getFormattedAllowedExtensi + -- 2.20.1