Jump to content

User:Z.E.R.O./Steel359.js

From Wikipedia, the free encyclopedia
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.
// <pre><nowiki>

// [[User:Lupin/popups.js]]
importScript('User:Lupin/popups.js');

popupHideDelay=0.0;
popupAdminLinks=true;
popupOnEditSelection=false;
popupFixDabs=true;
popupRedlinkRemoval=true

// importScript('User:Steel359/helper.js'); // From User:GeorgeMoney/UserScripts/helpers/all
// importScript('User:Steel359/csd.js'); // From User:GeorgeMoney/csd.js
importScript('User:Steel359/morebits.js'); // From User:AzaToth/morebits.js
// importScript('User:Steel359/twinkleprotect.js'); // From User:AzaToth/twinkleprotect.js
importScript('User:Steel359/twinkle.js'); // From User:AzaToth/twinklespeedy.js
importScript('User:Steel359/salt.js'); // From User:AzaToth/salt.js
importScript('User:Voice_of_All/Addtabs/monobook.js');
importScript('User:Voice_of_All/replacetxt.js');
importScript('User:Steel359/VoA.js'); // From User:Voice_of_All/Specialadmin/monobook.js
importScript('User:Cryptic/toggleundelete.js');
importScript('User:Steel359/watchlist.js');
importScript('User:Steel359/tag.js');

disableRealTitle = 1;

// User creation log quickblock ------------------------------

function runOnloadHook(){
  urlString = document.location.href;
  if(urlString.search("newusers")>0){
    bC = document.getElementById("bodyContent");
    liArray = bC.getElementsByTagName("li");
    for(i=0;i<liArray.length;i++){
      liANode = liArray[i].childNodes[1];
      liANodeNext = liArray[i].childNodes[8];
      liA = liANode.innerHTML;
      newAtext = "http://en.wikipedia.org/w/index.php?title=Special:Blockip&action=submit&wpBlockAddress=";
      newAtext = newAtext + liA;
      newAtext = newAtext + "&wpBlockExpiry=indefinite&wpBlockReason={{unb}}&wpEditToken=<token>";
      var newdash = document.createTextNode(" | ");
      xliA = liArray[i].childNodes[5].cloneNode(true);
      liArray[i].insertBefore(xliA,liANodeNext);
      xliA.innerHTML = "quickblock";
      xliA.href = newAtext;
      xliA.title = "Quick block this user";
      xliA.className = "extiw";
      liArray[i].insertBefore(newdash,xliA);
    }
  }
}

// AfD helper.js & easy voting ------------------------------------

document.write('<script type="text/javascript"' +
  'src="http://en.wikipedia.org/w/index.php?title=User:Jnothman/afd_helper/' +
  'script.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

function addLink(where, url, name, id, title, key, after) {
    // addLink() accepts either an id or a DOM node, mw.util.addPortletLink() only takes a node
    if (after && !after.cloneNode)
        after = document.getElementById(after);

    return mw.util.addPortletLink(where, url, name, id, title, key, after);
}

function autoafd_result()
{
  var close = prompt("Result of debate?")
  var f = document.editform, t = f.wpTextbox1;
  t.value = t.value.split('{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD').join('{{subst:User:Steel359/Empty');
  t.value = "{{subst:" + "at" + "}} '''" + close + "'''. " + "~" + "~" + "~" + "~" + '\n' + '\n' + t.value;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "ab" + "}}";
  f.wpSummary.value = "AfD Closed, result was " + close;
}

function autoafd_add_afd_tabs()
{
  // Only add for pages with the right string somewhere in the title
  if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1)
    {
      mw.util.addPortletLink('p-cactions', 'javascript:autoafd_result()', "close");
    }
}

$(autoafd_add_afd_tabs);

// Navigation -----------------------------------

$(function () {
 
 // if this is a user, show the logs for the user rather than the page
 if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
  url = wgServer + "/w/index.php?title=Special:Log&user=" + wgTitle.split("/")[0];
 } else if ( wgCanonicalNamespace == "Special" ) {
  // don't display link for special pages
  return;
 } else {
  url = wgServer + "/w/index.php?title=Special:Log&page=" + wgPageName;
 }
 
 mw.util.addPortletLink("p-navigation", url, "Logs", "pt-logs");

 if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
  url = wgServer + "/w/index.php?title=Special:Listusers&limit=1&username=" + wgTitle.split("/")[0];
 } else {
  return;
 }
 
 mw.util.addPortletLink("p-navigation", url, "User rights", "pt-rights");

 if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
  url = wgServer + "/w/index.php?title=Special:Prefixindex&namespace=2&from=" + wgTitle.split("/")[0] + '/';
 } else {
  return;
 }
 
 mw.util.addPortletLink("p-navigation", url, "Userspace", "pt-space");

});

// Vandalwarn -----------------------------------

function warnvandal()
{
  var warn = prompt("Which warning?")
  if( !warn ) {
  return;
  }
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += '\n' + "{{subst:" + warn + "}} ~~" + "~~";
  f.wpSummary.value = warn;
}

function warnvandalb()
{
  // Only add for pages with the right string somewhere in the title
  if (document.title.indexOf("Editing User talk:") != -1)
    {
      mw.util.addPortletLink('p-cactions', 'javascript:warnvandal()', "warn" );
    }
}

$(warnvandalb);