Jump to content

User:Pasqual/monobook.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>

==Carregador de mòduls==
Funció ingeniada per [[w:ca:Usuari Discussuió:Pasqual|Pasqual]]

Basat en la funció ''loadmonobook()'' (de'n [[User:Topaz/monobook.js|Martorell]]) i -ja eliminada- ''inclou()'', una adaptació meua de la funció ''incluir()'' de l'usuari peruà, ([[:es:Usuario:Axxgreazz/monobook.js|Axxgreaz]]) - [[Província de Castelló|Castelló]], [[9 d'agost]] de [[2006]] <span style="color:blue; font-weight:bold;">–Pasqual</span> · [[Usuari Discussió:Pasqual|<small>bústia</small>]]
<pre><nowiki>
*/

pqDebug=true;

function carrega (server,user,module) {
  var lt = String.fromCharCode(60);
  var gt = String.fromCharCode(62);
  var prefix = server.substring(0,2);

  if (prefix == '') prefix = 'ca';
  if (prefix == 'ca' && (module.indexOf("viquiestris") == -1  && module.indexOf("scripts/") == -1)) {
    module='scripts/'+module;
  }
  if (user == '') {
    if (prefix=='ca') {user='Pasqual'} else {user='Pasqual_%28ca%29';}
  }
  
  if (server == '') server=prefix;
  if (server.length == 2) server += ".wikipedia.org";
  if (module.indexOf(".js") == -1 && module.indexOf(".css") == -1) module += '.js';

  if (module.indexOf(".js") > -1) {
    document.writeln(lt+'script type="text/javascript" src="' + 'http://' + server
    + '/w/index.php?title=User:' + user + '/' + module 
    + '&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt);
  } else if (module.indexOf(".css") > -1) {
    document.writeln(lt+'link rel="stylesheet" type="text/css" href="' 
    + 'http://' + server + '/w/index.php?title=User:' + user + '/' + module 
    +'&action=raw&ctype=text/css" /'+gt);
  }

  if (module.indexOf("galetes")>-1){pqGaletes=true}else{pqGaletes=false};
  if (pqGaletes==true) {
  /*
     alert("galeta: "+prenGaleta("Estat-"+wgUserName));
     if (pqDebug ==true && prenGaleta("Estat-"+wgUserName)== 'debugging' && confirm('p: '
         +prefix+'\ns: '+server+'\nu: '+user+'\nm: '+module+'\nm_i: '
         +module.indexOf("scripts/"))==false){pqDebug=false};
  */
     }

}

function load (server,user,module) {
  carrega (server, user, module);
}

function load_ca (module) {
  carrega("ca.wikipedia.org","Pasqual",module);
}

function pqLoad (module){
  wpServerName = location.hostname
  carrega (wpServerName,wgUserName,module);
}

function tpLoad (module) {
  carrega("en","Topaz",module);
}

/*
</nowiki></pre>

==Inicialització==
Càrrega de [[:ca:Usuari:Pasqual/viquiestris.js|viquiestris.js]]

<pre><nowiki>
*/

load_ca ("viquiestris");
load_ca ("Subpàgines");
load_ca ("enllaçosperso");
load_ca ("editacapçalera");
//importScript('User:Alex_Smotrov/qpreview.js');

document.write('<script src="http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js'
+  '&action=raw&ctype=text/javascript"></script>');
var qeEnabled          = true;  // Activate Script?
var qeEnableSection0   = true;  // Enable QuickEdit link for section 0 (introduction)?
var qeShowErrors       = false; // Show errors (should be left false)
var qeEnableAccessKeys = true;  // Activate access keys?
var qeTextboxHeight    = 15;    // Height of the textbox


/*
tpLoad("init"); tpLoad("util"); tpLoad ("comm"); tpLoad ("wputil"); pqLoad("cookies");
pqLoad("statuschanger");
*/

/*********************************            popups           *********************************/

//per a personalitzar el resum d'edició
popupImages = false;
popupExtendedRevertSummary = 'Reversió a l\'edició amb hora i data:%s, usuari:%s, núm.:%s per vandalisme'
popupRevertSummaryPrompt = popupExtendedRevertSummary
//popupRevertSummaryPrompt = true;
popupLinksNewWindow = true;
//popupModifier='ctrl';
//popupDelay=0;

//load    ("en","Lupin","popups");

importScript('Wikipedia:WikiProject_User_scripts/Scripts/TwoColumns.js');

/* don't save the page when the user hits enter in the edit summary box
function noenter() { return !(window.event && window.event.keyCode == 13); }
function hooksummaryenter() { document.getElementById("wpSummary").addEventListener("keypress", noenter, true); }
$(hooksummaryenter);
*/

//</nowiki></pre>