Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Rapla Highlighter
- // @namespace https://rapla.dhbw-karlsruhe.de
- // @include https://rapla.dhbw-karlsruhe.de/*
- // @version 1
- // @require http://code.jquery.com/jquery-latest.js
- // @grant none
- // @author Mikescher
- // ==/UserScript==
- this.$ = this.jQuery = jQuery.noConflict(true);
- if (!('contains' in String.prototype)) {
- String.prototype.contains = function(str, startIndex) {
- return -1 !== String.prototype.indexOf.call(this, str, startIndex);
- };
- }
- var excludedBlocks = [
- "LPM4C", "LPM4B",
- "Gamification", "Robotik", "Evolutionäre Algorithmen", "Web-Services",
- "Englisch",
- "Maschinenelemente für Informatiker",
- "Fertigungstechnik für Informatiker",
- "Konstruktionslehre für Informatiker",
- "Wiederholungsklausur", "Klausurwoche",
- "Nachprüfung"
- ];
- var highlightedBlocks = [
- "Klausur", "Studienarbeitstag", "Exkursion", "DevFest"
- ];
- $(".week_block").css({
- "border-radius": "0px",
- "box-shadow": "none",
- });
- $(".week_header").css({
- "background-color": "white",
- });
- $(".week_times").css({
- "background-color": "white",
- });
- $("div.datechooser").css({
- "height": "auto",
- "background": "none",
- });
- $(".button").css({
- "height": "30px",
- "border-radius": "0px",
- "background": "#000",
- });
- $(".button a, .button input").css({
- "color": "#FFF",
- "background-image": "none",
- "background-color": "black",
- "height": "20px",
- });
- $('.week_block').each(function() {
- me = $(this);
- me.css({
- "background-color": "#a3ddff"
- });
- highlightedBlocks.forEach(function(element, index, array) {
- if (me.text().toLowerCase().contains(element.toLowerCase())) {
- me.css({
- "background-color": "#F80"
- });
- }
- });
- excludedBlocks.forEach(function(element, index, array) {
- if (me.text().toLowerCase().contains(element.toLowerCase())) {
- me.css({
- "background-color": "#FFF"
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement