User:919dd/global.js

// Standard Summaries window.dev = window.dev || {};

window.dev.editSummaries = { css: '#stdSummaries { ... }',    select: 'User:919dd/Standard Edit Summary' }; // Personal importArticles({   type: 'script',    articles: [    	'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:Standard Edit Summary/code.js',        'u:dev:MediaWiki:FileUsageAuto-update/code.js',        'u:dev:MediaWiki:PageRenameAuto-update/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        //'u:dev:MediaWiki:JWB/load.js',//        'u:dev:MediaWiki:ListFiles/code.js',        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:DupeArgs.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:DiscussionsActivity.js',        'u:dev:MediaWiki:QuickPurge.js',        'u:dev:MediaWiki:ScrollUpButton.js',        'u:dev:MediaWiki:Discussions Delete All/code.js',        'u:dev:MediaWiki:EditLeaderboard.js',        'u:dev:MediaWiki:RedirectManagement/code.js',        ] });

var properLinks = { init: function { this.api = new mw.Api; this.pages; },   pages: function { var api = this.api; document.querySelectorAll('.mw-changeslist-links > span:first-child').forEach(              function(el) {                if (el.childNodes.length === 1 && el.childElementCount === 0){                    var pageName = el.parentNode.parentNode.parentNode.getElementsByClassName('mw-changeslist-title')[0].attributes.title.nodeValue;                    while (el.firstChild) {                      el.removeChild(el.firstChild);                    }                    api.get({ action: 'query', titles: pageName, meta: 'tokens', prop: 'revisions', rvprop: 'ids|timestamp|user|userid|size|parsedcomment|flags', rvlimit: 1000, formatversion: 2 }).then(function(data) { var link = document.createElement('a'); var page = data.query.pages[0].title; var revisions = data.query.pages[0].revisions; var from = revisions[revisions.length-1].revid; var to = revisions[0].revid; if (from === to) { from = 0; } var label = 'diff'; if (revisions.length>1) { label = revisions.length + ' changes'; } link.href = '/wiki/'+page+'?diff='+ to +'&oldid='+from; link.title = page; link.appendChild(document.createTextNode(label)); el.appendChild(link); });               }            }        );    } }; mw.loader.using([    'mediawiki.api',    'mediawiki.util',    (mw.config.get('isGamepedia') ? 'jquery.timeago' : 'jquery') ]).then(function {   $($.proxy(properLinks.init, properLinks)); });