Jump to content

User:Cscott/TogetherJS.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cscott (talk | contribs) at 09:45, 9 August 2014 (Import configuration.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* TogetherJS configuration; loaded *before* TogetherJS loads. */
TogetherJSConfig = {
	toolName: 'TogetherJS', // HACKED
	baseUrl: "//togetherjs.wmflabs.org/extensions/TogetherJS/togetherjs", // HACKED
	hubBase: 'https://togetherjs-hub.wmflabs.org',
	lang: (function(lang) {
		// re-map language codes to those supported by togetherJS
		if (/^ru/.test(lang)) return "ru";
		return "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();
	}
};
importScript( 'User:cscott/TogetherJS-loader.js' );