MovieChat.org on IMDb - Desktop Companion

Make MovieChat.org look more streamlined when displayed within a IMDb page.

目前為 2017-05-16 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 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 on IMDb - Desktop Companion
// @version      1.21
// @description  Make MovieChat.org look more streamlined when displayed within a IMDb page.
// @author       RandomUsername404
// @match        https://moviechat.org/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at       document-start
// @grant        none
// @icon         http://moviechat.org/favicons/favicon.ico
// @namespace    https://greasyfork.org/users/105361
// ==/UserScript==

$(document).ready(function() {   
    var width = $(window).width();

    // If current width <= 770px :
    if(width <= 770)
    {
        $('.container').css('padding-right', '0px');
        $('.container').css('padding-left', '0px');
        $('.container').css('margin-right', '0');
        $('.container').css('margin-left', '0');
        $('.board-collection').css('padding-top', '0px');
        //$(".main").css('padding-top','40px');
        
        // Hide top-bar
        $("nav.navbar.navbar-default").hide();
        
        // Hide the description
        $(".movie-overview").hide();
        
        // Hide the 'discover' div
        $("#discover").hide();
        
        // (Only on message boards view)
        if (document.URL.length < 79)
        {   // Hide position
            $("#wrap > div.main > div > div > div:nth-child(1) > div").hide();
            
            // Hide what's left above the threads (No longer useful?)
            //$("#wrap > div.main > div > div > div:nth-child(4) > div > div").hide();
            
            // Keep the navbar (but not the search button)
            $("#compact-search-button").hide();
            $("ul.nav.navbar-nav.navbar-right").insertBefore($("#wrap > div.main > div > div > div:nth-child(1) > div"));
            $(".navbar-right").css('padding-top', '6px');
            
            // Keep the "add new post" button
            var buttonPosition = "#wrap > div.main > div > div > div:nth-child(4) > div";
            $("a.btn.btn-yellow.btn-block").insertBefore("ul.nav.navbar-nav.navbar-right");
            $("a.btn.btn-yellow.btn-block").css('width', '46%');
            $(buttonPosition).css('padding-bottom', '10px');
            $(buttonPosition).css('padding-left', '1px');
            $(".main").css('padding-top', '10px');

            // Remove the "news, rumors & gossip" tab
            $("ul.nav.nav-tabs").hide();
        }
        
        // Make the author's name visible when possible:
        if(width >= 450)
            {
                var authorDiv = $(".col-xs-3:last-child");
                (authorDiv).removeClass('hidden-xs');
                $('.col-xs-3').css('width', '16%');
                $(authorDiv).css('width', '18%');
                $(authorDiv).css('text-align', 'left');
                //$(authorDiv).css('overflow', 'hidden');
                //$(authorDiv).css('text-overflow', 'ellipsis');
            }        
    }
    
})();