User:Multichill/vector.js: Difference between revisions

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Content deleted Content added
Use local User:Multichill/Cat-a-lot.js
m &
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
importScript('User:Multichill/Cat-a-lot.js');
importScript('User:Multichill/Cat-a-lot.js');

(function(mw, $) {

if (mw.config.get('wgAction') !== 'view') return;

$(function() {
var title = new mw.Title(mw.config.get('wgTitle'), mw.config.get('wgNamespaceNumber'));
var titleForUrl = encodeURIComponent(title.toString());
var url = '//tools.wmflabs.org/locator-tool/#/geolocate';
if (mw.config.get('wgNamespaceNumber') === 6) {
url = 'https://commons.wikimedia.org/w/index.php?title=' + titleForUrl + '&action=edit&withJS=MediaWiki:InformationToArtwork.js';
} else {
return;
}

mw.util.addPortletLink(
'p-tb',
url,
'Convert to artwork',
't-art',
'Converts the information template to the artwork template'
);

});

})(mediaWiki, jQuery);

Revision as of 19:58, 28 July 2018

importScript('User:Multichill/Cat-a-lot.js');

(function(mw, $) {

  if (mw.config.get('wgAction') !== 'view') return;

  $(function() {
  	var title = new mw.Title(mw.config.get('wgTitle'), mw.config.get('wgNamespaceNumber'));
  	var titleForUrl = encodeURIComponent(title.toString());
  	var url = '//tools.wmflabs.org/locator-tool/#/geolocate';
  	if (mw.config.get('wgNamespaceNumber') === 6) {
  		url = 'https://commons.wikimedia.org/w/index.php?title=' + titleForUrl + '&action=edit&withJS=MediaWiki:InformationToArtwork.js';
  	} else {
  		return;
  	}

    mw.util.addPortletLink(
	'p-tb',
	url,
	'Convert to artwork',
	't-art',
	'Converts the information template to the artwork template'
);

  });

})(mediaWiki, jQuery);