// ==UserScript==
// @author nht.ctn
// @name [DP] PlanetDP Diğer Sitelere PlanetDP Bağlantısı Ekleme Aracı
// @namespace https://github.com/nhtctn
// @version 1.2.6
// @description Sık kullanılan birkaç film, dizi ve anime sitesine PlanetDP'ye kolay erişim sağlayacak bağlantı ekler.
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAAPHSURBVFhHxVZtaI1hGD7ztRGK8v39FUIkfiilKC0halPbOe/7zlZbxFbKHwmlJX6YhJolP1fyg4PT7Hy8m3xT8kNM4Q8TITQjs/tx3Y/73XnPOc84ph1X3Z33uZ/r/nju97nv8wYYsTJaGrdp2+VSNUor/gdiNk1CEufjFtVe20pjRJ1bKKXyEhbtQhLvEzYduRqisbKVW7iOWoIEHkE6OJFYBY2TrdzhZhENxSs5iQQIv52QutYgTZDt3CFq0Xok8SZhK6UTsehYzhO57HSMx92IcBK/RFfkhBukyUL5d7gWLTtXrAbqZ0fNQ4C1ekOgAiovGvpRjQp87UnEom/gnWwqoylC6zvguNwrbTxEi+Wk4eYSmqMJAnTGQgR+mKyG5n2LWXQqXkrThPb3wEn28kDiZ54DKc5tOuRuV8M1EUCFCqCvgw35E8EhvkN/GvvThZo9+J3CwTp+5leBdZffOU79EroSvIw8bQC4DhXC5nUKD8KJQBpQrRlC/TPgnKdguSz5lbxKd6yd26qluZQWCU2qRWEjlyuCROB7ltB7B5zcgOyRJa/vmpyywHEXHB+9HaSRzOULivV2BOo08nU16awbotnauQkgPY/Z3cdlGYDDiyZnfoFNO2SLmARaLJqP5B6YuCy9JsIngOHXuN19TlT8CupNTvwSt7o/48KViYmG67woQPJ3THxPuIKQhlavfZsqaLTetKhVK4C4pQ6kG6YKNae3HabmCji+ZeanC13heaMNUZoFrMRvm1YAaL2qTCOIpT4mHFXJVRNqgBNBNRphn9KWJgHnXsKhNWL6C6yQzU+i4qQ2phujQhH/1LtQTiMQuBZc4+VLFXoGXsn+/WqAmCfh2hQSEoUr1TDWtZTRcp/xBwR3NBnQcwItC4ftSU4vYtFb2NdECilfzDMBZ7s9g+hWNZN1UUtN5TWCXLpeThM1EcCYXg1+rzfdE3C+QGq9Vv0tMMePeoZopRWsi+ykfC6ZJgDxIM3FabJpzR848ZlI8Ev2/5QwavQcxBy1SdQa3CE4yTEI5nxmwFShMHwtENPswePV56SKdXjPQ3A5q7F+lxokUxD0NqqzSjvrC+CgrccZ+j8Wog0I/MQfxCz0FPxif0v2CUjgk+cUz9m01BvMiR33K9VgcdF3cNuZg5iEOnBhD0aC7/58s7MFt505WFJQlS5Ifb98jEat7ytNQT1B4As9M7s/gClYZAqMct/AMFoptP4DLlONPzD6/TF0m/2fXv0KlPiwBMa3HVW5q9Qg2coNkEAdhsg+tzj51Zs7BAI/ATGDAuhMWJKcAAAAAElFTkSuQmCC
// @include *://*.imdb.com/title/*
// @include *://*.imdb.com/list/*
// @include *://*.imdb.com/user/*/ratings*
// @include *://*.imdb.com/user/*/watchlist*
// @include *://*.google*/search*
// @include *://*trakt.tv/*
// @include *://*.icheckmovies.com/movies/*
// @include *://*.icheckmovies.com/lists/*
// @include *://*letterboxd.com/film/*
// @include *://*.themoviedb.org/movie*
// @include *://*.themoviedb.org/tv*
// @include *://*.thetvdb.com/series/*
// @include *://*.thetvdb.com/movies/*
// @include *://*.tvtime.com/*/show/*
// @exclude *://*.tvtime.com/*/show/*/episode/*
// @include *://*tvmaze.com/shows/*
// @include *://*.criticker.com/film/*
// @include *://*.criticker.com/tv/*
// @include *://*subscene.com/subtitles/*
// @include *://*.opensubtitles.org/*
// @exclude *://*.opensubtitles.org/en/search/subs
// @include *://*.addic7ed.com/serie/*
// @include *://*.addic7ed.com/show/*
// @include *://*.addic7ed.com/movie/*
// @include *://animetosho.org/series/*
// @include *://*myanimelist.net/*
// @include *://*anidb.net/perl-bin/animedb.pl?show=anime*
// @include *://anidb.net/anime/*
// @include *://*.livechart.me/*
// @include *://anilist.co/*
// @include *://kitsu.io/*
// @include *://*turkcealtyazi.org/mov/*
// @include *://*turkcealtyazi.org/sub/*
// @include *://*turkanime.net/anime/*
// @include *://mydramalist.com/*
// @include *://*movie.douban.com/subject/*
// @include *://*.amazon.com/s?i=instant-video*
// @grant GM_addStyle
// @run-at document-end
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
/* global $ */
// ==/UserScript==
/*jshint esversion: 6 */
(function() {
'use strict';
var PlanetDP =
[{//==========================================================================================================================================================================================
// İstemediğiniz siteler için 1'i 0'a çevirin.
imdb: '1', imdb_new: '1', imdb_list: '1', imdb_google: '1',
trakt: '1', iCheckMovies: '1', letterboxd: '1', TheMovieDB: '1', thetvdb: '1', tvTime: '1', tvMaze: '1', criticer: '1',
subscene: '1', OpenSubtitles: '1', addic7ed: '1', animetosho: '1', turkcealtyazi: '1', turkanime: '1',
MyAnimeList: '1', AniDB: '1', LiveChart: '1', aniList: '1', kitsu: '1', MyDramaList: '1', douban: '1', amazon_list: '1',
name: 'PlanetDP', short_name: 'DP', url: 'https://www.planetdp.org/movie/search?title=%ttimdbId%', url_title: 'https://www.planetdp.org/movie/search?title=%title%&year_date=%year%&is_serial=all', url_forum: 'http://forum.planetdp.org/index.php?/search/&q=%ttimdbId%',
icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAAPqSURBVFhHxVZJaBRBFG033HBLZqomMe4iiiAo4kFEBAUVFD0IghFUFJeDJ/EQiYILRkIUd/AiIogYVCSHkGS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uoNioDzlCvzq3+EaG3hqCcX6HaIlQNoTeHwCoycn8eAqK2wtSeIyUnaVdG2deMSEg1TR8f/e95SqPYsRqoAAAAASUVORK5CYII=',
icon_OpenSubtitles: 'https://images2.imgbox.com/4b/72/EpGIM9Ap_o.png',
icon_anidb: 'https://images2.imgbox.com/0b/d3/uH45PTHK_o.png',
icon_sarangni: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAQCAYAAAD52jQlAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC45bDN+TgAAAqZJREFUOE9lk8trE1EUxm8effiidpWNSJMaBClaaVMtUkQkKAgu1Y1VcONC1NrYmYSkaZsmttZW+6BR8dGVf4Abl/4fghsRlFaN0pR00uQev3PvzGTSDnzcM2fu97vfnZkrnEu+6SL5cj/JtwdIrh0k+Q7i2qvXtnieo9V2PcJvo/RV+5gkuYIHBUxYgJb3kVzE/QvUrIU23Z+HnrU29DRIcgYj++BnjgLKYlgDZmEsYAIned+htSflYZKv0OdkRWgVvRUEYB/7mQOekM/RzLdgVayWx4P5KA3fiNPw9ct089oQ5W7101ahgzY+nKTM3fP6ma3FO+eoMoa07FN+cLAjIefQyOGGtzMVoFq+h6LhSJPix6O0udS9p8/6kwgpn/IzBzwhZ5B02o6P1f5lhtTkwVgffcpccc1fipfc+nPuqltvjBzRKdnPHPCELNhJeYQc6Nn+WBP023KvWyto5JiqfyeOul6HI2SOY9uabqdSyoEONEF/zuqR5YWWzIjyeTlCToI+BU3o0YGe2ZXUC127f8Gty6nuJj+PQqYFijaqp/EVMa6bg2ry7qTfC2G3dnTx1Al88c4mP/NcaC3lp3oqSOuGhg709TYl+joTc+u/2RBVx9toJxsgy/ApH/tdaD2F3yHbSlXTR5bpp1/maWWMdDWSxVGXJhr31XG8Ow6TFGSNaR/7mcM8UTE0lFeyHvuobIbUT+1o6XYP/biHRBOtbq+WQSqGpgFMAAyfSgrO9pgf0GQnVVHILF4yJu9gEX4/vKV6Mkg7pi30WVUArId+2n7go8pIgCqP4OVF4GeOZXTY538Ox20UL3rKcxCeYOQznbfFff5l+AtPYuSvzeIw8Ck/OAroXJvGIdoa1WlqTlJvWk5ptKizzlvcTjRUTgSI/ZokxH9iteh4MiGYswAAAABJRU5ErkJggg==',
main_color: '#f80',
hover_color: '3F51B5',
domain: 'planetdp.org', domain_url: 'https://www.planetdp.org',
}];//=========================================================================================================================================================================================
var regex = /\/title\/(tt\d+)\/?/;
var pageUrl = window.location.href;
// Common Used Vars
var ttimdbId, HTML;
var episodeCheck;
var titleArea;
var imdbLink;
var imdbButton;
var elBox;
var elTitle;
var title;
var year = "";
var infos;
var styles = "";
var className;
var scriptSelector;
var x, a, i, len; // for integers
if (pageUrl.search( /imdb\.com\/title/ ) >= 0 && ( PlanetDP[0].imdb == 1 || PlanetDP[0].imdb_new == 1 ) ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
// Vars
ttimdbId = regex.exec( pageUrl )[1];
var newRatingBar = $('[class^="TitleBlock__ButtonContainer"]');
if (newRatingBar.length > 0 && PlanetDP[0].imdb_new == 1) {
// Episode Check
episodeCheck = $('a[class*="SeriesParentLink"]').length > 0;
if (episodeCheck) {
let parentLink = $('a[class*="SeriesParentLink"]').attr("href");
ttimdbId = regex.exec( parentLink )[1];
}
// Position and Classes
const refPos = (p_ref, width, marginR) => {
let ref = document.querySelector(p_ref).getBoundingClientRect();
let screen = window.screen.width;
return {
top: (window.scrollY + ref.top) + "px",
left: ( (screen >= 1023.5) ? ref.left - width - marginR : (screen >= 350) ? ref.right + (marginR*2) : -200 ) + "px",};
};
const refCls = (p_ref) => {
let ref = document.querySelector(p_ref)
return {
cls1: $(ref).children('div:first').attr("class"),
cls2: $(ref).find('div:first > div:first').attr("class"),
};
}
// On resize
var refSlc = '[class^="TitleBlock__ButtonContainer"]';
var wid = 90; // 90 benim yerleştirdiğim elementin boyu.
var marg = 10; // 10 Dudak payı
window.onresize = function() {
$('#imdb648').css("top", refPos(refSlc, wid, marg).top);
$('#imdb648').css("left", refPos(refSlc, wid, marg).left);
};
// Area
let pos = refPos(refSlc, wid, marg);
let cls = refCls(refSlc);
$('[class^="TitleBlock__TitleContainer"]').css("padding-right", wid + "px");
$('body').prepend('<div id="imdb648" class="imdb648 ' + cls.cls1 + '" style="position: absolute; top: ' + pos.top + '; left: ' + pos.left + '; z-index: 100;"></div>');
$('#imdb648').append('<div class="' + cls.cls2 + '">SEARCH ON</div><div id="newDiv648"></div>');
// Put Buttons
PlanetDP.forEach(function(p) {
let linkClone = newRatingBar.find('a.ipc-button:first').clone().css("min-width", "auto").attr("target", "_blank");
linkClone.clone().attr("href", url(p.url ) ).html('<img style="height: 1.4rem; opacity:0.9;" src="' + p.icon + '" title="' + p.name + '">').appendTo( $('#newDiv648') );
linkClone.clone().attr("href", url(p.url_forum) ).html('<img style="height: 1.4rem; opacity:0.9;" src="' + p.icon_green + '" title="' + p.name + ' Forum">').appendTo( $('#newDiv648') );
});
// Advanced Script
className = "imdb648";
scriptSelector = '#searchOn a[href*="planetdp.org/movie/search?title="]';
advencedScriptAction( className, scriptSelector );
}
else {
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.imdb_list == 1 ) {
h += '<a class="' + className + '" href="' + url( p.url_forum ) + '" target="_blank" style="height: 13px; float: right; padding: 0 3px;"><img style="height: 15px; opacity:0.7;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.7" src="' + p.icon_green + '" title="' + p.name + '"><\/a>';
h += '<a class="' + className + '" href="' + url( p.url ) + '" target="_blank" style="height: 13px; float: right; padding: 0 3px;"><img style="height: 15px; opacity:0.7;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.7" src="' + p.icon + '" title="' + p.name + '"><\/a>';
}
}
return h;
};
// Episode Check
episodeCheck = document.querySelector( 'meta[property="og:type"][content="video.episode"]' ) != null;
if (episodeCheck)
{
let parentLink = document.querySelector( 'div[class="titleParent"] > a' ).href;
ttimdbId = regex.exec( parentLink )[1];
}
// Advanced Script
className = "imdb648";
scriptSelector = 'table#gm_links a[href*="planetdp.org/movie/search?title="]';
advencedScriptAction( className, scriptSelector );
// Areas
titleArea = document.querySelector ( 'div.subtext' );
titleArea.insertAdjacentHTML( "beforeend", html() );
}
}
else if (pageUrl.search(/imdb\.com\/(list|.+\/ratings|.+\/watchlist)/) >= 0 && PlanetDP[0].imdb_list == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.imdb_list == 1 ) {
h += '<a href="' + url( p.url_forum ) + '" target="_blank" style="height: 16px; float: right; padding: 3px 0 0 5px;"><img style="height: 16px; opacity:0.6;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.6" src="' + p.icon_green + '" title="' + p.name + '"><\/a>';
h += '<a href="' + url( p.url ) + '" target="_blank" style="height: 16px; float: right; padding: 3px 0 0 10px;"><img style="height: 16px; opacity:0.6;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.6" src="' + p.icon + '" title="' + p.name + '"><\/a>';
}
}
return '<div>' + h + '</div>';
};
// Work on Each Movie
elBox = document.querySelectorAll( 'div[class="lister-item-content"]' );
for ( x = 0; x < elBox.length; x++ )
{
// Vars
ttimdbId = elBox[x].querySelector( '[href^="/title/tt"]' );
ttimdbId= ttimdbId.attributes[0].value; ttimdbId = ttimdbId.substr( 7, 9 );
// Areas
titleArea = elBox[x].querySelector( '[class="lister-item-header"]' );
titleArea.insertAdjacentHTML( "beforeend", html() );
}
}
else if (pageUrl.search(/google\D+\/search\?/i) >= 0 && PlanetDP[0].imdb_google == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (position = '') => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.imdb_google == 1 ) {
h += '<a href="' + url( p.url ) + '" target="_blank" style="' + position + ' z-index:5;"><img style="height: 20px; padding: 0 10px; vertical-align: sub; opacity:0.4;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.4" src="' + p.icon_long + '" border="0"></a>';
}
}
return h;
};
// Work on Each Link
imdbButton = document.querySelectorAll( '#search #rso .g [href^="https://www.imdb.com/title/tt"]' );
for ( x = 0; x < imdbButton.length; x++ )
{
// Vars
imdbLink = imdbButton[x].href;
var titleButton = imdbButton[x].querySelector( 'h3' );
ttimdbId = imdbLink.match( /.+imdb\.com\/title\/(tt\d+)\/?/i )[1];
title = imdbButton[x].textContent;
var subButtonCheck = imdbButton[x].attributes[0].value.search( /imdb\.com/i ) < 0;
// Areas
if (!subButtonCheck)
{
if (title.search( /(TV Episode|Video Game)/i ) < 0 && title.search( /"/i ) < 0 && imdbLink.search( /title\/tt\d+\/./i ) < 0)
{
titleButton.closest('div').insertAdjacentHTML( "beforeend", html() );
}
}
else if (imdbLink.search( /title\/tt\d+\/./i ) < 0)
{
imdbButton[x].insertAdjacentHTML( "afterend", html() );
}
}
}
else if (pageUrl.search(/trakt\.tv/) >= 0 && PlanetDP[0].trakt == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (urlType) => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.trakt == 1 ) {
h += '<a target="_blank" href="' + url( p[urlType] ) + '" data-original-title="" title="">' + p.short_name + '</a>';
}
}
return h;
};
waitForKeyElements('.sidebar .external', function() {
pageUrl = window.location.href;
if (pageUrl.search(/trakt\.tv\/(movies|shows)\//) >= 0) {
// Area
titleArea = document.querySelector( '[href*="imdb.com/"]' );
// Vars
imdbLink = document.querySelector( '[href*="imdb.com/"]' ).href;
if (imdbLink.search( "find" ) < 0) {
ttimdbId = imdbLink.match( regex )[1];
HTML = html("url");
} else {
title = titleEdit( document.querySelector( '[property="og:title"]' ).getAttribute( "content" ) );
year = titleEdit( document.querySelector( 'span[class="year"]' ).textContent );
HTML = html("url_title");
}
// Final
titleArea.insertAdjacentHTML("afterend", HTML);
}
});
}
else if (pageUrl.search(/icheckmovies\.com/) >= 0 && PlanetDP[0].iCheckMovies == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.iCheckMovies == 1 ) {
h += '<li><a href="' + url( p.url ) + '" target="_blank" style="background: none; text-indent:0px"><img style="width: 10px; height: 10px; margin: 8px; opacity:0.3;" onMouseover="this.style.opacity=1" onMouseout="this.style.opacity=0.3" src="' + p.icon_iCheckMovies + '" title="' + p.name + '"><\/a></li>';
}
}
return h;
};
// Work on Each Movie
elBox = document.querySelectorAll( 'ul[class="optionIconMenu optionIconMenuCheckbox"]' );
for ( x = 0; x < elBox.length; x++ ) {
// Vars
ttimdbId = elBox[x].querySelector( '[href*="imdb.com/"]' );
ttimdbId = ttimdbId.attributes[1].value; ttimdbId = ttimdbId.substr(26);
// Areas
titleArea = elBox[x].querySelector( 'a[class="optionIcon optionIMDB external"]' ).closest("li");
titleArea.insertAdjacentHTML( "beforebegin", html() );
}
}
else if (pageUrl.search(/letterboxd\.com/) >= 0 && PlanetDP[0].letterboxd == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.letterboxd == 1 ) {
h += '<a href="' + url( p.url ) + '" class="micro-button track-event">' + p.name + '</a>';
}
}
return h;
};
// Vars
imdbButton = document.querySelector( '[href*="imdb.com/"]' );
imdbLink= imdbButton.href; ttimdbId = imdbLink.match( /.+imdb\.com\/title\/(tt\d+)\/?/i )[1];
// Areas
titleArea = imdbButton.parentElement;
var thatDamnFlagIcon = titleArea.querySelector( '[data-original-title="Report this film"]' );
if (thatDamnFlagIcon) {
thatDamnFlagIcon.remove();
titleArea.insertAdjacentHTML( "beforeend", html() );
titleArea.insertAdjacentElement( "beforeend", thatDamnFlagIcon );
}
else {
titleArea.insertAdjacentHTML( "beforeend", html() );
}
}
else if (pageUrl.search(/themoviedb\.org\//) >= 0 && PlanetDP[0].TheMovieDB == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.TheMovieDB == 1 ) {
h += '<div class="homepage"><a class="social_link" title="' + p.name + '\'yi ziyaret edin" href="' + url( p.url_title ) + '" target="_blank" rel="noopener" data-role="tooltip"><img style="padding: 5px; width: 30px;" src="' + p.icon_TheMovieDB + '"></a></div>';
}
}
return h;
};
// Vars
infos = document.querySelector( 'title' ).textContent.replace( " — The Movie Database (TMDb)" , "");
title = titleEdit( infos.replace(/(\d+)|TV Series (\d+)-(\d+)? ?/, "") );
year = titleEdit( infos.match(/(\d+|TV Series \d+)/)[1].replace(/TV Series /, "") );
titleArea = document.querySelector( 'div[class="social_links"]' );
titleArea.insertAdjacentHTML( "beforeend", html() );
}
else if (pageUrl.search(/thetvdb\.com\/(series|movies)\//) >= 0 && PlanetDP[0].thetvdb == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.thetvdb == 1 ) {
h += '<span><a href="' + url( p.url ) + '" target="_blank">' + p.name + '</span></a>';
}
}
return h;
};
// Vars
imdbButton = document.querySelector( '[href*="imdb.com/"]' );
if (imdbButton) {
ttimdbId = imdbButton.href.match( /.+imdb\.com\/title\/(tt\d+)\/?/i )[1];
titleArea = imdbButton.parentElement.parentElement;
titleArea.insertAdjacentHTML( "beforeend", html() );
}
else {
ttimdbId = document.querySelector( '#series_title' ).textContent;
$('#series_basic_info .list-group').append( '<li class="list-group-item clearfix"><strong>ON OTHER SITES</strong>' + html() + '</li>' );
}
}
else if (pageUrl.search(/tvtime\.com\/.+\/show/) >= 0 && PlanetDP[0].tvTime == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.tvTime == 1 ) {
h += '<a href="' + url( p.url_title ) + '" target="_blank" class="' + p.name.toLowerCase() + '" style="background: ' + p.main_color + ';"><img src="' + p.icon_white + '" style="margin: 0;width: 20px;padding-bottom: 6px;"></a>';
}
}
return h;
};
// Vars & Areas
title = titleEdit( $('[property="og:title"]').attr("content") );
$( '.info-zone .container-fluid' ).append( '<span class="share-btns social" style="left: 20px;">' + html() + '</span>' );
}
else if (pageUrl.search(/tvmaze\.com\/shows\/\d+/) >= 0 && PlanetDP[0].tvMaze == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.tvMaze == 1 ) {
h += '<a id="' + p.name.toLowerCase() + '" href="' + url( p.url_title ) + '" target="_blank" title="' + p.name.toLowerCase() + '" style="float: left; margin-top: 3px; background: ' + p.main_color + '; height: 26px;width: 26px;display: inline-flex;border-radius: 2px;margin: 3px 5px 0 0;align-items: center;justify-content: center;" onmouseover="this.style.opacity=0.8" onmouseout="this.style.opacity=1"><img src="' + p.icon_white + '" style="height: 20px;"></a>';
}
}
return h;
};
// Vars
title = titleEdit( $('[property="og:title"]').attr("content").replace(" | TVmaze", "") );
// Areas
titleArea = $( '#general-information .social-buttons' );
titleArea.css("display", "flow-root");
titleArea.children('span').prepend( '<span style="float: left;">Search this on:</span>' );
titleArea.children('span').after( html() );
}
else if (pageUrl.search(/criticker\.com/) >= 0 && PlanetDP[0].criticer == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (urlType) => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.criticer == 1 ) {
h += '<a target="_blank" href="' + url( p[urlType] ) + '" title="' + p.name + '" style="float: right;"><img style="height: 26px; vertical-align: baseline; padding: 3px;" src="' + p.icon + '"></a>';
}
}
return h;
};
// Vars & Areas
imdbButton = document.querySelector( '#fi_info_ext [href^="http://www.imdb.com/title/tt"]' );
titleArea = document.querySelector( '.crit_container > h1' );
if (imdbButton != null) {
ttimdbId = regex.exec( imdbButton.href )[1];
HTML = html("url");
}
else {
title = titleEdit( titleArea.querySelector( '[itemprop="name"]' ).textContent );
if (pageUrl.search(/\/film\//) >= 0) {year = titleEdit( titleArea.querySelector( '[itemprop="datePublished"]' ).textContent );}
else {year = titleEdit( titleArea.querySelector( '[itemprop="startDate"]' ).textContent );}
HTML = html("url_title");
}
// Fatal Blow
titleArea.insertAdjacentHTML( "beforeend", HTML );
GM_addStyle( ".crit_container > h1 > a > img:hover {background-color: #01305F; border-radius: 13px;}" );
}
else if (pageUrl.search(/subscene\.com/) >= 0 && PlanetDP[0].subscene == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (type) => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.subscene == 1 ) {
h += '<a target="_blank" class="imdb" href="' + url( p[type] ) + '" style="margin-left: 6px;">' + p.name + '</a>';
}
}
return h;
};
// Vars
imdbButton = document.querySelector( '[href*="imdb.com/title"]' );
if (imdbButton != null) {
ttimdbId = imdbButton.href.match( regex )[1];
if (ttimdbId.length == 8) {ttimdbId = ttimdbId.replace( "tt", "tt0" );}
titleArea = imdbButton;
titleArea.insertAdjacentHTML( "afterend", html("url") );}
else {
title = titleEdit( document.querySelector( 'title').textContent.replace( /.+Subtitles for (.+)/i, "$1" ).replace( /Subscene - (.+) .+ subtitle/i, "$1" ) );
year = document.querySelector( 'div[class="header"] > ul > li' ).textContent.trim().replace( /Year:\s+/, " " );
year = ( $('.comment-sub').length > 0 ) ? '' : year;
titleArea = document.querySelector( '[href^="javascript:Embed"]' );
titleArea.insertAdjacentHTML( "afterend", html("url_title") );
}
}
else if (pageUrl.search(/opensubtitles\.org.+(\/subtitles\/|\/s?search\/)/) >= 0 && PlanetDP[0].OpenSubtitles == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.OpenSubtitles == 1 ) {
h += '<a target="_blank" href="' + url( p.url ) + '" style="width: 21px"><img alt="imdb" width="16" height="16" src="' + p.icon_OpenSubtitles + '"></a>';
}
}
return h;
};
// Vars
imdbButton = document.querySelector( '[href*="imdb.com/title/tt"]' );
ttimdbId = imdbButton.href.match( /\/title\/(tt\d{7,8})/i )[1];
if (ttimdbId.length == 8) {ttimdbId = ttimdbId.replace( "tt", "tt0" );}
episodeCheck = document.querySelector( 'span[itemtype*="schema.org/TVEpisode"]' ) != null;
if (episodeCheck)
{
var mainPageLink = document.querySelector( 'a[href*="/ssearch/sublanguageid-"]' ).href;
ttimdbId = 'tt' + mainPageLink.match( /\/imdbid\-(\d{7})/i )[1];
}
// Areas
titleArea = imdbButton;
titleArea.insertAdjacentHTML( "afterend", html() );
}
else if (pageUrl.search(/addic7ed\.com\/(show|serie|movie)/) >= 0 && PlanetDP[0].addic7ed == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.addic7ed == 1 ) {
h += ' <a target="_blank" href="' + url( p.url_title ) + '">PlanetDP</a>';
}
}
return h;
};
// Vars
var pageType = pageUrl.match(/addic7ed\.com\/(.+?)\//)[1];
if (pageType == "show") {
title = titleEdit( $('#header > div > b > font').text().replace(/(subtitles\s+)$/, "") );
titleArea = $('#header [href^="/overview/"]');
} else if (pageType == "serie") {
title = titleEdit( $('#container td > [href^="/show/"]').first().text() );
titleArea = $('#container td > [href^="/show/"]').last();
} else if (pageType == "movie") {
title = titleEdit( $('span.titulo').text().replace(/Subtitle/i,"").replace(/\(\d{4}\)/g, "") );
year = titleEdit( $('span.titulo').text().replace(/Subtitle/i,"").match(/\((\d{4})\)/g)[0] );
titleArea = $('#container td > [href^="/show/"]').last();
}
titleArea.after( html() );
}
else if (pageUrl.search(/animetosho\.org\/series\//) >= 0 && PlanetDP[0].animetosho == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if (p.animetosho == 1) {
h += ' | <a target="_blank" href="' + url( p.url_title ) + '">PlanetDP</a>';
}
}
return h;
};
// Vars
title = titleEdit( $('#title').text().replace(/(\d+)/, "") );
year = '';
titleArea = $('#title_desc + table td > div > [href*="anidb.net/anime/"]').parent();
titleArea.append( html() );
}
else if (pageUrl.search(/myanimelist\.net/) >= 0 && PlanetDP[0].MyAnimeList == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.MyAnimeList == 1 ) {
h += ', <a class="' + className + '" href="' + url( p.url_title ) + '" target="_blank">' + p.name + '</a>';
}
}
return h;
};
if (pageUrl.indexOf("myanimelist.net/anime/season") < 0 && pageUrl.indexOf("myanimelist.net/anime") >= 0) {
// Vars
title = titleEdit( document.querySelector( 'h1.title-name' ).firstChild.textContent.replace(/ ?\(TV\)/i, "") );
elTitle = document.querySelector( 'span[itemprop="name"]' );
// Advanced Script
className = "mal648";
scriptSelector = 'li > a[href*="planetdp.org/movie/search?title="]';
advencedScriptAction( className, scriptSelector );
// Areas
if (document.querySelector( '[class="btn-login"]' ) == null) {
titleArea = document.querySelector( '[class="pb16"]' );
titleArea.innerHTML += html();
}
}
}
else if (pageUrl.search(/anidb\.net/) >= 0 && PlanetDP[0].AniDB == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (site) => {
var h = '';
for( var i = 0, len = site.length; i < len; i++ ) {
var p = site[i];
if ( p.AniDB == 1 ) {
h += '<div class="icons ' + className + '"><a class="i_icon i_resource_' + (p.short_name).toLowerCase() + ' brand" style="background-image: url(' + p.icon_anidb + '); height: 16px; width: 16px;" href="' + url( p.url_title ) + '" data-anidb-rel="anidb::extern" itemprop="sameAs" title="' + p.name + '"><span class="text">' + p.name + '</span></a></div>';
}
}
return h;
};
// Vars
title = titleEdit( document.querySelector( 'h1[class="anime"]').textContent.replace(/Anime: ((.+)(\d{4})?) ?(\(\))?/, "$2") );
year = titleEdit( document.querySelector( 'h1[class="anime"]').textContent.replace(/Anime: ((.+)(\d{4})?) ?(\(\))?/, "$3") );
// Advanced Script
className = "dp";
scriptSelector = 'h1.anime li > a[href*="planetdp.org/movie/search?title="]';
advencedScriptAction( className, scriptSelector );
// Areas
var resources = document.querySelector( '.resources > .value' );
if ( resources.querySelector( 'div.group.thirdparty.english' ) == null ) {
resources.insertAdjacentHTML( "beforeend", '<div class="group thirdparty english"></div>' );
}
titleArea = resources.querySelector( 'div.group.thirdparty.english' );
titleArea.insertAdjacentHTML( "beforeend", html( PlanetDP ) );
}
else if (pageUrl.search(/livechart\.me\/anime/) >= 0 && PlanetDP[0].LiveChart == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (site) => {
var h = '';
for( var i = 0, len = site.length; i < len; i++ ) {
var p = site[i];
if ( p.LiveChart == 1 ) {
h += '<div class="liveChart648 column column-block"><a class="button expanded ' + p.name.toLowerCase() + '-button" href="' + url( p.url_title ) + '" target="_blank" rel="noopener nofollow">PLANET<span class="accent">DP</span></a></div>';
}
}
return h;
};
// Vars
title = titleEdit( $('[property="og:title"]').attr("content") );
// Advanced Script
className = "liveChart648";
scriptSelector = '#liveChart648-page div > a[href*="planetdp.org/movie/search?title="]';
advencedScriptAction( className, scriptSelector );
// Areas
titleArea = document.querySelector( 'div.column > div.row.small-up-2.medium-up-3' );
titleArea.insertAdjacentHTML( "beforeend", html( PlanetDP ) );
// Styles
GM_addStyle('.planetdp-button, .planetdp-button:hover, .planetdp-button:focus {background-color: #ff6d00; color: white}');
}
// SEASON CHARTS
else if (pageUrl.search(/livechart\.me\/(spring|summer|fall|winter|tba)(.+)?\/.+/) >= 0 && PlanetDP[0].LiveChart == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.LiveChart == 1 ) {
h += '<li id="LiveChart648" class="' + p.name + '"><a href="' + url( p.url_title ) + '" target="_blank" rel="noopener nofollow" style="display: table; padding: 7px 5px 0px 4px;" ><img style="height:16px;" src="' + p.icon + '" title="' + p.name + '"><\/a></li>';
}
}
return h;
};
const eliminate = (site) => {
if (elBox[x].querySelector( site ) != null)
{elBox[x].querySelector( site ).closest('li').style.display = "none";}
};
var myScriptCheck = document.querySelector( '[id="LiveChart648"]' );
if (myScriptCheck == null) {
elBox = document.querySelectorAll( '[class="anime-card"]');
for ( x = 0; x < elBox.length; x++ )
{
// Vars
title = titleEdit( elBox[x].querySelector( '[class="main-title"]' ).textContent );
// Areas
titleArea = elBox[x].querySelector( '.related-links' );
titleArea.innerHTML += html();
// Eliminate Existing Butons
//=====================================================================
// /* Official Site */ eliminate( '.website-icon' );
// /* Trailer */ eliminate( '.preview-icon' );
// /*Twitter*/ eliminate( '.twitter-icon' );
// /* AniList */ eliminate( '.anilist-icon' );
// /* MAL */ eliminate( '.mal-icon' );
// /* AniDB */ eliminate( '.anidb-icon' );
// /* AnimePlanet */ eliminate( '.anime-planet-icon' );
// /* AniSearch */ eliminate( '.anisearch-icon' );
// /* Kitsu */ eliminate( '.kitsu-icon' );
/* Crunchyroll */ eliminate( '.crunchyroll-icon' );
/* Official Ways to Watch */ eliminate( '.watch-icon' );
//=====================================================================
}
// Set required style and hover
styles = "";
for( i = 0, len = PlanetDP.length; i < len; i++ )
{
styles += "." + PlanetDP[i].name + ":hover {background-color: #" + PlanetDP[i].hover_color + "; border-radius: 15px;} ";
}
GM_addStyle ( styles );
}
}
else if (pageUrl.search(/anilist\.co/) >= 0 && PlanetDP[0].aniList == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = (site, vData) => {
var h = '';
for( var i = 0, len = site.length; i < len; i++ ) {
var p = site[i];
if ( p.aniList == 1 ) {
h += '<a data-v-' + vData + '="" href="' + url( p.url_title ) + '" target="_blank" class="external-link ' + p.name + '">' + p.name + '</a>';
}
}
return h;
};
const anilistAction = () => {
if (window.location.href.search(/anilist\.co\/anime/) > 0) {
// Varsa eskileri temizle.
var externals = document.querySelectorAll('.external-links');
var vClass = externals[0].innerHTML.replace(/.+<a data-v-(.+?)=""(.|\n)+/,"$1");
if (externals.length > 1) externals[1].remove();
var oldies = document.querySelectorAll('.external-link.PlanetDP');
for (let x=0; x<oldies.length; x++) {oldies[x].remove();}
// Yenisini yerleştir.
title = titleEdit( $('.header .content h1').text() );
if ( $( '.external-links' ).length > 0 ) {
$( '.external-links' ).append( html( PlanetDP, vClass ) );
} else {
$( '.sidebar' ).append( '<div data-v-7408c186="" data-v-1fe923a4="" class="external-links"><h2 data-v-7408c186="">External & Streaming links</h2>' + html( PlanetDP, vClass ) + '</div>' );
}
}
setTimeout(function(){ anilistAction(); }, 5000);
};
// Start ver.
setTimeout(function(){ anilistAction(); }, 1000);
}
else if (pageUrl.search(/kitsu\.io\//) >= 0 && PlanetDP[0].kitsu == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.kitsu == 1 ) {
h += '<li><a href="' + url( p.url_title ) + '" target="_blank" rel="noopener noreferrer" class="hint--top hint--bounce hint--rounded" aria-label="' + p.name + '"><img src="' + p.icon + '" style="width:20px"></a></li>';
}
}
return h;
};
const kitsuAction = () => {
if (window.location.href.search(/kitsu\.io\/anime\//) > 0 && $('[property="og:title"]').attr("content")) {
// Varsa eskileri temizle.
var oldies = document.querySelectorAll('.where-to-watch-widget.external-script');
for (let x=0; x<oldies.length; x++) {oldies[x].remove();}
// Yenisini yerleştir.
title = titleEdit( $('[property="og:title"]').attr("content") );
titleArea = $( '.entry-state-status' ).parent();
titleArea.after( '<div class="where-to-watch-widget external-script"><span class="where-to-watch-header"><span>Başka Sitede Ara</span></span><ul class="nav">' + html( ) + '</ul></div>' );
}
setTimeout(function(){ kitsuAction(); }, 5000);
};
// Start ver.
setTimeout(function(){ kitsuAction(); }, 3000);
}
else if (pageUrl.search(/turkcealtyazi\.org/) >= 0 && PlanetDP[0].turkcealtyazi == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if (p.turkcealtyazi == 1) {
h += '<a target="_blank" href="' + url( p.url_title ) + '" title="' + p.name + '" style="border: none; background: none; float: right; height: 17px; padding: 0 5px 0 0;"><img style="height: 17px; vertical-align: middle; padding: 0 0 0 0;" src="' + p.icon + '"></a>';
}
}
return h;
};
// Vars & Areas
if (pageUrl.search(/turkcealtyazi\.org\/mov/) >= 0) {
imdbButton = document.querySelector( '[href*="imdb.com/title/tt"]' );
if (imdbButton) {
title = imdbButton.href.match( /.+imdb\.com\/title\/(tt\d+)\/?/i )[1];
} else {
title = titleEdit( document.querySelector( 'span[itemprop="name"]' ).textContent );
year = titleEdit( document.querySelector( 'span[class="year"]' ).textContent );
}
titleArea = document.querySelector( '[id="altyazilar"] > h5' );
}
else {
// Vars
var titleYear = document.querySelector( 'strong > a[href^="/mov/"]' ).parentElement.textContent;
title = titleEdit( titleYear.replace( /(.+)\((\d+)\)/, "$1" ) );
year = titleEdit( titleYear.replace( /(.+)\((\d+)\)/, "$2" ) );
titleArea = document.querySelector( '[id="altyazilar"] > h2' );
GM_addStyle ( ".portalust h2 a:after, .portalust h5 a:after {content: none;}" );
}
// Fatal Blow
titleArea.insertAdjacentHTML( "beforeend", html() );
}
else if (pageUrl.search(/turkanime\.net\/anime\//) >= 0 && PlanetDP[0].turkanime == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.turkanime == 1 ) {
h += '<a href="' + url( p.url_title ) + '" target="_blank" title="PlanetDP" style="float: right; height: 12px;"><img style="height: 16px; margin: -2px 0 0 5px; opacity: 0.8;" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=0.8" src="' + p.icon + '"></a></li>';
}
}
return h;
};
// Vars
titleArea = $( '#detayPaylas .panel-ust' );
title = titleEdit( titleArea.text().trim() );
year = '';
// Area
titleArea.append( html() );
}
else if (pageUrl.search(/mydramalist\.com\/\d+/) >= 0 && PlanetDP[0].MyDramaList == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.MyDramaList == 1 ) {
h += '<li class="page-item nav-item"><a href="' + url( p.url_title ) + '" target="_blank" title="PlanetDP" class="nav-link"><img style="height: 20px; vertical-align: text-bottom; opacity: 0.7;" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=0.7" src="' + p.icon + '"></a></li>';
}
}
return h;
};
var type = document.querySelector( 'meta[property="og:type"]' ).content;
if (type == 'video.tv_show' || type == 'video.movie' || type == 'video.episode') {
// Vars
titleArea = document.querySelector( 'h1.film-title' );
title = titleEdit( titleArea.querySelector( 'a' ).textContent.trim() );
year = titleEdit( titleArea.textContent.match( /.+\((\d{4})\)$/i )[1] );
// Area
$('ul.nav-tabs').append( html() );
}
}
else if (pageUrl.search(/movie.douban\.com/) >= 0 && PlanetDP[0].douban == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.douban == 1 ) {
h += '<a target="_blank" href="' + url( p.url ) + '" class="colbutt" style="flex: 1.5; letter-spacing: 0; font: 10px; margin-right: 0; color: #000;"><span style="padding-left: 9px; font: normal 11px sans-serif; line-height: 20px;">' + p.name + '</span></a>';
}
}
return '<br><div style="display: flex; width: 135px; margin-right: 0px;"><a target="_blank" href="' + imdbLink + '" class="colbutt" style="flex: 1; letter-spacing: 0; color: #000;"><span style="padding-left: 9px; font: normal 11px sans-serif; line-height: 20px;">IMDB</span></a>' + h + '</div>';
};
// Vars
imdbButton = document.querySelector( '[href*="imdb.com/title/tt"]' );
imdbLink = imdbButton.href;
ttimdbId = imdbLink.substr( imdbLink.indexOf('title')+6, 9);
// Areas
titleArea = document.querySelector( '[id="mainpic"]' );
// Some CSS
titleArea.style.width = "135px";
var seasonInfo = document.querySelector( '[id="season"] > [selected="selected"]' );
if (seasonInfo == null || seasonInfo.textContent == "1") {
titleArea.insertAdjacentHTML( "beforeend", html() );
}
}
else if (pageUrl.search(/amazon\.com\/s\?i\=instant\-video/) >= 0 && PlanetDP[0].amazon_list == 1 ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
const html = () => {
var h = '';
for( var i = 0, len = PlanetDP.length; i < len; i++ ) {
var p = PlanetDP[i];
if ( p.amazon_list == 1 ) {
h += '<span id="648html" class="a-size-base a-color-secondary" dir="auto"> | </span><span id="648html" class="a-letter-space"></span><a id="648html" dir="auto" target="_blank" href="' + url( p.url_title ) + '">' + p.name + '</a>';
}
}
return h;
};
waitForKeyElements('[data-cel-widget="search_result_15"]', function() {
// Work on Each Link
var titles = document.querySelectorAll( '.s-result-item h2' );
for ( x = 0; x < titles.length; x++ )
{
// Vars
title = titleEdit( titles[x].textContent.trim() );
year = $($(titles[x]).next('div')).text().replace(/^(\d{4}).+/,"$1");
if (title.search(/season/i) >= 0) {
year = '';
title = titleEdit( title.replace(/season.+/i, "").replace(/ - | – /,"").trim() );
}
// Areas
$(titles[x]).next('div').append(html());
}
});
}
function advencedScriptAction( f_className, f_scriptSelector ) {
GM_addStyle( '.' + f_className + ' {}' );
if ( document.querySelector( f_scriptSelector ) != null ) { GM_addStyle( '.' + f_className + ' {display:none!important}' ); }
waitForKeyElements( f_scriptSelector, function() {GM_addStyle( '.' + f_className + ' {display:none!important}' );} );
}
function url( site ) {
if ( site.indexOf( "%ttimdbId%" ) >= 0) {site = site.replace( /%ttimdbId%/, ttimdbId );}
if ( site.indexOf( "%title%" ) >= 0) {site = site.replace( /%title%/, title );}
if ( site.indexOf( "%year%" ) >= 0) {site = site.replace( /%year%/, year );}
return site;
}
function getFirstItem(input, key, value) {
for (var i = 0; i < input.length; i++) {
var obj = input[i];
if(obj[key] == value)
return i;
}
return null;
}
function titleEdit( e_title ) {
e_title = e_title
.replace( ":", " " )
.replace( "-", " " )
.replace("&","&") //replace & with code
.replace(" ","") //delete nobreak space
.replace(/[\/\\#+()$~%"*?<>{}]/g, " ") //remove bad chars
.replace( /\s{2,}/g, " " )
.trim()
;
return e_title;
}
function waitForKeyElements (
selectorTxt, /* Required: The jQuery selector string that
specifies the desired element(s).
*/
actionFunction, /* Required: The code to run when elements are
found. It is passed a jNode to the matched
element.
*/
bWaitOnce, /* Optional: If false, will continue to scan for
new elements even after the first match is
found.
*/
iframeSelector /* Optional: If set, identifies the iframe to
search.
*/
) {
var targetNodes, btargetsFound;
if (typeof iframeSelector == "undefined")
targetNodes = $(selectorTxt);
else
targetNodes = $(iframeSelector).contents ()
.find (selectorTxt);
if (targetNodes && targetNodes.length > 0) {
btargetsFound = true;
/*--- Found target node(s). Go through each and act if they
are new.
*/
targetNodes.each ( function () {
var jThis = $(this);
var alreadyFound = jThis.data ('alreadyFound') || false;
if (!alreadyFound) {
//--- Call the payload function.
var cancelFound = actionFunction (jThis);
if (cancelFound)
btargetsFound = false;
else
jThis.data ('alreadyFound', true);
}
} );
}
else {
btargetsFound = false;
}
//--- Get the timer-control variable for this selector.
var controlObj = waitForKeyElements.controlObj || {};
var controlKey = selectorTxt.replace (/[^\w]/g, "_");
var timeControl = controlObj [controlKey];
//--- Now set or clear the timer as appropriate.
if (btargetsFound && bWaitOnce && timeControl) {
//--- The only condition where we need to clear the timer.
clearInterval (timeControl);
delete controlObj [controlKey];
}
else {
//--- Set a timer, if needed.
if ( ! timeControl) {
timeControl = setInterval ( function () {
waitForKeyElements ( selectorTxt,
actionFunction,
bWaitOnce,
iframeSelector
);
},
300
);
controlObj [controlKey] = timeControl;
}
}
waitForKeyElements.controlObj = controlObj;
}
})();