1 {% extends "base.html" %}
4 <script src="/static/js/jquery.fieldselection.js" type="text/javascript" charset="utf-8"></script>
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 type="text/javascript" charset="utf-8">
10 $('#id_folders').change(function() {
11 $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
12 $('#images').data('lastScroll', -1000);
16 function resizePanels() {
17 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
18 $('iframe').height($(window).height() - 100);
19 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
22 $('#toggle-sidebar').toggle(function() {
23 $('#images-wrap').width(480);
24 $('#sidebar').width(488);
27 $('#images-wrap').width(0);
28 $('#sidebar').width(8);
32 $(window).resize(function() {
36 var editor = CodeMirror.fromTextArea("id_text", {
37 parserfile: 'parsexml.js',
38 path: "/static/js/codemirror/",
39 stylesheet: "/static/css/xmlcolors.css",
40 parserConfig: {useHTMLKludges: false},
41 initCallback: function() {
42 $('#images').autoscroll('iframe');
43 $('.toggleAutoscroll').toggle(function() {
44 $(this).html('Synchronizuj przewijanie');
45 $('#images').disableAutoscroll();
47 $(this).html('Nie synchronizuj przewijania');
48 $('#images').enableAutoscroll();
53 function addEditorButton(editor, label, keyCode, fn) {
54 var handler = function() {
55 var text = editor.selection();
56 editor.replaceSelection(fn(text));
59 keys[keyCode] = handler;
61 $('<button type="button">' + label + '</button>').click(function(event) {
62 event.preventDefault();
64 }).appendTo('#buttons');
67 addEditorButton(editor, 'utwór', 65, function(text) { return '<utwor>' + text + '</utwor>'; });
68 addEditorButton(editor, 'akap', 83, function(text) { return '<akap>' + text + '</akap>'; });
70 editor.grabKeys(function(event) {
71 // console.log('handle', event, event.keyCode)
72 if (keys[event.keyCode]) {
73 keys[event.keyCode]();
75 }, function(event) { return event.ctrlKey && event.keyCode != 17; });
81 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
85 {% endblock extrahead %}
87 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
89 {% block maincontent %}
91 <a href="{% url file_xml hash %}" class="active">Źródło</a>
92 <a href="{% url file_html hash %}">HTML</a>
93 <div style="float: left" id="buttons"></div>
94 <div style="clear: both; height: 0; width: 0"> </div>
97 <form action="." method="post" accept-charset="utf-8">
100 <div id="images-wrap">
102 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
103 <p>{{ image_folders_form.folders }}</p>
106 <div id="toggle-sidebar"></div>
108 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
111 <div id="status-bar">
112 {{ form.user.errors }} {{ form.commit_message.errors }}
114 Użytkownik: {{ form.user }}
115 Opis zmian: {{ form.commit_message }}
116 <input type="submit" value="Zapisz"/>
117 <a href="#" class="toggleAutoscroll" style="float: right">Nie synchronizuj przewijania</a>
121 {% endblock maincontent %}