1 {% load toolbar_tags %}
3 <div class="change-font-size" style="">
4 <div class="decrease-font-size">A<sup>-</sup></div>
5 <div class="increase-font-size">A<sup>+</sup></div>
8 <div class="iframe-container" style="position: absolute; top: 41pt; left:0px; right:0px; bottom: 0px;">
9 <textarea name="text">{{ text }}</textarea>
15 <script type="text/javascript" charset="utf-8">
20 var panel = self.contentDiv;
22 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
23 $('textarea', panel).attr('id', textareaId);
25 var texteditor = CodeMirror.fromTextArea(textareaId, {
26 parserfile: 'parsexml.js',
27 path: "{{STATIC_URL}}js/codemirror/",
28 stylesheet: "{{STATIC_URL}}css/xmlcolors.css",
29 parserConfig: {useHTMLKludges: false},
30 onChange: function() {
31 self.fireEvent('contentChanged');
33 initCallback: function(editor) {
35 // Buttons are connected
36 // register callbacks for actions
38 $.fbind(self, self.hotkeyPressed),
39 $.fbind(self, self.isHotkey) );
43 $(texteditor.frame).css({width: '100%', height: '100%'});
47 $('.decrease-font-size', panel).click(function() {
48 var frameBody = $('body', $(texteditor.frame).contents());
49 console.log(frameBody.css('font-size'));
50 frameBody.css('font-size', parseInt(frameBody.css('font-size')) - 2);
53 $('.increase-font-size', panel).click(function() {
54 var frameBody = $('body', $(texteditor.frame).contents());
55 console.log(frameBody.css('font-size'));
56 frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
58 this.texteditor = texteditor;
62 this.texteditor = null;
66 //refresh: function() { }, // no support for refresh
68 saveInfo: function(saveInfo) {
70 url: "{% url file_xml fpath %}",
72 content: this.texteditor.getCode()
75 $.extend(saveInfo, myInfo);