User:DreamFlasher/monobook.js

/* Move top tabs inside body content */

$(function { //prevent from double running if(!document.getElementById("ca-edit2")){   content = document.getElementById("column-content");    // Find the main content column

tabs = document.getElementById("p-cactions");  // Find the top tab list tabs.parentNode.removeChild(tabs);   // Remove the tab list from the side column content.insertBefore(tabs,content.firstChild);   // Place tab list at the beginning of the content column

personal = document.getElementById("p-personal"); personal.parentNode.removeChild(personal); content.insertBefore(personal,content.firstChild);

lis = document.getElementsByTagName("li"); navli = document.getElementById("n-aboutsite").parentNode; for(var i=0; i<lis.length; i++){ j = lis[i].getAttribute("class"); if(j == "interwiki-en" || j == "interwiki-de") {navli.appendChild(lis[i]);} }

edit = document.getElementById("ca-edit").cloneNode(true); edit.setAttribute("id", "ca-edit2"); document.getElementById("n-help").parentNode.appendChild(edit); }  wikiReader; });

function wikiReader{ //prevent from double running if(!document.getElementById("markread")){ tools = document.getElementById("t-specialpages").parentNode; //add Seite gelesen Link var done = document.createElement("a"); done.setAttribute("href", "javascript:addLinkDone"); done.setAttribute("id", "markread"); done.appendChild(document.createTextNode("Seite gelesen")); tools.appendChild(done);

tools.appendChild(document.createElement("br"));

//add Seite entfernen Link var done = document.createElement("a"); done.setAttribute("href", "javascript:removeLink"); done.setAttribute("id", "dellnk"); done.appendChild(document.createTextNode("Seite entfernen")); tools.appendChild(done);

//get all wiki links, add blur-event (drag inside & click outside (unfocus)) which activates the adding mechanism var objects = document.getElementById("bodyContent").getElementsByTagName("a");

for(i=0; i < objects.length; i++) { if(objects[i].href.indexOf("/wiki/") != -1){ objects[i].setAttribute("onblur", "javascript:addLinkToDo(this)"); }  }

//create iframe that handles the external php wikireader = document.createElement("iframe"); /*wikireader.setAttribute("style", "display:none");*/ wikireader.setAttribute("src", "http://www.dreamflasher.de/php/wikireader.php"); wikireader.setAttribute("id", "wikireader"); wikireader.setAttribute("style", "border:0px; width:150px; height:250px;"); document.getElementById("column-one").appendChild(wikireader); } }

function addLinkToDo(lnk){ document.getElementById("wikireader").src = "http://www.dreamflasher.de/php/wikireader.php?action=todo&url=" + lnk; }

function addLinkDone{ document.getElementById("wikireader").src = "http://www.dreamflasher.de/php/wikireader.php?action=done&url=" + document.URL; }

function removeLink{ document.getElementById("wikireader").src = "http://www.dreamflasher.de/php/wikireader.php?action=remove&url=" + document.URL; }