Attached patch adds color picker integration to codefilter module:

http://bit.ly/1UlAJP

I just wish the highlighting was a bit more fine grained.

Comments

psynaptic’s picture

Status: Active » Needs review

Wrong status.

psynaptic’s picture

StatusFileSize
new4.72 KB

Missing hook_perm!

thedavidmeister’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

Wouldn't it be better to use ini_get() for the default colours and ini_set() to enforce the new colours, rather than writing a new function to search and replace over an already-parsed string?

Also, this patch essentially introduces a new dependency on the colour module if you want to edit the colours of your syntax highlighting through codefilter. I think if you want this functionality it would be better to start with a variable_set() and variable_get() style wrapper around the php ini_set() and ini_get() and *then* layer the colour picker on top of that.

Hope you don't mind that I've bumped this up a major version.

cameron tod’s picture

Feel like making a patch? ;)

thedavidmeister’s picture

I just ended up sticking my ini_set() calls straight in settings.php.

Just providing a review for the existing patch, not rewriting it at this point. It does need work though as it's currently re-implementing functionality that php implements natively in a way that is harder to maintain and slower performance.

cameron tod’s picture

Status: Needs work » Postponed

If I was going to implement this, I would create a submodule called something like "codefilter_color". The submodule would implement a color picker admin interface, which would then set the colors for each value (below) using ini_set() at runtime.

highlight.bg
highlight.comment
highlight.default
highlight.html
highlight.keyword
highlight.string

Postponing until the bug queue is a bit more under control, and we have some more tests written.

thedavidmeister’s picture

does it need to be a whole submodule?

seems like an .inc file that's only loaded when a supported colorpicker module is enabled would be more than enough.

pbonnefoi’s picture

cam8001,
I have created a submodule for this called codefilter_color with an admin interface not using ini_set but str_replace for each changed color.

I've sent you a message about this.