// ==UserScript== // @name IMDB+ // @namespace imdb.com // @description Add external links to IMDb. Every feature can be enabled/disabled in settings. // @include http://www.imdb.com/title/tt* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js // @grant GM_getValue // @grant GM_setValue // @grant GM_addStyle // @version 1.0.1 // @downloadURL none // ==/UserScript== jQuery(document).ready(function($) { var m = {}; m.Id = getMovieId(); m.Tt = getMovieTt(); m.TtYr = "%22" + getMovieTt() + "%22+" + getMovieYr(); var l = {}; l.rut = ["RuTracker", "http://rutracker.org/forum/tracker.php?nm=" + m.TtYr, "http://rutracker.org/favicon.ico"]; l.yt = ["Youtube", "http://www.youtube.com/results?search_query=" + m.TtYr, "http://www.youtube.com/favicon.ico"]; l.kp = ["Kinopoisk", "http://www.kinopoisk.ru/index.php?first=yes&kp_query=" + m.Tt, "http://st.kp.yandex.net/images/favicon.ico"]; l.all = ["allMovie", "http://www.allmovie.com/search/movies/" + m.TtYr, "http://www.allmovie.com/favicon.ico"]; // Functions function getMovieId() { var id = location.pathname.match(/title\/tt(.*?)\//i)[1]; return id; } function getMovieTt() { var title = document.title.replace(/^(.+) \((.*)([0-9]{4})(.*)$/gi, '$1'); return encodeURIComponent(title); } function getMovieYr() { var year = document.title.replace(/^(.+) \((.*)([0-9]{4})(.*)$/gi, '$3'); return encodeURIComponent(year); } function IMDbPlusStyle() { var s = '#title-overview-widget #IMDbPlus { padding: 5px 0 0 230px; }' + '#title-overview-widget #IMDbPlus a { margin: 5px 1px; }' + '#title-overview-widget #IMDbPlus #IMDbPlus-Feature-Settings { margin-left: 10px; }' + '#action-box #IMDbPlus #IMDbPlus-Feature-Settings { margin-top: 10px; }' + '#IMDbPlus-SettingsBox { display: none; margin-left: -404px; padding: 20px; position: fixed; top: 10%; left: 50%; width: 768px; z-index: 999; }' + '#IMDbPlus-SettingsBox > h2 { font-size: 21px }' + '#IMDbPlus-SettingsBox > h4 { font-size: 15px }' + '#IMDbPlus-SettingsBox #IMDbPlus-Options { margin: 20px 0;}' + '#IMDbPlus-SettingsBox #IMDbPlus-Options .IMDbPlus-OptionField label { display: inline-block; width: 150px; }' + '#IMDbPlus-SettingsBox button { margin: 8px 0 0; }' + '#IMDbPlus-SettingsBox #IMDbPlus-SettingsBox-Close { float: right; }'; GM_addStyle(s); } function IMDbPlusInit() { var fh, oh; fh = '