From f5e3a61bd19c347ab34ceb0dcbf5a155691a3078 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 7 May 2017 16:08:21 +0200 Subject: [PATCH] Basic support for tiny JS mode --- .../templates/headIncludeJavaScript.tpl | 5 + .../install/files/acp/templates/header.tpl | 5 + wcfsetup/install/files/js/WCF.ACL.js | 1110 ++-- wcfsetup/install/files/js/WCF.Attachment.js | 985 ++-- wcfsetup/install/files/js/WCF.ColorPicker.js | 1187 ++-- wcfsetup/install/files/js/WCF.Label.js | 287 +- wcfsetup/install/files/js/WCF.Location.js | 4 - wcfsetup/install/files/js/WCF.Message.js | 3658 ++++++------ wcfsetup/install/files/js/WCF.Moderation.js | 1000 ++-- wcfsetup/install/files/js/WCF.Poll.js | 559 +- wcfsetup/install/files/js/WCF.User.js | 2719 ++++----- wcfsetup/install/files/js/WCF.js | 4881 +++++++++-------- 12 files changed, 8636 insertions(+), 7764 deletions(-) diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 7480ccced1..519d8acf39 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -12,6 +12,11 @@ var TIME_NOW = {@TIME_NOW}; var LAST_UPDATE_TIME = {@LAST_UPDATE_TIME}; var URL_LEGACY_MODE = false; + + {if ENABLE_DEBUG_MODE} + {* This constant is a compiler option, it does not exist in production. *} + var COMPILER_TARGET_DEFAULT = {if $__wcf->user->userID}true{else}false{/if}; + {/if} {js application='wcf' lib='polyfill' file='promise' core='true'} diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index 32aefd7bab..385bfda8b1 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -25,6 +25,11 @@ var TIME_NOW = {@TIME_NOW}; var LAST_UPDATE_TIME = {@LAST_UPDATE_TIME}; var URL_LEGACY_MODE = false; + + {if ENABLE_DEBUG_MODE} + {* This constant is a compiler option, it does not exist in production. *} + var COMPILER_TARGET_DEFAULT = {if $__wcf->user->userID}true{else}false{/if}; + {/if} {js application='wcf' file='require' bundle='WoltLabSuite.Core' core='true'} diff --git a/wcfsetup/install/files/js/WCF.ACL.js b/wcfsetup/install/files/js/WCF.ACL.js index 09e4e34d07..4ba7c2f300 100644 --- a/wcfsetup/install/files/js/WCF.ACL.js +++ b/wcfsetup/install/files/js/WCF.ACL.js @@ -5,591 +5,623 @@ */ WCF.ACL = { }; -/** - * ACL support for WCF - * - * @author Alexander Ebert - * @copyright 2001-2017 WoltLab GmbH - * @license GNU Lesser General Public License - */ -WCF.ACL.List = Class.extend({ - /** - * name of the category the acl options belong to - * @var string - */ - _categoryName: '', - - /** - * ACL container - * @var jQuery - */ - _container: null, - - /** - * list of ACL container elements - * @var object - */ - _containerElements: { }, - - /** - * object id - * @var integer - */ - _objectID: 0, - - /** - * object type id - * @var integer - */ - _objectTypeID: null, - - /** - * list of available ACL options - * @var object - */ - _options: { }, - - /** - * action proxy - * @var WCF.Action.Proxy - */ - _proxy: null, - - /** - * user search handler - * @var WCF.Search.User - */ - _search: null, - - /** - * list of ACL settings - * @var object - */ - _values: { - group: { }, - user: { } - }, - - /** - * Initializes the ACL configuration. - * - * @param string containerSelector - * @param integer objectTypeID - * @param string categoryName - * @param integer objectID - * @param boolean includeUserGroups - */ - init: function(containerSelector, objectTypeID, categoryName, objectID, includeUserGroups, initialPermissions) { - this._objectID = objectID || 0; - this._objectTypeID = objectTypeID; - this._categoryName = categoryName; - if (includeUserGroups === undefined) { - includeUserGroups = true; - } - this._values = { - group: { }, - user: { } - }; - - this._proxy = new WCF.Action.Proxy({ - showLoadingOverlay: false, - success: $.proxy(this._success, this) - }); - - // bind hidden container - this._container = $(containerSelector).hide().addClass('aclContainer'); - - // insert container elements - var $elementContainer = this._container.children('dd'); - var $aclList = $('