/overlay.js (19e3b2e975f3a25acacb2737e2aa25b060396f13) (1264 bytes) (mode 100644) (type blob)

/** This script introduces an overlay to the andere-serien site.
 *  It indicates wether a serie was partly or fully watched.
 *  The nobreak wrapper removes the need for mutation watching
 *  since the search function replaces content of link elements
 *  and images appended to the li child creates linebreaks.
 */
'use strict'

let check = chrome.runtime.getURL('images/check.svg');
let times = chrome.runtime.getURL('images/times.svg');

/* add the overlay images to every found title */
function overlay() {
    let series = $('#seriesContainer li:not(.hidden)').get();
    
    series.forEach(function(e) {
        let title = e.firstChild.title;

        chrome.storage.local.get([title], function(items) {
            if (items[title] != null) {
                if (items[title][0] == items[title][1]) {
                    $(e).append('<img height="15" src="' + check + '" />').wrap('<nobr>');
                } else if (items[title][1] > 0) {
                    $(e).append('<img height="15" src="' + times + '" />').wrap('<nobr>');
                }
            }
        });
    });
}

/* If the user wants the overlay, render it */
chrome.storage.sync.get(['overlay'], function(items) {
    if (items.overlay === true) {
        overlay();
    }
});


Mode Type Size Ref File
100644 blob 1629 bbcec55dc995b9dd8cad03e19bb52367e13cb352 README.md
100644 blob 808 c77600f9ea887ca032fd7577a74d7864e778dd4a background.js
100644 blob 1498 be3245ae446702d46b5cc23d6f3052b689ca3f2c favorite.js
040000 tree - c9aa98d9296dbdb734be5a929b524a2d66a2d97b images
100644 blob 86927 4d9b3a258759c53e7bc66b6fc554c51e2434437c jquery-3.3.1.js
100644 blob 1566 d0070e77c72e3b6c83babbe8e996bc4925970acd manifest.json
100644 blob 1415 28d1fa42a634b270b1e3e9fdac892020b3878389 next.js
100644 blob 1268 396658b5d3fc25b0c509b9a8afbf9b07b9b4c68b options.html
100644 blob 5174 f83c1c8589bce30795ffe6b097f1cf7d75050d14 options.js
100644 blob 1264 19e3b2e975f3a25acacb2737e2aa25b060396f13 overlay.js
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/ratzeputz/Bsext

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/ratzeputz/Bsext

Clone this repository using git:
git clone git://git.rocketgit.com/user/ratzeputz/Bsext

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main