Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [DHTML] Real Time Syntax Highlighting JavaScript

  1. #1
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default [DHTML] Real Time Syntax Highlighting JavaScript

    1) CODE TITLE: Real Time Syntax Highlighting JavaScript

    2) AUTHOR NAME/NOTES: Fernando M.A.d.S.

    3) DESCRIPTION: This is a code editor with syntax highlighting engine written in JavaScript that colors text in real-time while it is being typed in the browser.
    The example shows syntax highlighting for Java and HTML. Other languages can be easily implemented, its a matter of some regular expressions.

    Tested with Firefox 1.5 and Internet Explorer 6 only.

    4) URL TO DEMO AND CODE:
    http://syntaxhighlighting.blogspot.c...hlighting.html
    Last edited by fermads; 08-20-2006 at 09:07 PM.

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Looked nice until a clicked in the textarea, and my browser crashed. The things I give up to beta test firefox...

  3. #3
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    mm... this script is really new.. and i dont find anything like this around..
    I tested only in Firefox 1.5.0.6 and IE6

  4. #4
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    yup, crashed FF2b1 again. It's important to note that as I'm using a beta browser it may not be your fault.

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Still a nice script, though.
    - Mike

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It works in the stable version of FX. The only bug I can see is that it temporarily displays the character 0x7f when it recolours something or starts a new line. It's not a serious problem, but just noticeable enough to be annoying

    Otherwise, very good job indeed.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Twey, your right.
    this character is part of the "system" that puts the cursor/caret back to its position after replacing/coloring the text.
    But here its fast enough that i can't see it cuz its replaced instantly.
    Maybe I shold try to change it to a less visible character.

  8. #8
    Join Date
    Jun 2006
    Posts
    182
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default

    Wow, now that's realy cool, nice job fermads

    But you shouldn't use image as the gutter. Line numbers and lines don't match (IE6)

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Maybe I shold try to change it to a less visible character.
    Yes... how about \0? That shouldn't show on most systems.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    ThanX DimX

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •