1 {% extends "base.html" %}
4 <script src="/static/js/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script>
5 <script type="text/javascript" charset="utf-8">
6 function aboveViewport(container, element, treshold) {
7 return $(container).offset().top >= $(element).offset().top + $(element).height() + treshold;
10 function belowViewport(container, element, treshold) {
11 return $(container).offset().top + $(container).height() + treshold <= $(element).offset().top;
15 var lastScroll = -1000;
17 function checkScroll() {
18 if (Math.abs($('#images').scrollTop() - lastScroll) > 300) {
19 var container = $('#images');
20 lastScroll = container.scrollTop();
22 $('#images .image-box').each(function() {
23 if (aboveViewport(container, this, TRESHOLD)) {
24 $(this).html('loading...');
25 } else if (belowViewport(container, this, TRESHOLD)) {
26 $(this).html('loading...');
28 $(this).html('<img src="' + $(this).attr('src') + '" width="460" height="460"/>');
32 setTimeout(checkScroll, 2000);
36 $('#id_folders').change(function() {
37 $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
42 setTimeout(checkScroll, 2000);
45 {% endblock extrahead %}
47 {% block breadcrumbs %}<a href="/">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
49 {% block maincontent %}
50 <div id="tabs"><a href="{% url file_xml hash %}">Źródło</a><a href="{% url file_html hash %}" class="active">HTML</a><div style="padding: 3px; margin-left: 10px">{{ image_folders_form.folders }}</div><div style="clear: both; height: 0; width: 0"> </div></div>
53 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
58 {% endblock maincontent %}