1 {% extends "base.html" %}
2 {% load toolbar_tags %}
5 <script src="/static/js/jquery.fieldselection.js" type="text/javascript" charset="utf-8"></script>
6 <script src="/static/js/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script>
7 <script src="/static/js/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
8 <script src="/static/js/jquery.autoscroll.js" type="text/javascript" charset="utf-8"></script>
9 <script src="/static/js/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
10 <script src="/static/js/jquery.resizable.js" type="text/javascript" charset="utf-8"></script>
11 <script type="text/javascript" charset="utf-8">
13 $('#id_folders').change(function() {
14 $('#images').load('{% url folder_image_ajax %}' + $('#id_folders').val() + '/', function() {
15 $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
19 function resizePanels() {
20 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
21 $('iframe').height($(window).height() - 100);
22 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
23 $('#images-wrap').width($('#sidebar').width() - 8);
26 $('#toggle-sidebar').toggle(function() {
27 $('#images-wrap').width(480);
28 $('#sidebar').width(488);
29 $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
32 $('#images-wrap').width(0);
33 $('#sidebar').width(8);
37 $(window).resize(function() {
41 var editor = CodeMirror.fromTextArea("id_text", {
42 parserfile: 'parsexml.js',
43 path: "/static/js/codemirror/",
44 stylesheet: "/static/css/xmlcolors.css",
45 parserConfig: {useHTMLKludges: false},
46 initCallback: function() {
47 $('#images').autoscroll('iframe');
48 $('.toggleAutoscroll').toggle(function() {
49 $(this).html('Synchronizuj przewijanie');
50 $('#images').disableAutoscroll();
52 $(this).html('Nie synchronizuj przewijania');
53 $('#images').enableAutoscroll();
57 $('#toolbar-tabs li').click(function() {
58 var id = $(this).attr('p:button-list');
59 $('#toolbar-tabs li').removeClass('active');
60 $(this).addClass('active');
61 if (!$('#' + id).is(':visible')) {
62 $('#toolbar-buttons ol').not('#' + id).hide();
68 $('#toolbar-buttons li').each(function() {
69 var tag = $(this).attr('p:tag');
70 var handler = function() {
71 var text = editor.selection();
72 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
73 if (text.length == 0) {
74 var pos = editor.cursorPosition();
75 editor.selectLines(pos.line, pos.character + tag.length + 2);
78 if ($(this).attr('p:key')) {
79 keys[$(this).attr('p:key')] = handler;
81 $(this).click(handler)
84 editor.grabKeys(function(event) {
85 if (keys[event.keyCode]) {
86 keys[event.keyCode]();
89 return event.ctrlKey && keys[event.keyCode];
92 // $('#sidebar').bind('resizable:resize', resizePanels).resizable('#toggle-sidebar');
98 $('#toolbar-buttons li').wTooltip({
101 border: "1px solid #7F7D67",
103 background: "#FBFBC6",
108 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
112 {% endblock extrahead %}
114 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
116 {% block maincontent %}
119 <form action="." method="post" accept-charset="utf-8">
122 <div id="images-wrap">
124 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
125 <p>{{ image_folders_form.folders }}</p>
128 <div id="toggle-sidebar"></div>
130 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
133 <div id="status-bar">
134 {{ form.user.errors }} {{ form.commit_message.errors }}
136 Użytkownik: {{ form.user }}
137 Opis zmian: {{ form.commit_message }}
138 <input type="submit" value="Zapisz"/>
139 <a href="#" class="toggleAutoscroll" style="float: right">Nie synchronizuj przewijania</a>
143 {% endblock maincontent %}