Gebruiker:Rots61/common.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 12: | Regel 12: | ||
mw.loader.load('//wikikids.nl/index.php?title=User:Rots61/Clear.js&action=raw&ctype=text/javascript'); // [[User:Rots61/Clear.js]] |
mw.loader.load('//wikikids.nl/index.php?title=User:Rots61/Clear.js&action=raw&ctype=text/javascript'); // [[User:Rots61/Clear.js]] |
||
+ | mw.loader.load('//wikikids.nl/index.php?title=User:Rots61/Gadget-Externelinks.js&action=raw&ctype=text/javascript') |
||
− | |||
− | /** |
||
− | * Load withJS & withCSS |
||
− | * |
||
− | * @source www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL |
||
− | * @rev 3 |
||
− | */ |
||
− | mw.loader.using( ['mediawiki.util'], function () { |
||
− | var extraJS = mw.util.getParamValue( 'withJS' ); |
||
− | if ( extraJS ) { |
||
− | // Disallow some characters in file name |
||
− | if ( extraJS.match( /\.js$/ ) ) { |
||
− | mw.log(extraJS); |
||
− | console.log(importScript(extraJS)); |
||
− | importScript( extraJS ); |
||
− | // Show message after DOM is ready. |
||
− | } else { |
||
− | $( function() { |
||
− | mw.notify( 'Invalid javascript URL; only javascript pages from MediaWiki: space are allowed.', { title: 'Error' } ); |
||
− | } ); |
||
− | } |
||
− | } |
||
− | var extraCSS = mw.util.getParamValue( 'withCSS' ); |
||
− | if ( extraCSS ) { |
||
− | // Disallow some characters in file name |
||
− | if ( extraCSS.match( /\.css$/ ) ) { |
||
− | importStylesheet( extraCSS ); |
||
− | // Show message after DOM is ready. |
||
− | } else { |
||
− | $( function() { |
||
− | mw.notify( 'Invalid stylesheet URL', { title: 'Error' } ); |
||
− | } ); |
||
− | } |
||
− | } |
||
− | } ); |
Versie van 16 dec 2022 13:36
mw.loader.using('mediawiki.util', function() {
mw.util.addPortletLink('p-tb',
'https://nl.wikipedia.org/wiki/' + encodeURIComponent(mw.config.get('wgPageName')),
'Wikipedia ', '#wikipedialink', mw.config.get('wgPageName') + " op Wikipedia ");
});
mw.loader.using('mediawiki.util', function() {
mw.util.addPortletLink('p-tb',
'https://www.google.nl/search?q=' + encodeURIComponent(mw.config.get('wgPageName')),
'Google ', '#googlelink', mw.config.get('wgPageName') + " op Google ");
});
mw.loader.load('//wikikids.nl/index.php?title=User:Rots61/Clear.js&action=raw&ctype=text/javascript'); // [[User:Rots61/Clear.js]]
mw.loader.load('//wikikids.nl/index.php?title=User:Rots61/Gadget-Externelinks.js&action=raw&ctype=text/javascript')