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 $('#toggle-sidebar').height($(window).height() - 55);
23 $('#images-wrap').height($(window).height() - 82)
24 $('#images-wrap, #sidebar-toolbar').width($('#sidebar').width() - 10);
27 $('#toggle-sidebar').toggle(function() {
28 $('#images-wrap').width(480);
29 $('#sidebar').width(488);
30 $('#images-wrap').data('lazyload:lastCheckedScrollTop', -10000);
33 $('#images-wrap').width(0);
34 $('#sidebar').width(8);
38 $(window).resize(function() {
42 var editor = CodeMirror.fromTextArea("id_text", {
43 parserfile: 'parsexml.js',
44 path: "/static/js/codemirror/",
45 stylesheet: "/static/css/xmlcolors.css",
46 parserConfig: {useHTMLKludges: false},
47 initCallback: function() {
48 $('#images').autoscroll('iframe');
49 $('.toggleAutoscroll').toggle(function() {
50 $(this).html('Synchronizuj przewijanie');
51 $('#images').disableAutoscroll();
53 $(this).html('Nie synchronizuj przewijania');
54 $('#images').enableAutoscroll();
58 $('#toolbar-tabs li').click(function() {
59 var id = $(this).attr('p:button-list');
60 $('#toolbar-tabs li').removeClass('active');
61 $(this).addClass('active');
62 if (!$('#' + id).is(':visible')) {
63 $('#toolbar-buttons ol').not('#' + id).hide();
69 $('#toolbar-buttons li').each(function() {
70 var tag = $(this).attr('p:tag');
71 var handler = function() {
72 var text = editor.selection();
73 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
74 if (text.length == 0) {
75 var pos = editor.cursorPosition();
76 editor.selectLines(pos.line, pos.character + tag.length + 2);
79 if ($(this).attr('p:key')) {
80 keys[$(this).attr('p:key')] = handler;
82 $(this).click(handler)
85 editor.grabKeys(function(event) {
86 if (keys[event.keyCode]) {
87 keys[event.keyCode]();
90 return event.ctrlKey && keys[event.keyCode];
93 // $('#sidebar').bind('resizable:resize', resizePanels).resizable('#toggle-sidebar');
99 $('#toolbar-buttons li').wTooltip({
102 border: "1px solid #7F7D67",
104 background: "#FBFBC6",
109 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
113 {% endblock extrahead %}
115 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
117 {% block maincontent %}
118 <form action="." method="post" accept-charset="utf-8">
121 <div id="toggle-sidebar" style="float: right"></div>
123 <div id="sidebar-toolbar">
124 <ol id="sidebar-tabs">
129 <div id="images-wrap">
131 <div style="clear: both; height: 0; width: 0"> </div>
133 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
134 <p>{{ image_folders_form.folders }}</p>
140 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
143 <div id="status-bar">
144 {{ form.user.errors }} {{ form.commit_message.errors }}
146 Użytkownik: {{ form.user }}
147 Opis zmian: {{ form.commit_message }}
148 <input type="submit" value="Zapisz"/>
149 <a href="#" class="toggleAutoscroll" style="float: right">Nie synchronizuj przewijania</a>
153 {% endblock maincontent %}