Jump to content

User:Dibbydib/common.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// ==== import from user ====

importScript('User:Ohconfucius/script/formatgeneral.js'); // [[User:Ohconfucius/script/formatgeneral.js]]
importScript('User:Ohconfucius/script/MOSNUM dates.js'); // [[User:Ohconfucius/script/MOSNUM dates.js]]
importScript('User:Ohconfucius/script/Sources.js'); // [[User:Ohconfucius/script/Sources.js]]
importScript('User:SD0001/StubSorter.js'); // [[User:SD0001/StubSorter.js]]
importScript('User:EnterpriseyBot/delsort.js'); // enterprisey delsort thing
importScript('User:Anomie/unsignedhelper.js'); // [[User:Anomie/unsignedhelper.js]]
importScript('User:DannyS712/DiscussionCloser.js'); // [[User:DannyS712/DiscussionCloser.js]]
importScript('User:Evad37/rater.js'); // [[User:Evad37/rater]]
importScript("User:EnterpriseyBot/AFCRHS.js"); // AFCHRS
importScript("User:RedWarn/.js"); // [[WP:REDWARN]]
importScript('User:Lourdes/PageCuration.js'); // Linkback: [[User:Lourdes/PageCuration.js]]
// ==== scripts that change ====

$.when( mw.loader.using( ['mediawiki.util'] ), $.ready ).done( function() {
  mw.util.addPortletLink(
    'p-personal',
    mw.util.getUrl('User:Dibbydib/dashboard'),
    'DASH',
    'pt-dashboard',
    'Dashboard',
    null,
    '#pt-preferences'
  );
});

// Linkback: [[User:BrandonXLF/FindSources.js]]
$(function(){
	if (mw.config.get('wgNamespaceNumber') === 0) {
		(new mw.Api()).parse('{{Template:Find sources mainspace}}',{title:mw.config.get('wgPageName')}).done(function(e){
			$('#siteSub').after('<div style="font-size:85%;">' + $(e).find('p').first().html().replace(/<i>(.*?)<\/i>/g,'<span>$1</span>') + '</div>');
		});
	}
});
// afc guff
$(function(){
	if (mw.config.get('wgNamespaceNumber') === 118) {
		(new mw.Api()).parse('{{Template:Find sources mainspace}}<br />([[toolforge:randomincategory/Pending_AfC_submissions&server=en.wikipedia.org&namespace=2!118&type=page|Rand sub]] - [[Special:RandomInCategory/AfC pending submissions by age/0 days ago|0d]] - [[:Category:Pending template and disambiguation AfC submissions|T/D]] - [[Wikipedia:Articles for creation/Redirects and categories|R/C]] - [[:Category:AfC pending submissions by age|Subs by age]] - [[WP:WPAFC|WP]])',{title:mw.config.get('wgPageName')}).done(function(e){
			$('#siteSub').after('<div style="font-size:85%;">' + $(e).find('p').first().html().replace(/<i>(.*?)<\/i>/g,'<span>$1</span>') + '</div>');
		});
	}
});

// userpage template IPuser
$(function(){
	if (mw.config.get('wgNamespaceNumber') === 2) {
		(new mw.Api()).parse('{{IPuser|{{BASEPAGENAME}}}}',{title:mw.config.get('wgPageName')}).done(function(e){
			$('#siteSub').after('<div style="font-size:85%;">' + $(e).find('p').first().html().replace(/<i>(.*?)<\/i>/g,'<span>$1</span>') + '</div>');
		});
	}
	if (mw.config.get('wgNamespaceNumber') === 3) {
		(new mw.Api()).parse('{{IPuser|{{BASEPAGENAME}}}}',{title:mw.config.get('wgPageName')}).done(function(e){
			$('#siteSub').after('<div style="font-size:85%;">' + $(e).find('p').first().html().replace(/<i>(.*?)<\/i>/g,'<span>$1</span>') + '</div>');
		});
	}
});
// ==== meta load ====

mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" );
mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Perhelion/WikiEditorEmoticons.js&action=raw&ctype=text/javascript&maxage=86400&bcache=1');
importScript('User:DannyS712/SATG.js'); // Backlink: [[User:DannyS712/SATG.js]]
importScript('User:Awesome Aasim/noeditredlinks.js'); // Backlink: [[User:Awesome Aasim/noeditredlinks.js]]
importScript('User:Wugapodes/Capricorn.js'); // Backlink: [[User:Wugapodes/Capricorn.js]]