Greasy Fork

Greasy Fork is available in English.

MovieChat.org Message Boards on m.IMDb.com

Based on drhouse's script, bring message boards back on IMDb mobile site by using MovieChat.org boards.

当前为 2017-03-19 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name               MovieChat.org Message Boards on m.IMDb.com
// @namespace          http://greasyfork.icu/en/users/105361-randomusername404
// @version            1.1
// @description        Based on drhouse's script, bring message boards back on IMDb mobile site by using MovieChat.org boards.
// @run-at             document-start
// @include            http://m.imdb.com/title/*
// @include            http://m.imdb.com/name/*
// @include            http://www.moviechat.org/*
// @include            https://www.moviechat.org/*
// @require            http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author             RandomUsername404
// @icon               http://ia.media-imdb.com/images/G/01/imdb/images/mobile/apple-touch-icon-mobile-2541571834._CB522736227_.png
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
	var theparenturl = document.URL;
	
	var quest = theparenturl.split('?')[0];
	var parts = quest.split('/');
	var lastSegment = parts.pop() || parts.pop();

	var theurl = 'http://www.moviechat.org/movies/';
	
	var simple = (theurl + lastSegment);
	//console.info(simple);  (by drhouse)
    
	var chatdiv = $('<div class="article" id="boardsTeaser"><h2>&nbsp;&nbsp;Message Boards</h2>'+
					'</div>').css('display','block').css('overflow','hidden').css('position','relative').css('height','100%').css('width','100%');

	var lastart = $('.col-xs-12').last();
	$(chatdiv).insertBefore(lastart);
	//lazy else (by drhouse)
	$(chatdiv).insertBefore('#tn15bot');
    // Can't find #tn15bot anywhere... (by RandomUsername404)

	var ifrm = document.createElement("iframe");
	ifrm.setAttribute("id", "msgframe");
	ifrm.setAttribute("src", simple);
	ifrm.setAttribute("style", "scrolling=no;position=absolute;padding=0px");  
	ifrm.setAttribute ("frameborder", "0");
	ifrm.style.height = 600+"px";
	ifrm.style.width = 110+"%";
    ifrm.style.position = "relative";
    ifrm.style.right = 3+"%";
	$(ifrm).appendTo(chatdiv);

	$('body').css('background-color','#fff');
	$('.main').css('box-shadow','0px 0px 0px 0px');

	var title = $('section#titleOverview > div.media.overview-top > div.media-body > h1').text();
	$('<div class="article"><a href='+simple+'>&nbsp;&nbsp;Discuss '+title+'</a> on MovieChat.org »</div><hr>').insertAfter(chatdiv);
	$('.contribute').css('border-top','1px;solid;#ccc');

});