2 <textarea name="text" width="480px"><ala><ma></ma></ala></textarea>
4 <script type="text/javascript" charset="utf-8">
7 var id = Math.ceil(Math.random() * 1000000000);
9 var load = function(event, panel) {
10 console.log('loading panel', panel);
12 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
13 $('textarea', panel).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},
19 initCallback: function() {}
21 $(document).unbind('panel:load.' + id, load);
24 var unload = function(event, panel) {
25 console.log('unload event!', panel, self);
27 console.log('unloading panel', self);
28 $(document).unbind('panel:unload.' + id, unload);
32 $(document).bind('panel:load.' + id, load);
33 $(document).bind('panel:unload.' + id, unload);