kneefer / Hide timetable activities (plan.polsl.pl)

Published:

Version: 3.1+70574d5 updated

Summary: Hides selected activities from plan.polsl.pl timetable.

License: MIT; https://opensource.org/licenses/MIT

Hide timetable activities

plan.polsl.pl

by Szymon Bartnik

Overview

The script gives you an ability to hide/make less visible unnecessary activities
from your timetable on your studies on Silesian University of Technology.

After you make choices and make some types of activities less visible,
if you hold your mouse over one of that activities, it will be again fully visible.
Again, if you hold your mouse over one of activities which are not selected to be hidden,
the rest of activities becomes fully invisible to enhance your timetable browse experience.

All transitions between different levels of visibility are fully animated.

The preview of final effect

Technical details

No support for IE 6,7,8!!!

I think this will be an advantage. New jQuery (versions 2.x) discontinued support for
that outdated browsers (I could use jQuery 1.x but ... why? xD)

Data storage

Your configuration is continuously stored in your browser by using localstorage technology
so every time you're getting back on your plan webpage, choices you made
(activities you've hidden) are restored.

Configuration

The snippet below shows fragment of code responsible for detecting specific types of activities
from timetable. If you notice that some types are missing, let me know or change the code by yourself
by adding another entry to the activities array.

var activities = [
    { key: "Wykłady",   value: "rgb(123, 247, 141)", isChecked: true },
    { key: "Ćwiczenia", value: "rgb(121, 249, 209)", isChecked: false },
    { key: "Laborki",   value: "rgb(124, 176, 246)", isChecked: false },
    { key: "Projekt",   value: "rgb(239, 131, 221)", isChecked: false },
];

Detecting activities in HTML

Sadly there is no other, more pretty way to find desired divs representing activities on timetable
than by telling jQuery to find nodes with appropriate value of background-color style property.

var activitiesToHide = jq('div').filter(function() {
    for(var i in conditions){
        if(jq(this).css('background-color') == conditions[i])
            return true;
    }
    return false;
});

jQuery collisions

As I previously said, since I had to use my own version of jQuery, I was required to use line of code
showed below to be able to use my own version of jQuery instead of version provided by the webpage.

var jq = jQuery.noConflict(true);

Rating: 0