Poprawki do file upload i toolbar.
[redakcja.git] / project / templates / explorer / panels / xmleditor.html
index 0f26ccf..c818550 100644 (file)
@@ -25,8 +25,8 @@ panel_hooks = {
 
                var texteditor = CodeMirror.fromTextArea(textareaId, {
             parserfile: 'parsexml.js',
 
                var texteditor = CodeMirror.fromTextArea(textareaId, {
             parserfile: 'parsexml.js',
-            path: "/static/js/codemirror/",
-            stylesheet: "/static/css/xmlcolors.css",
+            path: "{{STATIC_URL}}js/codemirror/",
+            stylesheet: "{{STATIC_URL}}css/xmlcolors.css",
             parserConfig: {useHTMLKludges: false},
             onChange: function() {
                                panel.trigger('panel:contentChanged', self);
             parserConfig: {useHTMLKludges: false},
             onChange: function() {
                                panel.trigger('panel:contentChanged', self);
@@ -35,17 +35,7 @@ panel_hooks = {
                 // Editor is loaded
                 // Buttons are connected
                 // register callbacks for actions
                 // Editor is loaded
                 // Buttons are connected
                 // register callbacks for actions
-                $(document).bind("ui:action:INSERT_TAG", function(event, data) {
-                    var tag = data;
-                    var text = texteditor.selection();
-                    editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
-                    if (text.length == 0) {
-                        var pos = texteditor.cursorPosition();
-                        texteditor.selectLines(pos.line, pos.character + tag.length + 2);
-                    }
-                    
-                    $(document).trigger('panel:contentChanged', self);
-                });
+                
 
 /*                texteditor.grabKeys(function(event) { 
                     if (keys[event.keyCode]) {
 
 /*                texteditor.grabKeys(function(event) { 
                     if (keys[event.keyCode]) {
@@ -64,7 +54,7 @@ panel_hooks = {
                 opacity: 0.9, 
                 background: "#FBFBC6", 
                 padding: "1px",
                 opacity: 0.9, 
                 background: "#FBFBC6", 
                 padding: "1px",
-                fontSize: "12px",
+                fontSize: "12px"
             }
         });
 
             }
         });
 
@@ -78,9 +68,8 @@ panel_hooks = {
             var frameBody = $('body', $(texteditor.frame).contents());
             console.log(frameBody.css('font-size'));
             frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
             var frameBody = $('body', $(texteditor.frame).contents());
             console.log(frameBody.css('font-size'));
             frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
-        });
-        
-               this.texteditor = texteditor;
+        });        
+        this.texteditor = texteditor;
     },
 
        unload: function() { 
     },
 
        unload: function() {