User:Martin Kraft/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
importScript('User:Martin Kraft/Mpx.js'); // MegaPixel berechnen 

(function(w){
	w.AjaxDeleteWatchUserTalk = true;
	w.AjaxDeleteWatchFile = true;
	w.aqdCORSOptOut = true;
	w.AjaxDeleteExtraButtons = [
		{
			'label': 'DW No Source',
			'tag': '{' + '{subst:dw-nsd}}',
			'img_summary': 'This is a [[COM:DW|derivative work]] and no source is provided.',
			'talk_tag': '{' + '{subst:dw image source|1=%FILE%}}',
			'talk_summary': 'Original source is missing for %FILE%',
		}, {
			'label': 'Tag as dupe',
			'tag': '{' + '{duplicate|1=%PARAMETER%|user=%USER%}}',
			'img_summary': 'Tagging as duplicate of  [[%PARAMETER%]]',
			'prompt_text': 'Which is file is this a duplicate of?'
		}, {
			'label': 'Copyvio (www)',
			'tag': '{' + '{copyvio|1=[[COM:NETCOPYRIGHT|Copyright violation]], found elsewhere on the web and unlikely to be own work: [https://www.google.com/searchbyimage?image_url={{filepath:{' + '{subst:BASEPAGENAME}}}} google search]}}',
			'img_summary': 'speedy deletion: possible copyvio',
			'talk_tag': '{' + '{subst:copyvionote|1=%FILE%}}',
			'talk_summary': 'Notification of possible copyright violation for %FILE%',
		}
	];
	
	console.log('AjaxDelete inited');
})(window);

$( function() {
   if(mw.config.get('wgNamespaceNumber') == 6) {
      var wgTitle = mw.config.get('wgTitle');
      if(wgTitle.match(/(.*)\.(jpg|jpeg)/gi)) {
          var croplink = "//tools.wmflabs.org/cropbot/cropbot.php?img="+wgTitle;
          mw.util.addPortletLink("p-tb", croplink, "Crop", "p-crop", "Crop this image", "o", false);
      }
   }
});