// ==UserScript==
// @name Mark quality
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description try to take over the world!
// @author Kirdock
// @match https://www.animes.so/forum/anime-deutsch-sub/*
// @match https://www.animes.so/forum/anime-deutsch/*
// @match https://www.animes.so/forum/anime-filme/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const colors = {
blurayFullHD: '#e95a00',
blurayHD: '#00bae9',
webrip: 'red',
default: 'green'
};
const webRip = ['webrip', 'web-dl', 'webdl'];
const bluRay = ['bdrip', 'bluray'];
for (const element of document.querySelectorAll('.js-threadList .aso_thread--title--title')){
const text = element.innerText.toLowerCase().replace(/ /g,''); //because sometimes the title is "abc[BluRa y]def"
element.style.color = getColor(text);
if(!text.includes('laufend')) {
element.style.backgroundImage = 'url(https://www.animes.so/styles/animesso/premium/glow.gif)';
}
};
function getColor(text /*:string*/) /*:string*/ {
if (webRip.some(t => text.includes(t))) {
return colors.webrip;
}
if(!bluRay.some(t => text.includes(t))) {
return colors.default;
}
if (text.includes('1080')) {
return colors.blurayFullHD;
}
return colors.blurayHD;
}
})();