Adapted code to new page design

This commit is contained in:
2018-05-26 20:48:43 +02:00
committed by GitHub
parent fc701824f6
commit 645c5d1f9c

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name aniSearch Enhancer // @name aniSearch Enhancer
// @namespace http://github.com/marvinlehmann/ani-search-enhancer // @namespace http://github.com/marvinlehmann/ani-search-enhancer
// @version 1.4 // @version 1.5
// @description Adds buttons to the info site of an anime on aniSearch which links you directly to various streaming portals. // @description Adds buttons to the info site of an anime on aniSearch which links you directly to various streaming portals.
// @author Marvin Lehmann // @author Marvin Lehmann
// @grant none // @grant none
@@ -12,20 +12,14 @@
// ==/UserScript== // ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true); this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() $(function() {
{ $('head').append('<style>#page-action-search:before{content:"\\f002";}</style>');
$('head').append('<style>#page-action-search:before{content:"\\f002";}</style>'); const animeTitle = $('#htitle > span[itemprop=name]').text();
var animeTitleElem = document.getElementById('htitle'); if (animeTitle) {
if (animeTitleElem !== null) const encodedTitle = encodeURI(animeTitle).replace(/'/g, "%27");
{ if ($('#page-action').length === 0) $('#htitle').after('<ul id="page-action" class="inline"></ul>');
var animeTitle = animeTitleElem.innerText; $('#page-action').append('<li id="page-action-search" onclick="window.open(\'http://kissanime.ru/Search/Anime?keyword=' + encodedTitle + '\', \'_blank\');"><span>KissAnime</span></li>');
if (animeTitle) $('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://proxer.me/search?s=search&name=' + encodedTitle + '&typ=all-anime#top\', \'_blank\');"><span>Proxer</span></li>');
{ $('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://9anime.to/search?keyword=' + encodedTitle + '\', \'_blank\');"><span>9Anime</span></li>');
var encodedTitle = encodeURI(animeTitle).replace(/'/g, "%27"); }
if (document.getElementById('page-action') === null) $('#infodetails').before('<div><nav><ul id="page-action"></ul></nav></div>');
$('#page-action').append('<li id="page-action-search" onclick="window.open(\'http://kissanime.ru/Search/Anime?keyword=' + encodedTitle + '\', \'_blank\');"><span>KissAnime</span></li>');
$('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://proxer.me/search?s=search&name=' + encodedTitle + '&typ=all-anime#top\', \'_blank\');"><span>Proxer</span></li>');
$('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://9anime.to/search?keyword=' + encodedTitle + '\', \'_blank\');"><span>9Anime</span></li>');
}
}
}); });