From: Lukasz Rekucki Date: Tue, 18 Aug 2009 14:34:16 +0000 (+0200) Subject: Merge branch 'master' of git@stigma:platforma X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/2e4974b1f5600a3a446d5b0844a8d63d9fb5fbb3?hp=4b33f145c7966710e537531261e04d2596159049 Merge branch 'master' of git@stigma:platforma --- diff --git a/project/static/css/master.css b/project/static/css/master.css index 79820591..f699cd6d 100644 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@ -1,6 +1,7 @@ body { margin: 0; font: 100%/1.5 Georgia, Verdana, sans-serif; + overflow: hidden; } #breadcrumbs { @@ -71,19 +72,40 @@ label { padding: 5px 10px; overflow-x: hidden; overflow-y: scroll; - width: 480px; - height: 480px; - border: 1px solid #999; } #images-wrap { - float: left; - width: 49%; + width: 0px; height: 480px; - border: 1px solid #999; -/* padding: 5px 10px;*/ + border-right: 1px solid #999; overflow-y: scroll; overflow-x: hidden; + background-color: #fff; + float: left; +} + +#sidebar { + float: left; + width: 8px; + overflow: hidden; +} + +#toggle-sidebar { + background-color: #DDD; + width: 7px; + height: 100%; + float: left; +} + +#toggle-sidebar:hover { + background-color: #999; + cursor: pointer; +} + +#status-bar { + border-top: 1px solid #999; + background-color: #EEE; + padding: 2px 10px; } .errorlist { @@ -100,4 +122,8 @@ label { p { margin: 0; -} \ No newline at end of file +} + +.image-box { + border-top: 1px solid #DDD; +} diff --git a/project/static/js/jquery.autoscroll.js b/project/static/js/jquery.autoscroll.js new file mode 100644 index 00000000..f8c07fbd --- /dev/null +++ b/project/static/js/jquery.autoscroll.js @@ -0,0 +1,47 @@ +(function($) { + $.fn.autoscroll = function(synchronizeWith, options) { + var $this = $(this); + var self = $this; + var selfContainer = self.parent(); + var synchronizeWith = $(synchronizeWith); + var synchronizeWithContainer = synchronizeWith.parent(); + var eventContainer = synchronizeWithContainer; + + // Hack for iframes + if (self.is('iframe')) { + selfContainer = $('body', $('iframe').contents()); + self = selfContainer; + } + + if (synchronizeWith.is('iframe')) { + eventContainer = synchronizeWith.contents(); + synchronizeWithContainer = $('body', eventContainer); + synchronizeWith = synchronizeWithContainer; + } + + $this.data('autoscroll:enabled', true); + synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop', synchronizeWithContainer.scrollTop()); + + eventContainer.scroll(function() { + if ($this.data('autoscroll:enabled')) { + var distanceScrolled = synchronizeWithContainer.scrollTop() - synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop'); + var percentScrolled = distanceScrolled / synchronizeWith.height(); + selfContainer.scrollTop(selfContainer.scrollTop() + percentScrolled * self.height()); + } + synchronizeWithContainer.data('autoscroll:lastCheckedScrollTop', synchronizeWithContainer.scrollTop()); + }); + }, + + $.fn.enableAutoscroll = function() { + $(this).data('autoscroll:enabled', true); + }, + + $.fn.disableAutoscroll = function() { + $(this).data('autoscroll:enabled', false); + }, + + $.fn.toggleAutoscroll = function() { + $(this).data('autoscroll:enabled', !$(this).data('autoscroll:enabled')); + } +})(jQuery); + diff --git a/project/static/js/jquery.lazyload.js b/project/static/js/jquery.lazyload.js index 25c94869..ea3de6ff 100644 --- a/project/static/js/jquery.lazyload.js +++ b/project/static/js/jquery.lazyload.js @@ -31,7 +31,13 @@ || belowViewport(container, this, settings.threshold)) { $(this).html(settings.placeholder); } else { - $(this).html(''); + $(this).html(''); + var self = this; + $('').load(function() { + if ($(this).height() > $(self).height()) { + $(self).height($(this).height()); + } + }).appendTo(this); } }) } diff --git a/project/templates/explorer/file_html.html b/project/templates/explorer/file_html.html index f3fe1876..ab8e40b4 100644 --- a/project/templates/explorer/file_html.html +++ b/project/templates/explorer/file_html.html @@ -10,7 +10,15 @@ }); }); - $('#images').lazyload('.image-box', {threshold: 600}); + function resizePanels() { + $('#images-wrap').height($(window).height() - 80); + $('#file-text').height($(window).height() - 80); + } + + $(window).resize(resizePanels) + resizePanels(); + + $('#images-wrap').lazyload('.image-box', {threshold: 600}); }); {% endblock extrahead %} @@ -20,8 +28,13 @@ {% block maincontent %}
ŹródłoHTML
{{ image_folders_form.folders }}
 
-
-

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

+
{{ object|safe }} diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index bd022e9f..e9cd85c0 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -4,6 +4,7 @@ + @@ -46,19 +72,30 @@ {% block breadcrumbs %}Platforma Redakcyjna ❯ plik {{ hash }}{% endblock breadcrumbs %} {% block maincontent %} -
ŹródłoHTML
{{ image_folders_form.folders }}
 
- -
-
-

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

-
-
+ +
- {#
#} - - {{ form.user.errors }} -

Użytkownik: {{ form.user }}

- {{ form.commit_message.errors }} -

Opis zmian: {{ form.commit_message }}

+
+ + +
+ +
+ {{ form.user.errors }} {{ form.commit_message.errors }} +

+ Użytkownik: {{ form.user }} + Opis zmian: {{ form.commit_message }} + + Nie synchronizuj przewijania +

+
{% endblock maincontent %} diff --git a/project/templates/explorer/folder_images.html b/project/templates/explorer/folder_images.html index e6beb076..8f5f600f 100644 --- a/project/templates/explorer/folder_images.html +++ b/project/templates/explorer/folder_images.html @@ -1,5 +1,3 @@ {% for image in images %} -
-

{{ image }}

-
+
{{ image }}
{% endfor %} \ No newline at end of file