New IMDB Message Boards - Moviechat (alternate 2)

Directly integrated replacement on the IMDB message boards using moviechat.org, appears at bottom of all IMDB movie/tv page listings, includes many archived posts saved from before the boards closed.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name               New IMDB Message Boards - Moviechat (alternate 2)
// @namespace          https://greasyfork.org/en/users/10118-drhouse
// @version            1.1
// @description        Directly integrated replacement on the IMDB message boards using moviechat.org, appears at bottom of all IMDB movie/tv page listings, includes many archived posts saved from before the boards closed.
// @run-at             document-start
// @include            http://www.imdb.com/*
// @include            http://www.moviechat.org/*
// @require            http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author             drhouse
// @icon               http://www.moviechat.org/images/logo.png
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
	var theparenturl = document.URL;
	var theurl = 'http://www.moviechat.org/movies/';

	var quest = theparenturl.split('?')[0];

	var parts = quest.split('/');
	var lastSegment = parts.pop() || parts.pop();

	var simple = (theurl + lastSegment);
	//console.log(simple);
	var chatdiv = $('<div class="article" id="boardsTeaser"><h2>Message Boards</h2>'+
					'Recent Posts'+
					'<br><br></div>').css('display','block').css('overflow','hidden').css('position','relative').css('height','600px').css('width','640px');

	if ($('#titleUserReviewsTeaser').length){
		$(chatdiv).insertAfter('#titleUserReviewsTeaser');
	} else {
		$(chatdiv).insertAfter('#titleFAQ');
	}

	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.width = 640+"px";
	ifrm.style.height = 600+"px";
	$(ifrm).appendTo(chatdiv);

	var title = $('#title-overview-widget > div.vital > div.title_block > div > div.titleBar > div.title_wrapper > h1').text();
	var year = $('#titleYear > a').text();
	$('<div><a href='+simple+'>Discuss '+title+'</a> on the Moviechat message boards »</div><br><hr>').prependTo('.contribute');

	$('.contribute').css('border-top','1px;solid;#ccc');

});