Adds default titles for toggle buttons in javascript handler
authorMatthias Schmidt <gravatronics@live.com>
Mon, 26 Dec 2011 21:26:49 +0000 (22:26 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 26 Dec 2011 21:26:49 +0000 (22:26 +0100)
If there is no specific title for the enable/disabled button is given, the neutral/general title is used.

"disableMessage"/"enableMessage" is replaced by "disableTitle"/"enableTitle" since that is - in my opinion - more accurate because the title is simply changed and you don't see any pop-up message appearing after changing the status.

com.woltlab.wcf/template/headInclude.tpl
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/WCF.js

index c84da34dbc5febaa675c608d3b3ae3b41a89d54d..8c57cfb926091babdce74f4dac63cbc0d1230850 100644 (file)
@@ -59,7 +59,9 @@
                        'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
                        'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
                        'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
-                       'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}'
+                       'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
+                       'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
+                       'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}'
                        {event name='javascriptLanguageImport'}
                });
                
index fa2e11c87f63c79ebc898ba784718d9f985f3f5e..57f80ec2523ca0b7b95522c16d6e04749e7bc435 100644 (file)
@@ -65,7 +65,9 @@
                                'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
                                'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
                                'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
-                               'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}'
+                               'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
+                               'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
+                               'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}'
                        });
                        new WCF.Date.Time();
                        new WCF.Effect.SmoothScroll();
index 1635192f8603b85610ebe9ef5d875b8d682df70b..0913c58fc4683f8b37aabf35deb900f812fca43a 100644 (file)
@@ -1353,10 +1353,18 @@ WCF.Action.Toggle.prototype = {
                                // toogle icon title
                                $toggleButton.attr('title', function() {
                                        if (this.src.match(/enabled1\.svg$/)) {
-                                               return $(this).data('disableMessage');
+                                               if ($(this).data('disableTitle')) {
+                                                       return $(this).data('disableTitle')
+                                               }
+                                               
+                                               return WCF.Language.get('wcf.global.button.disable');
                                        }
                                        else {
-                                               return $(this).data('enableMessage');
+                                               if ($(this).data('enableTitle')) {
+                                                       return $(this).data('enableTitle')
+                                               }
+                                               
+                                               return WCF.Language.get('wcf.global.button.enable');
                                        }
                                });
                        }