// ==UserScript==
// @version 1.0.1
// @name Kickass with Yt & IMDb
// @description add youtube popup and imdb rating to main movies page, this fixes the five fingers
// @namespace https://greasyfork.org/users/3159
// @include http://kickass.so/movies/*
// @include https://kickass.so/movies/*
// @downloadURL none
// ==/UserScript==
//minus IMDb for now
style = document.createElement('style');
style.innerText = ".king{background: linear-gradient(to bottom, #aac559 0%, #849d3a 100%) !important;margin-left:1px} .mag{background: linear-gradient(to bottom, #70abc6 0%, #5790d0 100%) !important}.mag, .king{box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 -1px 0 0 rgba(0, 0, 0, 0.03), inset 0 1px 0 0 rgba(255, 255, 255, 0.2)} #bg{background:rgba(0, 0, 0,.8);position:fixed;top:0;z-index:9001;width:100%;height:100%;display:none} .yt{background: linear-gradient(to bottom, #c8644b 0%, #b2491a 100%)} .imdb{margin-left:4px;background: linear-gradient(to bottom, #efe670 0%, #f1be00 100%)} iframe{border:0;width:640px;height:390px;max-width:90%;max-height:90%;margin:auto;position:absolute;top:0;left:0;bottom:0;right:0} em{margin-right:6px !important} .emi{top:0 !important;vertical-align:middle} .imdb:hover{background: linear-gradient(to bottom, #cfc761 0%, #d1a400 100%) !important} .yt:hover{background: linear-gradient(to bottom, #a6523d 0%, #913d16 100%) !important} .mag:hover{background: linear-gradient(to bottom, #5e8fa6 0%, #558bc9 100%) !important} .king:hover{background: linear-gradient(to bottom, #8da349 0%, #697d2e 100%) !important} .king2, .mag2 {vertical-align: middle;text-shadow: 0 1px 0 #4c4c4c}";
document.head.appendChild(style);
var box = document.getElementsByClassName('iaconbox');
var nlink = document.getElementsByClassName('cellMainLink');
var names = [];
function fixTitle(title) {
title = title.replace(/[()]/g, '').replace(/[.]/g, ' '); // remove unwanted characters
title = title.replace(/([1|2][8|9|0][0-9]{2}).*/, '$1'); // trim after date
return title;
}
for (i = 0; i < box.length; i++) {
box[i].children[4] ? box[i].children[4].style.display = "none" : null;
box[i].children[2] ? box[i].children[2].style.display = "none" : null;
var king = box[i].children[1];
var mag = box[i].children[3];
king ? (king.className += " king", king.children[0].className = king.children[0].className.replace(/ka16/, 'king2').replace(/ka-green/, '')) : null;
mag ? (mag.className += " mag", mag.children[0].className = mag.children[0].className.replace(/ka16/, 'mag2')) : null;
names.push(fixTitle(nlink[i].innerText));
}
bg = document.createElement("div");
bg.id = "bg";
bg.onclick = function () {
bg.style.display = "none";
bg.innerHTML = "";
};
document.body.appendChild(bg);
for (var i = 0; i < box.length; i++) {
//YouTube
box[i].insertAdjacentHTML("beforeend", "Yt");
var x = encodeURIComponent(names[i]).replace(/%20/g, '+').replace(/'/g, '%27'); // replace space with plus and apostrophe with %27
eval("document.getElementsByClassName('yt')[i].onclick = function (){bg.style.display='block';bg.innerHTML=''};");
//IMDb
//box[i].insertAdjacentHTML("beforeend", "9.2");
}