Thumbnails in opera cache
Monday, September 7, 2009 2:03:58 PM
Replace in yours *.lng file, string «-1713924769="Size"» on (press Ctrl+F11 before copying)
Update
Added "advanced search".
Update
Added sorting by name (~date) and size.
Update
Speed-up version for Opera 9.51 and later. Sorting works more fast (~5x).
english.lng for Opera 9.5x.
Update
Version for Opera 10 with a built-in correction for the new ugly style.
По русски здесь.
ru.lng для 9.5x.
-1713924769="Size<script type='text/javascript'>document.addEventListener('load',function(){for(var i=0;document.links[i];i++){document.links[i].target='_blank'};var tr=document.getElementsByTagName('tr');var sf=document.createElement('input');sf.type='text';sf.defaultValue='Search';sf.style='margin:0 4px;float:right;';sf.addEventListener('focus',function(){if(this.value==this.defaultValue){this.value=''}},false);sf.addEventListener('blur',function(){if(!this.value){this.value=this.defaultValue}},false);sf.addEventListener('keyup',function(){var v=this.value.toLowerCase();for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild.innerText;if(p&&p.toLowerCase().indexOf(v)==-1){l.style='display: none'}else{l.style='display: table-row'}}},false);var bt=document.createElement('input');bt.type='button';bt.value='Thumbnails';bt.style='float:right;';bt.addEventListener('click',function(){var b=/\.(jpe?g|bmp|gif|png|ico|swf|flv)$/i;var f=/\.(swf|flv)$/i;for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild;var c=l.firstChild.innerText;if(l.offsetHeight!=0&&p.childNodes.length<2){if(b.test(c)){var stl='float:right;border:1px dotted black;margin:1px;padding:1px;max-height:100px;max-width:100px;';if(f.test(c)){var dv=document.createElement('div');p.appendChild(dv);dv.innerHTML='<EMBED src='+p.href+'>';var fh=dv.firstChild;fh.setAttribute('height',100);fh.setAttribute('width',100);fh.setAttribute('style',stl+'content:normal;display:inherit;outline:none;background-image:none;')}else{var image=document.createElement('img');image.setAttribute('src',p.href);image.setAttribute('style',stl);p.appendChild(image)}}}}},false);var th=document.getElementsByTagName('th')[2];th.appendChild(bt);th.appendChild(sf)},false)</script>"
Update
Added "advanced search".
Update
Added sorting by name (~date) and size.
-1713924769="Size<script type='text/javascript'>function sorter(t){var table=document.getElementsByTagName('table')[0];var node;var col=t.cellIndex;var span=t.getElementsByTagName('span')[0];var a=new Array();var tbody=table.getElementsByTagName('tbody')[0];var tr=tbody.getElementsByTagName('tr');for(var i=0;(node=tr[i+1]);i++){a[i]=new Array();a[i][0]=getConcatenedTextContent(node.getElementsByTagName('td')[col]);a[i][1]=node}a.sort(_sort);var dtitle=span.getAttribute('title');if(dtitle==0){a.reverse()}dtitle=dtitle==0?1:0;span.innerHTML=dtitle==0?'↓':'↑';span.setAttribute('title',dtitle);for(var i=0;i<a.length;i++){tbody.appendChild(a[i][1])}function _sort(a,b){var a=a[0];var b=b[0];if(Number(a)&&Number(b)){return sort_numbers(a,b)}else{return sort_sensitive(a,b)}};function sort_numbers(a,b){return a-b};function sort_sensitive(a,b){if(a<b)return-1;if(a>b)return 1;return 0};function getConcatenedTextContent(node){var _result='';if(node==null){return _result}var childrens=node.childNodes;var i=0;while(i<childrens.length){var child=childrens[i];switch(child.nodeType){case 1:case 5:_result+=getConcatenedTextContent(child);break;case 3:case 2:case 4:_result+=child.nodeValue;break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:break}i++}return _result}};document.addEventListener('load',function(){for(var i=0;document.links[i];i++){document.links[i].target='_blank'};var tr=document.getElementsByTagName('tr');var sf=document.createElement('input');sf.type='text';sf.defaultValue='Search';sf.style='font-size:100%;margin:0 20px 0 30px;width:40%;';sf.addEventListener('focus',function(){if(this.value==this.defaultValue){this.value=''}},false);sf.addEventListener('blur',function(){if(!this.value){this.value=this.defaultValue}},false);sf.addEventListener('keyup',function(){var v=this.value.toLowerCase();for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild.innerText;if(p&&p.toLowerCase().indexOf(v)==-1){l.style='display: none'}else{l.style='display:table-row'}}},false);var bt=document.createElement('input');bt.type='button';bt.value='Thumbnails';bt.style='font-size:100%;cursor:pointer;float:right;';bt.addEventListener('click',function(){var b=/\.(jpe?g|bmp|gif|png|ico|swf|flv)$/i;var f=/\.(swf|flv)$/i;for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild;var c=l.lastChild.firstChild.innerText;if(l.offsetHeight!=0&&p.childNodes.length<2){if(b.test(c)){var stl='float:right;border:1px dotted black;margin:1px;padding:1px;max-height:100px;max-width:100px;';if(f.test(c)){var dv=document.createElement('div');p.appendChild(dv);dv.innerHTML='<EMBED src='+p.href+'>';var fh=dv.firstChild;fh.setAttribute('height',100);fh.setAttribute('width',100);fh.setAttribute('style',stl+'content:normal;display:inherit;outline:none;background-image:none;')}else{var image=document.createElement('img');image.setAttribute('src',p.href);image.setAttribute('style',stl);p.appendChild(image)}}}}},false);var th=document.getElementsByTagName('th');th[2].appendChild(bt);th[2].appendChild(sf);var addSort=function(ele){var span=document.createElement('span');span.title='0';span.appendChild(document.createTextNode('•'));ele.insertBefore(span,ele.firstChild);ele.onclick="sorter(this);";ele.style.cursor='pointer';};addSort(th[0]);addSort(th[1]);},false)</script>"
Update
Speed-up version for Opera 9.51 and later. Sorting works more fast (~5x).
-1713924769="Size<script type='text/javascript'>function sorter(span){var _sort=function(a,b){var a=a[1];var b=b[1];if(Number(a)&&Number(b)){return a-b}else{if(a<b)return-1;if(a>b)return 1;return 0}};var dir=span.innerHTML.charAt(0);var col=span.parentNode.cellIndex;var tbody=document.selectSingleNode('//tbody');var tr=tbody.selectNodes('tr[td]');var len=tr.length;var a=new Array(len);for(var i=0;i<len;i++){a[i]=new Array(2);a[i][0]=tr[i];a[i][1]=a[i][0].selectNodes('td')[col].innerText};a.sort(_sort);if(dir!='↓'&&dir!='↑')dir=arguments[1]?'↓':'↑';if(dir=='↑'){a.reverse()};span.innerHTML=(dir=='↑'?'↓':'↑')+span.innerHTML.substr(1);for(var i=0;i<len;i++){tbody.appendChild(a[i][0])}};document.addEventListener('load',function(){for(var i=0;document.links[i];i++){document.links[i].target='_blank'};var tr=document.selectNodes('//tr[td]');if(location.search){var ls=location.search.substring(1);for(var i=0,ti;ti=tr[i];i++){var tt=ti.lastChild.firstChild.innerText;if(tt&&tt.indexOf(ls)==-1){ti.parentNode.removeChild(ti)}}};var sf=document.createElement('input');sf.type='text';sf.defaultValue='Search';sf.style='font-size:100%;margin:0 20px 0 30px;width:40%;';sf.addEventListener('focus',function(){if(this.value==this.defaultValue){this.value=''}},false);sf.addEventListener('blur',function(){if(!this.value){this.value=this.defaultValue}},false);sf.addEventListener('keyup',function(){var v=this.value.toLowerCase();for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild.innerText;if(p&&p.toLowerCase().indexOf(v)==-1){l.style='display: none'}else{l.style='display:table-row'}}},false);var bt=document.createElement('input');bt.type='button';bt.value='Thumbnails';bt.style='font-size:100%;cursor:pointer;float:right;';bt.addEventListener('click',function(){var b=/\\.(jpe?g|bmp|gif|png|ico|swf|flv)$/i;var f=/\\.(swf|flv)$/i;var stl='float:right;border:1px dotted black;margin:1px;padding:1px;max-height:100px;max-width:100px;';for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild;var c=l.lastChild.firstChild.innerText;if(l.offsetHeight!=0&&p.childNodes.length<2){if(b.test(c)){if(f.test(c)){var dv=document.createElement('div');p.appendChild(dv);dv.innerHTML='<EMBED src='+p.href+'>';var fh=dv.firstChild;fh.setAttribute('height',100);fh.setAttribute('width',100);fh.setAttribute('style',stl+'content:normal;display:inherit;outline:none;background-image:none;')}else{var image=document.createElement('img');image.setAttribute('src',p.href);image.setAttribute('style',stl);p.appendChild(image)}}}}},false);var th=document.selectNodes('//th');th[2].appendChild(bt);th[2].appendChild(sf);var addSort=function(ele){var arg=arguments[1];var txt=ele.firstChild;var span=document.createElement('span');span.title='Sort';span.appendChild(document.createTextNode('•'));ele.insertBefore(span,txt);span.addEventListener('click',function(){sorter(this,arg)},false);span.style.cursor='pointer';span.appendChild(txt)};addSort(th[0]);addSort(th[1]);addSort(th[2],true)},false)</script>"
english.lng for Opera 9.5x.
Update
Version for Opera 10 with a built-in correction for the new ugly style.
-1713924769="Size: <script type='text/javascript'>function sorter(span){var _sort=function(a,b){var a=a[1];var b=b[1];if(Number(a)&&Number(b)){return a-b}else{if(a<b)return-1;if(a>b)return 1;return 0}};var dir=span.innerHTML.charAt(0);var col=span.parentNode.cellIndex;var tbody=document.selectSingleNode('//tbody');var tr=tbody.selectNodes('tr[td]');var len=tr.length;var a=new Array(len);for(var i=0;i<len;i++){a[i]=new Array(2);a[i][0]=tr[i];a[i][1]=a[i][0].selectNodes('td')[col].innerText};a.sort(_sort);if(dir!='↓'&&dir!='↑')dir=arguments[1]?'↓':'↑';if(dir=='↑'){a.reverse()};span.innerHTML=(dir=='↑'?'↓':'↑')+span.innerHTML.substr(1);for(var i=0;i<len;i++){tbody.appendChild(a[i][0])}};if(location.search)document.documentElement.style.display='none';var style=document.createElement('style');style.setAttribute('type','text/css');style.appendChild(document.createTextNode('td{border-width:1px 0;border-style:solid;border-color:#DEDEDE #F5F5F5 #F5F5F5;}td:first-child,td:first-child+td{border-width: 1px 1px 1px 0;border-color:#DEDEDE #DEDEDE #F5F5F5 #F5F5F5;}th{width:auto;}td+td+td a{-o-text-overflow:ellipsis;overflow:hidden;display:block;}'));document.getElementsByTagName('head')[0].appendChild(style);document.addEventListener('load',function(){for(var i=0;document.links[i];i++){document.links[i].target='_blank'};var tr=document.selectNodes('//tr[td]');if(location.search){var ls=location.search.substring(1);if(ls)for(var i=tr.length-1,ti;ti=tr[i];i--){var tt=ti.lastChild.firstChild.innerText;if(tt&&tt.indexOf(ls)==-1){ti.parentNode.removeChild(ti)}};document.documentElement.style.display='block'};var sf=document.createElement('input');sf.type='text';sf.defaultValue='Filter';sf.style='font-size:100%;margin:0 20px 0 30px;width:40%;';sf.addEventListener('focus',function(){if(this.value==this.defaultValue){this.value=''}},false);sf.addEventListener('blur',function(){if(!this.value){this.value=this.defaultValue}},false);sf.addEventListener('keyup',function(){var v=this.value.toLowerCase();for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild.innerText;if(p&&p.toLowerCase().indexOf(v)==-1){l.style='display: none'}else{l.style='display:table-row'}}},false);var bt=document.createElement('input');bt.type='button';bt.value='Thumbnails';bt.style='font-size:100%;cursor:pointer;float:right;';bt.addEventListener('click',function(){var b=/\\.(jpe?g|bmp|gif|png|ico|swf|flv)$/i;var f=/\\.(swf|flv)$/i;var stl='float:right;border:1px dotted black;margin:1px;padding:1px;max-height:100px;max-width:100px;';for(var i=0,l;l=tr[i];i++){var p=l.lastChild.firstChild;var c=l.lastChild.firstChild.innerText;if(l.offsetHeight!=0&&p.childNodes.length<2){if(b.test(c)){if(f.test(c)){var dv=document.createElement('div');p.appendChild(dv);dv.innerHTML='<EMBED src='+p.href+'>';var fh=dv.firstChild;fh.setAttribute('height',100);fh.setAttribute('width',100);fh.setAttribute('style',stl+'content:normal;display:inherit;outline:none;background-image:none;')}else{var image=document.createElement('img');image.setAttribute('src',p.href);image.setAttribute('style',stl);p.appendChild(image)}}}}},false);var th=document.selectNodes('//th');th[2].appendChild(bt);th[2].appendChild(sf);var addSort=function(ele){var arg=arguments[1];var txt=ele.firstChild;var span=document.createElement('span');span.title='Sort';span.appendChild(document.createTextNode('•'));ele.insertBefore(span,txt);span.addEventListener('click',function(){sorter(this,arg);for(var i=0;i<th.length;i++){var s=th[i].firstChild;if(s!=this)s.innerHTML='•'+s.innerHTML.substr(1)}},false);span.style.cursor='pointer';span.appendChild(txt)};addSort(th[0]);addSort(th[1]);addSort(th[2],true);if(location.search)sorter(th[0].firstChild)},false)</script>"
По русски здесь.
ru.lng для 9.5x.

1 2 Next »
XtremeMaC # Friday, May 18, 2007 10:20:50 PM
thanks man, appriciated
edit: the code works like charm!! thanks again
ChristianResearchWizard # Saturday, May 19, 2007 12:01:10 AM
Somehow strange to see JS working in a language file. And very interesting to see what happens after pressing the new Thumbnails button on the opera:cache page with all the images visually presented. Great work Lex1. Well, I think I don't need this but I'm looking for something similar for the HTML pages in History etc. (preferably as popup on the history panel entries). Would just be nice to have to play with and have a look whether it may be useful.
thenew # Monday, June 11, 2007 3:58:45 AM
but, when the thumbnails script running,my old machine almost burned up, seems it hard to swallow that...and actually, i dont need the thumbnails show very much.
so,could you tell me how can i do if i just want to cut off the thumbnails scipt ,and keep the advanced search going?
A.RuzanovLex1 # Monday, June 11, 2007 7:54:29 AM
Anonymous # Saturday, September 8, 2007 4:07:35 PM
Anonymous # Saturday, September 8, 2007 5:06:35 PM
A.RuzanovLex1 # Sunday, September 9, 2007 1:42:10 PM
Thomas
\profile\opera6.ini
[Windows]
Delete string «Startup Dialog=»
legion1978 # Friday, September 28, 2007 12:22:55 AM
any idea?
thanx
A.RuzanovLex1 # Saturday, September 29, 2007 2:46:44 PM
Looking path to .lng file in \profile\opera6.ini:
Language File=
xoxoo88 # Friday, November 30, 2007 6:55:13 AM
Martinxyborg # Thursday, December 6, 2007 7:59:09 PM
QuHno # Wednesday, January 16, 2008 8:29:20 PM
It would be perfect if you could add an option to filter the thumbnail view.
A little extra dropdown, maybe, to filter for flv, png, gif etc. pp. would be nice because the script slows down my computer massively when pushing the thumbnails button in my 100MB cache Opera profile.
A.RuzanovLex1 # Wednesday, January 16, 2008 9:52:20 PM
«You can at first use "Advanced search" (For instance, choosing a necessary site or file-extensions), and only then press on button "Thumbnails"»
It's not it enough?
QuHno # Thursday, January 17, 2008 7:34:44 AM
It works!
Thanks!
<just_some_wishes_no_real_need_to_worry>
But -there is always a "but, istn't it?
...or the possibility to switch off the thumbnail view. Advanced search before pressing "Thumbnails" helps a lot, but if the image, I am looking for, has an other extension than expected, my computer crawls when I try to type a new one in the advanced search without closing and reopening the cache tab before.
</just_some_wishes_no_real_need_to_worry>
skye11 # Saturday, February 2, 2008 6:11:39 AM
replaced the 2 lines of script into "C:\Program Files\Opera\English.lng", but nothing appears when clicking "Thumbnails" button, nor using search. I'm using XPPro/SP2/9594
any ideas?
A.RuzanovLex1 # Saturday, February 2, 2008 9:54:20 AM
skye11 # Saturday, February 2, 2008 4:29:56 PM
cache page is blank, except for headings, search field & Thumbnails button
also, filepaths are correct in opera:config
A.RuzanovLex1 # Saturday, February 2, 2008 10:09:00 PM
Update it.
Worked version english.lng for Opera 9.50
skye11 # Saturday, February 2, 2008 11:12:29 PM
I copied over your updated english.lng, but same thing
page displays with search field & T-button, but no actual images
A.RuzanovLex1 # Sunday, February 3, 2008 12:18:48 PM
That for errors in "Error console"?
Mayo Kyomotoborbis # Saturday, March 29, 2008 8:46:00 AM
Worked fine on my Opera 8.65 for Windows Mobile Pocket PC.
But some changes needed.
Please see my screen shot and script at
http://my.opera.com/borbis/blog/show.dml/1849569
Thanks again.
A.RuzanovLex1 # Saturday, March 29, 2008 1:25:15 PM
varver # Friday, June 13, 2008 10:15:21 AM
What I really find annoying though, is that the files in the cache folder have no extensions! That is a *horrible* decision from the Opera developers. I doubt it saves any worthy ammount of time or disk & memory space by not using extensions. The files in the cache folder are, well, *files* and I (the user) should be able to handle them as I please.
There are some ridiculous comments about using the opera:cache instead (even if it works, it sucks - I cannot sort the files e.g. by size/extension/date/...) or (even worse) by using a file/image manager that scans the headers of the files! Obviously whoever says that, has never used the cache files. Waiting for the scanning of headers takes time - since the file extension is useful for us (humans) and not so much for the computer, we should have file extensions to make our work easier. The removal of extensions is actually the removal of a nice feature that most Opera's power users enjoy and need.
Now I'm hungry and even more pissed off, so I'll stop here. I did register in the forum, where there are a lot of other people who agree with this matter, but whenever I click the "Post a reply" button, I get the Welcome back page with the terms, where I'm supposed to click 'I agree to the terms'. The thing is, there is no 'I agree to the terms' thing to click. I even tried with Firefox, and I.E. 6 and 7, from different computers...
What the heck is going on?
After this post, I'm reinstalling Opera 9.27. The only usefull feature of the 9.50 is the full history search and that it lists the bookmarks along with the history items whenever I type in the address bar. They are very nice features, but the thing with the cache files is much more important.
Sorry for the long post.
Well done for the oGet utility which I use quite frequently.
Best regards
Andrew Gregory # Sunday, June 22, 2008 3:43:39 AM
I didn't like how it enlarged the thumbnails and distorted images. To fix that I deleted the following code:
if(!image.height || image.height>100){image.height='100'};if(!image.width || image.width>100){image.width='100'};Then I made the following change:image.setAttribute('style', stl+'max-height:100px;max-width:100px;');That ensures the thumbnails are never bigger than 100px in either dimensions, but are stretched or distorted if they're smaller.Thanks again for this!
Andrew Gregory # Sunday, June 22, 2008 3:49:04 AM
A.RuzanovLex1 # Sunday, June 22, 2008 10:51:09 AM
Thanks for fix, Andrew.
Actually when I wrote this code, I had very shallow knowledges about css and did not know about existence of max-height
I did update an english.lng.
Jerrygtrman4040 # Thursday, June 26, 2008 10:51:38 PM
"big deal" meaning for me. Most users probably don't even need the excellent Opera cache feature of previous versions. The Opera crew probably talked about that before making the cache change decision.
Also, I'm not suggestion anybody else should do what I did. I'm just telling you why I uninstalled 9.50 and went back to 9.27. I want to be able to see file extensions in the cache. This was the only alternative that works for me this far.
BTW, this is the second internet browser I have uninstalled this week...lol. In Firefox 3, the Real Player downloader does not work anymore = uninstall.
Andrew Gregory # Thursday, July 3, 2008 11:16:27 AM
A.RuzanovLex1 # Thursday, July 3, 2008 1:05:25 PM
What bad in «advanced search»? It works more fast than sorting.
A.RuzanovLex1 # Friday, July 4, 2008 7:54:45 AM
Unfortunately Opera 9.50 (9 sec) more slow than Opera 9.27 (3 sec) and Opera 8.54 (2 sec). And winner it Safari with result 1 sec.
P.S. I use Core 2 Duo 2.66 Ghz.
A.RuzanovLex1 # Friday, July 4, 2008 10:04:20 AM
for(var i=0;i<a.length;i++){tbody.appendChild(a[i][1])}on
var temp=tr[0].outerHTML;var l=a.length;for(var i=0;i<l;i++){temp+=a[i][1].outerHTML};tbody.innerHTML=temp;gives a double acceleration, but Opera 9.50 however the slowest browser.
Edit
Speed-up version from above includes necessary changes already.
Big_Mike # Friday, July 4, 2008 11:31:18 AM
But with your fix, which should accelerate sorting, I can only sort once.
A.RuzanovLex1 # Friday, July 4, 2008 3:45:22 PM
Thanks, fixed. Use «Speed-up version» from above.
cecilia # Friday, July 4, 2008 6:03:32 PM
made the latest changes to my "english.lng" file although I don't seem to have a line that says "for(var i=0;i<a.length;i++){tbody.appendChild(a[1])}" so I can't replace it with that phrase.
I'm not upset by this
and my memory cache is set to the default 40MB
A.RuzanovLex1 # Friday, July 4, 2008 8:58:20 PM
It's looks as opera bug. Upgrade to 9.5x from previous version is not very good idea. Clean install - better. Or try clear cache in Ctrl+F12->Advanced->History.
Speed-up version from above includes necessary changes already.
LarryFisher # Saturday, July 5, 2008 5:47:54 PM
A.RuzanovLex1 # Sunday, July 6, 2008 9:58:59 AM
Press Ctrl+F11
LarryFisher # Sunday, July 6, 2008 10:03:40 PM
I didn't realize that Ctrl+F11 would work in the code box. Neat and thanks.
crabbit # Monday, July 7, 2008 1:14:33 AM
Anonymous # Saturday, August 2, 2008 9:50:31 AM
Anonymous # Saturday, August 16, 2008 8:15:40 AM
A.RuzanovLex1 # Saturday, August 16, 2008 11:01:27 AM
Eldar FaizullinXaHyMaH # Tuesday, August 19, 2008 6:25:31 AM
Спасибо товарищ, Родина вас не забудет!
MD.NAZMUL HOSSAIN SHARKAR(MASUD)/MD.ASIF IQBAL(MASUD).BANGLADESHOPERA # Wednesday, August 20, 2008 2:40:46 PM
cecilia # Monday, August 25, 2008 4:13:21 PM
but I don't get thumbnails in opera:cache (dispite the existence of the thumbnail button). It doesn't work if you have the cashe Empty On Exit - which is the way I like it. I hate files cluttering up my HD.
For those people who want access to the cache but need that setting there has to be another solution. I'm not complaining.....just stating a fact.
A.RuzanovLex1 # Monday, August 25, 2008 8:09:46 PM
Why not to use FireFox/SeaMonkey/K-meleon ?
cecilia # Monday, August 25, 2008 11:28:57 PM
I'm not sure what you are suggesting here..anyway, seeing the cashe is not a desperate need for me. it would be interesting, but not an absolute necessity
Anonymous # Sunday, August 31, 2008 7:28:54 AM
A.RuzanovLex1 # Sunday, August 31, 2008 11:04:58 AM
Spadar ShutSpShut # Sunday, September 28, 2008 10:38:09 AM