From: Matthias Schmidt Date: Wed, 9 Apr 2014 17:57:51 +0000 (+0200) Subject: Change spoiler toggle text to "Hide Spoiler" if spoiler is visible X-Git-Tag: 2.1.0_Alpha_1~905^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d1f9f988a97769a52395c12765db4e59e104495;p=GitHub%2FWoltLab%2FWCF.git Change spoiler toggle text to "Hide Spoiler" if spoiler is visible --- 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 +