topical media & game development
graphic-canvas-util-reflection-reflectomatic-bookmarklet.txt / txt
Enhanced Bookmarklet
javascript:(function(){ function I(u){var t=u.split('.'),e=t[t.length-1].toLowerCase();return {gif:1,jpg:1,jpeg:1,png:1,mng:1}[e]}function hE(s){return s.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"');} var i,L=document.images.length; z=open().document;z.write('<p>Select an image to load into reflect-o-matic:</p><h2>Inline Images</h2>');for (i=0;i<L;++i) z.write('<a href="http://cow.neondragon.net/stuff/reflection/reflectomatic/?url='+encodeURIComponent(document.images[i].src)+'"><img src="'+document.images[i].src+'" /></a>');z.write('<h2>Linked Images</h2>');for(i=0;q=document.links[i];++i){h=q.href;if(h&&I(h))z.write('<a href="http://cow.neondragon.net/stuff/reflection/reflectomatic/?url='+encodeURIComponent(hE(h))+'"><img src="'+hE(h)+'" /></a>');}z.close()})();
Original Bookmarklet
javascript:(function(){function I(u){var t=u.split('.'),e=t[t.length-1].toLowerCase();return {gif:1,jpg:1,jpeg:1,png:1,mng:1}[e]}function hE(s){return s.replace(/&/g,'&').replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"');}var q,h,i,z=open().document;z.write('<p>Images linked to by '+hE(location.href)+':</p>
');for(i=0;q=document.links[i];++i){h=q.href;if(h&&I(h))z.write(''+q.innerHTML+' ('+hE(h)+')
');}z.close();})()
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.