X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b3154a4f81c3a077d8e14ecc5a6826adb60f0548..986cfa5cc52d555d414357aa0e87c9f5a9559ae1:/project/templates/explorer/file_xml.html diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index 66e128de..ad55a88f 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -15,11 +15,7 @@ var lastScroll = -1000; function checkScroll() { - console.log('checkScroll', $('#images').scrollTop(), lastScroll); - if (Math.abs($('#images').scrollTop() - lastScroll) > 300) { - console.log('checking!'); - var container = $('#images'); lastScroll = container.scrollTop(); @@ -36,20 +32,25 @@ setTimeout(checkScroll, 2000); } + function addEditorButton(label, fn) { + $('').click(function(event) { + var text = $('#id_text').getSelection().text; + $('#id_text').replaceSelection(fn(text)); + event.preventDefault(); + }).appendTo('#buttons'); + } + $(function() { $('#id_folders').change(function() { $('#images').load('/images/' + $('#id_folders').val() + '/', function() { lastScroll = -1000; }); }); + + addEditorButton('utwór', function(text) { return '' + text + ''; }); + addEditorButton('akap', function(text) { return '' + text + ''; }); setTimeout(checkScroll, 2000); - - $('#rozdzial-button').click(function(event) { - console.log($('#id_text').getSelection().text); - $('#id_text').replaceSelection('' + $('#id_text').getSelection().text + '', true); - event.preventDefault(); - }); }); {% endblock extrahead %} @@ -60,12 +61,10 @@
ŹródłoHTML
{{ image_folders_form.folders }}
 
-
-

Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.

-
+

Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.

- Rodział +
{{ form.text }}

Użytkownik: {{ form.user }} Opis zmian: {{ form.commit_message }}