Utilizator:KlaudiuMihaila/vector.js

De la Wikționar, dicționarul liber

Notă: După salvare, trebuie să treceți peste cache-ul browser-ului pentru a vedea modificările. Mozilla/Safari/Konqueror: țineți apăsat Shift în timp ce apăsați Reload (sau apăsați Ctrl-Shift-R), IE: apăsați Ctrl-F5, Opera: apăsați F5.

//this code will add a button to the left. This button loads a tool on
//the toolserver that checks whether there are pages with the same name
//on other wiktionaries
 
document.write('<script type="text/javascript" src="'
+ 'http://ro.wiktionary.org/w/index.php?title=User:Annabel/Interwiki.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 
function doQajutor() {
  document.editform.wpTextbox1.value = '{' + '{' + 'Ajutor|}}'+'\n\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'Marcat pentru ajutor';
  document.editform.wpMinoredit.checked = true;
  document.editform.submit();
}
 
function doQbunVenit() {
  document.editform.wpTextbox1.value = '{' + '{' + 'subst:bunvenit}}'+'~~'+'~~' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'bv';
  document.editform.wpMinoredit.checked = true;
  document.editform.wpWatchthis.checked = false;
  document.editform.submit();
}
 
 
function addQajutor() {
  addTab("javascript:doQajutor()", "A", "ca-ajutor", "Marchează pentru ajutor", "");
  akeytt();
}
 
function addQbunVenit() {
  addTab("javascript:doQbunVenit()", "BV", "ca-bunVenit", "Urează bun venit", "");
  akeytt();
}
 
$(function() {
  if (document.title.indexOf("Discuție Utilizator:") != -1) {
     addOnloadHook(addQbunVenit);
  }
  if (document.title.indexOf("Utilizator:") != -1) {
     return;
  }
  if (document.title.indexOf("modificare ") != -1) {
     addOnloadHook(addQajutor);
  }
});
 
function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id)
    {
        if(key && title)
        {
            ta[id] = [key, title];
        }
        else if(key)
        {
            ta[id] = [key, ''];
        }
        else if(title)
        {
            ta[id] = ['', title];
        }
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}
 
function addTab(url, name, id, title, key){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    return addlilink(tabs, url, name, id, title, key)
};