1 {% load toolbar_tags %}
3 <div class="iframe-container" style="position: absolute; top: 40px; left:0px; right:0px; bottom: 0px;">
4 <textarea name="text">{{ text }}</textarea>
9 <script type="text/javascript" charset="utf-8">
14 var panel = self.contentDiv;
16 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
17 $('textarea', panel).attr('id', textareaId);
19 var texteditor = CodeMirror.fromTextArea(textareaId, {
20 parserfile: 'parsexml.js',
21 path: "{{STATIC_URL}}js/codemirror/",
22 stylesheet: "{{STATIC_URL}}css/xmlcolors.css",
23 parserConfig: {useHTMLKludges: false},
24 onChange: function() {
25 self.fireEvent('contentChanged');
27 initCallback: function(editor) {
29 // Buttons are connected
30 // register callbacks for actions
32 $.fbind(self, self.hotkeyPressed),
33 $.fbind(self, self.isHotkey) );
38 $(texteditor.frame).css({width: '100%', height: '100%'});
39 this.texteditor = texteditor;
43 this.texteditor = null;
47 //refresh: function() { }, // no support for refresh
49 saveInfo: function(saveInfo) {
51 url: "{% url file_xml fpath %}",
53 content: this.texteditor.getCode()
56 $.extend(saveInfo, myInfo);
59 toolbarResized: function() {
60 $('.iframe-container', self.contentDiv).css('top',
61 $('.toolbar', self.contentDiv).outerHeight() );