2 * Bootstraps WCF's JavaScript.
3 * It defines globals needed for backwards compatibility
4 * and runs modules that are needed on page load.
6 * @author Tim Duesterhus
7 * @copyright 2001-2015 WoltLab GmbH
8 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
9 * @module WoltLab/WCF/Bootstrap
13 'favico', 'enquire', 'perfect-scrollbar', 'WoltLab/WCF/Date/Time/Relative',
14 'UI/SimpleDropdown', 'WoltLab/WCF/UI/Mobile', 'WoltLab/WCF/UI/TabMenu', 'WoltLab/WCF/UI/FlexibleMenu',
15 'UI/Dialog', 'WoltLab/WCF/UI/Tooltip', 'WoltLab/WCF/Language', 'WoltLab/WCF/Environment'
18 favico
, enquire
, perfectScrollbar
, DateTimeRelative
,
19 UISimpleDropdown
, UIMobile
, UITabMenu
, UIFlexibleMenu
,
20 UIDialog
, UITooltip
, Language
, Environment
25 // perfectScrollbar does not need to be bound anywhere, it just has to be loaded for WCF.js
26 window
.Favico
= favico
;
27 window
.enquire
= enquire
;
28 // non strict equals by intent
29 if (window
.WCF
== null) window
.WCF
= { };
30 if (window
.WCF
.Language
== null) window
.WCF
.Language
= { };
31 window
.WCF
.Language
.get = Language
.get;
32 window
.WCF
.Language
.add
= Language
.add
;
33 window
.WCF
.Language
.addObject
= Language
.addObject
;
36 * @exports WoltLab/WCF/Bootstrap
40 * Initializes the core UI modifications and unblocks jQuery's ready event.
45 DateTimeRelative
.setup();
47 UISimpleDropdown
.setup();
50 UIFlexibleMenu
.setup();
54 // convert method=get into method=post
55 var forms
= document
.querySelectorAll('form[method=get]');
56 for (var i
= 0, length
= forms
.length
; i
< length
; i
++) {
57 forms
[i
].setAttribute('method', 'post');
60 if (Environment
.browser() === 'microsoft') {
61 window
.onbeforeunload = function() {
62 /* Prevent "Back navigation caching" (http://msdn.microsoft.com/en-us/library/ie/dn265017%28v=vs.85%29.aspx) */
68 interval = window.setInterval(function() {
69 if (typeof window.jQuery === 'function') {
70 window.clearInterval(interval);
72 window.jQuery.holdReady(false);