User:TheDJ/common.js

Source: 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.
importScript( 'User:TheDJ/inlinestylechecker.js' );


// window.wma_settings = {enabled:false}

//mw.loader.load('//en.wikipedia.org/w/index.php?title=User:TheDJ/ActualLivePreview.js&action=raw&ctype=text/javascript');
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Equazcion/ScriptInstaller.js&action=raw&ctype=text/javascript&maxage=86400' ); // Backlink: [[User:Equazcion/ScriptInstaller.js]]
//importScript( 'MediaWiki:Gadget-StickyTableHeaders.js' );

// function localDeprecate(obj, key, val, msg, logName) {
// 	mw.notify( $.parseHTML('Your wiki Javascript will soon stop working because it is using the outdated '
// 		+ encodeURIComponent( key )
// 		+ '. You can report at the <a href="/w/index.php?title=Wikipedia:Interface_administrators%27_noticeboard/helpme&action=edit&section=new&preload=Wikipedia:Interface_administrators%27_noticeboard/deprecationsTemplate' 
// 			+ '&preloadparams%5b%5d='
// 			+ encodeURIComponent( mw.config.get('wgUserName') )
// 			+ '&preloadparams%5b%5d='
// 			+ encodeURIComponent( key )
// 			+ '&preloadparams%5b%5d='
// 			+ encodeURIComponent( msg )
// 			+ '&preloadparams%5b%5d='
// 			+ encodeURIComponent( mw.config.get('skin') )
// 			+ '">noticeboard</a> to request assistence.'), {
// 		autoHide: false,
// 		type: 'warn'
// 	} );
//     mw.log.deprecate( obj, key, val, msg, logName );
// }

// mw.loader.using('mediawiki.util', function() {
// 	localDeprecate( window, 'addPortletLink2', mw.util.addPortletLink, 'Use mw.util.addPortletLink instead' );
// 	addPortletLink2();
// })

$(function (){
	if(document.querySelectorAll('.mw-empty-elt').length > 0){
		mw.log.error( "Empty elements: " + document.querySelectorAll('.mw-empty-elt').length );
	}
});


/* User:קיפודנחש/cat-a-lot.js */
// importScript( 'User:קיפודנחש/cat-a-lot.js' );// Backlink: [[User:קיפודנחש/cat-a-lot.js]]

TwinkleConfig = {
  userTalkPageMode : 'tab'
};

popupRevertSummaryPrompt=true;
popupPreviewRawTemplates=true;
popupPreviewKillTemplates=false;
popupPreviewButton=true;
popupFixDabs=true;
popupFixRedirs = true;
popupRedlinkRemoval = true;
popupStructure='menus';
popupDebug=true;
// Wikipedia:Tools/Navigation popups
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:TheDJ/popups.js&action=raw&ctype=text/javascript' );
// mw.loader.load('/w/load.php?modules=ext.gadget.Navigation_popups&only=styles', 'text/css');
mw.loader.using(['mediawiki.api', 'mediawiki.user', 'mediawiki.util', 'user.options', 'mediawiki.jqueryMsg']).then(function() {
	importScript('w:User:Sohom_Datta/popups.js');
	importStylesheet('w:MediaWiki:Gadget-navpop.css');
});


// Adds a "Random template" link to the Navigation box
function addLinksInit() {
  mw.util.addPortletLink( 'p-navigation', mw.config.get( 'wgArticlePath' ).replace('$1','Special:Random/Template'), 'Random template', 'n-randomtemplate', 'Load a random template', null );
  $(mw.util.addPortletLink( 'p-tb', '', 'Parse talkpage', 'n-talkpage-model', '', null )).on( 'click', function ( e ) {
  	importScript( 'User:TheDJ/signaturedetector.js' );
  	e.preventDefault();
  } );
}
$.when( mw.loader.using( [ 'mediawiki.util' ] ), $.ready ).done( addLinksInit );

// importScript( 'User:TheDJ/flowidth.js' );
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:TheDJ/ActualLivePreview.js&action=raw&ctype=text/javascript');
mw.hook( 'codeEditor.configure' ).add( function(session) {
    session.setUseWrapMode(true);
    session.setWrapLimitRange(120, 120);
});
// importScript('User:Js/urldecoder.js'); //Linkback: [[User:Js/urldecoder.js]] Added by Script installer
// importScript('User:Dr pda/prosesize.js'); //Linkback: [[User:Dr pda/prosesize.js]] Added by Script installer

// $( function() {
// 	// SVG embedder
// 	var svgRoot;
// 	$('.mwe-math-element > img.mwe-math-fallback-image-inline').each( function(index, element) {
// 		$.get( $( element ).attr('src') ).done( function( document ) {
// 			svgRoot = document.getElementsByTagName('svg');
// 			if( svgRoot.length > 0 ) {
// 				svgRoot = document.importNode(svgRoot[0], true);
// 				$( element ).replaceWith( svgRoot );
// 			}
// 		});
// 	});
// });

// if( $.inArray( 'sysop', mw.config.get('wgUserGroups') ) !== -1 && Math.floor(Math.random()*10) % 2 === 0) {
// 	$.when( mw.loader.using( ['oojs-ui-windows', 'mediawiki.storage'] ), $.ready ).done( function() {
// 		if( mw.storage.get('ignore-deprecatedJS') === true ){
// 			return;
// 		}
// 		var messageDialog = new OO.ui.MessageDialog();
		
// 		// Create and append window manager
// 		var windowManager = new OO.ui.WindowManager();
// 		$( 'body' ).append( windowManager.$element );
		
// 		// Add the dialog to the window manager
// 		windowManager.addWindows( [ messageDialog ] );
		
// 		// Configure the message dialog when it is opened with the window manager’s openWindow() method.
// 		windowManager.openWindow( messageDialog, {
// 		  title: 'Deprecated Javascript in use !',
// 		  size: 'large',
// 		  message: 'Sorry for disturbing you. English Wikipedia is trying to make sure that everyone is using up to date Gadgets and userscripts. We detected that you are using a Javascript which might be problematic.<br> If you choose "Help me !", then you will automatically leave a message so that one of the developers can help you out with updating your scripts. When you dismiss, we will try not to bother you again !',
// 		  verbose: true,
// 		  actions: [
// 		    {
// 		      action: 'help',
// 		      label: 'Help me !',
// 		      flags: 'primary'
// 		    },
// 		    {
// 		      action: 'dismiss',
// 		      label: 'Dismiss',
// 		    }
// 		  ]
// 		} ).closed.then( function ( data ) {
// 			if ( data && data.action && data.action === 'help' ) {
// 				// Go make edit
// 				mw.loader.using( 'mediawiki.api.edit').done( function(){
// 					var api = new mw.Api();
// 					api.newSection( 'User:TheDJ/DeprecationLog', mw.config.get('wgUserName'), 'test' );
// 				});
// 			} else {
// 				// mw.storage.set( 'ignore-deprecatedJS', true);
// 			}
// 		} );
// 	} );	
// }

//mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript" );

// importScript('MediaWiki:Gadget-mobilemaps.js');
// importScript('User:Enterprisey/reply-link.js'); //Linkback: [[User:Enterprisey/reply-link.js]] Added by Script installer

// [[d:User:Yair rand/WikidataInfo.js]]
// mw.loader.load("//www.wikidata.org/w/index.php?title=User:Yair rand/WikidataInfo.js&action=raw&ctype=text/javascript");
// importScript('User:TheDJ/signatureChecker.js'); //Linkback: [[User:TheDJ/signatureChecker.js]] Added by Script installer
//importScript('User:WebIntegrity/common.js'); //Linkback: [[User:WebIntegrity/common.js]] Added by Script installer
// importScript('User:Galobtter/Shortdesc helper.js'); //Linkback: [[User:Galobtter/Shortdesc helper.js]] Added by Script installer
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Theopolisme/Scripts/adminhighlighter.js&action=raw&ctype=text/javascript&maxage=86400'); //Linkback: [[User:Theopolisme/Scripts/adminhighlighter.js]] Added by Script installer
// importScript('User:Doug Weller/common.js'); //Linkback: [[User:Doug Weller/common.js]] Added by Script installer
// importScript('User:Doug Weller/vector.js'); //Linkback: [[User:Doug Weller/vector.js]] Added by Script installer
// importScript('User:PerfektesChaos/js/lintHint/r.js'); //Linkback: [[User:PerfektesChaos/js/lintHint/r.js]] Added by Script installer
// importScript('User:Reinischmax/IABooks.js'); //Linkback: [[User:Reinischmax/IABooks.js]] Added by Script installer
// importScript('User:PrimeHunter/Search sort.js'); //Linkback: [[User:PrimeHunter/Search sort.js]] Added by Script installer
// importScript('User:SD0001/dark-mode-toggle.js'); //Linkback: [[User:SD0001/dark-mode-toggle.js]] Added by Script installer

// mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Sebastian_Berlin_%28WMSE%29/js/wikispeech.js&action=raw&ctype=text/javascript');
// mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:TheDJ/Gadget-dark-mode-toggle.js&action=raw&ctype=text/javascript&maxage=86400'); //Linkback: [[User:TheDJ/Gadget-dark-mode-toggle.js]] Added by Script installer
// mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Alexis Jazz/EditNoticesOnMobile.js&action=raw&ctype=text/javascript&maxage=86400' ); //Linkback: [[User:Alexis Jazz/EditNoticesOnMobile.js]] Added by Script installer