X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3b370c78b8ac967a56be8321bbd88618a52aa017..c7917ce18f0f62eac89e1eb4b6ae6d8c48133600:/project/templates/explorer/panels/xmleditor.html diff --git a/project/templates/explorer/panels/xmleditor.html b/project/templates/explorer/panels/xmleditor.html index ef5976c5..350f6e85 100644 --- a/project/templates/explorer/panels/xmleditor.html +++ b/project/templates/explorer/panels/xmleditor.html @@ -1,10 +1,34 @@ {% load toolbar_tags %} -<div class="panel"> - {% toolbar %} - <textarea name="text" width="480px">{{ text }}</textarea> +{% toolbar %} +<div class="iframe-container" style="position: absolute; top: 48px; left:0px; right:0px; bottom: 0px;"> + <textarea name="text">{{ text }}</textarea> </div> + <script type="text/javascript" charset="utf-8"> +(function() { + function xmleditor_onload(event, me) { + $.log('loading: ', me); + var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000); + $('textarea', panel).attr('id', textareaId); + var editor = CodeMirror.fromTextArea(textareaId, { + parserfile: 'parsexml.js', + path: "/static/js/codemirror/", + stylesheet: "/static/css/xmlcolors.css", + parserConfig: {useHTMLKludges: false}, + }) + $.log('Frame is: ', editor.frame); + var frame = $(editor.frame) + frame.css({width: '100%', height: '100%', background: 'yellow'}); + }; + + function xmleditor_onunload(event, me) {} + + panel(xmleditor_onload, xmleditor_onunload); +})(); +</script> + +<!-- <script type="text/javascript" charset="utf-8"> (function() { function resizeEditor(event, panel) { var panel = panel || event.data.panel; @@ -12,7 +36,7 @@ } panel(function(event, panel) { - console.log('loading panel', panel); + $.log('loading panel', panel); var textareaId = 'xmleditor-' + Math.ceil(Math.random() * 1000000000); $('textarea', panel).attr('id', textareaId); var editor = CodeMirror.fromTextArea(textareaId, { @@ -25,7 +49,7 @@ $(window).bind('resize', {'panel': panel}, resizeEditor); resizeEditor(null, panel); }, function(event, panel) { - console.log('unloaded xmleditor panel', panel); + $.log('unloaded xmleditor panel', panel); }) })(); -</script> +</script> -->