1 {% extends "base.html" %}
2 {% load toolbar_tags %}
5 <script src="/static/js/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script>
6 <script src="/static/js/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
7 <script src="/static/js/jquery.autoscroll.js" type="text/javascript" charset="utf-8"></script>
8 <script src="/static/js/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
9 <script src="/static/js/jquery.resizable.js" type="text/javascript" charset="utf-8"></script>
10 <script type="text/javascript" charset="utf-8">
12 $('#id_folders').change(function() {
13 $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
14 $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
18 function resizePanels() {
19 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
20 $('iframe').height($(window).height() - $('iframe').position().top);
21 $('#toggle-sidebar').height($(window).height() - $('#toggle-sidebar').position().top);
22 $('#images-wrap').height($(window).height() - $('#images-wrap').position().top);
23 $('#images-wrap, #sidebar-toolbar').width($('#sidebar').width() - 10);
26 $(window).resize(function() {
30 var editor = CodeMirror.fromTextArea("id_text", {
31 parserfile: 'parsexml.js',
32 path: "/static/js/codemirror/",
33 stylesheet: "/static/css/xmlcolors.css",
34 parserConfig: {useHTMLKludges: false},
35 initCallback: function() {
36 $('#images').autoscroll('iframe');
37 $('.toggleAutoscroll').toggle(function() {
38 $(this).html('Synchronizuj przewijanie');
39 $('#images').disableAutoscroll();
41 $(this).html('Nie synchronizuj przewijania');
42 $('#images').enableAutoscroll();
46 $('#toolbar-tabs li').click(function() {
47 var id = $(this).attr('p:button-list');
48 $('#toolbar-tabs li').removeClass('active');
49 $(this).addClass('active');
50 if (!$('#' + id).is(':visible')) {
51 $('#toolbar-buttons ol').not('#' + id).hide();
57 $('#toolbar-buttons li').each(function() {
58 var tag = $(this).attr('p:tag');
59 var handler = function() {
60 var text = editor.selection();
61 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
62 if (text.length == 0) {
63 var pos = editor.cursorPosition();
64 editor.selectLines(pos.line, pos.character + tag.length + 2);
67 if ($(this).attr('p:key')) {
68 keys[$(this).attr('p:key')] = handler;
70 $(this).click(handler)
73 editor.grabKeys(function(event) {
74 if (keys[event.keyCode]) {
75 keys[event.keyCode]();
78 return event.altKey && keys[event.keyCode];
81 $('#sidebar').bind('resizable:resize', resizePanels)
82 .resizable('#toggle-sidebar', {minWidth: 8});
88 $('#toolbar-buttons li').wTooltip({
91 border: "1px solid #7F7D67",
93 background: "#FBFBC6",
98 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
102 {% endblock extrahead %}
104 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
106 {% block maincontent %}
107 <form action="." method="post" accept-charset="utf-8">
110 <div id="toggle-sidebar" style="float: right"></div>
112 <div id="sidebar-toolbar">
113 <ol id="sidebar-tabs">
118 <div id="images-wrap">
120 <div style="clear: both; height: 0; width: 0"> </div>
122 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
123 <p>{{ image_folders_form.folders }}</p>
129 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
132 {# <div id="status-bar"> #}
133 {# {{ form.user.errors }} {{ form.commit_message.errors }} #}
135 {# Użytkownik: {{ form.user }} #}
136 {# Opis zmian: {{ form.commit_message }} #}
137 {# <input type="submit" value="Zapisz"/> #}
138 {# <a href="#" class="toggleAutoscroll" style="float: right">Nie synchronizuj przewijania</a> #}
142 {% endblock maincontent %}