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 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name MovieChat.org Message Boards on m.IMDb.com
  3. // @namespace https://greasyfork.org/en/users/105361-randomusername404
  4. // @version 1.1
  5. // @description Based on drhouse's script, bring message boards back on IMDb mobile site by using MovieChat.org boards.
  6. // @run-at document-start
  7. // @include http://m.imdb.com/title/*
  8. // @include http://m.imdb.com/name/*
  9. // @include http://www.moviechat.org/*
  10. // @include https://www.moviechat.org/*
  11. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  12. // @author RandomUsername404
  13. // @icon http://ia.media-imdb.com/images/G/01/imdb/images/mobile/apple-touch-icon-mobile-2541571834._CB522736227_.png
  14. // ==/UserScript==
  15.  
  16. this.$ = this.jQuery = jQuery.noConflict(true);
  17. $(document).ready(function () {
  18. var theparenturl = document.URL;
  19. var quest = theparenturl.split('?')[0];
  20. var parts = quest.split('/');
  21. var lastSegment = parts.pop() || parts.pop();
  22.  
  23. var theurl = 'http://www.moviechat.org/movies/';
  24. var simple = (theurl + lastSegment);
  25. //console.info(simple); (by drhouse)
  26. var chatdiv = $('<div class="article" id="boardsTeaser"><h2>&nbsp;&nbsp;Message Boards</h2>'+
  27. '</div>').css('display','block').css('overflow','hidden').css('position','relative').css('height','100%').css('width','100%');
  28.  
  29. var lastart = $('.col-xs-12').last();
  30. $(chatdiv).insertBefore(lastart);
  31. //lazy else (by drhouse)
  32. $(chatdiv).insertBefore('#tn15bot');
  33. // Can't find #tn15bot anywhere... (by RandomUsername404)
  34.  
  35. var ifrm = document.createElement("iframe");
  36. ifrm.setAttribute("id", "msgframe");
  37. ifrm.setAttribute("src", simple);
  38. ifrm.setAttribute("style", "scrolling=no;position=absolute;padding=0px");
  39. ifrm.setAttribute ("frameborder", "0");
  40. ifrm.style.height = 600+"px";
  41. ifrm.style.width = 110+"%";
  42. ifrm.style.position = "relative";
  43. ifrm.style.right = 3+"%";
  44. $(ifrm).appendTo(chatdiv);
  45.  
  46. $('body').css('background-color','#fff');
  47. $('.main').css('box-shadow','0px 0px 0px 0px');
  48.  
  49. var title = $('section#titleOverview > div.media.overview-top > div.media-body > h1').text();
  50. $('<div class="article"><a href='+simple+'>&nbsp;&nbsp;Discuss '+title+'</a> on MovieChat.org »</div><hr>').insertAfter(chatdiv);
  51. $('.contribute').css('border-top','1px;solid;#ccc');
  52.  
  53. });