Change text color after symbol

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Change text color after symbol

Post by Brighto » Wed May 16, 2018 1:57 am

Essentially I'm looking for a way to change a line of text's color if it starts with a specific character; ">" for example.

I've looked around and can't find any working solution for this. I think this was doable previously through an extension that allowed the censor function to use bbcode.

Any other solutions?

Thanks.

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Sun May 20, 2018 1:07 am

bump

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 23, 2018 8:15 am

bump

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Tue May 29, 2018 12:02 am

bump

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 7:52 am

Here is an approach with Javascript only, using my new extension "Extra Javascript".

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 30, 2018 10:24 am

martti wrote:
Wed May 30, 2018 7:52 am
Here is an approach with Javascript only, using my new extension "Extra Javascript".
Looks promising, but I can't get it to work for some reason. I can edit and save the file no problem, but nothing seems to be happening.

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 12:33 pm

Brighto wrote:
Wed May 30, 2018 10:24 am

Looks promising, but I can't get it to work for some reason. I can edit and save the file no problem, but nothing seems to be happening.
And you have set the "Script names" to viewtopic,posting,search ?

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 30, 2018 12:44 pm

martti wrote:
Wed May 30, 2018 12:33 pm
Brighto wrote:
Wed May 30, 2018 10:24 am

Looks promising, but I can't get it to work for some reason. I can edit and save the file no problem, but nothing seems to be happening.
And you have set the "Script names" to viewtopic,posting,search ?
All as you posted:

Image

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 12:50 pm

You need to install the CodeMirror extension too. Just using the textarea is untested (I should put a warning about this in the "Extra Javascript" extension).
Last edited by martti on Wed May 30, 2018 12:53 pm, edited 1 time in total.

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 30, 2018 12:52 pm

I've installed that too.

Image

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 12:55 pm

Brighto wrote:
Wed May 30, 2018 12:52 pm
I've installed that too.
It might not be correctly installed, because your editor is just a textarea. Is the CodeMirror (helper ext) enabled? Does the "CodeMirror Configuration" show up under "Extensions"?

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 12:57 pm

Brighto wrote:
Wed May 30, 2018 12:52 pm
I've installed that too.

Image
Uhm, the editor doesn't load. This might have to do with permissions.

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 30, 2018 12:57 pm

Yep, it's there:

Image

Image

User avatar
martti
Registered User
Posts: 561
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Change text color after symbol

Post by martti » Wed May 30, 2018 1:12 pm

Can you see if
ext/marttiphpbb/codemirror/codemirror/lib/codemirror.js?v=5.37.0

is loading? (In the "Inspector" tool > Network of your browser)

(I gotta go now for a few hours btw)

Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Change text color after symbol

Post by Brighto » Wed May 30, 2018 1:18 pm

martti wrote:
Wed May 30, 2018 1:12 pm
Can you see if
ext/marttiphpbb/codemirror/codemirror/lib/codemirror.js?v=5.37.0

is loading? (In the "Inspector" tool > Network of your browser)

(I gotta go now for a few hours btw)
No, I don't think it is.

Image

And no problem, sleeping soon anyway.

Post Reply

Return to “Extension Requests”

Who is online

Users browsing this forum: koraldon and 9 guests