Updated ACP JavaScript to be somewhat similar, still not finished
authorAlexander Ebert <ebert@woltlab.com>
Mon, 1 Jun 2015 16:38:22 +0000 (18:38 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 1 Jun 2015 16:38:22 +0000 (18:38 +0200)
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/WoltLab/WCF/ACP/Bootstrap.js [new file with mode: 0644]

index 94f4133ca17d821d9f967852467eb989802e7866..cae38fe70c7e97f1e36733dc687c9b268716fabf 100644 (file)
        {@$__wcf->getStyleHandler()->getStylesheet(true)}
        {event name='stylesheets'}
        
-       <script data-relocate="true">
-               //<![CDATA[
+       <script>
                var SID_ARG_2ND = '{@SID_ARG_2ND_NOT_ENCODED}';
                var WCF_PATH = '{@$__wcf->getPath()}';
                var SECURITY_TOKEN = '{@SECURITY_TOKEN}';
                var LANGUAGE_ID = {@$__wcf->getLanguage()->languageID};
                var TIME_NOW = {@TIME_NOW};
                var URL_LEGACY_MODE = {if URL_LEGACY_MODE}true{else}false{/if};
-               //]]>
        </script>
        <script src="{@$__wcf->getPath()}js/3rdParty/jquery.min.js?v={@LAST_UPDATE_TIME}"></script>
        <script src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.min.js?v={@LAST_UPDATE_TIME}"></script>
@@ -31,9 +29,7 @@
        <script src="{@$__wcf->getPath()}js/require.js?v={@LAST_UPDATE_TIME}"></script>
        <script src="{@$__wcf->getPath()}js/require.config.js?v={@LAST_UPDATE_TIME}"></script>
        <script>
-               //<![CDATA[
                WCF.User.init({$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
-               //]]>
        </script>
        {event name='javascriptInclude'}
        
                        baseUrl: '{@$__wcf->getPath()}js'
                });
                
-               define('jquery', [], function() { return window.jQuery; });
-               
                $.holdReady(true);
-               require(['WoltLab/WCF/Bootstrap'], function(bootstrap) {
-                       bootstrap.setup();
-               });
        </script>
        
        <script>
-               require(['Language'], function(Language) {
+               require(['Language', 'WoltLab/WCF/ACP/Bootstrap'], function(Language, ACPBootstrap) {
                        Language.addObject({
                                '__days': [ '{lang}wcf.date.day.sunday{/lang}', '{lang}wcf.date.day.monday{/lang}', '{lang}wcf.date.day.tuesday{/lang}', '{lang}wcf.date.day.wednesday{/lang}', '{lang}wcf.date.day.thursday{/lang}', '{lang}wcf.date.day.friday{/lang}', '{lang}wcf.date.day.saturday{/lang}' ],
                                '__daysShort': [ '{lang}wcf.date.day.sun{/lang}', '{lang}wcf.date.day.mon{/lang}', '{lang}wcf.date.day.tue{/lang}', '{lang}wcf.date.day.wed{/lang}', '{lang}wcf.date.day.thu{/lang}', '{lang}wcf.date.day.fri{/lang}', '{lang}wcf.date.day.sat{/lang}' ],
                                'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}'
                                {event name='javascriptLanguageImport'}
                        });
+                       
+                       ACPBootstrap.setup();
                });
                
                $(function() {
                        {/if}
                        
                        if (jQuery.browser.touch) $('html').addClass('touch');
-                       //new WCF.Date.Time();
-                       new WCF.Effect.SmoothScroll();
                        
-                       //WCF.Dropdown.init();
+                       new WCF.Effect.SmoothScroll();
                        WCF.System.PageNavigation.init('.pageNavigation');
                        WCF.Date.Picker.init();
-                       //WCF.System.FlexibleMenu.init();
                        
                        {if $__wcf->user->userID}
                                new WCF.ACP.Search();
diff --git a/wcfsetup/install/files/js/WoltLab/WCF/ACP/Bootstrap.js b/wcfsetup/install/files/js/WoltLab/WCF/ACP/Bootstrap.js
new file mode 100644 (file)
index 0000000..1243c44
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * Bootstraps WCF's JavaScript with additions for the ACP usage.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2015 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module     WoltLab/WCF/ACP/Bootstrap
+ */
+define(['WoltLab/WCF/Bootstrap'], function(Bootstrap) {
+       "use strict";
+       
+       /**
+        * ACP Boostrapper.
+        * 
+        * @exports     WoltLab/WCF/ACP/Bootstrap
+        */
+       var ACPBootstrap = {
+               /**
+                * Bootstraps general modules and frontend exclusive ones.
+                * 
+                * @param       {object<string, *>}     options         bootstrap options
+                */
+               setup: function(options) {
+                       Bootstrap.setup();
+               }
+       };
+       
+       return ACPBootstrap;
+});