MovieChat.org Message Boards on IMDb.com [Desktop]

Brings message boards back on IMDb by using MovieChat.org boards.

目前為 2018-05-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name               MovieChat.org Message Boards on IMDb.com [Desktop]
// @namespace          https://greasyfork.org/en/users/105361-randomusername404
// @version            2.06
// @description        Brings message boards back on IMDb by using MovieChat.org boards.
// @run-at             document-start
// @include            *://www.imdb.com/title/*
// @include            *://www.imdb.com/name/*
// @exclude            *://*.imdb.com/*/*/releaseinfo*
// @exclude            *://*.imdb.com/*/*/bio*
// @exclude            *://*.imdb.com/*/*/publicity*
// @exclude            *://*.imdb.com/*/*/otherworks*
// @exclude            *://*.imdb.com/*/*/awards*
// @exclude            *://*.imdb.com/*/*/mediaindex*
// @exclude            *://*.imdb.com/*/*/videogallery*
// @exclude            *://*.imdb.com/*/*/fullcredits*
// @exclude            *://*.imdb.com/*/*/plotsummary*
// @exclude            *://*.imdb.com/*/*/synopsis*
// @exclude            *://*.imdb.com/*/*/keywords*
// @exclude            *://*.imdb.com/*/*/parentalguide*
// @exclude            *://*.imdb.com/*/*/locations*
// @exclude            *://*.imdb.com/*/*/companycredits*
// @exclude            *://*.imdb.com/*/*/technical*
// @exclude            *://*.imdb.com/*/*/trivia*
// @exclude            *://*.imdb.com/*/*/soundtrack*
// @exclude            *://*.imdb.com/*/*/faq*
// @exclude            *://*.imdb.com/*/*/reviews*
// @require            https://code.jquery.com/jquery-3.3.1.min.js
// @author             RandomUsername404
// @grant              none
// @icon               http://ia.media-imdb.com/images/G/01/imdb/images/favicon-2165806970._CB522736556_.ico
// ==/UserScript==

$(window).on("load", function() {
    var pathname = window.location.pathname;

    // Get page ID
    var pageID;
    if (pathname.includes("title/")) {
        pageID = pathname.split("title/").pop();
    } else if (pathname.includes("name/")) {
        pageID = pathname.split("name/").pop();
    }
    pageID = pageID.split("/").shift();

    // Get iframe position and dimensions
    var positionReference = $('.article.contribute');
    var height = $(window).innerHeight() * 0.9;
    var width;
    if (pathname.includes("reference")) {
        width = $("#main").width();
    } else if (pathname.includes("name/")) {
        width = $("#maindetails_center_top").width();
    } else {
        width = $(".title_bar_wrapper").width();
    }

    // Create iframe
    var movieChat = document.createElement("iframe");
    $(movieChat).attr({ "src": "https://moviechat.org/" + pageID, "allowtransparency": "false" });
    $(movieChat).css({ "height": height + "px", "width": width + "px", "border": "none", "margin-top": "-20px" });
    $(movieChat).insertBefore(positionReference);

    // Add title and separator above iframe
    var title = document.createElement("div");
    $(title).addClass('article');
    var pageTitle;
    if (window.location.pathname.includes("reference")) {
        pageTitle = $('h3[itemprop="name"]').text();
    } else {
        pageTitle = $('h1[itemprop="name"]').text();
    }
    $(title).html('<h2>Discuss <i>' + pageTitle + '</i> on MovieChat</h2>');
    $(title).insertBefore(movieChat);

});