Jump to content

User:Macy/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Macy (talk | contribs) at 02:56, 7 June 2008 (restoring previous version). 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.
//FastButtons 1.0
importScript('User:Macys123/FastButtons.js');

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

importScript('User:Paranomia/simplevote.js');
importScript('User:AzaToth/twinkle.js');
importScript('User:Ais523 non-admin/adminrights.js');
importScript('User:Ioeth/friendlywelcome.js');
importScript('User:Ioeth/friendlytag.js');
importScript('User:Lupin/recent2.js');
importScript('User:Voice_of_All/Addtabs/monobook.js');
importScript('User:Misza13/statusChanger.js');
importScript('User:Jnothman/afd_helper/script.js');

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

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

importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('Wikipedia:WikiProject User scripts/Scripts/Compact Navigation');

TwinkleConfig = {
        revertMaxRevisions              :       50,
        userTalkPageMode                :       'window',
        showSharedIPNotice              :       true,
        openTalkPage                    :       [ 'agf', 'norm', 'vand' ],
        openTalkPageOnAutoRevert        :       false,
        openAOLAnonTalkPage             :       false,
        summaryAd                       :       " ",
        deletionSummaryAd               :       " ",
        watchSpeedyPages                :       [ 'g3', 'g5', 'g10', 'g11', 'g12' ],
        openUserTalkPageOnSpeedyDelete  :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], 
        watchRevertedPages              :       [],
        watchWarnings                   :       false,        
        markRevertedPagesAsMinor        :       [ 'agf', 'norm', 'vand', 'torev' ],
        deleteTalkPageOnDelete          :       false,
        markWarningsAsMinor             :       true,
        markAIVReportAsMinor            :       true,
        markSpeedyPagesAsMinor          :       true,
        confirmUsernameToAIV            :       true
};

FriendlyConfig = {
        summaryAd                       :       " ",
        topWelcomes                     :       false,
        watchWelcomes                   :       false,
        markWelcomesAsMinor             :       true,
        insertHeadings                  :       true,
        welcomeHeading                  :       "== Welcome ==",
        insertUsername                  :       true,
        insertSignature                 :       false,
        quickWelcomeMode                :       "auto",
        quickWelcomeTemplate            :       "Welcome",
        maskTemplateInSummary           :       true,
        markSharedAsMinor               :       true,
        groupByDefault                  :       true,
        watchTaggedPages                :       true,
        markTaggedPagesAsMinor          :       true
};

// CommonsHelper by Krimpet¿
 
function ch2I18N() {
ch2_wplanguage = "en";
ch2_chlanguage = "en";
ch2_edittitle_Prefix = "Editing Image:";
ch2_edittitle_Postfix = "";
ch2_string_SpecifyNewName = "New Name? (leave blank to keep original):";
ch2_string_UseWikiSense = "Use WikiSense to suggest categories?";
ch2_string_StartCommonsHelper = "Start CommonsHelper";
ch2_string_FinishedUploading = "Click when finished uploading";
ch2_string_Done = "Done! Review everything below to ensure it is correct, and save this page.";
ch2_string_MoveToCommons = "MC";
ch2_string_EditSummary = "[[Wikipedia:Moving images to the Commons|Moved image to the Wikimedia Commons]] using [[User:Krimpet/CommonsHelper Helper|CH²]]";
ch2_template_ncd = "subst:ncd";
ch2_templates_copy = new Array(
"Copy to Wikimedia Commons",
"Move to Wikimedia Commons",
"Move to Commons",
"Move to commons",
"To Commons",
"to Commons"
);
ch2_templates_embed = new Array(
"PD-USGov-HHS-CDC",
"PD-USGov-USDA-ARS"
);
}
 
document.write('<script type="text/javascript" src="' 
+ 'http://commons.wikimedia.org/w/index.php?title=User:Krimpet/CH2.js' 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
//

//<pre><nowiki>
 
document.write('<link rel="stylesheet" type="text/css" href="'  
             + 'http://es.wikipedia.org/w/index.php?title=User:Axxgreazz/modulobusqueda.css'
             + '&action=raw&ctype=text/css&dontcountme=s">');
 
function modulobusqueda()
{
   if (typeof ms_Activa_Modulobusqueda == 'undefined') { ms_Activa_Modulobusqueda = true;}
   if (!msActivarModulo(ms_Activa_Modulobusqueda)) return;
 
   var btSearch = "<br /><div>";
   for (i=0; i<misbuscadores.length; i++)
   {
      if (misbuscadores[i].proy == msProyectoCod || misbuscadores[i].proy == "0")
      {
         var direccion = misbuscadores[i].url;
         var nombre = misbuscadores[i].nom;
         var caption = msStringU(misbuscadores[i].tt);
 
         if (caption != "")
            btSearch += buttonCode(caption, nombre, direccion,"")
         else
            btSearch += "<br /><div>";
       }
   }
   var boxSearch;
   switch (skin)
   {  case "monobook"    : boxSearch = document.getElementById("searchform"); break;
      case "cologneblue" : boxSearch = document.getElementById("searchform2"); break;
   }
 
   if (boxSearch)
     boxSearch.innerHTML += btSearch+"</div>";
}
 
function buttonCode(titulo, texto, inicio, fin)
{ 
   return '&nbsp;<input type="button" class="searchButton" onclick="goSearch(\''+inicio+'\', \''+fin+'\')" value="' + texto + '" title="' + titulo +'" />';
}
 
function goSearch(inicio, fin)
{
   var Qs = '';
   var text; 
   switch (skin)
   {  case "monobook"    : text = document.getElementById("searchInput"); break;
      case "cologneblue" : text = document.getElementById("searchInput2"); break;
   }
 
   if (escape(text.value) == '')
   {  
      if (wgNamespaceNumber == -1) Qs = wgUserName ;      //Si es una página Especial
      else {
      Qs = get_subpage_title().replace(/_/g , ' ');
      Qs = Qs.substring(Qs.indexOf(':')+ 1 , Qs.length); }
   }
   else
   {  Qs = text.value;}
   window.open(inicio + Qs + fin);
}
 
if (window.addEventListener) window.addEventListener("load",modulobusqueda,false);
else 
  if (window.attachEvent) window.attachEvent("onload",modulobusqueda);
 
 
//</nowiki></pre>


function moduloBusqueda()
{
  var btSearch = '<div>';
  btSearch += buttonCode('onclick="goSearch(0)" value="es" title="Spanisw Wikipedia"');
  btSearch += buttonCode('onclick="goSearch(1)" value="de" title="German Wikipedia"');
  btSearch += buttonCode('onclick="goSearch(2)" value="fr" title="French Wikipedia"');
  btSearch += buttonCode('onclick="goSearch(3)" value="C" title="Commons"');
  btSearch += buttonCode('onclick="goSearch(4)" value="D" title="Wiktionary"');
  btSearch += buttonCode('onclick="goSearch(5)" value="N" title="Wikinews"');

  btSearch += '</div>';
 
  var boxSearch = document.getElementById("searchform");
  if (boxSearch)
    boxSearch.innerHTML += btSearch;
}
 
function goSearch(i)
{
  urls = new Array(
    "http://es.wikipedia.org/wiki/", 
    "http://de.wikipedia.org/wiki/",
    "http://fr.wikipedia.org/wiki/",
    "http://commons.wikimedia.org/wiki/",
    "http://en.wiktionary.org/wiki/",
    "http://en.wikinews.org/wiki/"
  );
 
  var text = document.getElementById("searchInput");
 
  window.open(urls[i] + escape(text.value));
}
 
function buttonCode(strCode)
{
  return '&nbsp;<input type="button" class="searchButton" '+strCode+' />';
}
 
addOnloadHook(moduloBusqueda);

function nuevaCaja() {
  var l = document.getElementById("column-one");
  if (l) {
    l.innerHTML = l.innerHTML
    + '<div class="portlet" id="p-nbx">'
    + ' <h5>My shorcuts</h5>'
    + ' <div class="pBody">'
    + '   <ul>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Special:MyPage/monobook.js">My monobook.js</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Special:MyPage/monobook.css">My monobook.css</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Wikipedia:VP">Village Pump</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Wikipedia:SANDBOX">Sandbox</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Wikipedia:Goings-on">Goings-on</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Wikipedia:Requests_for_comment">RfC</a></li>'
    + '     <li><a href="http://en.wikipedia.org/wiki/Wikipedia:RfA">RfA</a></li>'
    + '   </ul>'
    + ' </div>'
    + '</div> ';
  }
}
addOnloadHook(nuevaCaja);

//Currently using scripts

/* Syntax highlighter */

 if(document.title.indexOf(".js") == -1)     //   Ignore pages that end in .js
  addOnloadHook(function () {
  /* CSS syntax highlighting */
     multicommentRE = new RegExp('(/\\*[\\s\\S]*?\\*/)', 'g');
     ruleRE = new RegExp('([^\\{]+)\\{([^\\}]+)\\}', 'g');
     idselectorRE = new RegExp('(#[a-zA-Z0-9\-\_]+)\\b', 'g');
     classselectorRE = new RegExp('(\\.[a-zA-Z0-9\-\_]+)\\b', 'g');
     pairRE = new RegExp('([a-zA-Z-]+):([^;]+);', 'g');
     css = document.getElementsByTagName('pre');
     for (i = 0; i < css.length; i++) {
       c = css[i];
       content = c.innerHTML;
       content=content.replace(multicommentRE, '<span class="comment">$1</span>');
       content = content.replace(ruleRE, function(text, selector, body) {
         selector = selector.replace(idselectorRE, '<span class="idselector">$1</span>');
         selector = selector.replace(classselectorRE, '<span class="classselector">$1</span>');
         body = body.replace(pairRE, '<span class="property">$1</span>:<span class="value">$2</span>;');
         return selector + '{' + body + '}';
       });
       c.innerHTML = content;
     }
  });

// [[User:Henrik/live-edit-counter]]
importScript('User:Henrik/js/live-edit-counter.js');