User:Jr Mime/global.js

//Variables (Auto protect-delete) var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'Junk', 'label': 'J' }; fdButtons[fdButtons.length] = { 'summary': 'Opinion', 'label': 'O' }; fdButtons[fdButtons.length] = { 'summary': 'Non-English', 'label': 'Ѭ' }; fdButtons[fdButtons.length] = { 'summary': 'Not a question', 'label': 'NQ' }; fdButtons[fdButtons.length] = { 'summary': 'Homework', 'label': 'HW' }; fdButtons[fdButtons.length] = { 'summary': 'Clean-up', 'label': 'C↑' }; fdButtons[fdButtons.length] = { 'summary': 'Too broad/not enough detail', 'label': 'B' }; fdButtons[fdButtons.length] = { 'summary': 'Violation of Wikias terms of use (pornography, advertisement, etc.)', 'label': 'ToU' };

var AjaxRCRefreshText = 'Auto-refresh'; var AjaxRCRefreshHoverText = 'Automatically refresh the page';

//Import Scripts importArticles({   type: "script",    articles: [        "w:c:dev:AjaxRC/code.js",        "w:c:dev:AjaxUndo/code.js",        "w:c:dev:FloatingToc/code.js",        "w:c:mlp:User:Jr Mime/MarkForTemplate/General.js",        "w:c:mlp:User:Jr Mime/MarkForTemplate/Welcome.js",        "w:c:answers:User:The Mol Man/Annihilate.js",        "w:c:answers:MediaWiki:Gadget-HotCat.js",        "w:c:answers:User:The Mol Man/FastDeleteProtect.js",    ] });

//Other Functions if ( wgNamespaceNumber !=undefined && !window.ToolbarLinksLoads ) { addOnloadHook( addToolbarLinkss ); }

var ToolbarLinksLoads = true; function addToolbarLinkss { $('Kill tool').insertAfter('ul.tools > li:first-childRTRC').insertAfter('ul.tools > li:first-child'); }

$('a.new').each(function {   if ($(this).attr('title').substring(0, 10) == "User talk:") {        var t_href = $(this).attr('href');        $(this).attr('href', t_href.substring(0, t_href.indexOf('?')));    } });

var editMenu = $('#WikiaPageHeader') .find('nav.wikia-menu-button') .find('ul.WikiaMenuElement'); $('Unsigned') .appendTo(editMenu) .click(function addTemplates {     var PageName = wgPageName;      $.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; $.getJSON("/api.php", {action: "query", prop: "revisions", titles:  PageName, rvprop: "user", format: "json", indexpageids: 1},   function(json) {  		var user = json.query.pages[pageid].revisions[0].user;                  var reason = "Adding unsigned template for: "+user;                  var addtexttalk = '';                  var namespace  = mw.config.get('wgNamespaceNumber');                  if (-1 < [1,3,5,7,9,11,13,15,110].indexOf(namespace))   {                      $.post("/api.php", {action: "edit", title: wgPageName, token: mw.user.tokens.values.editToken, appendtext: addtexttalk, summary: reason});               }  	  }); }); });