del.icio.us Inline View

By pwlin Last update Aug 13, 2009 — Installed 335 times. Daily Installs: 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 2, 4, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0

There are 3 previous versions of this script.

// ==UserScript==
// @name       del.icio.us Inline View
// @namespace  http://userscripts.org/scripts/show/9304   
// @version	0.2.1   
// @description  Adds an 'inline view...' link to del.icio.us pages which loads the url inside a html iframe in the bottom of every link.
// @include  http://delicious.com/*
// @exclude	http://delicious.com/rss/*
// ==/UserScript==

var $del_inline = {
	
	init : function(){
		try {
			var links = $xpath('//html//body//ul[@id="bookmarklist"]//a[@class="taggedlink "]');
			var metas = $xpath('//html//body//div[@class="meta"]');
			for (i=0,k=metas.snapshotLength; i<k; i++) {
				var meta = metas.snapshotItem(i);
				var link = links.snapshotItem(i);
				meta.innerHTML += this.generate_iframe_js(i,link.href);
			}
		}
		catch(e){}
	},
	
	generate_iframe_js : function(i,theURL){
		var iframejs = '';
		iframejs += '' 
			+ ' <a class="inlinesave" id="inlineview_anchor'+i+'" onfocus="this.blur();" href="#" '
			+ 'title="'+theURL+'"'
			+ 'onclick="document.getElementById(\''+i+'iframedivview\').style.display=\'block\'; '
			+ 'document.getElementById(\''+i+'inlineiframe1view\').setAttribute(\'src\',\''+theURL+'\'); '
			+ 'document.getElementById(\''+i+'anchorinlineremoveiframeview\').style.display=\'inline\'; '
			+ 'return false;">INLINE VIEW</a>'
			+ '<div id="'+i+'iframedivview" style="display:none;">'
			+ '<iframe id="'+i+'inlineiframe1view" name="inlineiframe1view" width="750" height="400" style="background-color: white;"></iframe></div>'
			+ '<div style="display:none;" id="'+i+'anchorinlineremoveiframeview"> '
			+ '<a title="close iframe" onfocus="this.blur();" href="#'+i+'anchorinlinecopy" '
			+ 'onclick="document.getElementById(\''+i+'inlineiframe1view\').setAttribute(\'src\',\'about:blank\'); '
			+ 'document.getElementById(\''+i+'iframedivview\').style.display=\'none\'; '
			+ 'document.getElementById(\''+i+'anchorinlineremoveiframeview\').style.display=\'none\'; '
			+ ' return false;"><span style="font-size:20px;color:#FFFFFF;background-color:#000088;">&nbsp;X&nbsp;</span></a><br/>&nbsp;<br/></div>';
		return iframejs ; 
	}
}

function $xpath(q,doc) { if (!doc || doc == '') {doc = document ; } return doc.evaluate(q, doc,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); }
(function() {
	$del_inline.init() ;
})();