1 {% load toolbar_tags %}
2 {% toolbar toolbar_groups toolbar_extra_group %}
4 <div class="iframe-container" style="position: absolute; top: 40px; left:0px; right:0px; bottom: 0px;">
5 <textarea name="text">{{ text }}</textarea>
8 <script type="text/javascript" charset="utf-8">
12 var panel = self.contentDiv;
14 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
15 $('textarea', panel).attr('id', textareaId);
17 var texteditor = CodeMirror.fromTextArea(textareaId, {
18 parserfile: 'parsexml.js',
19 path: "{{STATIC_URL}}js/codemirror/",
20 stylesheet: "{{STATIC_URL}}css/xmlcolors.css",
21 parserConfig: {useHTMLKludges: false},
22 onChange: function() {
23 self.fireEvent('contentChanged');
25 initCallback: function(editor) {
27 // Buttons are connected
28 // register callbacks for actions
30 $.fbind(self, self.hotkeyPressed),
31 $.fbind(self, self.isHotkey) );
36 $(texteditor.frame).css({width: '100%', height: '100%'});
37 this.texteditor = texteditor;
41 this.texteditor = null;
45 //refresh: function() { }, // no support for refresh
47 saveInfo: function(saveInfo) {
49 url: "{% url file_xml fileid %}",
51 content: this.texteditor.getCode()
54 $.extend(saveInfo, myInfo);
57 toolbarResized: function() {
58 $('.iframe-container', self.contentDiv).css('top',
59 $('.toolbar', self.contentDiv).outerHeight() );