Skip navigation

Sign up | Lost password? | Help

My program for Opera

Thumbnails in opera cache

Replace in yours *.lng file, string «-1713924769="Size"» on (press Ctrl+F11 before copying)
-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.

По русски здесь.
ru.lng для 9.5x.

UserJSCopying text with formatting to clipboard and Autocopy.js

Comments

XtremeMaC 18. May 2007, 22:20

thanks man, trying it right now but in the meantime it took about a minute to copy this code to clipboard since there is no "select all" option. can u either have it as a downloadable text file or make it so that it is expanded like this "write a comment" text box?

thanks man, appriciated

edit: the code works like charm!! thanks again

ResearchWizard 19. May 2007, 00:01

Selecting in the codebox is somewhat slow or tricky: in Opera a triple click does the job. Surely it would be easier to select and to preview the code having it added in the post simply as plain text.

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 11. June 2007, 03:58

it 's amazing! i like it!
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?

Lex1 11. June 2007, 07:54

You can at first use "Advanced search" (for an example, choosing a necessary site), and only then press on button "Thumbnails".

Anonymous 8. September 2007, 16:07

Thomas writes:

How can I change the size of the start-up dialog box, currently it takes up the whole screen and the start and help buttons are below my start bar.

Anonymous 8. September 2007, 17:06

Anonymous writes:

Can you do one for history?

Lex1 9. September 2007, 13:42

Yes, but why? Tools->History is better.

Thomas
\profile\opera6.ini
[Windows]
Delete string «Startup Dialog=»

legion1978 28. September 2007, 00:22

didnt work for me.. i have latest spanish version and i replaced the string for es_ES es_La and english-lng...
any idea?
thanx

Lex1 29. September 2007, 14:46

Javascript enabled?
Looking path to .lng file in \profile\opera6.ini:
Language File=

xoo88 30. November 2007, 06:55

it was great !! thanks for the tips

xyborg 6. December 2007, 19:59

great! thanks :smile:

QuHno 16. January 2008, 20:29

Great work :smile:

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.

Lex1 16. January 2008, 21:52

QuHno
«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 17. January 2008, 07:34

Homer: Doh! Didn't think about that!
It works!
Thanks!

<just_some_wishes_no_real_need_to_worry>
But -there is always a "but, istn't it? :wink: - preselectors for combining some extensions would be fine, too. For example PNG+JPG or something like this. Some checkboxes, that add up their values in the variables b and f maybe?

...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 2. February 2008, 06:11

not working for me

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?

Lex1 2. February 2008, 09:54

Use version for Kestrel. It work without any problem with latest weekly

skye11 2. February 2008, 16:29

yes, that's the script version I'm using
cache page is blank, except for headings, search field & Thumbnails button

also, filepaths are correct in opera:config

Lex1 2. February 2008, 22:09

9594


Update it.
Worked version english.lng for Opera 9.50

skye11 2. February 2008, 23:12

thanks for trying
I copied over your updated english.lng, but same thing
page displays with search field & T-button, but no actual images

Lex1 3. February 2008, 12:18

It works with normal version (non alfa)?
That for errors in "Error console"?

borbis 29. March 2008, 08:46

Great work Lex1. Thanks!

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.

Lex1 29. March 2008, 13:25

And thank you for interesting information.

varver 13. June 2008, 10:15

Unfortunately I cannot test it, since in the new version (9.50) the opera:cache is always displayed empty...
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 22. June 2008, 03:43

I think this patch is a really great idea, but it could do with a little refining. IMHO, anyway.

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 22. June 2008, 03:49

For folks like varver above, you can at least search out cached files by extension. See my blog post: http://my.opera.com/Andrew%20Gregory/blog/2008/06/21/working-around-the-extension-less-cache

Lex1 22. June 2008, 10:51

Andrew Gregory
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 :smile:
I did update an english.lng.

gtrman4040 26. June 2008, 22:51

Hi, I just uninstalled 9.50. The cache change is a big deal and the fix unfortunately did not work for me (no files showing). I do appreciate the efforts to fix the problem. I found a link on google for download of 9.27 and so I did that. I had to also delete the opera directory in documents and settings - application data as the older version of opera mail is not compatible with the new mail.

"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 3. July 2008, 11:16

@Lex1: Your new sorting is working fairly well. The only thing missing is being able to group files by extension. At least, that's what a lot of the complaints about Opera's cache have been concentrating on!

Lex1 3. July 2008, 13:05

Small update. Sorting works more fast (3x-5x in Opera 9.27).

group files by extension.


What bad in «advanced search»? It works more fast than sorting.

Lex1 4. July 2008, 07:54

I did small test of sorting speed, with table contains 3500 rows.
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.

Lex1 4. July 2008, 10:04

Replace
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 4. July 2008, 11:31

Thank you, this little addon is really amazing :smile:
But with your fix, which should accelerate sorting, I can only sort once. :frown:

Lex1 4. July 2008, 15:45

Big_Mike,
Thanks, fixed. Use «Speed-up version» from above.

cecilia 4. July 2008, 18:03

like varver this is not working for me - I'm getting a blank cache page. Just upgraded to 9.51

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 :smile: but I am curious as to why this is not working. I'm using windows2000, in case anyone cares.

and my memory cache is set to the default 40MB

Lex1 4. July 2008, 20:58

I'm getting a blank cache page. Just upgraded to 9.51


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.

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.


Speed-up version from above includes necessary changes already.

Larry Fisher 5. July 2008, 17:47

The blank cache page result for me, was due to improper copying out of the code box. A triple click looked like it had worked but only part of the code came through. Starting at the far right edge with a dragging selection got the entire code and now it works. There has to be a better way for the casual user than the code box. After all of that, however, the results are very useful and I love it.

Lex1 6. July 2008, 09:58

Larry Fisher
Press Ctrl+F11 :wink:

Larry Fisher 6. July 2008, 22:03

Lex1
I didn't realize that Ctrl+F11 would work in the code box. Neat and thanks.

crabbit 7. July 2008, 01:14

wonderful, thanks.

Anonymous 2. August 2008, 09:50

Janghou writes:

Selecting code?

Try the old E and D keyboard shortcuts. Just select something just above the code box with the mouse and press D a few times.

It will select the code wonderfully.

Actually it's amazing how it can help selecting text, much faster then dragging. It's a hidden gem of Opera

Dunno the new 9.5 keyboard set-up, it was called the Cycle through elements in page shortcuts.

For 9.5
Enable single-key shortcuts" in Preferences > Advanced > Shortcuts.

Anonymous 16. August 2008, 08:15

Anonymous writes:

So does the zip file contain all these updates ?

Thanks.

Lex1 16. August 2008, 11:01

Yes.

XaHyMaH 19. August 2008, 06:25

Thanks a lot!
Спасибо товарищ, Родина вас не забудет!

BANGLADESHOPERA 20. August 2008, 14:40

BELKINGSON

cecilia 25. August 2008, 16:13

I have a clean install of Opera 9.51

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.

Lex1 25. August 2008, 20:09

if you have the cashe Empty On Exit


Why not to use FireFox/SeaMonkey/K-meleon ? :smile:

cecilia 25. August 2008, 23:28

"FireFox/SeaMonkey/K-meleon"

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 31. August 2008, 07:28

zizi writes:

hi,
Very nice!
for more Advance, can i put a column with "Date" ode "Time" and Sortable?

Tanks a lot!
ps.: my english is not good, sorry!

Lex1 31. August 2008, 11:04

File name proportionally date. Use sorting by name.

SpShut 28. September 2008, 10:38

Hey, but as long as i included the string and restarted opera, my menu has gone! I would really like to have the advanced cache features, but WTF about the menu?

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

Type the two words displayed in the image below:


Smilies