forked from kaltura/mwEmbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.js
196 lines (155 loc) · 7.58 KB
/
loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/**
*
* Core "loader.js" for mwEmbed
*
* This loader along with all the enabled module loaders is combined with mwEmbed.js
* via the script-loader.
*
*/
/**
* Core js components
*
* These components are pieces of the core mwEmbed lib
* They are in separate files to keep the code easier to maintain.
*
* All mwEmbed core classes are loaded on every mwEmbed request
*
* NOTE: All user / application module code should go into /modules
* and enabled in mwEnabledModuleList below.
*/
( function( mw, $ ) { "use strict";
var mwCoreComponentList = [
'mw.Parser',
'mw.Language',
'mw.Api'
];
/**
* mwEmbed default config values.
*/
mw.setDefaultConfig ( {
// Default coreComponents:
'coreComponents' : mwCoreComponentList,
// Default jquery ui skin name
'jQueryUISkin' : 'kdark',
// The mediaWiki path of mwEmbed
'mediaWikiEmbedPath' : 'js/mwEmbed/',
// Api actions that must be submitted in a POST, and need an api proxy for cross domain calls
'apiPostActions': [ 'login', 'purge', 'rollback', 'delete', 'undelete',
'protect', 'block', 'unblock', 'move', 'edit', 'upload', 'emailuser',
'import', 'userrights' ],
// If we are in debug mode ( results in fresh debug javascript includes )
'debug' : false,
// If mobile html5 should be forced
'forceMobileHTML5' : false,
// Default request timeout ( for cases where we include js and normal browser timeout can't be used )
// stored in seconds
'defaultRequestTimeout' : 30,
// Default user language is "en" Can be overwritten by:
// "uselang" url param
// wgUserLang global
'userLanguage' : 'en',
// Set the default providers ( you can add more provider via {provider_id}_apiurl = apiUrl
'commons_apiurl' : 'http://commons.wikimedia.org/w/api.php',
// Set the default loader group strategy
'loader.groupStrategy' : 'module',
// Default appendJS string ( not used outside of wikimedia gadget system )
'Mw.AppendWithJS' : false,
// The amount of days that user preferences stick around.
'Mw.UserPreferenceExpireDays' : 7,
// The xml proxy entry point for loading remote xml
'Mw.XmlProxyUrl' : mw.getMwEmbedPath() + 'simplePhpXMLProxy.php',
// Loading Spinner Image URL, by default false (we use Spin.js pure css spinner)
'LoadingSpinner.ImageUrl' : false
} );
/**
* -- Load Class Paths --
*
* PHP AutoLoader reads this loader.js file along with
* all the "loader.js" files to determine script-loader
* class paths
*
*/
// Set the loaderContext for the classFiles paths call:
mw.setConfig( 'loaderContext', '' );
/**
* Core set of mwEmbed classes:
*/
mw.addResourcePaths( {
"mwEmbed" : "mwEmbed.js",
"window.jQuery" : "libraries/jquery/jquery-1.7.2.js",
"$j.mobile" : "libraries/jquerymobile/jquery.mobile-1.0a2.js",
"mw.style.mobile" : "libraries/jquerymobile/jquery.mobile-1.0a2.css",
"iScroll" : "libraries/iscroll/src/iscroll-lite.js",
"fullScreenApi" : "libraries/fullScreenApi/fullScreenApi.js",
"mw.Language" : "components/mw.Language.js",
"mw.Parser" : "components/mw.Parser.js",
"mw.Api" : "components/mw.Api.js",
"Modernizr" : "libraries/jquery/plugins/modernizr.js",
"JSON" : "libraries/json/json2.js",
"MD5" : "libraries/crypto/MD5.js",
"utf8_encode" : "libraries/utf8/utf8_encode.js",
"base64_encode" : "libraries/base64/base64_encode.js",
"base64_decode" : "libraries/base64/base64_decode.js",
"$j.replaceText.js" : "libraries/jquery/plugins/jquery.replaceText.js",
"$j.fn.menu" : "libraries/jquery/plugins/jquery.menu/jquery.menu.js",
"mw.style.jquerymenu" : "libraries/jquery/plugins/jquery.menu/jquery.menu.css",
"$j.fn.pngFix" : "libraries/jquery/plugins/jquery.pngFix.js",
"$j.fn.autocomplete" : "libraries/jquery/plugins/jquery.autocomplete.js",
"mw.style.autocomplete" : "libraries/jquery/plugins/jquery.autocomplete.css",
"$j.fn.hoverIntent" : "libraries/jquery/plugins/jquery.hoverIntent.js",
"$j.fn.datePicker" : "libraries/jquery/plugins/jquery.datePicker.js",
"mw.style.ui_redmond" : "skins/jquery.ui.themes/redmond/jquery-ui-1.7.2.css",
"mw.style.ui_darkness" : "skins/jquery.ui.themes/darkness/jquery-ui-1.7.2.css",
"mw.style.ui_le-frog" : "skins/jquery.ui.themes/le-frog/jquery-ui-1.7.2.css",
"mw.style.ui_start" : "skins/jquery.ui.themes/start/jquery-ui-1.7.2.css",
"mw.style.ui_sunny" : "skins/jquery.ui.themes/sunny/jquery-ui-1.7.2.css",
"mw.style.ui_kdark" : "skins/jquery.ui.themes/kaltura-dark/jquery-ui-1.7.2.css",
"mw.style.ui_smoothness" : "skins/jquery.ui.themes/smoothness/jquery-ui-1.7.2.css",
"mw.style.mwCommon" : "skins/common/mw.style.mwCommon.css",
"mw.Uri" : "libraries/mediawiki/mediawiki.Uri.js",
"$j.cookie" : "libraries/jquery/plugins/jquery.cookie.js",
"$j.postMessage" : "libraries/jquery/plugins/jquery.postmessage.js",
"$j.contextMenu" : "libraries/jquery/plugins/jquery.contextMenu.js",
"$j.fn.suggestions" : "libraries/jquery/plugins/jquery.suggestions.js",
"$j.fn.textSelection" : "libraries/jquery/plugins/jquery.textSelection.js",
"$j.browserTest" : "libraries/jquery/plugins/jquery.browserTest.js",
"$j.fn.jWizard" : "libraries/jquery/plugins/jquery.jWizard.js",
"$j.ui" : "libraries/jquery/jquery.ui/ui/jquery.ui.core.js",
"$j.widget" : "libraries/jquery/jquery.ui/ui/jquery.ui.widget.js",
"$j.effects.blind" : "libraries/jquery/jquery.ui/ui/jquery.effects.blind.js",
"$j.effects.bounce" : "libraries/jquery/jquery.ui/ui/jquery.effects.bounce.js",
"$j.effects.clip" : "libraries/jquery/jquery.ui/ui/jquery.effects.clip.js",
"$j.effects" : "libraries/jquery/jquery.ui/ui/jquery.effects.core.js",
"$j.effects.drop" : "libraries/jquery/jquery.ui/ui/jquery.effects.drop.js",
"$j.effects.explode" : "libraries/jquery/jquery.ui/ui/jquery.effects.explode.js",
"$j.effects.fold" : "libraries/jquery/jquery.ui/ui/jquery.effects.fold.js",
"$j.effects.highlight" : "libraries/jquery/jquery.ui/ui/jquery.effects.highlight.js",
"$j.effects.pulsate" : "libraries/jquery/jquery.ui/ui/jquery.effects.pulsate.js",
"$j.effects.scale" : "libraries/jquery/jquery.ui/ui/jquery.effects.scale.js",
"$j.effects.shake" : "libraries/jquery/jquery.ui/ui/jquery.effects.shake.js",
"$j.effects.slide" : "libraries/jquery/jquery.ui/ui/jquery.effects.slide.js",
"$j.effects.transfer" : "libraries/jquery/jquery.ui/ui/jquery.effects.transfer.js",
"$j.ui.accordion" : "libraries/jquery/jquery.ui/ui/jquery.ui.accordion.js",
"$j.ui.autocomplete" : "libraries/jquery/jquery.ui/ui/jquery.ui.autocomplete.js",
"$j.ui.button" : "libraries/jquery/jquery.ui/ui/jquery.ui.button.js",
"$j.ui.datepicker" : "libraries/jquery/jquery.ui/ui/jquery.ui.datepicker.js",
"$j.ui.dialog" : "libraries/jquery/jquery.ui/ui/jquery.ui.dialog.js",
"$j.ui.droppable" : "libraries/jquery/jquery.ui/ui/jquery.ui.droppable.js",
"$j.ui.draggable" : "libraries/jquery/jquery.ui/ui/jquery.ui.draggable.js",
"$j.ui.mouse" : "libraries/jquery/jquery.ui/ui/jquery.ui.mouse.js",
"$j.ui.position" : "libraries/jquery/jquery.ui/ui/jquery.ui.position.js",
"$j.ui.progressbar" : "libraries/jquery/jquery.ui/ui/jquery.ui.progressbar.js",
"$j.ui.resizable" : "libraries/jquery/jquery.ui/ui/jquery.ui.resizable.js",
"$j.ui.selectable" : "libraries/jquery/jquery.ui/ui/jquery.ui.selectable.js",
"$j.ui.slider" : "libraries/jquery/jquery.ui/ui/jquery.ui.slider.js",
"$j.ui.sortable" : "libraries/jquery/jquery.ui/ui/jquery.ui.sortable.js",
"$j.ui.tabs" : "libraries/jquery/jquery.ui/ui/jquery.ui.tabs.js"
} );
// Add a special css dependency for $j.ui
mw.addStyleResourceDependency( {
'$j.ui' : ( 'mw.style.ui_' + mw.getConfig( 'jQueryUISkin' ) )
} );
mw.bindHelper = function( bindName, callback ){
$( window.mw ).bind( bindName, callback );
};
} )( window.mw, window.jQuery );