I am trying to create an addon using codemirror to provide syntax highlighting etc for a style.php (for style sheet editing in the couch end).
I thought this would be relatively simple to implement but it's not working for some reason - maybe fresh eyes can help. I've attached the addon zip and below is my style.php code
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:content_type 'text/css' />
<cms:template clonable='0' nested_pages='0' executable='0' title='Style'>
<cms:editable name='codemirror' type='message'>
<style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.CodeMirror-activeline-background {background: #e8f2ff !important;}
</style>
<link rel="stylesheet" href="<cms:show k_couch_link/>addons/codemirror/lib/codemirror.css">
<script src="<cms:show k_couch_link/>addons/codemirror/lib/codemirror.js"></script>
<script src="<cms:show k_couch_link/>addons/codemirror/mode/css/css.js"></script>
<script src="<cms:show k_couch_link/>addons/codemirror/addon/selection/active-line.js"></script>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("f_code"), {
mode: "application/xml",
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true
});
</script>
</cms:editable>
<cms:editable name='code' label='CSS Code' type='textarea' />
</cms:template>
<?php COUCH::invoke(); ?>