பயனர்:Shrikarsan/imagelinks.js

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.

குறிப்பு - சேமித்த பின்னர், நீங்கள் செய்த மாற்றங்களைக் காண்பதற்கு உங்கள் உலவியின் இடைமாற்று அகற்றப்பட வேண்டும்.

  • மொஸில்லா பயர்பாக்ஸ் / சபாரி: Shift+Reload, அல்லது Ctrl-F5 அல்லது Ctrl-R (⌘-R Mac ல்)
  • கூகிள் குரோம் Ctrl-Shift-R அழுத்தவும். (⌘-Shift-R Mac ல்) ;
  • இண்டர்நெட் எக்ஸ்ப்ளோரர்: Ctrl-Refresh அல்லது Ctrl-F5 ஐ அழுத்தவும்.
  • ஒபேரா: Tools → Preferences இல் இடைமாற்றை அகற்றவும்;
/
 * Direct imagelinks to Commons
 * Files hosted at Commons have local image links redirected to Commons.
 */
if ( mw.config.get( 'wgNamespaceNumber', 0 ) >= 0 ) {
	$( function () {
		var
			uploadBaseRe = /^\/\/upload\.wikimedia\.org\/wikipedia\/commons/,
 
			localBasePath = new RegExp('^' + mw.util.wikiGetlink( mw.config.get( 'wgFormattedNamespaces' )['6'] + ':' ).replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")),
			localBaseScript = new RegExp('^' + (mw.util.wikiScript() + '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgFormattedNamespaces' )['6'] + ':' )).replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")),
 
			commonsBasePath =  '//commons.wikimedia.org/wiki/File:',
			commonsBaseScript =  '//commons.wikimedia.org/w/index.php?title=File:';
 
		$( 'a.image' ).attr( 'href', function ( i, currVal ) {
			if ( uploadBaseRe.test( $(this).find( 'img' ).attr( 'src' ) ) ) {
				return currVal
					.replace( localBasePath, commonsBasePath )
					.replace( localBaseScript, commonsBaseScript );
			}
		});
	});
}
"https://ta.wikipedia.org/w/index.php?title=பயனர்:Shrikarsan/imagelinks.js&oldid=1621401" இலிருந்து மீள்விக்கப்பட்டது