Greasy Fork

Link Guru

Adds boxes full on links to a few sites.

目前为 2016-12-25 提交的版本。查看 最新版本

// ==UserScript==
// @name          Link Guru
// @namespace     http://greasyfork.org/users/2240-doodles
// @author        Doodles
// @version       1
// @description   Adds boxes full on links to a few sites.
// @include       *://*.wikipedia.org/*
// @include       *://www.google.*/search?*
// @include       *://*.wiktionary.org/wiki/*
// @include       *://www.imdb.com/*
// @include       *://www.rottentomatoes.com/*
// @run-at        document-end
// @require       https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @require       https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js
// @grant         GM_getValue
// @grant         GM_setValue
// @updateVersion 1
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
	'use strict';
	// =======================================================================================================================
	String.prototype.lgReplaceAll = function(f, r) {
		return this.split(f).join(r);
	}
	function UrlContains(urlfragment) {
		return document.URL.indexOf(urlfragment) != -1;
	}
	function SelectiveFire(functionToFire, delay){
		delay = delay || 2500;
		document.body.addEventListener("DOMSubtreeModified", function(){
			setTimeout(function() {
				functionToFire();
			}, delay);
		});
		functionToFire();
	}
	function CreateLink(givenLink, urlfragment, linkStyle) {
		var linkElement = $('<a></a>');
		$(linkElement).attr('title', givenLink[0]);
		$(linkElement).attr('href', givenLink[1] + urlfragment + givenLink[2]);
		if(linkStyle != 1){
			$('<img />').attr('src', givenLink[3]).attr('alt', givenLink[0]).appendTo(linkElement);
		}
		if(linkStyle != 0){
			$('<span></span>').text(givenLink[0]).appendTo(linkElement);
		}
		return linkElement;
	}
	function CreateLinkContainer(linkList, urlfragment, linkStyle) {
		var linkContainter = $('<div id="lgLinkContainer"></div>');
		for(var i = 0; i < linkList.length; i++){
			var linkData = linkList[i];
			var linkElement = $('<a></a>').attr('title', linkData[0]).attr('href', linkData[1] + urlfragment + linkData[2]);
			if(linkStyle != 1){ $('<img />').attr('src', linkData[3]).attr('alt', linkData[0]).appendTo(linkElement); }
			if(linkStyle != 0){ $('<span></span>').text(linkData[0]).appendTo(linkElement); }
			$(linkContainter).append(linkElement);
			if(i + 1 < linkList.length){ $(linkContainter).append(document.createTextNode((linkStyle != 1 ? " " : " | "))); }
		}
		return linkContainter;
	}
	// =======================================================================================================================
	$('<style></style>').prop('type', 'text/css').html('' +
		'div#lgSettingsContainer {padding:2px 2px 0 0;float:left;display:block;z-index:1000;}div#lgLinkContainer {padding:0 0 3px 0;margin:0 0 10px 0;line-heig' +
		'ht:16px;font-size:12px;}div#lgLinkContainer a img {display:inline-block;vertical-align:middle;width:16px;height:16px;}div#lgLinkContainer a span {vert' +
		'ical-align:middle;display:inline-block;margin:0 7px 0 3px;}.ui-corner-all {border-radius:0 !important;}.ui-dialog {z-index:403 !important;background-c' +
		'olor:#CCC;background:#CCC;color:#333;font-size:14px;border:1px solid #FFF;box-shadow:5px 5px 5px rgba(0, 0, 0, 0.5);font-family:Arial, Helvetica, Verd' +
		'ana, sans-serif !important;outline:1px solid #000;}.ui-widget-content {background-color:#AAAAAA;background:#AAAAAA;border:none !important;}.ui-dialog-' +
		'titlebar {font-size:16px;background-color:#AAAAAA;background:#AAAAAA;padding:4px 4px 4px 7px;text-shadow:1px 1px 2px #000000;color:#daf0ff;font-weight' +
		':bold;border:none !important;}.ui-dialog-titlebar-close {float:right !important;height:19px !important;background-color:#3498db !important;border:1px ' +
		'solid #222222 !important;background-image:none !important;text-shadow:1px 1px 1px #000000 !important;font-size:11px !important;font-weight:bold !impor' +
		'tant;color:#FFF !important;}.ui-dialog-titlebar-close:after {content:"Close";}.ui-dialog-titlebar-close:hover {background-color:#3cb0fd !important;}.u' +
		'i-dialog-titlebar-close span {display:none;}.ui-dialog-content {background-color:#CCC;padding:5px;border:none !important;color:#000;}.ui-dialog-button' +
		'pane {padding:2px 7px 7px 7px;background-color:none !important;background:none !important;border:none;}.ui-dialog-buttonset {text-align:right;}.ui-dia' +
		'log-buttonset button {background-color:#3498db !important;border:1px solid #222222 !important;background-image:none !important;text-shadow:1px 1px 1px' +
		' #000000;font-size:16px;font-weight:bold;color:#FFF;font-family:Arial, Helvetica, Verdana, sans-serif !important;padding:2px 12px 3px 12px;margin-left' +
		':3px;}.ui-dialog-buttonset button:hover {background-color:#3cb0fd !important;}.ui-widget-overlay {position:absolute;top:0;left:0;width:100%;height:100' +
		'%;background-color:#000000;opacity:.60;filter:Alpha(Opacity=60);background-image:none !important;}.ui-tabs .ui-tabs-nav {display:block;margin:0;paddin' +
		'g:0;border: none;background-color:#AAAAAA;background:#AAAAAA;}.ui-tabs .ui-tabs-nav li {list-style:none;float:left;margin:0 6px 1px 0;border: none;bor' +
		'der-radius:0 !important;}a.ui-tabs-anchor:link {list-style:none;display:inline-block;margin:0 0 0 0;}a.ui-tabs-anchor:link, a.ui-tabs-anchor:visited {' +
		'display:inline-block;padding:2px 12px 3px 12px;background-color:#446382;color:#FFF;font-weight:bold;text-decoration:none;}a.ui-tabs-anchor:hover, a.ui' +
		'-tabs-anchor:active, a.ui-tabs-anchor:focus {background-color:#F5F5F5;color:#000;}.ui-tabs-active a.ui-tabs-anchor:link, .ui-tabs-active a.ui-tabs-anc' +
		'hor:visited {background-color:#F5F5F5;color:#000;}.ui-tabs-active a.ui-tabs-anchor:hover, .ui-tabs-active a.ui-tabs-anchor:active, .ui-tabs-active a.u' +
		'i-tabs-anchor:focus {background-color:#F5F5F5;color:#000;}.ui-tabs .ui-tabs-panel {clear:left;background-color:#F5F5F5;height:251px;padding:5px;border' +
		'-radius:0 !important;}label.lgSetEnableCheck {padding:5px;display:block;line-height:16px;}label.lgSetEnableCheck input[type="checkbox"] {margin-right:' +
		'5px;line-height:16px;}.ui-tabs .ui-tabs-panel p {padding:0 0 0 0;margin:0 0 0 0;}div#lgSettingsTabs hr {margin:2px 0 2px 0;border: none;height: 1px;ba' +
		'ckground-color:#AAAAAA;}' +
	'').appendTo('head');
	$('body').append('' +
		'<div id="lgSettingsDialog" title="Link Guru - Settings"><div id="lgSettingsTabs"><ul><li><a href="#tabs-1">General</a></li><li><a href="#tabs-2">Wikip' +
		'edia</a></li><li><a href="#tabs-3">Wiktionary</a></li><li><a href="#tabs-4">Rotten Tomatoes</a></li><li><a href="#tabs-5">IMDb</a></li></ul><div id="t' +
		'abs-1"><label class="lgSetEnableCheck"><input type="checkbox" name="lgSetEnableWikipedia" id="lgSetEnableWikipedia"><strong>Wikipedia</strong> - Title' +
		' Search Links</label><hr /><label class="lgSetEnableCheck"><input type="checkbox" name="lgSetEnableWiktionary" id="lgSetEnableWiktionary"><strong>Wikt' +
		'ionary</strong> - Word Search Links</label><hr /><label class="lgSetEnableCheck"><input type="checkbox" name="lgSetEnableImdb" id="lgSetEnableImdb"><s' +
		'trong>IMDb</strong> - Add search links to Movie, TV Series, Person, and Character pages.</label><hr /><label class="lgSetEnableCheck"><input type="che' +
		'ckbox" name="lgSetEnableRotten" id="lgSetEnableRotten"><strong>Rotten Tomatoes</strong> - Add search links to Movie and Person pages.</label><hr /><la' +
		'bel class="lgSetEnableCheck"><input type="checkbox" name="lgSetEnableGoogle" id="lgSetEnableGoogle"><strong>Google</strong> - Replace "Videos" tab wit' +
		'h link to YouTube</label><hr /><p>Enabling/Disabling Link Guru requires a refresh.</p></div><div id="tabs-2">Individual Wikipedia Settings Coming...</' +
		'div><div id="tabs-3">Individual Wiktionary Settings Coming...</div><div id="tabs-4">Individual Rotten Tomatoes Settings Coming...</div><div id="tabs-5' +
		'">Individual IMDb Settings Coming...</div></div></div>' +
	'');
    $("#lgSettingsTabs").tabs();
	$('#lgSettingsDialog').dialog({ modal:true, resizable: false, autoOpen: false, width: 634, position: { my: "center top", at: "center top+120", of: window } });
	var settingsLink = $('<a href="#" id="lgSettingsLink">Link Guru Settings</a>');
	$(settingsLink).click(function() {$('#lgSettingsDialog').dialog('open');});
	// =======================================================================================================================
	// Stored Data Variables
	var lgSetEnWikipedia = GM_getValue('lgEnWikipedia', true);
	$("#lgSetEnableWikipedia").prop('checked', lgSetEnWikipedia).change(function() {
		lgSetEnWikipedia = this.checked ? true : false;
		GM_setValue('lgEnWikipedia', lgSetEnWikipedia);
	});
	// -------------------
	var lgSetEnWiktionary =	GM_getValue('lgEnWiktionary', true);
	$("#lgSetEnableWiktionary").prop('checked', lgSetEnWiktionary).change(function() {
		lgSetEnWiktionary = this.checked ? true : false;
		GM_setValue('lgEnWiktionary', lgSetEnWiktionary);
	});
	// -------------------
	var lgSetEnRotten = GM_getValue('lgEnRotten', true);
	$("#lgSetEnableRotten").prop('checked', lgSetEnRotten).change(function() {
		lgSetEnRotten = this.checked ? true : false;
		GM_setValue('lgEnRotten', lgSetEnRotten);
	});
	// -------------------
	var lgSetEnImdb = GM_getValue('lgEnImdb', true);
	$("#lgSetEnableImdb").prop('checked', lgSetEnImdb).change(function() {
		lgSetEnImdb = this.checked ? true : false;
		GM_setValue('lgEnImdb', lgSetEnImdb);
	});
	// -------------------
	var lgSetEnGoogle = GM_getValue('lgEnGoogle', true);
	$("#lgSetEnableGoogle").prop('checked', lgSetEnGoogle).change(function() {
		lgSetEnGoogle = this.checked ? true : false;
		GM_setValue('lgEnGoogle', lgSetEnGoogle);
	});
	// =======================================================================================================================
	// WIKIPEDIA
		var linkStyleWiki = 0; // 0 = icon links, 1 = text links, 2 = icon and text links
		var linksWiki = [];
		linksWiki.push(["Google", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
		linksWiki.push(["Google Image", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
		linksWiki.push(["YouTube", "https://www.youtube.com/results?search_query=", "", "http://i.imgur.com/Oi6BUxD.png"]);
		linksWiki.push(["IMDB", "http://www.imdb.com/find?s=all&q=", "", "http://i.imgur.com/At43y4m.png"]);
		linksWiki.push(["Pirate Bay", "https://thepiratebay.se/search/", "/0/99/0", "http://i.imgur.com/cnc2XKT.png"]);
		linksWiki.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
		if (UrlContains('wikipedia.org') && window.top == window.self) {
			$('#p-navigation > div.body > ul').append($('<li></li>').append(settingsLink));
			if (lgSetEnWikipedia && !UrlContains('/wiki/Main_Page') && !UrlContains('/wiki/Portal:') && !UrlContains('/wiki/Talk:') && $('h1#firstHeading') && $('li#ca-nstab-main.selected')) {
				var pageTitle = $('h1#firstHeading').text();
				pageTitle = pageTitle.lgReplaceAll("<i>", "").lgReplaceAll("</i>", "");
				pageTitle = pageTitle.lgReplaceAll("&equals;", "%3D").lgReplaceAll("&#61;", "%3D").lgReplaceAll("=", "%3D");
				pageTitle = pageTitle.lgReplaceAll("&amp;", "%26").lgReplaceAll("&#38;", "%26").lgReplaceAll("&", "%26");
				pageTitle = pageTitle.replace(" (film)","").replace("(film)","").replace(" film)",")");
				$(CreateLinkContainer(linksWiki, pageTitle, linkStyleWiki)).insertBefore('h1#firstHeading');
				$('div#lgLinkContainer').css({'float':'right', 'padding':'10px 0 10px 0'});
				if ($('div.mw-indicators').children().length > 0) {
					$('div.mw-indicators').css({'padding-left':'25px'});
				}
			}
		}
	// =======================================================================================================================
	// WIKTIONARY
		var linkStyleWiktionary = 0; // 0 = icon links, 1 = text links, 2 = icon and text links
		var linksWiktionary = [];
		linksWiktionary.push(["Merriam-Webster synonyms", "http://www.merriam-webster.com/thesaurus/", "", "http://i.imgur.com/3IkK6gI.png"]);
		linksWiktionary.push(["Thesaurus.com", "http://thesaurus.com/browse/", "", "http://i.imgur.com/Ngxbqzc.png"]);
		linksWiktionary.push(["Google", "http://www.google.com/search?output=search&q=define:", "", "http://i.imgur.com/Ocn9d7X.png"]);
		linksWiktionary.push(["Synonym.com", "http://www.synonym.com/synonyms/", "/", "http://i.imgur.com/5zx9OP9.png"]);
		linksWiktionary.push(["Wikisaurus", "http://wiktionary.org/wiki/Wikisaurus:", "", "http://i.imgur.com/2wDa3Kq.png"]);
		linksWiktionary.push(["One Look", "http://www.onelook.com/?w=", "&ls=a", "http://i.imgur.com/GjvfCVA.png"]);
		linksWiktionary.push(["Wolfram|Alpha", "http://www.wolframalpha.com/input/?i=", "", "http://i.imgur.com/z5p7oL7.png"]);
		linksWiktionary.push(["Urban Dictionary", "http://www.urbandictionary.com/define.php?term=", "", "http://i.imgur.com/oRspJNs.png"]);
		linksWiktionary.push(["iTools", "http://itools.com/language/dictionary?q=", "&submit=English+Dictionary", "http://i.imgur.com/caWzb02.png"]);
		linksWiktionary.push(["Vocabulary.com", "http://www.vocabulary.com/dictionary/", "", "http://i.imgur.com/8MNsoze.png"]);
		linksWiktionary.push(["Cambridge Dictionary", "http://dictionary.cambridge.org/dictionary/english/", "", "http://i.imgur.com/MtWE6Yt.png"]);
		linksWiktionary.push(["RhymeZone", "http://www.rhymezone.com/r/rhyme.cgi?Word=", "&typeofrhyme=perfect&org1=syl&org2=l&org3=y", "http://i.imgur.com/d9giQh4.png"]);
		linksWiktionary.push(["Online Etymology Dictionary", "http://www.etymonline.com/index.php?search=", "", "http://i.imgur.com/uUiJWbY.png"]);
		if (UrlContains('wiktionary.org') && window.top == window.self) {
			$('#p-navigation > div.body > ul').append($('<li></li>').append(settingsLink));
			if (lgSetEnWiktionary && !UrlContains('/wiki/Wiktionary:Main_Page') && !UrlContains('/wiki/Index:') && !UrlContains('/wiki/Talk:') && !UrlContains('/wiki/Special:') &&
				!UrlContains('/wiki/Category:') && $('h1#firstHeading') && $('li#ca-nstab-main.selected')) {
				var pageTitle = $('h1#firstHeading').text().lgReplaceAll("<i>", "").lgReplaceAll("</i>", "");
				$(CreateLinkContainer(linksWiktionary, pageTitle, linkStyleWiktionary)).insertBefore('h1#firstHeading');
				$('div#lgLinkContainer').css({'float':'right', 'padding':'10px 0 10px 0'});
			}
		}
	// =======================================================================================================================
	// Rotten Tomatoes
		var linkStyleRotten = 0; // 0 = icon links, 1 = text links, 2 = icon and text links
		var linksRotten = [];
		if (UrlContains('www.rottentomatoes.com') && window.top == window.self) {
			$('div.header_links').prepend(settingsLink);
			if (lgSetEnRotten) {
				if(UrlContains("rottentomatoes.com/m/")){
					linksRotten.push(["YouTube Trailer Search", "http://www.youtube.com/results?search_query=", " trailer", "http://i.imgur.com/Oi6BUxD.png"]);
					linksRotten.push(["Google Image Search", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
					linksRotten.push(["Google Search", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
					linksRotten.push(["Wikipedia", "http://en.wikipedia.org/w/index.php?title=Special:Search&search=", "", "http://i.imgur.com/8GnE9TT.png"]);
					linksRotten.push(["IMDB", "http://www.imdb.com/find?s=all&q=", "", "http://i.imgur.com/At43y4m.png"]);
					linksRotten.push(["MetaCritic", "http://www.metacritic.com/search/all/", "/results", "http://i.imgur.com/j84MuyF.png"]);
					linksRotten.push(["AllMovie", "http://www.allmovie.com/search/movies/", "", "http://i.imgur.com/893QQhS.png"]);
					linksRotten.push(["Box Office Mojo", "http://www.boxofficemojo.com/search/?q=", "", "http://i.imgur.com/GLa3QlT.png"]);
					linksRotten.push(["Movie Mistakes", "http://www.moviemistakes.com/search.php?text=", "", "http://i.imgur.com/DNn1W4y.png"]);
					linksRotten.push(["Letterboxd", "https://letterboxd.com/search/", "/", "http://i.imgur.com/BnJx4gH.png"]);
					linksRotten.push(["Episode Calendar", "http://episodecalendar.com/en/shows?q[name_cont]=", "", "http://i.imgur.com/5IeiE6p.png"]);
					linksRotten.push(["ThePirateBay", "https://thepiratebay.org/search/", "/0/99/200", "http://i.imgur.com/cnc2XKT.png"]);
					linksRotten.push(["YIFY Subtitles", "http://www.yifysubtitles.com/search?q=", "", "http://i.imgur.com/VyMFcXf.png"]);
					linksRotten.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
					var titleText = $('h1.title.hidden-xs').html().split("<span")[0].trim();
					titleText = titleText.lgReplaceAll("/", " ").lgReplaceAll("\\", " ");
					$(CreateLinkContainer(linksRotten, titleText, linkStyleRotten)).insertBefore('div#topSection');
					$('div#lgLinkContainer').css({'padding':'8px 0 8px 0', 'margin-bottom':'0'});
					$('div#topSection').css({'margin-top':'0'});
				}else if(UrlContains("rottentomatoes.com/celebrity/")){
					linksRotten.push(["YouTube", "http://www.youtube.com/results?search_query=", " interview", "http://i.imgur.com/Oi6BUxD.png"]);
					linksRotten.push(["Google Image Search", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
					linksRotten.push(["Google Search", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
					linksRotten.push(["Wikipedia", "http://en.wikipedia.org/w/index.php?title=Special:Search&search=", "", "http://i.imgur.com/8GnE9TT.png"]);
					linksRotten.push(["IMDB", "http://www.imdb.com/find?s=nm&q=", "", "http://i.imgur.com/At43y4m.png"]);
					linksRotten.push(["MetaCritic", "http://www.metacritic.com/search/person/", "/results", "http://i.imgur.com/j84MuyF.png"]);
					linksRotten.push(["AllMovie", "http://www.allmovie.com/search/people/", "", "http://i.imgur.com/893QQhS.png"]);
					linksRotten.push(["Box Office Mojo", "http://www.boxofficemojo.com/search/?q=", "", "http://i.imgur.com/GLa3QlT.png"]);
					linksRotten.push(["Letterboxd", "https://letterboxd.com/search/", "/", "http://i.imgur.com/BnJx4gH.png"]);
					linksRotten.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
					var titleText = $('div.celeb_name > h1').text();
					$(CreateLinkContainer(linksRotten, titleText, linkStyleRotten)).appendTo('div.celeb_name');
					$('div.celeb_name > h1').css({'border-bottom':'none', 'margin-bottom':'0', 'padding-bottom':'0'});
				}
			}
		}
	// =======================================================================================================================
	// IMDb
		var linkStyleImdb = 0; // 0 = icon links, 1 = text links, 2 = icon and text links
		var linksImdb = [];
		if (UrlContains('www.imdb.com') && window.top == window.self) {
			$(settingsLink).css({'color':'white'});
			$('<div></div>').css({'font-size':'10px', 'height':'15px', 'line-height':'15px', 'padding-left':'3px' }).append(settingsLink).prependTo('div#nb20');
			$('div#navbar').css({'margin-top':'0'});
			if (lgSetEnImdb) {
				if(UrlContains("/title/")){
					linksImdb.push(["YouTube Trailer Search", "http://www.youtube.com/results?search_query=", " trailer", "http://i.imgur.com/Oi6BUxD.png"]);
					linksImdb.push(["Google Image Search", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
					linksImdb.push(["Google Search", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
					linksImdb.push(["Wikipedia", "http://en.wikipedia.org/w/index.php?title=Special:Search&search=", "", "http://i.imgur.com/8GnE9TT.png"]);
					linksImdb.push(["Rotten Tomatoes", "http://www.rottentomatoes.com/search/?search=", "&sitesearch=rt", "http://i.imgur.com/KdEB9NR.png"]);
					linksImdb.push(["MetaCritic", "http://www.metacritic.com/search/all/", "/results", "http://i.imgur.com/j84MuyF.png"]);
					linksImdb.push(["AllMovie", "http://www.allmovie.com/search/movies/", "", "http://i.imgur.com/893QQhS.png"]);
					linksImdb.push(["Box Office Mojo", "http://www.boxofficemojo.com/search/?q=", "", "http://i.imgur.com/GLa3QlT.png"]);
					linksImdb.push(["Movie Mistakes", "http://www.moviemistakes.com/search.php?text=", "", "http://i.imgur.com/DNn1W4y.png"]);
					linksImdb.push(["Letterboxd", "https://letterboxd.com/search/", "/", "http://i.imgur.com/BnJx4gH.png"]);
					linksImdb.push(["Episode Calendar", "http://episodecalendar.com/en/shows?q[name_cont]=", "", "http://i.imgur.com/5IeiE6p.png"]);
					linksImdb.push(["ThePirateBay", "https://thepiratebay.org/search/", "/0/99/200", "http://i.imgur.com/cnc2XKT.png"]);
					linksImdb.push(["YIFY Subtitles", "http://www.yifysubtitles.com/search?q=", "", "http://i.imgur.com/VyMFcXf.png"]);
					linksImdb.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
					var titleText = $('div.title_wrapper > h1').html().split("&nbsp;<span")[0].trim();
					titleText = titleText.lgReplaceAll("/", " ").lgReplaceAll("\\", " ");
					titleText = titleText.lgReplaceAll("&nbsp;", " ").trim();
					$(CreateLinkContainer(linksImdb, titleText, linkStyleImdb)).insertAfter('div.titleBar');
					$('div#lgLinkContainer').css({'padding':'5px 0 0 20px'});
				}else if(UrlContains("/name/")){
					linksImdb.push(["YouTube", "http://www.youtube.com/results?search_query=", " interview", "http://i.imgur.com/Oi6BUxD.png"]);
					linksImdb.push(["Google Image Search", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
					linksImdb.push(["Google Search", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
					linksImdb.push(["Wikipedia", "http://en.wikipedia.org/w/index.php?title=Special:Search&search=", "", "http://i.imgur.com/8GnE9TT.png"]);
					linksImdb.push(["Rotten Tomatoes", "http://www.rottentomatoes.com/search/?search=", "&sitesearch=rt", "http://i.imgur.com/KdEB9NR.png"]);
					linksImdb.push(["MetaCritic", "http://www.metacritic.com/search/person/", "/results", "http://i.imgur.com/j84MuyF.png"]);
					linksImdb.push(["AllMovie", "http://www.allmovie.com/search/people/", "", "http://i.imgur.com/893QQhS.png"]);
					linksImdb.push(["Box Office Mojo", "http://www.boxofficemojo.com/search/?q=", "", "http://i.imgur.com/GLa3QlT.png"]);
					linksImdb.push(["Letterboxd", "https://letterboxd.com/search/", "/", "http://i.imgur.com/BnJx4gH.png"]);
					linksImdb.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
					var titleText = $('h1.header > span.itemprop').text();
					$(CreateLinkContainer(linksImdb, titleText, linkStyleImdb)).insertAfter('div.infobar');
					$('div#name-job-categories').css({'margin-bottom':'4px'});
				}else if(UrlContains("/character/")){
					linksImdb.push(["YouTube", "http://www.youtube.com/results?search_query=", "", "http://i.imgur.com/Oi6BUxD.png"]);
					linksImdb.push(["Google Image Search", "http://www.google.com/search?tbm=isch&q=", "", "http://i.imgur.com/FFntMod.png"]);
					linksImdb.push(["Google Search", "http://www.google.com/search?output=search&q=", "", "http://i.imgur.com/Ocn9d7X.png"]);
					linksImdb.push(["Wikipedia", "http://en.wikipedia.org/w/index.php?title=Special:Search&search=", "", "http://i.imgur.com/8GnE9TT.png"]);
					linksImdb.push(["Rotten Tomatoes", "http://www.rottentomatoes.com/search/?search=", "&sitesearch=rt", "http://i.imgur.com/KdEB9NR.png"]);
					linksImdb.push(["MetaCritic", "http://www.metacritic.com/search/all/", "/results", "http://i.imgur.com/j84MuyF.png"]);
					linksImdb.push(["AllMovie", "http://www.allmovie.com/search/all/", "", "http://i.imgur.com/893QQhS.png"]);
					linksImdb.push(["Box Office Mojo", "http://www.boxofficemojo.com/search/?q=", "", "http://i.imgur.com/GLa3QlT.png"]);
					linksImdb.push(["Imgur", "http://imgur.com/search?q=", "", "http://i.imgur.com/bMdIHrQ.png"]);
					var titleText = document.getElementById("tn15title").getElementsByTagName("h1")[0].innerHTML.split("<span>")[0].trim();
					$(CreateLinkContainer(linksImdb, titleText, linkStyleImdb)).insertBefore('div#tn15title');
					$('div#lgLinkContainer').css({'float':'right'});
				}
			}
		}
	// =======================================================================================================================
	// GOOGLE
		if (lgSetEnGoogle && UrlContains('www.google.') && window.top == window.self) {
			SelectiveFire(function(){
				var xs = document.URL.split('?')[1];
				if(xs.indexOf('#q=') != -1){
					xs = xs.split('#')[1];
				}
				xs = xs.split('q=')[1].split('&')[0].split('#')[0];
				$('a.q.qs').filter(function(index) {
					return $(this).text() == 'Videos' || $(this).text() == 'Video\'s';
				}).text('YouTube').attr('href', 'http://www.youtube.com/results?search_query=' + xs);
			}, 500);
		}
	// =======================================================================================================================
	// End Brace for document.ready function
});