User:Minato826/global.js

//*Mass Categorization*// massCategorizationDelay = 1000; importScriptPage('MediaWiki:MassCategorization/code.js', 'dev');

$( document ).ready( function { mw.util.addPortletLink( 'p-personal', mw.util.wikiGetlink('Special:NewPagesFeed'), 'Page Curation', 'pt-pagecuration', 'View Special:New Pages using the Page Curation tool', null, '#pt-preferences' ); });

// This script reimpliments the last edit banner used on mobile // See User:Opencooper/lastEdit // TODO: standardize on either single or double quotes

function requestRevision { // If we're not reading an article, do nothing if (!(mw.config.get( 'wgAction' ) === 'view' && mw.config.get( 'wgIsArticle' ) && mw.config.get("wgPageName") !== "Main_Page")) { return; }   // API docs: https://www.mediawiki.org/wiki/API:Revisions $.ajax({       url: "https://en.wikipedia.org/w/api.php?action=query&prop=revisions&format=json&titles="             + mw.config.get('wgPageName')             + "&rvprop=timestamp%7Cuser%7Ccomment%7Ctags%7Cids",        success: displayEdit    }); }

// Display the last edit info to the right of the site subhead function displayEdit(response) { var pageId = mw.config.get('wgArticleId'); var pageInfo = response.query.pages[pageId].revisions[0]; // Relies on moment.js. See script history for an inline implementation var relativeTimestamp = moment(pageInfo.timestamp).fromNow;

var editComment = pageInfo.comment; if (!editComment) { editComment = "[No edit summary]"; }   editComment = editComment.replace(/'/g, "&#39;"); // HTML encode quotes

var lastEdit = " Last edited " + relativeTimestamp + ""; var lastEditor = "" + pageInfo.user + ""; // Can be filtered if needed var pageTags = ""; if (pageInfo.tags.length > 0) { pageTags = " (" + pageInfo.tags + ") "; }

var notice = lastEdit + " by " + lastEditor + pageTags;

// MediaWiki:Gadget-metadata.js replaces the siteSub element so wait for it   // to run first // Check if script is enabled and if it hasn't ran already if ($("script").text.search("ext.gadget.metadata") != -1 && !$(".assess-article-rating").length) { var target = document.querySelector('#siteSub'); var observer = new MutationObserver(function(mutations) { // IE 11+           $('#siteSub').append(" " + notice + " ");            observer.disconnect;        });

observer.observe(target, {childList: true}); } else { $('#siteSub').append(" " + notice + " "); }

// Unfortunately Template:Coords absolutely positions itself so we have // to move it down so we don't get obscured var sheet = window.document.styleSheets[0]; sheet.insertRule('#coordinates { top: 2em !important; }', sheet.cssRules.length); }

$(requestRevision);

//From StarmanW // Always show bots--Full Credits goes to Dorumin $('a').each(function {  if ( $(this).attr('href') == '/wiki/Special:RecentChanges' ) {      $(this).attr('href', '/wiki/Special:RecentChanges?hidebots=0');   } }); importScriptPage('MediaWiki:Nuke/code.js', 'dev'); // Remove MPC--Full Credits goes to Dorumin if ( $(".youtubeplayer").length ) { $('ul.tools li:first-child:not(.tools-menu li)').after('Remove MPC'); $(".removeMPC").click(function {       $(".youtubeplayer").remove;        $(".removeMPC").remove;    }); }

//Linksweeper linkSweepConfirmation = true; LinkSweeperDelay = 1000;

//MassRename settings massRenameDelay = 1000;

//MassCat massCategorizationDelay = 500;

//Page Creator options var PCOptions = { namespaces: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 110, 111, 828, 829, 1202] };

// Fast Delete var fdButtons = []; fdButtons[fdButtons.length] = {'summary': 'spam','label': 'S'}; fdButtons[fdButtons.length] = {'summary': 'vandalism','label': 'V'}; fdButtons[fdButtons.length] = {'summary': 'Housekeeping','label': 'HK'}; fdButtons[fdButtons.length] = {'summary': 'Duplicate','label': 'D'}; fdButtons[fdButtons.length] = {'summary': 'Unused','label': 'U'}; fdButtons[fdButtons.length] = {'summary': 'Unofficial/Not-Needed/Irrelevant','label': 'UNI'}; fdButtons[fdButtons.length] = {'summary': 'Other reason','label': 'Other'};

importArticles( {   type: 'script',    articles: [        // ...        'u:dev:FastDelete/code.js',        // ...    ] } );

$(window).load(function {   importArticles({ type: "script", articles: [ 'u:dev:AjaxBlock/code.js', 'u:dev:AjaxPatrol/code.js', 'u:dev:RedirectManagement/beta.js', 'u:dev:MediaWiki:AjaxBatchDelete/code.js', 'u:dev:MediaWiki:AjaxBatchUndelete/code.js', 'u:dev:MediaWiki:AjaxDiff/code.js', 'u:dev:MediaWiki:AjaxRC/code.js', 'u:dev:MediaWiki:AjaxRedirect/code.js', 'u:dev:MediaWiki:AjaxRename/code.js', 'u:dev:MediaWiki:AjaxUndo/code.js', 'u:dev:MediaWiki:AnchoredRollback/code.js', 'u:dev:MediaWiki:AntiSoundcloud/code.js', 'u:dev:MediaWiki:AutoEditDropdown/code.js', 'u:dev:MediaWiki:CacheCheck/code.js', 'u:dev:MediaWiki:CategoryRenameAuto-update/code.js', 'u:dev:MediaWiki:DisplayTimer/code.js', 'u:dev:FastDelete/code.js', 'u:dev:MediaWiki:LastEdited/code.js', 'u:dev:MediaWiki:Linksweeper/code.js', 'u:dev:MediaWiki:MassRename/code.js', 'u:dev:MediaWiki:MassRenameRevert/code.js', 'u:dev:MediaWiki:MultipleFileDelete/code.js', 'u:dev:MediaWiki:RedirectManagement/code.js', 'u:dev:MediaWiki:RevealAnonIP/code.js', 'u:dev:MediaWiki:SearchSuggest/code.js', 'u:dev:MediaWiki:UserAccountAge/code.js', 'u:dev:MediaWiki:View_Source/code.js', 'u:dev:MediaWiki:ViewRemovedAlways/code.js', 'u:dev:ViewRemovedAlways/code.js', 'u:kocka:MediaWiki:AjaxThreadDelete/code.js', 'u:kocka:MediaWiki:VSTFReport/code.js', 'u:kocka:User:KockaAdmiralac/EmptyDeleteReason.javascript', 'u:kocka:User:KockaAdmiralac/UnhideUserWikis.javascript', 'u:starmanw:MediaWiki:MultiUpload/code.js', 'u:starmanw:MediaWiki:QuickLogs/code.js', 'u:admintools:MediaWiki:Common.js/Maintenance.js', 'u:dev:MediaWiki:AllPagesHideRedirect/code.js', 'u:dev:MediaWiki:DiscussionsFeed.js', 'u:dev:MediaWiki:GlobalEditcount/code.js', 'u:dev:MediaWiki:LastEdited/code.js', 'u:dev:MediaWiki:MassNullEdit/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:OldFilePages/code.js', 'u:dev:MediaWiki:QuickDiff/code.js'

]   }); });

/*self import */ importArticles({   type: "script",    articles: [        'u:the-last-tycoon:User:Minato826/wikia.js'        ] });

importArticles({   type: "script",    articles: [        'u:travel:User:Minato826/wikia.js'        ] });

importArticles({   type: "script",    articles: [        'u:hi.travel:User:Minato826/wikia.js'        ] });

// TWEAKS $(function {   $(' Admins  ').insertBefore('.wds-global-navigation__search');    $(' Global.js  ').insertBefore('.wds-global-navigation__search'); });