User:Shodai Tsuchi/scripts.js

// Imports importArticles({   type: 'script',    articles: [    'u:dev:PortableCSSPad/code.js',    'u:dev:RevealAnonIP/usercode.js',    'u:dev:LastEdited/code.js',    'u:dev:AjaxBatchDelete/code.2.js',    'u:dev:View_Source/code.js',    'u:dev:AjaxUndo/code.js',    'u:dev:PurgeButton/code.js',    'u:dev:Message/code.js',    'u:dev:AutoEditDropdown/code.js',    'u:dev:Quick_Management/code.js',    'u:dev:CategoryRenameAuto-update/code.js',    'u:dev:AjaxDiff/code.js',    'u:dev:AutoEditPages/code.js',    'u:dev:AjaxRC/code.js',    'u:dev:AjaxUndo/code.js',    'u:kiddo:User:Shodai_Tsuchi/AjaxUndoPersonal.js',    'u:cod:User:Madnessfan34537/redlinkfix.js',    'u:cod:User:Madnessfan34537/userlinks.js',    'u:kiddo:User:Shodai_Tsuchi/buttons.js',    'u:dev:QuickTemplate/code.js',    'u:dev:QuickContribs/code.js',     'u:dev:QuickCreateUserPage/code.js',    ] }); // AJAX window.ajaxRefresh = 3000; AjaxRCRefreshText = 'AJAX'; AjaxRCRefreshHoverText = 'Automaticamente recarregar a página'; window.ajaxPages = [ "Special:WikiActivity", "Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions", "Special:Block", "Special:Unblock" ]; batchDeleteDelay = 10; var qtUserPageTemplate = ''; var qtEnableUserPageOverwrite = true; // FastDelete Buttons importScriptPage('FastDelete/code.js', 'dev'); var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'V' }; fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'cleanup', 'label': 'C↑' }; fdButtons[fdButtons.length] = { 'summary': 'Violation of the ToU', 'label': 'ToU' }; fdButtons[fdButtons.length] = { 'summary': 'Sem sentido', 'label': 'SS' }; fdButtons[fdButtons.length] = { 'summary': 'Fanon content', 'label': 'FC' }; fdButtons[fdButtons.length] = { 'summary': 'Sem necessidade', 'label': 'SN' };

if (wgDBname == "wikia") { $("link[rel='shortcut icon'").attr("href",       "http://vignette2.wikia.nocookie.net/monchbox/images/f/f3/Icon-staff.png"    ); } // QuickBlock and QuickUnblock - Written by Shodai Tsuchi function quickBlock { var userArray = wgPageName.split(":"); $('.WikiaMenuElement').append('Block'); } if (wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk') { addOnloadHook(quickBlock); } function quickUnblock { var userArray = wgPageName.split(":"); $('.WikiaMenuElement').append('Unblock'); } if (wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk') { addOnloadHook(quickUnblock); }

var c = mw.config.get( [   'wgArticlePath',    'wgPageName',    'wgCanonicalSpecialPageName',    'wgTitle',    'wgAction',    'wgCanonicalNamespace',    'wgNamespaceNumber',    'wgUserGroups',    'wgSiteName',    'skin' ] ), array = [], escapedPage = encodeURIComponent(c.wgPageName); switch (c.wgCanonicalSpecialPageName) { /* Compile list of videos listed on Special:UnusedVideos and Special:UnusedFiles; add delete link */ case "UnusedVideos": case "Unusedimages": $('.mw-spcontent p:first').after('Compile'); $('#btn-compile').click(function {     array = [];      $('.gallerytext').each(function { if (!/File missing/gi.test($(this).text)) { array.push($(this).find('a').attr('title')); $(this).find('a').after(' (delete)'); }     });      alert(array.sort.join('\n').trim);    }); break; /* Add IP lookup on anon contribs */ case "Contributions": if ($('#anontalktext').length && c.wgTitle.split('.').length == 4) $('.masthead-info h2').html('(lookup)'); break; /* Create an edit link on Special:MovePage */ case "Movepage": $('#mw-movepage-table').find('a').first.after(' (edit)'); break; /* Add edit link to Special:WhatLinksHere listings */ case "Whatlinkshere": $('#mw-whatlinkshere-list li').find('a:first').each(function {     $(this).parent.find('a:last').before('<a href="' + $(this).attr('href') + '?action=edit">edit</a> | ');    }); break; /* Special:SearchDigest better functionality */ case "SearchDigest": $('#mw-content-text ul li').each(function {     if ($(this).find('a').attr('title').indexOf('(page does not exist)') === -1)        $(this).remove;    }); break; /* Dupe file list markup */ case "Blankpage": if ($.getUrlVar('blankspecial') === 'listdupefiles') { document.title = 'Duplicate Files'; $('#mw-content-text').html(' '); importScriptPage('DupImageList/code.js', 'dev'); } break; /* Make sure when using CheckUser on IPs, it always has users selected by default rather than edits */ case "CheckUser": if ($.getUrlVar('user').split('.').length == 4) $('#subipusers').attr('checked','checked'); break; } /* Unchecks redirects when moving files */ if (c.wgPageName.indexOf("Special:MovePage/File:") !== -1) $('#wpLeaveRedirect').removeAttr('checked'); /* Show abuse log entries in Special:Log/newusers */ if ("Special:Log/newusers".indexOf(c.wgPageName) !== -1) { $('.mw-logline-newusers').each(function {   $(this).find('.mw-usertoollinks').find('a:last').after(' | <a href="/wiki/Special:AbuseLog?wpSearchUser=' + $(this).find('.mw-userlink,.new mw-userlink').attr('href').split("User:")[1] + '">abuse</a>');  }); } /* Revision delete */ if (c.wgAction == 'revisiondelete' || c.wgCanonicalSpecialPageName == 'Revisiondelete') { $('#wpHidePrimary,#wpHideComment,#wpHideUser').attr('checked','checked'); $('#wpReason').val('spam'); } /* Thread history return to thread */ if (c.wgCanonicalNamespace == "Thread" && c.wgAction == "history") $('.SortingBar').after('<a href="/wiki/' + c.wgPageName + '" style="font-size:14px">Back to thread</a>'); /* Make Visual Editor links load the regular editor instead */ if ($.getUrlVar('veaction') == 'edit') location.replace(document.URL.replace('veaction','action')); /* Special:WhatLinksHere on redirect page */ if ($('#WikiaPageHeader h2').text.indexOf('Redirected from') != -1) $('#WikiaPageHeader h2').append(' <a href="/wiki/Special:WhatLinksHere/' + $('#WikiaPageHeader h2 a').attr('title') + '">(links)</a> <a href="/wiki/' + $('#WikiaPageHeader h2 a').attr('title') + '?action=history">(history)</a>'); /* Add link to chatconnect per banned user for MLP chat ban log */ if ("Special:Log/chatban".indexOf(c.wgPageName) !== -1 && c.wgSiteName == "My Little Pony Friendship is Magic Wiki") { $('.mw-logline-chatban').each(function {   $(this).find('.mw-usertoollinks:last').find('a:last').after(' | <a href="/wiki/Special:Log/chatconnect?user=' + $(this).find('a.new.mw-userlink,a.mw-userlink').last.attr('href').substring(11) + '">connect</a>');  }); } /* Always go to IP contributions, not userpage */ if (c.wgNamespaceNumber == 2 && $('h2:contains("A Wikia Contributor")').length) location.replace("/wiki/Special:Contributions/" + c.wgTitle.split('/')[1]); /* Remove Help:Contents from dropdown thing */ if ($('#globalNavigation').length) $('.user-menu.subnav li:nth-child(3),.hubs-entry-point').remove; /* Quick Dev Buttons */ if ($('.toolbar > .tools').length) { $('.toolbar > .tools > li:last').after(   $('').append('<a href="/index.php?title='+escapedPage+'&useskin=monobook">Monobook</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&allowuserjs=0">No User JS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&allowusercss=0">No User CSS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&usesitejs=0">No Site JS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&usesitecss=0">No Site CSS</a>'),    $('').append('<a href="/index.php?title='+escapedPage+'&uselang=qqx">MediaWiki Sources</a>')  ); } /* Auto-submit bugged pages for deletion */ if (c.wgAction == "delete" && $('#ca-edit').text.trim == "Create") $('#mw-img-deleteconfirm,#deleteconfirm').submit; /* Create dupe file list button */ if (c.skin === 'monobook') { mw.util.addPortletLink('p-tb', '/index.php?title=Special:BlankPage&blankspecial=listdupefiles', 'List Dupe Files', 't-dl'); } else { $('#my-tools-menu').prepend(' <a href="/index.php?title=Special:BlankPage&blankspecial=listdupefiles">List Dupe Files</a></li>'); } /* Untick minor edit box after 10 seconds when editing */ if (c.wgAction === 'edit' || c.wgAction === 'submit') { setTimeout(function {   if ($('#wpMinoredit').attr('Checked'))       $('#wpMinoredit').removeAttr('checked');  }, 10000); } /* Remove self user rights changes on Special:Log/rights */ if (c.wgPageName.indexOf("Special:Log/rights") !== -1) { $('#mw-content-text form').after('<a class="wikia-button" id="remove-self-changes">Others Only</a> '); $('#remove-self-changes').click(function {   $('.mw-logline-rights').each(function { if ($(this).children('a:first').text == $(this).children('a:last').text.split(':')[1]) //split using : to suit interlang $(this).remove; }); }); } }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {