1 {% load toolbar_tags %}
4 <div class="iframe-container" style="position: absolute; top: 48px; left:0px; right:0px; bottom: 0px;">
5 <textarea name="text">{{ text }}</textarea>
8 <script type="text/javascript" charset="utf-8">
10 function xmleditor_onload(event, me) {
11 console.log('loading: ', me);
12 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
13 $('textarea', me).attr('id', textareaId);
14 var editor = CodeMirror.fromTextArea(textareaId, {
15 parserfile: 'parsexml.js',
16 path: "/static/js/codemirror/",
17 stylesheet: "/static/css/xmlcolors.css",
18 parserConfig: {useHTMLKludges: false},
20 console.log('Frame is: ', editor.frame);
21 var frame = $(editor.frame)
22 frame.css({width: '100%', height: '100%'});
25 function xmleditor_onunload(event, me) {}
27 panel(xmleditor_onload, xmleditor_onunload);
31 <!-- <script type="text/javascript" charset="utf-8">
33 function resizeEditor(event, panel) {
34 var panel = panel || event.data.panel;
35 $('iframe', panel).height($(panel).height());
38 panel(function(event, panel) {
39 console.log('loading panel', panel);
40 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
41 $('textarea', panel).attr('id', textareaId);
42 var editor = CodeMirror.fromTextArea(textareaId, {
43 parserfile: 'parsexml.js',
44 path: "/static/js/codemirror/",
45 stylesheet: "/static/css/xmlcolors.css",
46 parserConfig: {useHTMLKludges: false},
47 initCallback: function() {}
49 $(window).bind('resize', {'panel': panel}, resizeEditor);
50 resizeEditor(null, panel);
51 }, function(event, panel) {
52 console.log('unloaded xmleditor panel', panel);