From 4bbf6ff1aa08188575541c5193ef16770a82a36e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 3 May 2015 20:15:22 +0200 Subject: [PATCH] Initial commit for WCF 2.2 w/ require.js This is a highly experimental version and it is neither complete nor fully working. You cannot even install it at this time, if you really must play around with it, use version 2.1 and copy the necessary changes/additions. At this point it is not meant to be actively development in terms of new features or API changes, I'm solely focusing on playing around with require.js and see how these things turn out. --- README.md | 8 +- com.woltlab.wcf/package.xml | 128 +-- .../templates/headIncludeJavaScript.tpl | 65 +- wcfsetup/install/files/js/WCF.js | 857 +----------------- .../files/js/WoltLab/WCF/CallbackList.js | 65 ++ wcfsetup/install/files/js/WoltLab/WCF/Core.js | 75 ++ .../files/js/WoltLab/WCF/DOM/Traverse.js | 174 ++++ .../install/files/js/WoltLab/WCF/DOM/Util.js | 160 ++++ .../js/WoltLab/WCF/Date/Time/Relative.js | 85 ++ .../files/js/WoltLab/WCF/Dictionary.js | 112 +++ .../files/js/WoltLab/WCF/Event/Handler.js | 115 +++ .../files/js/WoltLab/WCF/UI/Alignment.js | 167 ++++ .../js/WoltLab/WCF/UI/Dropdown/Simple.js | 362 ++++++++ .../install/files/js/WoltLab/WCF/UI/Mobile.js | 172 ++++ .../files/js/WoltLab/WCF/UI/TabMenu.js | 36 + .../files/js/WoltLab/WCF/UI/TabMenu/Simple.js | 300 ++++++ wcfsetup/install/files/js/require.js | 36 + wcfsetup/install/files/style/layout.less | 4 + 18 files changed, 1968 insertions(+), 953 deletions(-) create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/CallbackList.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Core.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/DOM/Traverse.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/DOM/Util.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Date/Time/Relative.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Dictionary.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Event/Handler.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/UI/Alignment.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/UI/Dropdown/Simple.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/UI/TabMenu.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/UI/TabMenu/Simple.js create mode 100644 wcfsetup/install/files/js/require.js diff --git a/README.md b/README.md index 1c36ff544f..75a12a7d1e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -WoltLab Community Framework 2.1 +WoltLab Community Framework 2.2 =============================== WoltLab Community Framework is a free web-framework, designed and developed for complex community applications. The framework applies the latest and most modern technologies, it is structured completly object-oriented, constantly enhanced and forms the base for all WoltLab products. @@ -6,9 +6,11 @@ WoltLab Community Framework is a free web-framework, designed and developed for Version notes ------------- -This is the **stable** tree of WCF, changes will be rejected unless they fix an existing issue without changing the API. +This is the **EXPERIMENTAL/crash-for-sure** tree of WCF, it contains work in progress subject to change. At no point it is guaranteed to yield a successful build. -If you wish to access the **oldstable WCF 2.0.x** branch, please see here: [WCF 2.0.x](https://github.com/WoltLab/WCF/tree/2.0) +Other versions: +- **stable** branch: [WCF 2.1.x](https://github.com/WoltLab/WCF/tree/master) +- **oldstable** branch: [WCF 2.0.x](https://github.com/WoltLab/WCF/tree/2.0) About Redactor -------------- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 333a3b576b..dfa081cefb 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -5,8 +5,8 @@ 1 - 2.1.3 - 2015-04-14 + 2.2.0 Alpha 1 + 2015-05-03 @@ -42,128 +42,4 @@ aclOption.xml acp/post_install.php - - - - pre_update_check.tar - acp/pre_update_com.woltlab.wcf_2.1.php - - - option.xml - - files.tar - acp/update_com.woltlab.wcf_2.1.php - - templates.tar - - acptemplates.tar - - language/*.xml - - update_210.sql - - update_user1_210.sql - update_user2_210.sql - update_user3_210.sql - update_user4_210.sql - update_user5_210.sql - - acpMenu.xml - bbcode.xml - blue-temptation-style.tgz - clipboardAction.xml - coreObject.xml - cronjob_update210.xml - dashboardBox.xml - objectTypeDefinition.xml - objectType.xml - option.xml - pageMenu.xml - userGroupOption.xml - userMenu.xml - userNotificationEvent.xml - userOption.xml - userProfileMenu.xml - - acp/update_mqc_com.woltlab.wcf_2.1.php - acp/rebuild_comments_com.woltlab.wcf_2.1.php - - - - - pre_update_check.tar - acp/pre_update_com.woltlab.wcf_2.1.php - - - option.xml - - files.tar - acp/update_com.woltlab.wcf_2.1.php - - templates.tar - - acptemplates.tar - - language/*.xml - - update_210.sql - - update_user1_210.sql - update_user2_210.sql - update_user3_210.sql - update_user4_210.sql - update_user5_210.sql - - acpMenu.xml - bbcode.xml - blue-temptation-style.tgz - clipboardAction.xml - coreObject.xml - cronjob_update210.xml - dashboardBox.xml - objectTypeDefinition.xml - objectType.xml - option.xml - pageMenu.xml - userGroupOption.xml - userMenu.xml - userNotificationEvent.xml - userOption.xml - userProfileMenu.xml - - acp/update_mqc_com.woltlab.wcf_2.1.php - acp/rebuild_comments_com.woltlab.wcf_2.1.php - - - - - - acptemplates_update.tar - files_update.tar - templates_update.tar - - - - acptemplates_update.tar - files_update.tar - templates_update.tar - - - - acptemplates_update.tar - files_update.tar - templates_update.tar - - - - acptemplates_update.tar - files_update.tar - templates_update.tar - - - - acptemplates_update.tar - files_update.tar - templates_update.tar - diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index dacb6f49e7..d10950f90c 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -42,6 +42,9 @@ + + + {else} {/if} @@ -128,13 +131,65 @@ {event name='javascriptLanguageImport'} }); - new WCF.Date.Time(); + $(function() { + console.time('wcf'); + //WCF.TabMenu.init(); + //WCF.System.FlexibleMenu.init(); + console.timeEnd('wcf'); + }); + + + {if ENABLE_DEBUG_MODE} diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 31486786d7..a132200bde 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -409,11 +409,7 @@ $.fn.extend({ * @return string */ wcfIdentify: function() { - if (!this.attr('id')) { - this.attr('id', WCF.getRandomID()); - } - - return this.attr('id'); + return window.domUtilIdentify(this[0]); }, /** @@ -624,14 +620,7 @@ $.extend(WCF, { * @return string */ getRandomID: function() { - var $elementID = ''; - - do { - $elementID = 'wcf' + this._idCounter++; - } - while ($.wcfIsset($elementID)); - - return $elementID; + return window.domUtilGetUniqueId(); }, /** @@ -832,6 +821,8 @@ WCF.Dropdown = { */ _dropdowns: { }, + + /** * container for dropdown menus * @var object @@ -844,78 +835,14 @@ WCF.Dropdown = { */ _menus: { }, - /** - * Initializes dropdowns. - */ - init: function() { - if (this._menuContainer === null) { - this._menuContainer = $('