Jump to content

User:Peter Karlsen/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Peter Karlsen (talk | contribs) at 02:02, 15 September 2010. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Lupin/recent2.js');
if( typeof( TwinkleConfig ) == 'undefined' ) TwinkleConfig = {};
TwinkleConfig.openTalkPageOnAutoRevert                  =       true;
TwinkleConfig.watchRevertedPages                        =       [];
TwinkleConfig.watchSpeedyPages                          =       [];
TwinkleConfig.watchWarnings                             =       false;
TwinkleConfig.showRollbackLinks                         =       [];
function warnVandal()
{
  if( document.URL.indexOf("&action=roll") > 0)
  {
    vandalsTalkPageInitialIndex = document.URL.indexOf("from") + 5;
    vandalsTalkPageCharacterCount = document.URL.indexOf("&token") - document.URL.indexOf("from") - 5;
    vandalsNamePriorToCorrection = document.URL.substr(vandalsTalkPageInitialIndex, vandalsTalkPageCharacterCount);
    vandalsNameAfterCorrection = vandalsNamePriorToCorrection.replace('+', '_');
    vandalsTalkPage = "User_talk:" + vandalsNameAfterCorrection;
    prompt("The vandal's talk page is " + vandalsTalkPage);
    window.open( wgServer + wgScriptPath + '/index.php?title=' + vandalsTalkPage + "&action=edit&preview=yes&vanarticle=" + wgPageName.replace('_', ' ') + "&type=vand&count=1", 'twinklewarnwindow', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
  }
}
addOnloadHook(warnVandal);