Shoutbox

[release] JavaScript and PHP syntax highlighting... - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [release] JavaScript and PHP syntax highlighting... (/showthread.php?tid=72487)

[release] JavaScript and PHP syntax highlighting... by the DtTvB on 03-09-2007 at 11:01 AM

This script is not yet stable. Please report bugs and suggestions!

--=--=--=--=--=--=--=--=--=--=--=--

Download: http://dttvb.yi.org/js-php-hi.plsc

Example:
[Image: asdhas.gif]

--=--=--=--=--=--=--=--=--=--=--=--

This script will highlight JavaScript and PHP syntax.

Features:

  • Uhhh...
  • Highlight strings, comments, and inline regexp. Does not use regular expression, so it should handle strings more correctly.[/font]
  • Highlight numbers.
  • Highlight keywords.
  • Highlight members. It highlights thing that follows '.', '::', or '->'. It also highlight something before ':', but not '::'.
  • Highlight functions. Something before '('.
  • Highlight parentheses. ( ) { } [ ].
  • Highlight PHP variables. Something after $.

--=--=--=--=--=--=--=--=--=--=--=--

How to use...
Use the /code command.
/code <a code to highlight>

--=--=--=--=--=--=--=--=--=--=--=--

If you don't like the colors, you can change them by editing the script. Near the line #21.
I still use the old formatting way because some of my friends prefer not to use WLM. But it could be easily changed!


the DtTvB
.
RE: [release] JavaScript and PHP syntax highlighting... by matty on 03-09-2007 at 03:55 PM

If you don't mind, may I use this for a script I am working on?

I will give credit where credit is due, this will just save me from having to do it myself basically.


RE: [release] JavaScript and PHP syntax highlighting... by mickael9 on 03-09-2007 at 07:55 PM

It doesn't higlight keywords in strings or comments and that's really good.

Nice script :)


RE: [release] JavaScript and PHP syntax highlighting... by the DtTvB on 03-10-2007 at 02:29 AM

Sure, you can! ;)

Thank you everyone for comments!


RE: [release] JavaScript and PHP syntax highlighting... by Matti on 03-10-2007 at 09:13 AM

That's great! I'm certainly going to use that when someone asks me for some code! :D

Great job, and welcome to the forums! (y)


RE: [release] JavaScript and PHP syntax highlighting... by Eddie on 03-10-2007 at 10:21 AM

Welcome to the forums :) Very nice script :)