NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name AAU - Campus Link Fix // @author Peter Jochum // @copyright 2015, Peter Jochum // @description Adds a link to the campus system in the main menu. // @namespace aau.at // @include https://www.aau.at // @domain www.aau.at // @match https://www.aau.at/* // @version 1 // @grant none // ==/UserScript== (function(){ // Prüfen ob das Menü existiert var mainMenu = document.querySelector('nav.main_menu ul'); if (mainMenu) { // Linkelement auf Campus-System erzeugen var campusLiA = document.createElement('a'); campusLiA.setAttribute('href', 'http://campus.uni-klu.ac.at/index.jsp'); campusLiA.setAttribute('itemprop', 'url'); // Format-Klassen-Span-Elemente für Menüdarstellung erstellen und dem Link beifügen var spans = ['avia-bullet', 'avia-menu-text', 'avia-menu-fx', 'avia-arrow-wrap']; spans.forEach(function (value) { var tmpSpan = document.createElement('span'); tmpSpan.className = value; campusLiA.appendChild(tmpSpan); }); // Menütext in das span.avia-menu-text hinzufügen var campusLiAText = document.createTextNode('Campus-System'); campusLiA.querySelector('span.avia-menu-text').appendChild(campusLiAText); // Listenelement erstellen var campusLi = document.createElement('li'); campusLi.appendChild(campusLiA); // Listenelement im Hauptmenü an entsprechender Position einfügen mainMenu.insertBefore(campusLi, mainMenu.childNodes[2]); } })();