User:Wikieat/global.js

// This file contains global JavaScript, loaded on every wiki. // For more information, see .

/** * Forces left-to-right layout and editing on RTL wikis. * @see https://meta.wikimedia.org/wiki/Force_ltr * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js');

/** * Ajax sysop * @see https://meta.wikimedia.org/wiki/Ajax_sysop * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');

/** * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see https://meta.wikimedia.org/wiki/TemplateScript * @update-token */ // $.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function {	pathoschild.TemplateScript.add([ // bot policy redirect {			name: 'bpi_redir', script: function(editor) { var text = editor.get; editor .set('#REDIRECT ' + text + '') .setEditSummary('redirected to bot request page for standard bot policy'); }		},		// insert bot policy text {			name: 'bpi_text', script: function(editor) { editor .prepend(						"* " + mw.config.get('wgContentLanguage') + ": \n"						+ "* en: Requests for the bot flag should be made on this page. This wiki uses the standard bot policy, and allows global bots and automatic approval of certain types of bots. Other bots should apply below, and then request access from a steward if there is no objection.\n"						+ "* en: Requests for the bot flag should be made on this page. This wiki uses the standard bot policy, and allows global bots and automatic approval of certain types of bots. Other bots should apply below.\n\n"					) .setEditSummary('implemented standard bot policy'); }		},		// insert bot policy proposal {			name: 'bpi_proposal', script: function(editor) { editor .replace(/[\s\n]*$/, '') .append(						'\n\n==Bot policy==\n'						+ 'Hello. To facilitate steward granting of bot access, I suggest implementing the standard bot policy on this wiki. In particular, this policy allows stewards to automatically flag known interlanguage linking bots (if this page says that is acceptable), which form the vast majority of such requests. The policy also enables global bots on this wiki (if this page says that is acceptable), which are trusted bots that will be given bot access on every wiki that allows global bots.\n'						+ '\n'						+ 'This policy makes bot access requesting much easier for local users, operators, and stewards. To implement it we only need to create a redirect to this page from Project:Bot policy, and add a line at the top noting that it is used here. Please read the text at Bot policy before commenting. If you object, please say so; I hope to implement it soon if there is no objection, since it is particularly written to streamline bot requests on wikis with little or no community interested in bot access requests.\n' + ' ~'					)					.setEditSummary('+ /* Bot policy */');			}		},		// format local bot request as already done		{			name: 'br_adone',			script: function(editor) {				// grab bot name & build message				var name = editor.get.replace(/^.+\[\\+)[\s\S]+$/, '$1');				var message = 'Already [ done]';				// pass to generic function				bot_done(editor, message, 're: already done');			}		},		{			name: 'br_gbot',			script: function(editor) {				bot_done(editor, "Not done; a local bot flag is no longer needed. This is a global bot, and this wiki recently enabled global bots", "not done, global bot");			}		},		{			name: 'bot_done',			script: function(editor) {				bot_done(editor, "done", "re: done");			}		}	]); function bot_done(editor, message, summary) { editor .replace( /^(=+)\s+(.+?)\s+(\1).+/, '$1$2$1' ) // fix header syntax .replace( /^(.+=)\n([\s\S]+)$/, '$1\n \n$2\n: ' + message + '. — Pathoschild 05:05, 16 August 2015 (UTC) \n ' ) // place formatted box & message .setEditSummary(summary); } }); //

/** * UTC clock * by w:User:AzaToth */ mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript');