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);
31 $('#sidebar-toolbar').width(480);
34 $('#images-wrap').width(0);
35 $('#sidebar').width(8);
36 $('#sidebar-toolbar').width(0);
40 $(window).resize(function() {
44 var editor = CodeMirror.fromTextArea("id_text", {
45 parserfile: 'parsexml.js',
46 path: "/static/js/codemirror/",
47 stylesheet: "/static/css/xmlcolors.css",
48 parserConfig: {useHTMLKludges: false},
49 initCallback: function() {
50 $('#images').autoscroll('iframe');
51 $('.toggleAutoscroll').toggle(function() {
52 $(this).html('Synchronizuj przewijanie');
53 $('#images').disableAutoscroll();
55 $(this).html('Nie synchronizuj przewijania');
56 $('#images').enableAutoscroll();
60 $('#toolbar-tabs li').click(function() {
61 var id = $(this).attr('p:button-list');
62 $('#toolbar-tabs li').removeClass('active');
63 $(this).addClass('active');
64 if (!$('#' + id).is(':visible')) {
65 $('#toolbar-buttons ol').not('#' + id).hide();
71 $('#toolbar-buttons li').each(function() {
72 var tag = $(this).attr('p:tag');
73 var handler = function() {
74 var text = editor.selection();
75 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
76 if (text.length == 0) {
77 var pos = editor.cursorPosition();
78 editor.selectLines(pos.line, pos.character + tag.length + 2);
81 if ($(this).attr('p:key')) {
82 keys[$(this).attr('p:key')] = handler;
84 $(this).click(handler)
87 editor.grabKeys(function(event) {
88 if (keys[event.keyCode]) {
89 keys[event.keyCode]();
92 return event.ctrlKey && keys[event.keyCode];
95 // $('#sidebar').bind('resizable:resize', resizePanels).resizable('#toggle-sidebar');
101 $('#toolbar-buttons li').wTooltip({
104 border: "1px solid #7F7D67",
106 background: "#FBFBC6",
111 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
115 {% endblock extrahead %}
117 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
119 {% block maincontent %}
120 <form action="." method="post" accept-charset="utf-8">
123 <div id="toggle-sidebar" style="float: right"></div>
125 <div id="sidebar-toolbar">
126 <ol id="sidebar-tabs">
131 <div id="images-wrap">
133 <div style="clear: both; height: 0; width: 0"> </div>
135 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
136 <p>{{ image_folders_form.folders }}</p>
142 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
145 <div id="status-bar">
146 {{ form.user.errors }} {{ form.commit_message.errors }}
148 Użytkownik: {{ form.user }}
149 Opis zmian: {{ form.commit_message }}
150 <input type="submit" value="Zapisz"/>
151 <a href="#" class="toggleAutoscroll" style="float: right">Nie synchronizuj przewijania</a>
155 {% endblock maincontent %}