-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathext.togetherjs.config.js
More file actions
36 lines (33 loc) · 962 Bytes
/
ext.togetherjs.config.js
File metadata and controls
36 lines (33 loc) · 962 Bytes
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
( function ( mw ) {
"use strict";
/* TogetherJS configuration; loaded *before* TogetherJS loads. */
window.TogetherJSConfig = {
toolName: mw.msg( 'togetherjs-name' ),
baseUrl: mw.config.get( 'wgServer' ) +
mw.config.get( 'wgExtensionAssetsPath' ) +
'/TogetherJS',
hubBase: 'https://hub.togetherjs.com/',
useMinimizedCode: true,
cacheBust: false,
lang: (function(lang) {
// re-map language codes to those supported by togetherJS
if (/_/.test(lang || '')) {
return lang.replace(/_/g, '-');
}
return lang || 'en-US';
})(mw.config.get( 'wgUserLanguage' )),
callToStart: function(callback) {
// defer loading of TogetherJS until after mw loads.
var hook = mw.hook( 'togetherjs.autostart' );
var once = function() {
hook.remove(once);
callback();
};
hook.add( once );
},
getUserName: function() {
if (mw.user.isAnon()) { return null; }
return mw.user.getName();
}
};
}( mediaWiki ) );