Change spoiler toggle text to "Hide Spoiler" if spoiler is visible
authorMatthias Schmidt <gravatronics@live.com>
Wed, 9 Apr 2014 17:57:51 +0000 (19:57 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 9 Apr 2014 17:57:51 +0000 (19:57 +0200)
com.woltlab.wcf/templates/spoilerBBCodeTag.tpl
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 0d00ed2a86d7c5dbf14fed377b6f541bf8756a12..513ca9b3b835e657284e2345543cb9681bd29aed 100644 (file)
        $(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}
                                }
                        });
                });
        });
        //]]>
 </script>
-<!-- end:parser_nonessential -->
\ No newline at end of file
+<!-- end:parser_nonessential -->
index f751d89f69bacda809aa67c9a420edf629714923..3c429a1143bfceb26f1d8d11690800d8c80cf7f5 100644 (file)
@@ -1451,6 +1451,7 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExt
                <item name="wcf.bbcode.code.xml.title"><![CDATA[XML-Quellcode]]></item>
                <item name="wcf.bbcode.quote.title"><![CDATA[{@$quoteAuthor} schrieb:]]></item>
                <item name="wcf.bbcode.quote.text"><![CDATA[Zitat{if $cite} von {@$cite}{/if}: „{@$content}“]]></item>
+               <item name="wcf.bbcode.spoiler.hide"><![CDATA[Spoiler ausblenden]]></item>
                <item name="wcf.bbcode.spoiler.show"><![CDATA[Spoiler anzeigen]]></item>
                <item name="wcf.bbcode.spoiler.text"><![CDATA[(Versteckter Text)]]></item>
        </category>
index 2b46c08c13a13d2aec7bd0c7e65007301bf3e37e..ce27102e86bd2884250e1964480e36b4ea69fc5b 100644 (file)
@@ -1450,6 +1450,7 @@ Allowed extensions: {', '|implode:$attachmentHandler->getFormattedAllowedExtensi
                <item name="wcf.bbcode.code.xml.title"><![CDATA[XML Source Code]]></item>
                <item name="wcf.bbcode.quote.title"><![CDATA[{@$quoteAuthor} wrote:]]></item>
                <item name="wcf.bbcode.quote.text"><![CDATA[Quote{if $cite} from {@$cite}{/if}: “{@$content}”]]></item>
+               <item name="wcf.bbcode.spoiler.hide"><![CDATA[Hide Spoiler]]></item>
                <item name="wcf.bbcode.spoiler.show"><![CDATA[Show Spoiler]]></item>
                <item name="wcf.bbcode.spoiler.text"><![CDATA[(Hidden Content)]]></item>
        </category>