MediaWiki:Common.js: Difference between revisions
From DFO – Flood Observatory
DFO Kettner (talk | contribs) Created page with "→Any JavaScript here will be loaded for all users on every page load.: →Adds a refresh option under the "...": mw.util.addPortletLink('p-views', '?action=purge', 'Refresh');" |
DFO Kettner (talk | contribs) No edit summary |
||
| Line 3: | Line 3: | ||
/*Adds a refresh option under the "..."*/ | /*Adds a refresh option under the "..."*/ | ||
mw.util.addPortletLink('p-views', '?action=purge', 'Refresh'); | mw.util.addPortletLink('p-views', '?action=purge', 'Refresh'); | ||
/*************** | |||
* @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 13:41, 3 December 2025
/* Any JavaScript here will be loaded for all users on every page load. */
/*Adds a refresh option under the "..."*/
mw.util.addPortletLink('p-views', '?action=purge', 'Refresh');
/***************
* @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;
} );
} );