User:Pemaksa/vector.js

mw.loader.using(	[ 'mediawiki.util' ],	function {		mw.util.addPortletLink( 'p-Community', '/wiki/Special:RecentChanges', 'Recent changes' );	} );

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Pemaksa/Scripts/translate.js&action=raw&ctype=text/javascript');

$(document).ready(function {	$("body.mw-special-Watchlist .mw-rollback-link>a").click(function {		return confirm("Are you sure you want to roll back this edit?"); }); });

$.when( mw.loader.using('mediawiki.util'), $.ready).then(function{ if ($(".mw-rollback-link").length > 0) {    var link = mw.util.addPortletLink('p-cactions', '', "rollback summary", "ca-rollbacksummary", "Set rollback link edit summary");    $(link).find('a').click( setRollbackSummary );  }}); function setRollbackSummary(event) { event.preventDefault; var i;   var summary = prompt("Change the default rollback summary for rollback links on this page to:", ""); if (!summary) { for (i in document.links) { if (document.links[i].href.indexOf('summary=') != -1) { document.links[i].href = document.links[i].href.substring(0, document.links[i].href.indexOf('summary=')-1); }   }  }  else { summary = "&summary=" + encodeURIComponent(summary); for ( i in document.links) { if (document.links[i].href.indexOf('action=rollback') != -1) { document.links[i].href += summary; }   }  } }