Highlights User-defined Text
< Feedback on Text Highlighter - Dynamic
When using regex, the whole match will be highlighted. Is there a chance to make it highlight a group. Example: /de(activate)/ that would highlight activate only when it's preceded by de.
*deactivate
Hi Jenie, I'm sure it's possible if one really understands how regular expression work. Ha ha. Is there a page you can point me to with sample code for it?When using regex, the whole match will be highlighted. Is there a chance to make it highlight a group. Example: /de(activate)/ that would highlight activate only when it's precede by de.
*deactivate
Hi Jefferson, I didn't fully get what you meant, maybe because I'm not that good with codes..
As I understand by using "Match type:Whole word only" your script would put it in something similar to a regex..
/ word1 | word2 | word3 / but highlight the word itself and never the spaces. So I want to do the same thing here only not with spaces but rather whatever I want. Using "Match type: Regular Expression".
In another word in that example, I want to highlight "activate" only if it's a part of the word "deactivate".
Hey Jefferson,
I registered special on this website just to say "Thank you" for modifying this user script. Glad to see this thread is fairly new as well! For the longest time, I have been using "innerHTML" to accomplish this, e.g.:
document.body.innerHTML=document.body.innerHTML.replace(/Justin Boone/g, function(m){return ''+m+''});
But it was far too slow, (especially in Tampermonkey, less in Greasemonkey). I found erosman's original script (on the userscripts.org archive) before I knew of your modification and was sad to see it didn't work 1) In Firefox without me modifying the code, and 2) In Chrome, at all.
But there you were, the hero in my next Google search to see if someone had updated the script. Thank you sir! I'm using this to highlight the most accurate Fantasy Football experts, and my current players on my favorite news websites as well. An example is attached-- this simple kind of functionality sure puts me ahead! :)
I'm really looking forward to any new changes you make to this application. Consider me another beta tester!
I'd like to suggest an "Import" option (as I see you're already planning)-- this would allow us to change them in bulk a lot quicker. I'd also change "hide" to "remove" or "delete" and also place that function in the keyword/highlight drop down. Perhaps a way to re-arrange them as well? (Even if that has to be done in an export/import, it would be handy).
There's only ONE MORE suggestion I have, and that would be some ability to have multiple different types of highlights on the "same" keyword. As you can see in the attachment, I have a border-bottom:2px of a particular border color, to color-code the top experts of 2014 (last year). The same border color corresponds to this year's background color. As you can see, in order to do this I need to create a new set for each of the dozens of possible options. If I try to create another set with the same word criteria, the second one is currently ignored. I don't know if that's tough to fix but it would be awesome!
Anyway, thank you again for taking the initiative to make this "already powerful" idea much more powerful, (and usable!)
Matt
"backcolor":"rgb(2...rder-bottom:#fff600 solid 2px;"
Hi,
Over the past year I've gotten a good amount of feedback about this script, which was largely unchanged from the original by erosman. Users indicated that it needs to be able to handle more than one keyword/style pair, and there also was interest in allowing more advanced matching pattern (regular expressions). I personally found it annoying that the page had to be reloaded after a change. In thinking about how to improve the script, I also thought it would be useful to add buttons to seek within the document to the matches. So with all of that in mind, I present version
1.9.7beta1.9.8beta.The beta should migrate over your existing keyword list and style rules. However, my testing has been limited, so please make a note of those before installing "just in case" something goes wrong.
IF YOU HAVE MADE CHANGES TO THE ACTUAL SCRIPT ITSELF, YOU NEED TO MAKE A BACKUP COPY OF THE SCRIPT; CODE CHANGES CANNOT BE MIGRATED AND WILL BE LOST WHEN UPDATING.
NOTE: THE STYLE RULES NEED TWEAKING TO OVERRIDE SOME SITE STYLES. Please give me your examples of sites where the bar is messed up.
The script is available here: Please see the following script instead: Text Highlight and Seek
I often get multiple install dialogs from my web server and I have no idea why. You can close the extra ones; you don't need to install multiple times.
To get an idea of how it will work, please see the following screen shots:
(1) The script displays a small "H" button in the upper right corner of the page. You can click that button to display the control bar.
(2) You can display a list of the keyword/style sets from the bar. Some samples are included for reference.
(3) Use the Seek button for a set to enable the buttons on the control bar.
(4) and (5) Use the Edit button to open a panel to modify the keywords or associated styles. Note that any color or background-color rules in "Custom" will override the controls above it. Please note: the script does not clean your input! I will need to think about how to help avoid useless keywords for the next pre-release version.
(6) Use the Add New Set button to create a new set.
(7) Use the Options drop-down on the control bar to turn off the "H" button or to not highlight in <pre> and <code> tags.
The "monkey menu" has a option to flush out all of the new keyword/style sets so you can start testing as though it was a fresh install. If the data somehow gets corrupted, you might need to use that. This beta
I look forward to your comments!