מדיה ויקי:Common.js: הבדלים בין גרסאות בדף
מ סקריפט להוספת תבנית:דיון חדש במזנון לפני יצירת פסקה חדשה במזנון |
לבקשת יוני |
||
| שורה 803: | שורה 803: | ||
if(!document.getElementById('ca-addsection')) return; | if(!document.getElementById('ca-addsection')) return; | ||
document.getElementById('ca-addsection').getElementsByTagName('a')[0].href+='&editintro=%D7%AA%D7%91%D7%A0%D7%99%D7%AA:%D7%93%D7%99%D7%95%D7%9F_%D7%97%D7%93%D7%A9_%D7%91%D7%9E%D7%96%D7%A0%D7%95%D7%9F'; | document.getElementById('ca-addsection').getElementsByTagName('a')[0].href+='&editintro=%D7%AA%D7%91%D7%A0%D7%99%D7%AA:%D7%93%D7%99%D7%95%D7%9F_%D7%97%D7%93%D7%A9_%D7%91%D7%9E%D7%96%D7%A0%D7%95%D7%9F'; | ||
} | |||
/* A helper function to add a button to one of the toolbars in the interface. | |||
Took it from [[:en:User:Omegatron/monobook.js/addlink.js]] */ | |||
function addLink(where, url, name, id, title, key, after){ | |||
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); | |||
var tabs = document.getElementById(where).getElementsByTagName('ul')[0]; | |||
if(after) { | |||
tabs.insertBefore(li,document.getElementById(after)); | |||
} else { | |||
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; | |||
} | } | ||