Gepost op 2004.02.13 |
Geen reacties |
Tweaks
Deze post is geïmporteerd van de oude blog en is nog niet geconverteerd naar de nieuwe syntax.
You all know those open directories with pictures in it.
And you all know how annoying it can be to view them all by clicking them, or downloading them all to your hd and viewing them there.
Well, here's another way:
Add this .url to your favorites. And when you're on such an open dir, just hit the url and it will show all the .jpg, .gif, .png and .bmp's on that page.
All this actually is, is a javascript as url. This has been tested in IE6, I don't garantee it'll work in other browsers, you can try.
Here's the actual script that's in the link:
[javascript]
var sHTML = 'Fotoviewer \n\n\t
document.body.innerHTML=sHTML;
[/javascript]
Or in a compact one line version:
javascript:var%20sHTML='<html><head><title>Fotoviewer</title></head>\n<body>\n\t<div%20align="center">\n';for(x=0;x<document.links.length;x++){link=document.links[x].href.toLowerCase();if((link.indexOf('.jpg')!=-1)||(link.indexOf('.gif')!=-1)||(link.indexOf('.png')!=-1)||(link.indexOf('.bmp')!=-1)){sHTML+='\t\t<img%20src="'+document.links[x].href+'"/><br/><br/>\n'}}sHTML+="\t</div>\n</body></html>";document.body.innerHTML=sHTML;
Update: Added the .toLowerCase() to link.
Update #2: Changed links(x) to links[x] to make it work in other browsers ;)
And you all know how annoying it can be to view them all by clicking them, or downloading them all to your hd and viewing them there.
Well, here's another way:
Add this .url to your favorites. And when you're on such an open dir, just hit the url and it will show all the .jpg, .gif, .png and .bmp's on that page.
All this actually is, is a javascript as url. This has been tested in IE6, I don't garantee it'll work in other browsers, you can try.
Here's the actual script that's in the link:
[javascript]
var sHTML = '
\n';
for (x = 0; x < document.links.length; x++) {
link = document.links(x).href.toLowerCase();
if ((link.indexOf('.jpg') != -1) || (link.indexOf('.gif') != -1) || (link.indexOf('.png') != -1) || (link.indexOf('.bmp') != -1)) {
sHTML += '\t\t
\n'
}
}
sHTML += "\t
\n";for (x = 0; x < document.links.length; x++) {
link = document.links(x).href.toLowerCase();
if ((link.indexOf('.jpg') != -1) || (link.indexOf('.gif') != -1) || (link.indexOf('.png') != -1) || (link.indexOf('.bmp') != -1)) {
sHTML += '\t\t
\n'
}
}
sHTML += "\t
document.body.innerHTML=sHTML;
[/javascript]
Or in a compact one line version:
javascript:var%20sHTML='<html><head><title>Fotoviewer</title></head>\n<body>\n\t<div%20align="center">\n';for(x=0;x<document.links.length;x++){link=document.links[x].href.toLowerCase();if((link.indexOf('.jpg')!=-1)||(link.indexOf('.gif')!=-1)||(link.indexOf('.png')!=-1)||(link.indexOf('.bmp')!=-1)){sHTML+='\t\t<img%20src="'+document.links[x].href+'"/><br/><br/>\n'}}sHTML+="\t</div>\n</body></html>";document.body.innerHTML=sHTML;
Update: Added the .toLowerCase() to link.
Update #2: Changed links(x) to links[x] to make it work in other browsers ;)