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