User:Fenakhay/common.js

jQuery(document).ready(function ($) {	console.log("executing common.js");

try {

mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:BrandonXLF/QuickEdit.js&action=raw&ctype=text/javascript'); mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:BrandonXLF/ShowRevisionID.js&action=raw&ctype=text/javascript'); mw.loader.load('https://www.mediawiki.org/w/index.php?title=XTools/ArticleInfo.js&action=raw&ctype=text/javascript'); importScript("User:Erutuon/scripts/cleanup.js"); importScript("User:Erutuon/scripts/addAutoCat.js"); importScript("User:Erutuon/scripts/phonemicGreekTransliteration.js"); importScript("User:Fenakhay/scripts/nonmainspaceCategories.js"); importScript("User:Erutuon/scripts/gadgets-definition.js"); importScript("User:Fenakhay/extraCategoryLinks.js"); importScript("User:Ioaxxere/minitoc.js"); importScript("User:Ioaxxere/PagePreviews.js"); importScript("User:Erutuon/scripts/gadgets-definition.js");

/********* rollback msg *********/ $('span.mw-rollback-link a').each(function { if (-~this.href.indexOf('&action=rollback&') && this.href.indexOf('summary=') < 0) this.href += '&summary=Reverted%20edits%20by%20%5B%5BSpecial%3AContributions%2F%242%7C%242%5D%5D.%20If%20you%20think%20this%20rollback%20is%20in%20error%2C%20please%20leave%20a%20message%20on%20my%20%5B%5BUser%20talk%3AFenakhay%7Ctalk%20page%5D%5D.' });

/********* silent rb *********/ $('#p-tb ul').append('Hide RB msgs'); $('#fenakhay-t-rb-lta-link').click(function {			$('span.mw-rollback-link a').each(function  { if (-~this.href.indexOf('&action=rollback&')) { if (this.href.indexOf('summary=') >= 0) this.href = this.href.split('&summary=')[0]; this.href += '&summary=rv%2Fv'; }			});			alert("ok");		});

/********* mass revdel *********/ mw.loader.load('//en.wiktionary.org/w/index.php?title=User:Surjection/massRevdel.js&action=raw&ctype=text/javascript');

/********* mass rv *********/ {			var nukeLink = $('.mw-changeslist-links .mw-contributions-link-nuke'); if (nukeLink) { var linkSpan = nukeLink.parent; var rv = $('mass revert'); rv.click(function (e) {					if (confirm('Are you sure?')) {						$('.mw-contributions-current span.mw-rollback-link a').each(function { if (-~this.href.indexOf('&action=rollback&')) { window.open(this.href, '_blank'); }						});						alert("OK");					}				}); $(' ').append(rv).insertAfter(linkSpan); }		}

/********* quick move revert *********/ $('.mw-logline-move a[href*="wpReason=revert"]').each(function {			if (this.href.indexOf('&autosubmitmove=1') < 0)				this.href += '&wpLeaveRedirect=0&autosubmitmove=1';		}); if (mw.config.get("wgPageName").startsWith("Special:MovePage") && new URL(window.location.href).searchParams.get("autosubmitmove") == '1') { $('button[name="wpMove"]').click; }

/********* quick LTA block *********/ var ltaBlockLink = '/wiki/Special:Block/@@@?wpCreateAccount=1&wpDisableUTEdit=1&wpExpiry=indefinite&wpHardBlock=1&wpReason=Vandalism&wpReason-other=LTA&wpDisableEmail=1&autosubmitblock=0'; var spamBlockLink = '/wiki/Special:Block/@@@?wpCreateAccount=1&wpDisableUTEdit=1&wpExpiry=indefinite&wpHardBlock=1&wpReason=Promotional%20material%2Fspamming&wpDisableEmail=1&autosubmitblock=0'; var proxyBlockLink = '/wiki/Special:Block/@@@?wpCreateAccount=1&wpDisableUTEdit=1&wpExpiry=6+months&wpHardBlock=1&wpReason=Suspected+%5B%5BWiktionary%3AProject+-+Open+proxies%7Copen+proxy%5D%5D&autosubmitblock=0'; var botBlockLink = '/wiki/Special:Block/@@@?wpCreateAccount=1&wpDisableUTEdit=1&wpExpiry=indefinite&wpHardBlock=1&wpReason=Unauthorized+bot+%28see+%5B%5BWT%3ABOT%5D%5D%29&wpDisableEmail=1&autosubmitblock=0'; var hiddenBlockLink = '/wiki/Special:Block/@@@?wpCreateAccount=1&wpDisableUTEdit=1&wpExpiry=indefinite&wpHardBlock=1&wpDisableEmail=1&autosubmitblock=0'; if (mw.config.get("wgPageName").startsWith("Special:Contributions/")) { var isIP = !Array.prototype.find.call(document.getElementsByTagName("a"), function (a) { return (a.getAttribute("title") || '').slice(0, 5) == "User:" }); var buttons = isIP ? "proxy block", proxyBlockLink : "LTA block", ltaBlockLink], ["stealth block", hiddenBlockLink], ["spam block", spamBlockLink], ["bot block", botBlockLink; var pn = mw.config.get("wgPageName"); var usern = pn.slice(pn.indexOf("/") + 1); var makeLink = function (url) { return url.replace("@@@", usern); }; buttons.forEach(function (button) {				$('#contentSub a[href*="Special:Block/"]').first.after(' | (' + button[0] + ')');			}); }		if (mw.config.get("wgPageName").startsWith("Special:Block/") && new URL(window.location.href).searchParams.get("autosubmitblock") == '1') { $('button[value="Block this user"]').click; }

/********* block IPv6 /64 by default *********/ if (mw.config.get("wgPageName").startsWith("Special:Contributions/") || mw.config.get("wgDiffNewId")) { var blockIPv6 = /Special:Block\/[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{1,4}$/; $('a[href*="/Special:Block/"]').each(function (i, element) {				element.href = element.href.replace(blockIPv6, function (m) { return m + "/64"; });			}); }

/********* autofeed *********/ if (mw.config.get('wgAction') == 'edit' && new URLSearchParams(document.location.search).has('autofeedtext')) { var editField = $('#wpTextbox1'); if (editField.val) { var newtext = document.createElement('textarea'); newtext.setAttribute('readonly', true); newtext.setAttribute('rows', 20); newtext.textContent = new URLSearchParams(document.location.search).get('autofeedtext'); document.getElementById('mw-content-text').insertBefore(newtext, document.getElementById('editform')); } else { editField.val(new URLSearchParams(document.location.search).get('autofeedtext')); }		}	} catch (e) { console.error(e); }

mw.hook("wikipage.content").add(function { console.log("wikipage.content hook"); });

console.log("executed common.js"); });