Discussions » Creation Requests

[SOLVED] Highlighter multiple categories

§
Posted: 2018-05-31
Edited: 2018-06-07

[SOLVED] Highlighter multiple categories

Hi, I would like a script for highlight words with some categorie and custom css for every categories. Example :

  1. Categorie Disney (blue):
  2. Mickey
  3. Minnie
  4. Daisy
  5. etc
  6. Categorie Pixar (green) :
  7. WallE
  8. Wall E
  9. etc
  10. DreamWorks (red)
  11. Shrek
  12. Fiona
  13. etc

I would like use it in a tchat (in JS I think) refresh every 1 second. I need a script easy to use. I can show you an example ^^ I can pay for this script (20€ it's a good price ?).

Really, really, thanks !

Sorry for my bad english :wink:

§
Posted: 2018-05-31

But I thought that Fiona and Shrek are in one weight category :o

§
Posted: 2018-05-31
Edited: 2018-05-31

I looked for a solution among existing scripts, but didn't find anything suitable. Tomorrow I'll try to write such script myself

§
Posted: 2018-06-01
Edited: 2018-06-02

something like this

// ==UserScript==
// @name        words hilite
// @namespace   trespassersW
// @description highligts some words 
// @include https://greasyfork.org/en/forum/discussion/*
// @license MIT
// @run-at document-end
// @grant unsaveWindow
// ==/UserScript==
function stickStyle(css){
 var s=document.createElement("style"); s.type="text/css";
 s.appendChild(document.createTextNode(css));
 return (document.head||document.documentElement).appendChild(s);
}
stickStyle('\
.hwB {color:blue !important;}\
.hwG {color:green !important;}\
.hwR {color:red !important;}\
');
var cC=0;
function wh(H,r,c){
   return H.replace(r,
   function(m){
    cC++;  return ''+m+'';
   });
}
var  H= document.body.innerHTML;
 H=  wh(H,/Mickey|Minnie|Daisy/g, 'hwB');
 H=  wh(H,/WallE|Wall E/g, 'hwG');
 H=  wh(H,/Shrek|Fiona/g, 'hwR');
 if(cC) document.body.innerHTML=H;
edited 2018.06.02

§
Posted: 2018-06-01

Thanks, but this doesn't work :/

§
Posted: 2018-06-02
Edited: 2018-06-02

Hmm, script was tested on this page in Firefox. 2018.06.02. The code of script was slightly modified.

§
Posted: 2018-06-02

You can install it from github

§
Posted: 2018-06-02
Edited: 2018-06-02

Hi, thanks for answer :) The script work in html page, but not in the tchat (i send you a private message with the link). This one work (but not everywhere) but only for one categorie : https://greasyfork.org/fr/scripts/3719-text-highlighter-dynamic

§
Posted: 2018-06-03
Edited: 2018-06-03
§
Posted: 2018-06-03

Of course you should correct this script and specify proper @include statement that refers to the site you are interested

§
Posted: 2018-06-03

Really good ! All what I want ! :smiley: But :blush: This doesn't work everywhere. I think because it's protected. I can't select text (and text can't be highlight i think). It's possible to forced highlight ?

Too, can I add blink for a set ? Like this : #test{ animation: Test 1s infinite; } @keyframes Test{ 0%{opacity: 1;} 50%{opacity: 0;} 100%{opacity: 1;} } This will be verry good for shocking words.

§
Posted: 2018-06-03

Please addres your questions to the author, Jefferson Sher. I wash my hands of it B)

§
Posted: 2018-06-03
Edited: 2018-06-03

This doesn't work everywhere. I think because it's protected. I can't select text (and text can't be highlight i think). In these cases I use the bookmarklet

javascript:
(function () {
 var D = document,
 C = D.createElement("style");
 C.type = "text/css";
 C.appendChild(D.createTextNode("body,body *{-webkit-user-select:text!important;-moz-user-select:text!important;}"));
 (D.head || D.documentElement).appendChild(C);
 function R(a) {
  var n,
  ona = "on" + a;
  window.addEventListener(a, function (e) {
   for (n = e.originalTarget; n; n = n.parentNode)
    n[ona] = null;
  }, true);
  window[ona] = null;
  D[ona] = null;
  if (D.body)
   D.body[ona] = null;
 }
 R("click");
 R("mousedown");
 R("mouseup");
 R("selectstart");
 window.status = 'selection enabled';
})();

§
Posted: 2018-06-03

Ok. But how to use it ? :p

§
Posted: 2018-06-04

Create new bookmark, insert the above code as Location

§
Posted: 2018-06-04

I'm sorry, but i don't know where :$

§
Posted: 2018-06-04

Forgot to say, bookmarlet was found somewhere here: https://www.squarefree.com/bookmarklets/

Deleted user 15079
§
Posted: 2018-06-04

Hey there! I had some free time this weekend and tossed something together. I'm not sure if this is for the correct website or if this is exactly what you're looking for. Check out the video demo and if you are interested let me know.

  • GUI
  • Regex Support
  • Optional Custom CSS
  • Automatically highlights new tweets
  • Does not break anything (links, etc)

Video Demo Link video is not in real-time in order to show features in a reasonable time

This would also have support as I plan on eventually making a full highlighter tool for any site. This version would contain the specific requirements for this website while using the same base system as the more generic highlighter.

§
Posted: 2018-06-04

Amazing ! I just need try it where i need :)

Deleted user 15079
§
Posted: 2018-06-04
Edited: 2018-06-04

Can you send me a link? I can take a look and fix any issues if they pop up. I'm curious about the text selection issue you were talking about. If it looks good I can send it your way to further check out.

§
Posted: 2018-06-05

Send ^^

Deleted user 15079
§
Posted: 2018-06-05

Okay, I have found the problem that you're having. I will update you when done.

§
Posted: 2018-06-05
Edited: 2018-06-05

I have an other member who work for me Too late, sorry :)

§
Posted: 2018-06-05

@Drawbackz a dit : Okay, I have found the problem that you're having. I will update you when done.

For free ? :open_mouth:

§
Posted: 2018-06-05

I can pay for this script (20€ it's a good price ?). leave your €20 for your juice (not beer!) , that's freeware o:)

§
Posted: 2018-06-05
Edited: 2018-06-05

@trespassersW a dit : leave your €20 for your juice (not beer!) , that's freeware o:)

Huuuuuush, this is a joke :p EDIT: This script is freeware ? Where i can found it to try ? :)

@Drawbackz, I can leave you my 20€ for the script :) But i need it work where i need ;)

Deleted user 15079
§
Posted: 2018-06-05
Edited: 2018-06-05

I will have it for you in a bit. I'm just having an issue with one small thing... Once I wrap it up it should work on anything you see that I can't. Dang thing works for everything I see but it's doing something weird making me have to force the highlight on the usernmes sometimes (not the refresh). The requirements changed a bit also since we are now goin to be highlighting buttons also and it can be a little tough making sure it is fast and not going to nuke your browser. It is running very fast and clean just the one little thing I have to wrap up.

§
Posted: 2018-06-05

I can wait ^^ But I have some ask :

  1. I don't need right-click (an option (ON-OFF) will be great). If you test the website tchat, you can see that you use right-click to close room or private message. I don't need context menu if I must make a choice.
  2. I need use my keyboard (Up, Down and Esc). This is a shortcut to select nickname in a room for moderator only.

Thanks for your job ! :)

Deleted user 15079
§
Posted: 2018-06-05

I put a bandaid on it for now it is working 100%. I will send you a message and we can make sure all is well for you.

Post reply

Sign in to post a reply.