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() - $('#breadcrumbs').height() - $('toolbar').height());
22 $('#toggle-sidebar').height($(window).height() - $('#breadcrumbs').height());
23 $('#images-wrap').height($(window).height() - $('#breadcrumbs').height() - $('#sidebar-toolbar').height())
24 $('#images-wrap, #sidebar-toolbar').width($('#sidebar').width() - 10);
27 $(window).resize(function() {
31 var editor = CodeMirror.fromTextArea("id_text", {
32 parserfile: 'parsexml.js',
33 path: "/static/js/codemirror/",
34 stylesheet: "/static/css/xmlcolors.css",
35 parserConfig: {useHTMLKludges: false},
36 initCallback: function() {
37 $('#images').autoscroll('iframe');
38 $('.toggleAutoscroll').toggle(function() {
39 $(this).html('Synchronizuj przewijanie');
40 $('#images').disableAutoscroll();
42 $(this).html('Nie synchronizuj przewijania');
43 $('#images').enableAutoscroll();
47 $('#toolbar-tabs li').click(function() {
48 var id = $(this).attr('p:button-list');
49 $('#toolbar-tabs li').removeClass('active');
50 $(this).addClass('active');
51 if (!$('#' + id).is(':visible')) {
52 $('#toolbar-buttons ol').not('#' + id).hide();
58 $('#toolbar-buttons li').each(function() {
59 var tag = $(this).attr('p:tag');
60 var handler = function() {
61 var text = editor.selection();
62 editor.replaceSelection('<' + tag + '>' + text + '</' + tag + '>');
63 if (text.length == 0) {
64 var pos = editor.cursorPosition();
65 editor.selectLines(pos.line, pos.character + tag.length + 2);
68 if ($(this).attr('p:key')) {
69 keys[$(this).attr('p:key')] = handler;
71 $(this).click(handler)
74 editor.grabKeys(function(event) {
75 if (keys[event.keyCode]) {
76 keys[event.keyCode]();
79 return event.ctrlKey && keys[event.keyCode];
82 $('#sidebar').bind('resizable:resize', resizePanels)
83 .resizable('#toggle-sidebar', {minWidth: 8});
89 $('#toolbar-buttons li').wTooltip({
92 border: "1px solid #7F7D67",
94 background: "#FBFBC6",
99 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
103 {% endblock extrahead %}
105 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
107 {% block maincontent %}
108 <form action="." method="post" accept-charset="utf-8">
111 <div id="toggle-sidebar" style="float: right"></div>
113 <div id="sidebar-toolbar">
114 <ol id="sidebar-tabs">
119 <div id="images-wrap">
121 <div style="clear: both; height: 0; width: 0"> </div>
123 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
124 <p>{{ image_folders_form.folders }}</p>
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 %}