User:Jim Grisham/common.js
Appearance
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:Jim Grisham/common.css. |
/* Error received from mid-2023 until 2024-01-12:
"ReferenceError: Can't find variable: WgServer" (may not be verbatium)
Note: Starting with MediaWiki 1.34, $wgServer is set by default to 'false'
*/
/* Error received starting mid-March 2024 on iOS:
"... portlet..."
"https://en.wikipedia.org/w/index.php?title=User:Jim_Grisham/common.js&action=submit at line 1: TypeError: undefined is not an object (evaluating 'mw.util.addPortletLink')"
*/
try {
// Mass move tool
// [[Wikipedia:Moving a page#Automating multiple subpage moves]]
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Plastikspork/massmove.js&action=raw&ctype=text/javascript' ); //[[User:Plastikspork/massmove.js]]
mw.util.addPortletLink("p-tb", "//en.wikipedia.org/wiki/Special:Massmove", "Mass move", "p-massmove", "Mass move");
} catch { };
try {
//Add subpage option to sidebar ‘tools’ section
// https://en.wikipedia.org/w/index.php?title=Wikipedia:Do_not_use_subpages&oldid=2836167
// https://en.wikipedia.org/wiki/Wikipedia:Subpages#Notes
/* disabled in part on 2024-01-12 to fix 'WgServer' error mentioned above
*/
mw.util.addPortletLink ('p-tb', /* mw.config.values.wgServerName+ */ mw.config.values.wgArticlePath.replace("$1", "Special:PrefixIndex/"+mw.config.values.wgPageName+"/"), 'Subpages');
} catch { };
try {
// Add 'Smart Linking' link preview tool
// [[User:V111P/js/Smart Linking]]
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) > -1 ) {
importScript('User:V111P/js/smartLinkingLoader.js'); // [[User:V111P/js/smartLinkingLoader.js]]
}
} catch { };
try {
// Highlight 'redirects with possibilities' with a red dashed border
// [[Template:R_with_possibilities/doc#User_script_for_highlighting_links_to_redirects_with_possibilities]]
mw.hook( 'LinkClassifier' ).add( function ( linkClassifier ) {
linkClassifier.cats['redirect-with-possibilities'] = [ 'Category:Redirects with possibilities' ].sort();
} );
mw.loader.load('/w/index.php?title=User:Anomie/linkclassifier.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Anomie/linkclassifier]]
} catch { };