User:Lokal Profil/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.
//Start Add uncat template to images
function doUncat() {
  document.editform.wpTextbox1.value += '{' + '{' + 'uncat}}\n';
  document.editform.wpSummary.value = 'Uncat';
  document.editform.wpMinoredit.checked = true;
  document.editform.submit();
}
//End Add uncat template to images

// Länkar till olika sidor
// Modifierad http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Add_purge_to_tabs

mw.loader.using( 'mediawiki.util' ).done(function(){
	jQuery( function( $ ) {
	    mw.util.addPortletLink('p-participate', '//commons.wikimedia.org/w/index.php?title=Special:Upload&uploadformstyle=basic', 'Special:Upload');
	
	    if (document.editform) {
	    	mw.util.addPortletLink("p-tb", "javascript:doUncat()", "uncat", "ca-uncat", "Märk som uncat", "");
	    }
	} );
} );

//

//Add Dupe button
window.AjaxDeleteExtraButtons = [
    {
        'label': 'Tag as dupe',
        'tag': '{\{duplicate|1=%PARAMETER%|user=%USER%}}',
        'img_summary': 'Tagging as duplicate of [[:File:%PARAMETER%]]',
        'prompt_text': 'Which file is this a duplicate of?'
    }
];

// Structured data image notations
mw.loader.load( '//commons.wikimedia.org/w/index.php?title=User:Lucas_Werkmeister/wd-image-positions.js&action=raw&ctype=text/javascript' );