Difference between revisions of "MediaWiki:Common.js"

From Stm32World Wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
 
         y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
 
         y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
 
})(window, document, "clarity", "script", "6te8216fhk");
 
})(window, document, "clarity", "script", "6te8216fhk");
 +
 +
/**
 +
* @source https://www.mediawiki.org/wiki/Snippets/Open_specific_links_in_new_window
 +
* @version 2018-09-15
 +
*/
 +
$( function () {
 +
$( '#mw-content-text' ).on( 'click', '.newwin > a', function () {
 +
var otherWindow = window.open();
 +
otherWindow.opener = null;
 +
otherWindow.location = this;
 +
return false;
 +
} );
 +
} );

Latest revision as of 04:15, 23 May 2024

/* Any JavaScript here will be loaded for all users on every page load. */

(function(c,l,a,r,i,t,y){
        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
        t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "6te8216fhk");

/**
 * @source https://www.mediawiki.org/wiki/Snippets/Open_specific_links_in_new_window
 * @version 2018-09-15
 */
$( function () {
	$( '#mw-content-text' ).on( 'click', '.newwin > a', function () {
		var otherWindow = window.open();
		otherWindow.opener = null;
		otherWindow.location = this;
		return false;
	} );
} );