From 1e1651db11ec96ad6cf29bdf2f4db4fea80d42f4 Mon Sep 17 00:00:00 2001 From: zuber Date: Fri, 14 Aug 2009 17:15:16 +0200 Subject: [PATCH 1/1] =?utf8?q?Synchroniczne=20przewijanie=20obrazk=C3=B3w?= =?utf8?q?=20z=20galerii=20skan=C3=B3w=20oraz=20tekstu=20w=20edytorze.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- project/static/css/master.css | 2 +- project/templates/explorer/file_xml.html | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) 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.

+
{#
#} -- 2.20.1