From: Alexander Ebert Date: Sun, 17 Apr 2016 15:41:14 +0000 (+0200) Subject: Fixed language chooser / recaptcha X-Git-Tag: 3.0.0_Beta_1~1868 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51ab10862f3eb4833b048be6eb5fc2e798819b9e;p=GitHub%2FWoltLab%2FWCF.git Fixed language chooser / recaptcha --- diff --git a/com.woltlab.wcf/templates/pageHeaderUser.tpl b/com.woltlab.wcf/templates/pageHeaderUser.tpl index aebad8c360..4ed650ff1b 100644 --- a/com.woltlab.wcf/templates/pageHeaderUser.tpl +++ b/com.woltlab.wcf/templates/pageHeaderUser.tpl @@ -118,7 +118,7 @@ window.location = location + delimiter + 'l=' + elData(listItem, 'language-id') + window.location.hash; }; - LanguageChooser.init('pageLanguageContainer', 'languageID', {@$__wcf->getLanguage()->languageID}, languages, callback); + LanguageChooser.init('pageLanguageContainer', 'pageLanguageID', {@$__wcf->getLanguage()->languageID}, languages, callback); EventHandler.add('com.woltlab.wcf.UserMenuMobile', 'more', function(data) { if (data.identifier === 'com.woltlab.wcf.language') { callback(data.parent); diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 86a47d671c..3ececfe6f2 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -7252,122 +7252,31 @@ WCF.EditableItemList = Class.extend({ /** * Provides a language chooser. + * + * @param {string} containerId input element conainer id + * @param {string} chooserId input element id + * @param {int} languageId selected language id + * @param {object>} languages data of available languages + * @param {function} callback function called after a language is selected + * @param {boolean} allowEmptyValue true if no language may be selected * - * @param string containerID - * @param string inputFieldID - * @param integer languageID - * @param object languages - * @param object callback + * @deprecated 2.2 - please use `WoltLab/WCF/Language/Chooser` instead */ WCF.Language.Chooser = Class.extend({ - /** - * callback object - * @var object - */ - _callback: null, - - /** - * dropdown object - * @var jQuery - */ - _dropdown: null, - - /** - * input field - * @var jQuery - */ - _input: null, - /** * Initializes the language chooser. - * - * @param string containerID - * @param string inputFieldID - * @param integer languageID - * @param object languages - * @param object callback - * @param boolean allowEmptyValue - */ - init: function(containerID, inputFieldID, languageID, languages, callback, allowEmptyValue) { - var $container = $('#' + containerID); - if ($container.length != 1) { - console.debug("[WCF.Language.Chooser] Invalid container id '" + containerID + "' given"); - return; - } - - // bind language id input - this._input = $('#' + inputFieldID); - if (!this._input.length) { - this._input = $('').appendTo($container); - } - - // handle callback - if (callback !== undefined) { - if (!$.isFunction(callback)) { - console.debug("[WCF.Language.Chooser] Given callback is invalid"); - return; - } - - this._callback = callback; - } - - // create language dropdown - this._dropdown = $('