I've been playing around with trying to integrate CodePress into Ext. I'll share what I have currently and hopefully get a few fresh eyes to help me fix what's still broken.

To use:

You must download the CodePress library (http://codepress.org) and use as suggested. Add the following code into a file called 'Ext.ux.codepress.js' and put it in the main codepress folder. Instead of
HTML Code:
<script type="text/javascript" src="includes/codepress/codepress.js"></script>
you would then use
HTML Code:
<script type="text/javascript" src="includes/codepress/Ext.ux.codepress.js"></script>
From there, you call it as a form item:
PHP Code:
new Ext.ux.CodePress({
    
id'docadminTemplateEditor'
    
language'html'
    
autoResizetrue
}) 
The main config options for it are:
id: The id of the component
element: If your code is in a textarea element, put the id here
code: If you want to input the code via initialization
language: The language to use
height: The component's height
width: The component's width
autoResize: If you don't enter a width or height and want it to automatically resize (still not perfect)

There are probably quite a few things still wrong with this at this point, but it's a good start and I figured I would put it out there so others can improve on it as well.


Download the file here or check out the example here.