1 {% extends "base.html" %}
4 <script src="/static/js/jquery.fieldselection.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);
35 function addEditorButton(label, fn) {
36 $('<button type="button">' + label + '</button>').click(function(event) {
37 var text = $('#id_text').getSelection().text;
38 $('#id_text').replaceSelection(fn(text));
39 event.preventDefault();
40 }).appendTo('#buttons');
44 $('#id_folders').change(function() {
45 $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
50 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
51 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
53 setTimeout(checkScroll, 2000);
56 {% endblock extrahead %}
58 {% block breadcrumbs %}<a href="/">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
60 {% block maincontent %}
61 <div id="tabs"><a href="{% url file_xml hash %}" class="active">Źródło</a><a href="{% url file_html hash %}">HTML</a> <div style="padding: 3px; margin-left: 10px">{{ image_folders_form.folders }}</div><div style="clear: both; height: 0; width: 0"> </div></div>
64 <div class="image-box">
65 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
68 <form action="." method="post" accept-charset="utf-8">
69 <div id="buttons"></div>
71 <p>Użytkownik: {{ form.user }} Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
73 {% endblock maincontent %}