X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a11cf903969595b065b46cc991d70c43035af76d..c9355cb6a53e0fa130ebe8458f9bcda3ef0c4a50:/platforma/static/js/main.js diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index b98e1c20..d42af82b 100644 --- a/platforma/static/js/main.js +++ b/platforma/static/js/main.js @@ -661,7 +661,7 @@ function html(element) { } if (editable.is('.annotation-inline-box')) { $('*[x-annotation-box]', editable) - .css({width: 300, position: 'absolute', left: event.clientX - editable.offset().left + 5, top: event.clientY - editable.offset().top + 5}) + .css({position: 'absolute', left: event.clientX - editable.offset().left + 5, top: event.clientY - editable.offset().top + 5}) .show(); } else { $('*[x-annotation-box]').hide(); @@ -715,7 +715,7 @@ function refreshHistory(callback){ +''+ this[1]+'') }); $.unblockUI(); - callback(); + if(callback) callback(); } }); }; @@ -763,13 +763,14 @@ $(function() { CodeMirror.fromTextArea('id_text', { parserfile: 'parsexml.js', path: STATIC_URL + "js/lib/codemirror/", - stylesheet: STATIC_URL + "css/xmlcolors.css", + stylesheet: STATIC_URL + "css/xmlcolors_15032010.css", parserConfig: { useHTMLKludges: false }, - iframeClass: 'xml-iframe', + iframeClass: 'xml-iframe', textWrapping: true, - /* lineNumbers: true, */ + lineNumbers: true, + width: "100%", tabMode: 'spaces', indentUnit: 0, initCallback: function(editor) { @@ -886,15 +887,18 @@ $(function() { $('.vsplitbar').click(function() { if ($('#sidebar').width() == 0) { $('#sidebar').width(480).css({right: 0}).show(); - $('#source-editor, #simple-editor').css({right: 495}); + $('#editor .editor').css({right: 495}); $('.vsplitbar').css({right: 480}).addClass('active'); } else { $('#sidebar').width(0).hide(); - $('#source-editor, #simple-editor').css({right: 15}); + $('#editor .editor').css({right: 15}); $('.vsplitbar').css({right: 0}).removeClass('active'); } $(window).resize(); }); - + + $(window).bind('beforeunload', function(event) { + return "Na stronie mogą być niezapisane zmiany."; + }); });