Opened 13 years ago

Closed 10 years ago

#861 closed enhancement (inactive)

HTML Syntax highlighting in source view

Reported by: koto Owned by:
Priority: normal Milestone: 0.97
Component: Plugins Version: trunk
Severity: normal Keywords: syntax highlighting coloring
Cc:

Description

I found some really clever JS library that could make it possible to implement syntax coloring in source view for a text area.

The library is described here: http://syntaxhighlighting.blogspot.com/2006/08/real-time-syntax-highlighting.html

The code itself is small, clean, "unobtrusive" and pretty much self-documenting. The license is very liberal - we just have to mention the original author.

I will try to look on how to implement this to Xinha, but obviously I would very much recommend any help as I didn't yet work with code for Xinha core and wish to avoid any possible traps hidden.

Does anyone have any suggestions? Is this needed at all? Should it be implemented as a plugin or rather merged into the core?

Attachments (2)

Codepress.zip (20.4 KB) - added by gocher 13 years ago.
Codepress plugin
codepress.zip (19.9 KB) - added by gocher 13 years ago.
new Codepress plugin (it works with IE too)

Download all attachments as: .zip

Change History (18)

comment:1 Changed 13 years ago by koto

"recommend any help" -> "welcome any help" of course ;)

comment:2 Changed 13 years ago by ray

Great idea. I would love to see it. This would grade up Xinha really much.

I especially like the idea to insert a secret character and scroll to that position when you change the view. This is an essential feature I've been missing all the time and should be integrated in the core in every case.

comment:3 Changed 13 years ago by mharrisonline

What a cool idea!

Why not make it a plugin like QuickTag?, and have it display the way Linker does? That would probably be much easier than changing core Xinha.

Also, one limitation that I see is that it can't line wrap, so some people may need the original code view left available or paragraphs of text will scroll right several screen widths. Also, if it was a plugin, it could wholly retain its LGPL license, which requires you to comment your code changes, etc. As a plugin its license would not interfere with Xinha's license because the code would be seperate.

It would be great if you could tab between html, javascript, php, etc. syntax highlighting.

comment:4 Changed 13 years ago by mharrisonline

Actually, I meant EditTag?, not QuickTag? (although it would be cool if QuickTag?, FindReplace? and InsertSnippets? worked in code view...).

I noticed that the URL has moved to http://codepress.fermads.net/

comment:5 Changed 13 years ago by guest

  • Milestone set to 2.0
  • Priority changed from low to high

comment:6 Changed 13 years ago by mharrisonline

If you did want to pursue this as a plugin, you could decide to have the button take the place of the regular code view button...

comment:7 Changed 13 years ago by gocher

Hello here is the Codepress plugin to see if it is the right tool to get Syntax highlighting with Xinha!

Changed 13 years ago by gocher

Codepress plugin

comment:8 Changed 13 years ago by ray

koto,

are you working on this?

comment:9 Changed 13 years ago by mharrisonline

It works great in FireFox?, but not at all in IE6. As soon as the popup window appears, you get JavaScript? errors for codepress.html:

Line 8: "CodePress?" is undefined

and then

Line 122: 'languages[...],length' is null or not an object

Then the window opens with no highlighting.

By the way, how is the "Delete" button different than the "Cancel" button?

Changed 13 years ago by gocher

new Codepress plugin (it works with IE too)

comment:10 Changed 13 years ago by gocher

The new version of the plugin works with IE too.

The "Delete" button deletes the code!

comment:11 Changed 13 years ago by ray

In IE(7):

  • There seems to be no hilighting of the code
  • The icon doesn't appear next to htmlmode, but at the beginning of the toolbar
  • The icon is the normal htmlmode icon

Please have a look at this ticket: http://xinha.python-hosting.com/ticket/900[[BR]]
It was cool if you could add this behaviour (which is actually inspired by codepress)

comment:12 Changed 12 years ago by ray

  • Component changed from Xinha Core to Plugins
  • Milestone changed from 2.0 to 0.96
  • Owner gogo deleted
  • Priority changed from high to normal

comment:13 Changed 11 years ago by ray

  • Milestone changed from 0.96 to 0.97

comment:14 Changed 11 years ago by guest

Codepress is abandonware.

How about CodeMirror? instead?
http://marijn.haverbeke.nl/codemirror/

Adam J

comment:15 Changed 10 years ago by guest

This is an awesome Idea I haven't really messed with the core on xinha and only developed a small plugin for myself. I will try and then post my results and see if it is acceptable.

comment:16 Changed 10 years ago by gogo

  • Resolution set to inactive
  • Status changed from new to closed

I don't think anybody will get around to this, it introduces a lot of complexity for mnimal advantage.

Closing.

Note: See TracTickets for help on using tickets.