Ad placeholder

User:Nattern/vector.js: Difference between revisions

Jump to navigation Jump to search
Added more elements to the "Custom" portlet in mw-panel. Fixed accessKey not working.
(Changed some variable names. added mwPanel, leftNavigation and rightNavigation variables. Added acessKey support for createListItem(). Added link to templates,)
(Added more elements to the "Custom" portlet in mw-panel. Fixed accessKey not working.)
Line 51: Line 51:




function createListItem(end, contentList, listItemName, onClick, title, acessKey) {
function createListItem(end, contentList, listItemName, onClick, title, accessKey) {
var li = document.createElement('li');
var li = document.createElement('li');
var a = document.createElement('a');
var a = document.createElement('a');
Line 65: Line 65:
a.setAttribute('onclick', onClick);
a.setAttribute('onclick', onClick);
if (title) {a.title = title;}
if (title) {a.title = title;}
if (acessKey) {a.acessKey;}
if (accessKey) {a.accessKey = accessKey;}
a.appendChild(span);
a.appendChild(span);
span.innerText = listItemName;
span.innerText = listItemName;
Line 91: Line 91:
createListItem(5, pPersonal, "CSS", "https://bg3.wiki/wiki/User:Nattern/vector.css", "User:Nattern/vector.css");
createListItem(5, pPersonal, "CSS", "https://bg3.wiki/wiki/User:Nattern/vector.css", "User:Nattern/vector.css");


createListItem("a", pCustom, "Templates", "/wiki/Category:Templates", "List of templates [alt-shift-t]", "w");
createListItem("a", pCustom, "Templates", "/wiki/Category:Templates", "List of templates");
createListItem("a", pCustom, "Wiki Maintenance", "/wiki/Category:Wiki_Maintenance", "Wiki maintenance pages");
createListItem("a", pCustom, "All Pages", "/wiki/Special:AllPages", "A list of all pages on the wiki");

Navigation menu