Opened 16 years ago
Closed 16 years ago
#9173 closed task (blessed) (fixed)
Add CodePress syntax highlighting to Theme and Plugin editors
Reported by: | beaulebens | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | UI | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Attached is a patch to add syntax highlighting to both the Plugin and Theme editors using the aptly-named, yet technically unrelated "CodePress" javascript library.
You'll want to download v0.9.6 of CodePress from here: http://codepress.sourceforge.net/download/codepress-v.0.9.6.zip and put it here: /wp-includes/js/codepress/
Currently, I have enabled highlighting for CSS, JS, PHP, HTML and TXT files. CodePress technically supports a few others, but you can actually only ever edit PHP or CSS files through the current editors, so I figured that was plenty.
After you have the JS in place, apply the patch and load up either editor and you should see syntax highlighting immediately.
You can also load the CodePress library on any other page/plugin/etc using:
wp_enqueue_script( 'codepress' );
Attachments (4)
Change History (14)
#1
@
16 years ago
BTW: as per the CodePress library, this doesn't work on Safari or Opera, so it just stays the same as currently (normal textarea).
@
16 years ago
Updating patch to avoid problems since documentation lookups were added (#9184). Don't forget to download CodePress itself!
@
16 years ago
New patch prevents CP from loading at all in WebKit browsers (not supported) and also avoids a JS error when CP wasn't cached in your browser. Please test/confirm. Esp on Opera/IE/Chrome
#4
@
16 years ago
CodePress looks pretty in FF :)
Unfortunately for me, It doesnt support Opera, Fair enough.
However, Its marking the Textarea as disabled for me under Opera.
#5
@
16 years ago
Seems to work in Opera 9.63 (current stable) but if it fails in 10.0 we will have to exclude Opera too.
#6
@
16 years ago
Hm, If its working for you under 9.63(Really need to remember i'm running alpha's..) then all should be fine. It'll either be a regression in opera, or a bug in codepress (That i'll investigate myself at some point)
#7
@
16 years ago
Actually it seem to have a line breaks problem in Opera and some (minor) glitches in FF 3. The latest stable release of CodePress is from couple of years ago and it looks like development has almost stopped.
Perhaps we should switch to CodeMirror that is being actively developed and supports all newer browsers, despite that it's a lot heavier.
Add CodePress support. You MUST download the CodePress library itself separately still.