Added buttons when signed out and replaced hyperlinks with events

The hyperlinks of the buttons were replaced by "onclick" events so that the whole button functions as a link.
This commit is contained in:
2017-02-02 23:25:10 +01:00
committed by GitHub
parent 0d32d250d2
commit 146e473d7c

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name aniSearch Enhancer // @name aniSearch Enhancer
// @namespace http://github.com/marvinl97/ani-search-enhancer // @namespace http://github.com/marvinl97/ani-search-enhancer
// @version 1.01 // @version 1.1
// @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 (marvinl97) // @author Marvin Lehmann (marvinl97)
// @grant none // @grant none
@@ -21,10 +21,11 @@ $(document).ready(function()
var animeTitle = animeTitleElem.innerText; var animeTitle = animeTitleElem.innerText;
if (animeTitle) if (animeTitle)
{ {
$('#page-action').append('<li id="page-action-search"><a href="http://kissanime.ru/Search/Anime?keyword=' + animeTitle + '" target="_blank">KissAnime</a></li>'); var encodedTitle = encodeURI(animeTitle).replace(/'/g, "%27");
$('#page-action').append('<li id="page-action-search"><a href="https://proxer.me/search?s=search&name=' + animeTitle + '&typ=all-anime#top" target="_blank">Proxer</a></li>'); 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"><a href="http://9anime.to/search?keyword=' + animeTitle + '" target="_blank">9Anime</a></li>'); $('#page-action').append('<li id="page-action-search" onclick="window.open(\'http://kissanime.ru/Search/Anime?keyword=' + encodedTitle + '\', \'_blank\');">KissAnime</li>');
$('li#page-action-search a').css("color", $('li#page-action-search').css("color")); $('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://proxer.me/search?s=search&name=' + encodedTitle + '&typ=all-anime#top\', \'_blank\');">Proxer</li>');
$('#page-action').append('<li id="page-action-search" onclick="window.open(\'https://9anime.to/search?keyword=' + encodedTitle + '\', \'_blank\');">9Anime</li>');
} }
} }
}); });