Tuesday, 30. September 2008, 12:48:59
Thumbnail when hovering imagelinks
Maybe theres something similiar out there (always seem to be when I make a userjs).But here it is anyway. When you hover a image link youll see a thumbnail in bottom left corner.
It's not bug-tested at all so please say if you find any bugs.
http://sima.ax.loopiadns.com/Other/imgthumb.js
Might have to restart opera after putting it in userJS folder.
Friday, 3. October 2008, 07:18:21
Updated the link in main post to version 1.1, fixed the fit-to-width bug and added a very handy feature:
Like before, a thumbnail is shown when you hover an image link. But now you can show the image in it's original size by pressing and holding down ctrl while the thumbnail is shown.
Like before, a thumbnail is shown when you hover an image link. But now you can show the image in it's original size by pressing and holding down ctrl while the thumbnail is shown.
Tuesday, 7. October 2008, 14:33:16
Thanks but "Download All with oGet" script does not work with imgthumb.js. Is there any solution?
"Download All with oGet"
"Download All with oGet"
[Document Popup Menu]
.
.
.
Platform Windows, Item, "Download All with oGet"="Go to Page, "javascript:(function(){var encodeBase64=function(a){var b='';var c=0;var i=0;var d='';var e=a.length;var f=[];var g='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';while(c=a.charCodeAt(i++)){if(c<0x80){f[f.length]=c}else if(c<0x800){f[f.length]=0xc0|(c>>6);f[f.length]=0x80|(c&0x3f)}else if(c<0x10000){f[f.length]=0xe0|(c>>12);f[f.length]=0x80|((c>>6)&0x3f);f[f.length]=0x80|(c&0x3f)}else{f[f.length]=0xf0|(c>>18);f[f.length]=0x80|((c>>12)&0x3f);f[f.length]=0x80|((c>>6)&0x3f);f[f.length]=0x80|(c&0x3f)}if(i==e){while(f.length%%3){f[f.length]=0;d+='='}}if(f.length>2){b+=g[f[0]>>2];b+=g[((f.shift()&3)<<4)|(f[0]>>4)];b+=g[((f.shift()&0xf)<<2)|(f[0]>>6)];b+=g[f.shift()&0x3f]}}return(b+d)};var topLevelDN=function(domain){if(!domain)return;if(/^(?:\d{1,3}\.){3}\d{1,3}$/.test(domain))return domain;var a=domain.split('.');var l=a.length;return(l<3)?domain:(a[l-2]+'.'+a[l-1])};var links='';var n=0;var rn='\r\n';var downloadAll=function(w){if(w)with(w)try{var l=document.links;var h=topLevelDN(location.hostname);var c=document.cookie;for(var i=0,li;li=l[i];i++){if(li.protocol!='javascript:'&&li.protocol!='mailto:'){links+=li.href+rn+li.innerText.replace(/\s/g,' ').replace(/^\s+|\s+$/,'')+rn+((c&&h==topLevelDN(li.hostname))?c+'; ':'')+rn+rn;n++}};for(var j=0,f;f=frames[j];j++){downloadAll(f)}}catch(e){}};downloadAll(window.top);location.href='data:text/ogt;charset=UTF-8;base64,'+encodeBase64(n+';My_Download_Manager;2;;'+rn+location.href+rn+links)})()",,,"Save" "
Wednesday, 15. October 2008, 11:16:08
Kani
Good idea, but worst code which I saw. I think it contains most possible errors.
offcu
Replace
on «var links = document.getElementsByTagName("a");»
Good idea, but worst code which I saw. I think it contains most possible errors.
offcu
but "Download All with oGet" script does not work with imgthumb.js.
Replace
links = document.getElementsByTagName("a"); in imgthumb.json «var links = document.getElementsByTagName("a");»
Wednesday, 15. October 2008, 11:52:51
Kani
http://dev.opera.com/articles/view/efficient-javascript/
Error №1 Avoid a global variables and functions. Use anonymous function.
Error №2 Don't use .onsomething. It may break exists handlers on pages.
Error №3 Not forget about «var» in functions.
Error №4 Cache DOM values in script variables. Five «document.getElementById('thumbBoxDiv')» - bad idea.
And it contains many useless code
it can be written twice shorter:
http://dev.opera.com/articles/view/efficient-javascript/
Error №1 Avoid a global variables and functions. Use anonymous function.
Error №2 Don't use .onsomething. It may break exists handlers on pages.
Error №3 Not forget about «var» in functions.
Error №4 Cache DOM values in script variables. Five «document.getElementById('thumbBoxDiv')» - bad idea.
And it contains many useless code
function onReady()
{
createBox();
var links = document.getElementsByTagName("a");
for(var i = 0; i <= links.length; i++)
{
if(links[i] != 'undefined' && links[i] != 'null' && links[i] != null)
{
if(links[i].href.toLowerCase().match("jpg$") || links[i].href.toLowerCase().match("png$") || links[i].href.toLowerCase().match("gif$"))
{
links[i].onmouseover = "showThumb('" + links[i].href + "');";
links[i].onmouseout = hideThumb;
}
}
}
}
it can be written twice shorter:
function onReady()
{
createBox();
var links = document.getElementsByTagName('a');
for(var i=0, li; li=links[i]; i++)
{
if(li.href && li.href.match(/\.(jpe?g|bmp|gif|png)$/i))
{
li.onmouseover = "showThumb('" + li.href + "');";
li.onmouseout = hideThumb;
}
}
}
Tuesday, 10. March 2009, 10:51:02
Thanks. This works great:)
It gave me a new idea for a js. It would be useful to have something like this for Google Image Search and facebook. When I hover an image thumbnail that link to the full size image, i will see the image the same way as this js display it, only in full size.
Just imagine to search for a image and you can just hover it to display the full size image. The same goes foe facebook, when i am looking for my friends and their updates.
It gave me a new idea for a js. It would be useful to have something like this for Google Image Search and facebook. When I hover an image thumbnail that link to the full size image, i will see the image the same way as this js display it, only in full size.
Just imagine to search for a image and you can just hover it to display the full size image. The same goes foe facebook, when i am looking for my friends and their updates.
Monday, 17. August 2009, 04:04:47
You should check that when using this script your acid3 test results will drop to 97/100, at least it happened to me using it with Blockit, Linkalert and Snap-Links, BUT removing any/all of those other JS didn't make a difference on the result so it is a problem with imgthumb.js
Sunday, 20. September 2009, 19:13:30
will be awsome if we can use this script with extra download links script... that way we will be able to have a preview of the image in link panel.
Wednesday, 25. November 2009, 06:54:29 (edited)
If you have Opera 10.1 you can install this Unite application, it can install scripts for you.
@Kani, it's a wonderful script but is there anything that can be done to makeit compatible with Arve's autosizer script?
@Kani, it's a wonderful script but is there anything that can be done to makeit compatible with Arve's autosizer script?
Forums » Opera Community » General Opera topics » User JavaScript

