1 /*global Class CodeMirror render_template panels */
2 var XMLView = Class.extend({
4 template: 'xml-view-template',
7 init: function(element, template) {
8 this.element = $(element);
9 this.template = template || this.template;
10 this.element.html(render_template(this.template, {}));
13 this.editor = CodeMirror.fromTextArea($('textarea', this.element)[0], {
14 parserfile: 'parsexml.js',
15 path: "/static/js/lib/codemirror/",
16 stylesheet: "/static/css/xmlcolors.css",
17 parserConfig: {useHTMLKludges: false},
18 // onChange: function() {
19 // self.fireEvent('contentChanged');
21 initCallback: function(editor) {
22 console.log('whatever');
24 // $.fbind(self, self.hotkeyPressed),
25 // $.fbind(self, self.isHotkey)
27 editor.setCode('Ala ma kota a kot ma AlÄ™!');
30 console.log(this.editor);
31 $(this.editor.frame).css({width: '100%', height: '100%'});
40 panels.push({name: 'xml', klass: XMLView});