Ensure require.config.js is loaded before require.js is used
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 18 May 2015 17:16:40 +0000 (19:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 18 May 2015 17:16:40 +0000 (19:16 +0200)
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
wcfsetup/install/files/acp/templates/header.tpl

index 82e4a1556bc9a81eede4c881766fc3d08af3c770..e677e83ab99465eb85556640f90561811bb1de16 100644 (file)
 <script src="{@$__wcf->getPath()}js/WCF.Combined.min.js?v={@LAST_UPDATE_TIME}"></script>
 {/if}
 
+<script data-relocate="true" src="{@$__wcf->getPath()}js/require.config.js"></script>
+<script data-relocate="true">
+       requirejs.config({
+               baseUrl: '{@$__wcf->getPath()}js'
+       });
+       
+       define('jquery', [], function() { return window.jQuery; });
+       
+       $.holdReady(true);
+       require(['WoltLab/WCF/BootstrapFrontend'], function(BootstrapFrontend) {
+               BootstrapFrontend.setup({
+                       styleChanger: {if $__wcf->getStyleHandler()->countStyles() > 1}true{else}false{/if}
+               });
+       });
+</script>
+
 <script data-relocate="true">
        WCF.User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
        
        });
 </script>
 
-<script data-relocate="true" src="{@$__wcf->getPath()}js/require.config.js"></script>
-<script data-relocate="true">
-       requirejs.config({
-               baseUrl: '{@$__wcf->getPath()}js'
-       });
-       
-       define('jquery', [], function() { return window.jQuery; });
-       
-       $.holdReady(true);
-       require(['WoltLab/WCF/BootstrapFrontend'], function(BootstrapFrontend) {
-               BootstrapFrontend.setup({
-                       styleChanger: {if $__wcf->getStyleHandler()->countStyles() > 1}true{else}false{/if}
-               });
-       });
-</script>
-
 {if ENABLE_DEBUG_MODE}
 <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Like.js?v={@LAST_UPDATE_TIME}"></script>
 <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.ACL.js?v={@LAST_UPDATE_TIME}"></script>
index 3af26e4e871d566626b1a58bb97d2ec38afb87bf..94f4133ca17d821d9f967852467eb989802e7866 100644 (file)
        <link rel="shortcut icon" href="{@$__wcf->getPath()}images/favicon.ico" />
        <link rel="apple-touch-icon" href="{@$__wcf->getPath()}images/apple-touch-icon.png" />
        
+       <script>
+               requirejs.config({
+                       baseUrl: '{@$__wcf->getPath()}js'
+               });
+               
+               define('jquery', [], function() { return window.jQuery; });
+               
+               $.holdReady(true);
+               require(['WoltLab/WCF/Bootstrap'], function(bootstrap) {
+                       bootstrap.setup();
+               });
+       </script>
        
-<script data-relocate="true">
-       
-</script>
        <script>
-               WCF.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}' ],
-                       '__months': [ '{lang}wcf.date.month.january{/lang}', '{lang}wcf.date.month.february{/lang}', '{lang}wcf.date.month.march{/lang}', '{lang}wcf.date.month.april{/lang}', '{lang}wcf.date.month.may{/lang}', '{lang}wcf.date.month.june{/lang}', '{lang}wcf.date.month.july{/lang}', '{lang}wcf.date.month.august{/lang}', '{lang}wcf.date.month.september{/lang}', '{lang}wcf.date.month.october{/lang}', '{lang}wcf.date.month.november{/lang}', '{lang}wcf.date.month.december{/lang}' ], 
-                       '__monthsShort': [ '{lang}wcf.date.month.short.jan{/lang}', '{lang}wcf.date.month.short.feb{/lang}', '{lang}wcf.date.month.short.mar{/lang}', '{lang}wcf.date.month.short.apr{/lang}', '{lang}wcf.date.month.short.may{/lang}', '{lang}wcf.date.month.short.jun{/lang}', '{lang}wcf.date.month.short.jul{/lang}', '{lang}wcf.date.month.short.aug{/lang}', '{lang}wcf.date.month.short.sep{/lang}', '{lang}wcf.date.month.short.oct{/lang}', '{lang}wcf.date.month.short.nov{/lang}', '{lang}wcf.date.month.short.dec{/lang}' ],
-                       'wcf.acp.search.noResults': '{lang}wcf.acp.search.noResults{/lang}',
-                       'wcf.clipboard.item.unmarkAll': '{lang}wcf.clipboard.item.unmarkAll{/lang}',
-                       'wcf.date.relative.now': '{lang}wcf.date.relative.now{/lang}',
-                       'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}',
-                       'wcf.date.relative.hours': '{capture assign=relativeHours}{lang}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}',
-                       'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}',
-                       'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}',
-                       'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}',
-                       'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}',
-                       'wcf.date.hour': '{lang}wcf.date.hour{/lang}',
-                       'wcf.date.minute': '{lang}wcf.date.minute{/lang}',
-                       'wcf.date.timeFormat': '{lang}wcf.date.timeFormat{/lang}',
-                       'wcf.date.firstDayOfTheWeek': '{lang}wcf.date.firstDayOfTheWeek{/lang}',
-                       'wcf.global.button.add': '{lang}wcf.global.button.add{/lang}',
-                       'wcf.global.button.cancel': '{lang}wcf.global.button.cancel{/lang}',
-                       'wcf.global.button.close': '{lang}wcf.global.button.close{/lang}',
-                       'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
-                       'wcf.global.button.delete': '{lang}wcf.global.button.delete{/lang}',
-                       'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
-                       'wcf.global.button.disabledI18n': '{lang}wcf.global.button.disabledI18n{/lang}',
-                       'wcf.global.button.edit': '{lang}wcf.global.button.edit{/lang}',
-                       'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}',
-                       'wcf.global.button.hide': '{lang}wcf.global.button.hide{/lang}',
-                       'wcf.global.button.next': '{lang}wcf.global.button.next{/lang}',
-                       'wcf.global.button.preview': '{lang}wcf.global.button.preview{/lang}',
-                       'wcf.global.button.reset': '{lang}wcf.global.button.reset{/lang}',
-                       'wcf.global.button.save': '{lang}wcf.global.button.save{/lang}',
-                       'wcf.global.button.search': '{lang}wcf.global.button.search{/lang}',
-                       'wcf.global.button.submit': '{lang}wcf.global.button.submit{/lang}',
-                       'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}',
-                       'wcf.global.confirmation.cancel': '{lang}wcf.global.confirmation.cancel{/lang}',
-                       'wcf.global.confirmation.confirm': '{lang}wcf.global.confirmation.confirm{/lang}',
-                       'wcf.global.confirmation.title': '{lang}wcf.global.confirmation.title{/lang}',
-                       'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
-                       'wcf.global.error.timeout': '{lang}wcf.global.error.timeout{/lang}',
-                       'wcf.global.error.title': '{lang}wcf.global.error.title{/lang}',
-                       'wcf.global.form.error.empty': '{lang}wcf.global.form.error.empty{/lang}',
-                       'wcf.global.form.error.greaterThan': '{lang __literal=true}wcf.global.form.error.greaterThan{/lang}',
-                       'wcf.global.form.error.lessThan': '{lang __literal=true}wcf.global.form.error.lessThan{/lang}',
-                       'wcf.global.loading': '{lang}wcf.global.loading{/lang}',
-                       'wcf.global.page.jumpTo': '{lang}wcf.global.page.jumpTo{/lang}',
-                       'wcf.global.page.jumpTo.description': '{lang}wcf.global.page.jumpTo.description{/lang}',
-                       'wcf.global.page.pageNavigation': '{lang}wcf.global.page.pageNavigation{/lang}',
-                       '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.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
-                       'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
-                       'wcf.global.success': '{lang}wcf.global.success{/lang}',
-                       'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}',
-                       'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}',
-                       'wcf.global.thousandsSeparator': '{capture assign=thousandsSeparator}{lang}wcf.global.thousandsSeparator{/lang}{/capture}{@$thousandsSeparator|encodeJS}',
-                       'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}'
-                       {event name='javascriptLanguageImport'}
+               require(['Language'], function(Language) {
+                       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}' ],
+                               '__months': [ '{lang}wcf.date.month.january{/lang}', '{lang}wcf.date.month.february{/lang}', '{lang}wcf.date.month.march{/lang}', '{lang}wcf.date.month.april{/lang}', '{lang}wcf.date.month.may{/lang}', '{lang}wcf.date.month.june{/lang}', '{lang}wcf.date.month.july{/lang}', '{lang}wcf.date.month.august{/lang}', '{lang}wcf.date.month.september{/lang}', '{lang}wcf.date.month.october{/lang}', '{lang}wcf.date.month.november{/lang}', '{lang}wcf.date.month.december{/lang}' ], 
+                               '__monthsShort': [ '{lang}wcf.date.month.short.jan{/lang}', '{lang}wcf.date.month.short.feb{/lang}', '{lang}wcf.date.month.short.mar{/lang}', '{lang}wcf.date.month.short.apr{/lang}', '{lang}wcf.date.month.short.may{/lang}', '{lang}wcf.date.month.short.jun{/lang}', '{lang}wcf.date.month.short.jul{/lang}', '{lang}wcf.date.month.short.aug{/lang}', '{lang}wcf.date.month.short.sep{/lang}', '{lang}wcf.date.month.short.oct{/lang}', '{lang}wcf.date.month.short.nov{/lang}', '{lang}wcf.date.month.short.dec{/lang}' ],
+                               'wcf.acp.search.noResults': '{lang}wcf.acp.search.noResults{/lang}',
+                               'wcf.clipboard.item.unmarkAll': '{lang}wcf.clipboard.item.unmarkAll{/lang}',
+                               'wcf.date.relative.now': '{lang}wcf.date.relative.now{/lang}',
+                               'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}',
+                               'wcf.date.relative.hours': '{capture assign=relativeHours}{lang}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}',
+                               'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}',
+                               'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}',
+                               'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}',
+                               'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}',
+                               'wcf.date.hour': '{lang}wcf.date.hour{/lang}',
+                               'wcf.date.minute': '{lang}wcf.date.minute{/lang}',
+                               'wcf.date.timeFormat': '{lang}wcf.date.timeFormat{/lang}',
+                               'wcf.date.firstDayOfTheWeek': '{lang}wcf.date.firstDayOfTheWeek{/lang}',
+                               'wcf.global.button.add': '{lang}wcf.global.button.add{/lang}',
+                               'wcf.global.button.cancel': '{lang}wcf.global.button.cancel{/lang}',
+                               'wcf.global.button.close': '{lang}wcf.global.button.close{/lang}',
+                               'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
+                               'wcf.global.button.delete': '{lang}wcf.global.button.delete{/lang}',
+                               'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
+                               'wcf.global.button.disabledI18n': '{lang}wcf.global.button.disabledI18n{/lang}',
+                               'wcf.global.button.edit': '{lang}wcf.global.button.edit{/lang}',
+                               'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}',
+                               'wcf.global.button.hide': '{lang}wcf.global.button.hide{/lang}',
+                               'wcf.global.button.next': '{lang}wcf.global.button.next{/lang}',
+                               'wcf.global.button.preview': '{lang}wcf.global.button.preview{/lang}',
+                               'wcf.global.button.reset': '{lang}wcf.global.button.reset{/lang}',
+                               'wcf.global.button.save': '{lang}wcf.global.button.save{/lang}',
+                               'wcf.global.button.search': '{lang}wcf.global.button.search{/lang}',
+                               'wcf.global.button.submit': '{lang}wcf.global.button.submit{/lang}',
+                               'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}',
+                               'wcf.global.confirmation.cancel': '{lang}wcf.global.confirmation.cancel{/lang}',
+                               'wcf.global.confirmation.confirm': '{lang}wcf.global.confirmation.confirm{/lang}',
+                               'wcf.global.confirmation.title': '{lang}wcf.global.confirmation.title{/lang}',
+                               'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
+                               'wcf.global.error.timeout': '{lang}wcf.global.error.timeout{/lang}',
+                               'wcf.global.error.title': '{lang}wcf.global.error.title{/lang}',
+                               'wcf.global.form.error.empty': '{lang}wcf.global.form.error.empty{/lang}',
+                               'wcf.global.form.error.greaterThan': '{lang __literal=true}wcf.global.form.error.greaterThan{/lang}',
+                               'wcf.global.form.error.lessThan': '{lang __literal=true}wcf.global.form.error.lessThan{/lang}',
+                               'wcf.global.loading': '{lang}wcf.global.loading{/lang}',
+                               'wcf.global.page.jumpTo': '{lang}wcf.global.page.jumpTo{/lang}',
+                               'wcf.global.page.jumpTo.description': '{lang}wcf.global.page.jumpTo.description{/lang}',
+                               'wcf.global.page.pageNavigation': '{lang}wcf.global.page.pageNavigation{/lang}',
+                               '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.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
+                               'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
+                               'wcf.global.success': '{lang}wcf.global.success{/lang}',
+                               'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}',
+                               'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}',
+                               'wcf.global.thousandsSeparator': '{capture assign=thousandsSeparator}{lang}wcf.global.thousandsSeparator{/lang}{/capture}{@$thousandsSeparator|encodeJS}',
+                               'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}'
+                               {event name='javascriptLanguageImport'}
+                       });
                });
                
                $(function() {
                        $('form[method=get]').attr('method', 'post');
                });
        </script>
-       <script>
-               requirejs.config({
-                       baseUrl: '{@$__wcf->getPath()}js'
-               });
-               
-               define('jquery', [], function() { return window.jQuery; });
-               
-               $.holdReady(true);
-               require(['WoltLab/WCF/Bootstrap'], function(bootstrap) {
-                       bootstrap.setup();
-               });
-       </script>
 </head>
 
 <body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}" class="wcfAcp">