SheeEttin

unedditreddit

Jul 31st, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void($(".flat-list a:contains('permalink')").each(function() {
  2.     var permalink = $(this).get(0);
  3.     var oldhost = permalink.hostname;
  4.     permalink.hostname="www.unedditreddit.com";
  5.     var e = $(permalink).parents(".entry");
  6.     if (e.has(".grayed").length) {
  7.         $.getJSON(permalink.href+"?callback=?",function(data){
  8.             e.find(".md>p").text((data==null)?"[not found]":data.content);
  9.             e.find(".tagline>em").text(((data==null)?"":data.author+" ")+"[deleted]");
  10.             permalink.hostname=oldhost
  11.         })
  12.     } else {
  13.         e.one("dblclick", function() {
  14.             e.css("opacity",0.6);
  15.             $.getJSON(permalink.href+"?callback=?", function(data) {
  16.                 e.css("opacity",1);
  17.                 if (data!=null) {
  18.                     e.find(".md").html("<p></p>").find("p").text(data.content);
  19.                     e.find(".tagline>.userTagged").append(" [pre-edit]");
  20.                 }
  21.                 permalink.hostname=oldhost;
  22.             })
  23.         })
  24.     }
  25. }));
Add Comment
Please, Sign In to add comment