1 {% load toolbar_tags %}
4 <div class="change-font-size" style="">
5 <div class="decrease-font-size">A<sup>-</sup></div>
6 <div class="increase-font-size">A<sup>+</sup></div>
9 <div class="iframe-container" style="position: absolute; top: 41pt; left:0px; right:0px; bottom: 0px;">
10 <textarea name="text">{{ text }}</textarea>
16 <script type="text/javascript" charset="utf-8">
21 var panel = self.contentDiv;
23 var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000);
24 $('textarea', panel).attr('id', textareaId);
26 var texteditor = CodeMirror.fromTextArea(textareaId, {
27 parserfile: 'parsexml.js',
28 path: "{{STATIC_URL}}js/codemirror/",
29 stylesheet: "{{STATIC_URL}}css/xmlcolors.css",
30 parserConfig: {useHTMLKludges: false},
31 onChange: function() {
32 panel.trigger('panel:contentChanged', self);
34 initCallback: function(editor) {
36 // Buttons are connected
37 // register callbacks for actions
40 /* texteditor.grabKeys(function(event) {
41 if (keys[event.keyCode]) {
42 keys[event.keyCode]();
44 }, function(event) { return event.altKey && keys[event.keyCode]; }); */
48 $(texteditor.frame).css({width: '100%', height: '100%'});
50 $('#toolbar-buttons li').wTooltip({
53 border: "1px solid #7F7D67",
55 background: "#FBFBC6",
61 $('.decrease-font-size', panel).click(function() {
62 var frameBody = $('body', $(texteditor.frame).contents());
63 console.log(frameBody.css('font-size'));
64 frameBody.css('font-size', parseInt(frameBody.css('font-size')) - 2);
67 $('.increase-font-size', panel).click(function() {
68 var frameBody = $('body', $(texteditor.frame).contents());
69 console.log(frameBody.css('font-size'));
70 frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
72 this.texteditor = texteditor;
76 this.texteditor = null;
80 //refresh: function() { }, // no support for refresh
82 saveInfo: function(saveInfo) {
84 url: "{% url file_xml fpath %}",
86 content: this.texteditor.getCode()
89 $.extend(saveInfo, myInfo);