Misplaced Pages

User:TheDJ/common.js

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:TheDJ
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump.
This code will be executed when previewing this page.
The accompanying .css page for this skin is at User:TheDJ/common.css.
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 Misplaced Pages:Bypass your cache.
importScript( 'User:TheDJ/inlinestylechecker.js' );

$('head').one('reftoolbarbase', function() {
new citeTemplate('Cite RCDB', 'Cite RCDB',
[ // Basic fields
{"field": "coaster_name", "label":"Coaster name"},
{"field": "location", "label":"Park name"}, 
{"field": "rcdb_number", "label":"RCDB number"},
{"field": "accessdate", "label":"Access date"},
{"field": "url", "label":"URL"}
],
[ // Expanded fields
]);
});

// window.wma_settings = {enabled:false}

//mw.loader.load('//en.wikipedia.org/search/?title=User:TheDJ/ActualLivePreview.js&action=raw&ctype=text/javascript');
mw.loader.load( 'https://en.wikipedia.org/search/?title=User:Equazcion/ScriptInstaller.js&action=raw&ctype=text/javascript&maxage=86400' ); // Backlink: ]
//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="/search/?title=Misplaced Pages:Interface_administrators%27_noticeboard/helpme&action=edit&section=new&preload=Misplaced Pages: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: ]

TwinkleConfig = {
  userTalkPageMode : 'tab'
};

popupRevertSummaryPrompt=true;
popupPreviewRawTemplates=true;
popupPreviewKillTemplates=false;
popupPreviewButton=true;
popupFixDabs=true;
popupFixRedirs = true;
popupRedlinkRemoval = true;
popupStructure='menus';
popupDebug=true;
// Misplaced Pages:Tools/Navigation popups
// mw.loader.load('//en.wikipedia.org/search/?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().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(  ), $.ready ).done( addLinksInit );

// importScript( 'User:TheDJ/flowidth.js' );
// mw.loader.load('//en.wikipedia.org/search/?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: ] Added by Script installer
// importScript('User:Dr pda/prosesize.js'); //Linkback: ] 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, true);
// 				$( element ).replaceWith( svgRoot );
// 			}
// 		});
// 	});
// });

// if( $.inArray( 'sysop', mw.config.get('wgUserGroups') ) !== -1 && Math.floor(Math.random()*10) % 2 === 0) {
// 	$.when( mw.loader.using(  ), $.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(  );
		
// 		// 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 Misplaced Pages 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/search/?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: ] Added by Script installer

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

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