From 7c0999cdd93345db094ecf1008ae6f74f33fc2f8 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 26 Dec 2011 22:26:49 +0100 Subject: [PATCH] Adds default titles for toggle buttons in javascript handler 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 | 4 +++- wcfsetup/install/files/acp/templates/header.tpl | 4 +++- wcfsetup/install/files/js/WCF.js | 12 ++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/com.woltlab.wcf/template/headInclude.tpl b/com.woltlab.wcf/template/headInclude.tpl index c84da34dbc..8c57cfb926 100644 --- a/com.woltlab.wcf/template/headInclude.tpl +++ b/com.woltlab.wcf/template/headInclude.tpl @@ -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'} }); diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index fa2e11c87f..57f80ec252 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -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(); diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 1635192f86..0913c58fc4 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -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'); } }); } -- 2.20.1