From: zuber Date: Fri, 14 Aug 2009 15:15:16 +0000 (+0200) Subject: Synchroniczne przewijanie obrazków z galerii skanów oraz tekstu w edytorze. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/1e1651db11ec96ad6cf29bdf2f4db4fea80d42f4?ds=sidebyside Synchroniczne przewijanie obrazków z galerii skanów oraz tekstu w edytorze. --- diff --git a/project/static/css/master.css b/project/static/css/master.css index 7c38ea0b..79820591 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -76,7 +76,7 @@ label { border: 1px solid #999; } -#images { +#images-wrap { float: left; width: 49%; height: 480px; diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index b408cc5e..401d6893 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -20,19 +20,27 @@ $('#images').data('lastScroll', -1000); }); }); - + var editor = CodeMirror.fromTextArea("id_text", { parserfile: 'parsexml.js', path: "/static/js/codemirror/", stylesheet: "/static/css/xmlcolors.css", parserConfig: {useHTMLKludges: false} }); - + + $('iframe').load(function() { + $($('iframe').contents()).scroll(function() { + var percentScrolled = $('body', this).scrollTop() / $('body', this).height(); + $('#images-wrap').scrollTop(percentScrolled * $('#images').height()); + }); + }) + addEditorButton('utwór', function(text) { return '' + text + ''; }); addEditorButton('akap', function(text) { return '' + text + ''; }); $('#images').lazyload('.image-box', {threshold: 600}); }); + {% endblock extrahead %} @@ -41,8 +49,10 @@ {% block maincontent %}
Ź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.

+
{#
#}