Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(25 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
//setTimeout(function(){ | //setTimeout(function(){ | ||
− | var header = document.getElementById(" | + | var header = document.getElementById("mw-head-base"); //top-bar for 2018 |
var button = document.createElement("div"); | var button = document.createElement("div"); | ||
button.setAttribute("class", "selectionscreen"); | button.setAttribute("class", "selectionscreen"); | ||
button.setAttribute("id", "backtoselectionscreen"); | button.setAttribute("id", "backtoselectionscreen"); | ||
var link = document.createElement("a"); | var link = document.createElement("a"); | ||
− | link.setAttribute("href", "/ | + | link.setAttribute("href", "/home/index.html") |
link.setAttribute("tabindex","0"); | link.setAttribute("tabindex","0"); | ||
var object = document.createElement("object"); | var object = document.createElement("object"); | ||
− | object.setAttribute("data", "../img/BackArrow-01.svg"); | + | object.setAttribute("data", "../img/BackArrow-OL-01.svg"); |
object.setAttribute("type", "image/svg+xml"); | object.setAttribute("type", "image/svg+xml"); | ||
object.setAttribute("class", "selectionscreen"); | object.setAttribute("class", "selectionscreen"); | ||
− | if (header == | + | if (header == 0) { |
console.log("found no header"); | console.log("found no header"); | ||
} else { | } else { | ||
+ | console.log(header); | ||
header.appendChild(button); | header.appendChild(button); | ||
button.appendChild(link); | button.appendChild(link); | ||
link.appendChild(object); | link.appendChild(object); | ||
} | } | ||
+ | |||
+ | //var findform = document.querySelector("#form"); | ||
+ | //console.log("findform",findform); | ||
+ | //if (findform) {findform.setAttribute("action", "/wiki/index.php?title=Special:WikiForum&wfaction=savenewcategory");} | ||
+ | //else {console.log("no form")} | ||
+ | |||
+ | //var findsearch = document.querySelector("#mw-wikiforum-searchbox > form"); | ||
+ | //console.log("findsearch",findsearch); | ||
+ | //if (findsearch) {findsearch.setAttribute("action", "/wiki/index.php?title=Special:WikiForum&wfaction=search");} | ||
+ | //else {console.log("no search")} | ||
+ | |||
+ | //var findlink = document.querySelector(".mw-wikiforum-rightside > a"); | ||
+ | //console.log("findlink"); | ||
+ | //var linkabsolute = findlink.href; | ||
+ | //console.log(linkabsolute); | ||
+ | //var linkrelative = linkabsolute.replace('http://lehmannmax.de',''); | ||
+ | //console.log(linkrelative) | ||
+ | //if (findlink) {findlink.setAttribute("href", linkrelative);} | ||
//}, 100); | //}, 100); |
Latest revision as of 16:58, 12 June 2021
/* Any JavaScript here will be loaded for all users on every page load. */ //setTimeout(function(){ var header = document.getElementById("mw-head-base"); //top-bar for 2018 var button = document.createElement("div"); button.setAttribute("class", "selectionscreen"); button.setAttribute("id", "backtoselectionscreen"); var link = document.createElement("a"); link.setAttribute("href", "/home/index.html") link.setAttribute("tabindex","0"); var object = document.createElement("object"); object.setAttribute("data", "../img/BackArrow-OL-01.svg"); object.setAttribute("type", "image/svg+xml"); object.setAttribute("class", "selectionscreen"); if (header == 0) { console.log("found no header"); } else { console.log(header); header.appendChild(button); button.appendChild(link); link.appendChild(object); } //var findform = document.querySelector("#form"); //console.log("findform",findform); //if (findform) {findform.setAttribute("action", "/wiki/index.php?title=Special:WikiForum&wfaction=savenewcategory");} //else {console.log("no form")} //var findsearch = document.querySelector("#mw-wikiforum-searchbox > form"); //console.log("findsearch",findsearch); //if (findsearch) {findsearch.setAttribute("action", "/wiki/index.php?title=Special:WikiForum&wfaction=search");} //else {console.log("no search")} //var findlink = document.querySelector(".mw-wikiforum-rightside > a"); //console.log("findlink"); //var linkabsolute = findlink.href; //console.log(linkabsolute); //var linkrelative = linkabsolute.replace('http://lehmannmax.de',''); //console.log(linkrelative) //if (findlink) {findlink.setAttribute("href", linkrelative);} //}, 100);