Jifty::Plugin::CodePress
CodePress, web-based source code editor with syntax highlighting
In etc/config.yml
Plugins: - CodePress: {}
In your View do something like:
$action->form_field( 'source', cols => 80, rows => 25, language => 'perl', render_as => 'Jifty::Plugin::CodePress::Textarea', );
or if you are using Template::Declare
render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => 'Jifty::Plugin::CodePress::Textarea', );
Created from https://codepress.svn.sourceforge.net/svnroot/codepress/trunk/stable revision 219 with bunch of local changes to make it play nicer with Jifty.
This involved some hard-coding of paths (because automatic path detection from CodePress doesn't work well with Jifty's expectation of JavaScript code in /js/), addition of CodePress.instances object to track all instances and additional JavaScript event handling using DOM.Events to remove requirement to call CodePress.beforeSubmit from form submit (If you want you can still call it, and it will turn all CodePress editors back to textarea).
/js/
CodePress.instances
DOM.Events
CodePress.beforeSubmit
This also side-stepped problem with original calling schematic which created functions with names from element ids. This was problematic with Jifty because ids are automatically generated and use dashes (-) in them which aren't valid JavaScript function names.
-
There seems to strange interaction between CodePress and Jifty fragments.
http://codepress.org/ - project site
To install Jifty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Jifty
CPAN shell
perl -MCPAN -e shell install Jifty
For more information on module installation, please visit the detailed CPAN module installation guide.