Sign up | Lost password? | Help

[ advanced search ]

Ultimate Highlight JS version 2.5

Forums » Opera Community » General Opera topics » User JavaScript

Saturday, 12. November 2005, 18:31:04

Luchio

Burninating!

avatar

Posts: 943

Canada

Ultimate Highlight JS version 2.5

Ultimate Highlight JS. WARNING: Might be funky with 9.0 TP1.

Main features:
-Automatically highlight keywords from Google results (if page is selected from Google results).
-Highlights multiple keywords in different colors at any time.
-Shows detailed search results in a floating div.
-Remembers search queries with cookies.
-Works in frames.
-Customizable with variables.



Installation:
1- Download the script uhb2.5.js in your UserJS directory.
2- Drag the following link to any toolbar (except personal bar): button
3- (Optional) Assign action Go to page, "javascript:UltimateHighlightKeywords('%t')" to a keyboard or mouse shortcut.

The button must be located to the right of an Opera search field if you want to use input from that field. You can also input your text in the address field.



What's new in 2.5?
-Bigger buttons.
-Font issue fixed
-Output now says "not found" instead of 0.
-Cookie name is obfuscated.
-Global vars and functions are obfuscated.
-URL recognition is better.
-Highlight() and HighlightKeywords(k) functions renamed to UltimateHighlight() and UltimateHighlightKeywords(k) to make it unlikely they would interfer with webpages.

IMPORTANT NOTE: If you used an older version of UHB before, YOUR OLD TOOLBAR BUTTON WON'T WORK. Use the new one. button

Go to [url]http://nontroppo.org/wiki/UHB for version details.



Check the old forum post for tips and tricks.

Edit:
uhb2.5.js

Saturday, 12. November 2005, 18:38:36

The userjs doesn't seem to be on the wiki.

Monday, 14. November 2005, 03:56:49

Luchio

Burninating!

avatar

Posts: 943

Canada

Ok I got it now!

Monday, 14. November 2005, 04:40:37

Stoen

avatar

Posts: 1109

Luchio,

Would you be able to add an option to strip Google's stop words when auto highlighting from a Google search? This is so that it will be more inline with what Google does when it highlights cached pages and doesnt cause colour mismatches between your script and Google's highlighting.

Something like this?

function StripGoogleStopWords(text) {
text=" "+text+" ";
return text.replace(/ (I|a|about|an|are|as|at|be|by|com|for|from|how|in|is|it|of|on|or|that|the|this|to|was|what|when|where|who|will|with|and|the|www) /gi," ");
}


Called after the text=decodeURI(text) statements on line 304 and 311 of the script?

Cheers for the update :up:

Monday, 14. November 2005, 23:32:06

Luchio

Burninating!

avatar

Posts: 943

Canada

I would, but I want my script to find every submitted word. I would be pissed if I searched a word on a page and my script would return "not found". Maybe as an option... But anyway, the sad news is that development is suspended until further notice, as that last release took me much of my time, and it's not even what I would call a big release...

However, I don't prohib you or anyone to change it the way they like it better. :smile:

Much of the changes from 2.5 were made to make my script "acceptable" for userjs.org, not much more.

Thursday, 17. November 2005, 22:54:30

Gspusi

avatar

Banned User

@Luchio
FYI, it seems that 8.50 and 9.0tp1 are handling UHB in different ways.
You might have a look into a issue I experienced and described here:
http://my.opera.com/community/forums/findpost.pl?id=1227013

Friday, 18. November 2005, 20:18:44

Luchio

Burninating!

avatar

Posts: 943

Canada

Thanks for reporting this, Gspusi. I knew there was some bug with uhb and 9.0 tp1, but I will adopt a "wait and see" approach on this, because I don't want to start coding something that might get fixed by Opera themselves in the next releases. I will make sure that UHB works with 9.0 final, but right now that tech preview is far away from a final release.

Sorry for the inconvenience.

Friday, 31. March 2006, 07:45:54

grossdm

avatar

Posts: 3

I am having trouble with associating a keyboard shortcut to UHB. It does not work to activate the UHB, but it does close an open stats/results popup (if I have one from using the toolbar button).
Please help.
P.S. I have Opera version 8.53 and Windows 2000 SP4.

Friday, 2. June 2006, 19:26:06

bmusic

avatar

Posts: 4

Seems to crash the browser with Opera 9 beta 8432 build.

Saturday, 24. June 2006, 17:42:46

Nice script, hower in Opera v9.0 it messes up some of the text it highlights and the text around it...even when I switch the highlights of, the text remains scrambled. Only way to see the text the way it should be is to disable the whole script. (I had UHB 2.1, but in 2.5 it's the same)

see the screenshots:

original: [img]http://img470.imageshack.us/img470/6755/uhboriginal9ke.png
Highlighted: [img]http://img470.imageshack.us/img470/4715/uhbhighlighted9cw.png
After Highlights switched off: [img]http://img470.imageshack.us/img470/885/uhbhighlightsswitchedoff0vu.png

As you can see some of the text gets scrambled...

Thursday, 29. June 2006, 12:06:51

Matic

avatar

Posts: 29

Indeed, same problem here...

Saturday, 1. July 2006, 21:47:41

Big_Mike

avatar

Posts: 45

Hm, strange. After fitting to width (Ctrl+F11) and disabling it again, the garbage disappears and UHB works fine without producing any garbage anymore.

Sunday, 2. July 2006, 03:13:11

Stoen

avatar

Posts: 1109

Search for this in the script
p000_UHFunc_ShowWindowHighlights(window);


replace with
p000_UHFunc_ShowWindowHighlights(window);
var docbody, disp;
if(docbody = document.body) {
   disp = docbody.style.display;
   docbody.style.display = 'none';
   docbody.style.display = disp;
}

Sunday, 2. July 2006, 11:14:19

Thank you very much, that works!

Sunday, 2. July 2006, 11:22:03

Big_Mike

avatar

Posts: 45

Thank you, works fine for me!

Forums » Opera Community » General Opera topics » User JavaScript