Add editor: CodePress
| Project: | Wysiwyg |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
I hacked together a working piece of code for the CodePress editor using a stub found here. It's major features are HMTL, PHP, CSS, and JS syntax highlighting, autocomplete, line numbering, and code snippets.
I would like to integrate this with Wysiwyg and since this is new code I was wondering what the best approach would be. Should I create a new project or would you be open to having it reside within this project?
I've attached my working code for people to take a look. Basically install, enable, discover a text area (eg. go to node/add/page), then set the syntax at admin/settings/codepress. Code snippets are triggered by typing something like 'img' and hitting tab.
Hopefully this can find a good home as I think it is a great editor for savvy users.
| Attachment | Size |
|---|---|
| codepress.zip | 70.53 KB |

#1
Whoops, forgot to paste in URL for stub: http://drupal.org/cvs?file=/sandbox/jjeff/codepress/codepress.module
#2
Wysiwyg Editor module still needs some abstraction to support multiple editors. However, when that is implemented, supporting CodePress would be interesting.
Additionally, I want you to point to the first paragraph in http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/jjeff/codep... -- the code of CodePress itself is LGPL and thus, incompatible with d.o's CVS policies. It cannot be committed to drupal.org. (however, the editor integration code can)
#3
Thanks for the quick response sun, I will be on the lookout for updates to Wysiwyg Editor. I noticed the LGPL license as well and will consider it carefully.
#4
#5
Took some time tonight and put together integration for CodePress — everything seems to be working great. Both integration files wrapped up in a zip: /editors/codepress.inc and /editors/js/codepress_editor.js
Hoping it all works well!
#6
I'd like to test it, but http://codepress.org/ seems to be down (at least for me)...
#7
Ya I noticed that too, maybe not a good sign for the Codepress project...
The code is still hosted at SourceForge (I linked to this in the module for the download): http://sourceforge.net/project/platformdownload.php?group_id=186981
#8
Was also looking at some other syntax highlighted editors that seem more active:
#9
#10
Oh well. This editor is pretty lame. Anyway, rewrote it from scratch.
However, one needs to comment out the following two lines at the bottom of codepress.js:
if(window.attachEvent) window.attachEvent('onload',CodePress.run);else window.addEventListener('DOMContentLoaded',CodePress.run,false);
#11
And yes, there are also other options (to be dealt with in separate issues)...
http://marijn.haverbeke.nl/codemirror/
http://los.php5.cz/simple-codearea/
http://www.cdolivet.net/index.php?page=editArea
#12
To get this feature in, someone needs to convince the authors/maintainers of CodePress to remove the offending lines I mentioned in #10. This means, someone has to step up and create an issue in their tracker or communicate with them in other ways.
Marking as postponed until that happened.
#13