Skip to content

Instantly share code, notes, and snippets.

@atomer
Last active December 22, 2015 17:09
Show Gist options
  • Save atomer/6504655 to your computer and use it in GitHub Desktop.
Save atomer/6504655 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name digg fullfeed
// @namespace http://www.atomer.sakuran.ne.jp
// @description nantyatte fullfeed
// @include http://digg.com/reader/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js
// @version 0.1
// ==/UserScript==
(function(window, loaded){
var win;
if (!loaded && this.chrome) {
var fn = '(' + arguments.callee.toString() + ')(this,true);';
var script = document.createElement('script');
script.appendChild(document.createTextNode(fn));
document.body.appendChild(script);
return;
} else if (this.chrome) {
win = window;
} else {
win = unsafeWindow;
}
var $ = win.jQuery;
$(document.body)
.on("click", ".feeditem-headline", function(e) {
var $base = $(e.target).parents(".feeditem-list");
$base.find(".story-meta").append('<span class="story-meta-item _fullfeed"><a href="#">fullfeed</a></span>');
})
.on("click", "._fullfeed a", function(e) {
var $base = $(e.target).parents(".story-detail-content");
var $a = $base.find(".story-title a");
var $detail = $base.find(".detail-body");
var $iframe = $('<iframe></iframe>').attr("src", $a.attr("href"));
$iframe.css({
width: "100%",
height: 500
});
$detail.html($iframe);
});
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment