2 <textarea name="text" width="480px">{{ text }}</textarea>
4 <script type="text/javascript" charset="utf-8">
6 function resizeEditor(event, panel) {
7 var panel = panel || event.data.panel;
8 $('iframe', panel).height($(panel).height());
11 panel(function(event, panel) {
12 console.log('loading panel', panel);
13 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
14 $('textarea', panel).attr('id', textareaId);
15 var editor = CodeMirror.fromTextArea(textareaId, {
16 parserfile: 'parsexml.js',
17 path: "/static/js/codemirror/",
18 stylesheet: "/static/css/xmlcolors.css",
19 parserConfig: {useHTMLKludges: false},
20 initCallback: function() {}
22 $(window).bind('resize', {'panel': panel}, resizeEditor);
23 resizeEditor(null, panel);
24 }, function(event, panel) {
25 console.log('unloaded xmleditor panel', panel);