Szerkesztő:Kisbes/jaror.js

A Wikipédiából, a szabad enciklopédiából

Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.

  • Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
  • Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
  • Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
  • Opera: Nyomj Ctrl–F5-öt
//<nowiki>
$(jaror);

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}

function jaror () {
  if (getURLParam('printable') == 'yes') {
    return;
  }
if (wgAction == 'view' && wgRestrictionEdit.length == 0 && wgNamespaceNumber == 0) document.getElementById('content').innerHTML = '<div align="center" id="jarordiv"><a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=szubcsonk">Szubcsonk</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=azonnali">Azonnali</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=torles">Törlés</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=forma">Forma</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=lektor">Lektor</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=nincsforras">Nincs forrás</a>  | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=sn">SN</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=csonk">Csonk</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=jogserto">Jogsértő</a></div>' + document.getElementById('content').innerHTML;
if (wgAction == 'edit' && typeof(document.editform) != "undefined" && getURLParam('jaror') != '') {
switch(getURLParam('jaror')){
case 'szubcsonk': document.getElementById('wpTextbox1').value = '{'+'{szub'+'csonk|~~'+'~~'+'~}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Szubcsonk sablon'; document.editform.submit();
break;
case 'azonnali': document.getElementById('wpTextbox1').value = '{'+'{azo'+'nnali}}\n' + document.getElementById('wpTextbox1').value;  document.getElementById('wpSummary').value='Azonnali sablon';
break;
case 'forma': document.getElementById('wpTextbox1').value = '{'+'{fo'+'rma}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Forma sablon'; document.editform.submit();
break;
case 'lektor': document.getElementById('wpTextbox1').value = '{'+'{lekt'+'or}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Lektor sablon'; document.editform.submit();
break;
case 'nincsforras': document.getElementById('wpTextbox1').value = '{'+'{nincs f'+'orrás}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Nincs forrás sablon'; document.editform.submit();
break;
case 'sn': document.getElementById('wpTextbox1').value = '{'+'{s'+'n}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='SN sablon'; document.editform.submit();
break;
case 'torles': document.getElementById('wpTextbox1').value = '{'+'{tör'+'lés}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Törlés sablon'; document.editform.submit();
break;
case 'vandalizmus': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value+'\n{{sub'+'st:van'+'dalizmus}} ~~'+'~~\n'; document.getElementById('wpSummary').value='Vandalizmus sablon'; document.editform.submit();
break;
case 'teszt': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value+'\n{{sub'+'st:te'+'szt}} ~~'+'~~\n'; document.getElementById('wpSummary').value='Teszt sablon'; document.editform.submit();
break;
case 'teszt2': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value+'\n{{sub'+'st:tes'+'zt2}} ~~'+'~~\n'; document.getElementById('wpSummary').value='Teszt2 sablon'; document.editform.submit();
break;
case 'teszt3': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value+'\n{{sub'+'st:tesz'+'t3}} ~~'+'~~\n'; document.getElementById('wpSummary').value='Teszt3 sablon'; document.editform.submit();
break;
case 'teszt4': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value+'\n{{sub'+'st:tes'+'zt4}} ~~'+'~~\n'; document.getElementById('wpSummary').value='Teszt4 sablon'; document.editform.submit();
break;
case 'csonk': document.getElementById('wpTextbox1').value = '{'+'{cso'+'nk}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Csonk sablon';
break;
case 'jogserto': document.getElementById('wpTextbox1').value = '{'+'{jogs'+'értő}}\n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Jogsértő sablon';
break;
case 'udvozlet': document.getElementById('wpTextbox1').value = '{'+'{sub'+'st:üdvözlet|user=~~'+'~~}} \n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Üdvözlet'; document.editform.submit();
break;
case 'anonudv': document.getElementById('wpTextbox1').value = '{'+'{sub'+'st:anonüdv|user=~~'+'~~}} \n' + document.getElementById('wpTextbox1').value; document.getElementById('wpSummary').value='Anonüdv'; document.editform.submit();
break;
case 'spam': document.getElementById('wpTextbox1').value = document.getElementById('wpTextbox1').value + '\n{{subst:sp'+'am}} – ~~'+'~~\n'; document.getElementById('wpSummary').value='Spam'; document.editform.submit();
break;
default: break;
}
}
if (wgCanonicalNamespace == "User_talk") {  
document.getElementById('content').innerHTML = '<div align="center" id="jarordiv"><a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=teszt">Teszt</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=teszt2">Teszt2</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=teszt3">Teszt3</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=teszt4">Teszt4</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=vandalizmus">Vandalizmus</a> | <a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=spam">Spam</a></div>' + document.getElementById('content').innerHTML;
if (wgAction == 'edit' && typeof(document.editform) != "undefined" && wgRestrictionEdit.length == 0) if (document.getElementById('wpTextbox1').value == "") {
var reg = /\b(?:\d{1,3}\.){3}\d{1,3}\b/;
if(reg.test(wgTitle)) document.getElementById('content').innerHTML = '<center><a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=anonudv">Anonüdv</a></center>' + document.getElementById('content').innerHTML; else 
document.getElementById('content').innerHTML = '<center><a href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='+wgPageName+'&action=edit&jaror=udvozlet">Üdvözlet</a></center>' + document.getElementById('content').innerHTML;
}
}
}
//</nowiki>