User talk:Raylu/monobook.js

to fix the code, do:

function addlilink(tabs, url, name, id){ 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); return li; }

function addTab(url, name, id){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlilink(tabs, url, name, id); }

function addlimenu(tabs, name, id) { var na = document.createElement('a'); na.href = ''; var mn = document.createElement('ul'); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.className = 'tabmenu'; li.appendChild(na); li.appendChild(mn); tabs.appendChild(li); return li; }

// ===== My Script ===== funciton doQwikify { alert('test'); } function addQwikify { addTab("javascript:doQwikify", "dqw", "") }

if (window.addEventListener) window.addEventListener("load", addQwikify, false); else if (window.attachEvent) window.attachEvent("onload", addQwikify);

// ========== Edit Section 0 ========== function addEditSection0 { ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page']; if (!document.getElementById) return; x = document.getElementById('ca-edit'); if(!x) return; y = document.createElement('LI'); y.id = 'ca-edit-0'; if (x.className == 'selected') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected'; } else { x.className = 'selected istalk'; } } else if (x.className == 'selected istalk') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected istalk'; } else { y.className = 'istalk'; } } else { y.className = x.className; x.className = 'istalk'; } z = document.createElement('A'); if (x.children) { z.href = x.children[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling); } else { z.href = x.childNodes[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling); } }

if (window.addEventListener) window.addEventListener("load", addEditSection0, false); else if (window.attachEvent) window.attachEvent("onload", addEditSection0);

// ========== Add Last Diff ==========

function doLastDiff { z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") { var pname=z[n].textContent; }; }; var nurl="http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev"; document.location=nurl } function addLastDiff { var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; var l=addlilink(tabs, "javascript:doLastDiff", 'last', ''); l.lastChild.title="Show most recent diff"; }

if (window.addEventListener) window.addEventListener("load", addLastDiff, false); else if (window.attachEvent) window.attachEvent("onload", addLastDiff);