Korigovátko slouží ke korigování PDF souborů. Umožňuje přidávat a komentovat
+korektury a označovat je jako zanesené / irelevantní. Rovněž umožňuje o PDF
+říci, že jsou právě zanášeny korektury nebo že je zastaralé.
+
Použití
+
+Kliknu do PDF tam, kam chci zadat korekturu, napíši text a kliknu na Oprav!
+(nebo Ctrl-Enter).
+Korektura se zobrazí na pravé straně červeně. Korektura nelze smazat ani
+upravit.
+
+Pokud chci korekturu okomentovat, kliknu na ikonu ,
+napíši komentář a kliknu na Oprav! (nebo Ctrl-Enter). Komentář se zobrazí pod
+původní korekturou.
+
+
Tlačítka u korektury
+
+
- smazat korekturu
+
- označt koreturu jako zanesenou
+
- označit korekturu jako irelevantní
+ (není to chyba, nebude zaneseno)
+
- upravit text korektury
+
- okomentovat korekturu
+
+
Stavy
+
Korektura
+
+
K opravě - zadaná, čeká na zanesení / zahození
+
Zanesená - zanesená v TeXu
+
Irelevantní - není to chyba, nebude zanesena
+
K reakci - vyžaduje reakci od autora (zatím není
+ implementováno)
+
+
PDF
+
+
Přidávání - probíhá přidávání korektur
+
Zanášení - probíhá zanášení korektur do TeXu
+
Zastaralé - PDF je zastaralé, nepřidávat nové korektury
+
+
diff --git a/korektury/static/korektury/imgs/check.png b/korektury/static/korektury/imgs/check.png
new file mode 100644
index 00000000..c4d5504e
Binary files /dev/null and b/korektury/static/korektury/imgs/check.png differ
diff --git a/korektury/static/korektury/imgs/comment.png b/korektury/static/korektury/imgs/comment.png
new file mode 100644
index 00000000..4a648425
Binary files /dev/null and b/korektury/static/korektury/imgs/comment.png differ
diff --git a/korektury/static/korektury/imgs/cross.png b/korektury/static/korektury/imgs/cross.png
new file mode 100644
index 00000000..f3add6aa
Binary files /dev/null and b/korektury/static/korektury/imgs/cross.png differ
diff --git a/korektury/static/korektury/imgs/delete-gr.png b/korektury/static/korektury/imgs/delete-gr.png
new file mode 100644
index 00000000..d0ed643c
Binary files /dev/null and b/korektury/static/korektury/imgs/delete-gr.png differ
diff --git a/korektury/static/korektury/imgs/delete.png b/korektury/static/korektury/imgs/delete.png
new file mode 100644
index 00000000..9b77ca3b
Binary files /dev/null and b/korektury/static/korektury/imgs/delete.png differ
diff --git a/korektury/static/korektury/imgs/edit-gr.png b/korektury/static/korektury/imgs/edit-gr.png
new file mode 100644
index 00000000..e7ca04b8
Binary files /dev/null and b/korektury/static/korektury/imgs/edit-gr.png differ
diff --git a/korektury/static/korektury/imgs/edit.png b/korektury/static/korektury/imgs/edit.png
new file mode 100644
index 00000000..95cabe7d
Binary files /dev/null and b/korektury/static/korektury/imgs/edit.png differ
diff --git a/korektury/static/korektury/imgs/link.png b/korektury/static/korektury/imgs/link.png
new file mode 100644
index 00000000..cfa343c7
Binary files /dev/null and b/korektury/static/korektury/imgs/link.png differ
diff --git a/korektury/static/korektury/imgs/next-gr.png b/korektury/static/korektury/imgs/next-gr.png
new file mode 100644
index 00000000..885c2cd7
Binary files /dev/null and b/korektury/static/korektury/imgs/next-gr.png differ
diff --git a/korektury/static/korektury/imgs/next.png b/korektury/static/korektury/imgs/next.png
new file mode 100644
index 00000000..e8b15f66
Binary files /dev/null and b/korektury/static/korektury/imgs/next.png differ
diff --git a/korektury/static/korektury/imgs/undo.png b/korektury/static/korektury/imgs/undo.png
new file mode 100644
index 00000000..973b5939
Binary files /dev/null and b/korektury/static/korektury/imgs/undo.png differ
diff --git a/korektury/static/korektury/opraf.css b/korektury/static/korektury/opraf.css
new file mode 100644
index 00000000..18da5f5a
--- /dev/null
+++ b/korektury/static/korektury/opraf.css
@@ -0,0 +1,145 @@
+body{background: #f3f3f3; color: black;}
+body.comitting {
+ background: yellow;
+}
+body.deprecated {
+ background: red;
+}
+
+img{background:white;}
+
+.pointer-hi,
+.pointer,
+.pointer-wontfix,
+.pointer-wontfix-hi,
+.pointer-done,
+.pointer-done-hi {
+ position:absolute;
+ /*border-bottom-left-radius: 10px; */
+ border-left: 2px solid yellow;
+ border-bottom: 2px solid yellow;
+}
+
+.pointer-done-hi,
+.pointer-wontfix-hi,
+.pointer-hi {
+ border-width: 3px;
+}
+
+.pointer {
+ border-color: #F00; /*IE*/
+ border-color: rgba(255, 0, 0, 0.35);
+}
+.pointer-hi {
+ border-color: #F00; /*IE*/
+ border-color: rgba(255, 0, 0, 1);
+}
+.pointer-done {
+ border-color: #00F; /*IE*/
+ border-color: rgba(0, 0, 255, 0.2);
+}
+.pointer-done-hi {
+ border-color: #00F; /*IE*/
+ border-color: rgba(0, 0, 255, 1);
+}
+.pointer-wontfix {
+ border-color: #00F; /*IE*/
+ border-color: rgba(128, 128, 128, 0.2);
+}
+.pointer-wontfix-hi {
+ border-color: #00F; /*IE*/
+ border-color: rgba(128, 128, 128, 1);
+}
+
+
+.box:hover,
+.box-done:hover,
+.box-wontfix:hover{
+ border-width:3px;
+ margin: 0px;
+}
+.box, .box-done, .box-wontfix {
+ margin: 1px;
+ background-color: white;
+ width:300px;
+ /*position:absolute;*/
+ padding: 3px;
+ border: 2px solid black;
+ border-radius: 10px;
+}
+.box {
+ border-color: red;
+}
+.box-done {
+ border-color: blue;
+}
+.box-wontfix {
+ border-color: grey;
+}
+form {
+ display:inline;
+}
+
+.float-right{
+ float:right;
+}
+
+.imgdiv {
+ position:relative;
+ left:0px;
+ top:0px;
+}
+#commform-div {
+ display: none;
+ position: absolute;
+ background-color: white;
+ border: 1px solid;
+ padding: 3px;
+ /*
+ width: 310;
+ height: 220;
+ */
+ z-index: 10;
+ border: 4px solid red;
+ border-radius: 10px;
+ background-color: white;
+}
+.close-button{
+ background-color: yellow;
+}
+
+
+.box button,
+.box img,
+.box-done button,
+.box-done img,
+.box-wontfix button,
+.box-wontfix img{
+ border: 1px solid white;
+ background-color:transparent;
+ margin:0;
+ padding: 1px;
+}
+.box button:hover,
+.box img:hover,
+.box-done img:hover,
+.box-done button:hover,
+.box-wontfix img:hover,
+.box-wontfix button:hover{
+ border: 1px solid black;
+}
+
+.comment hr {
+ height: 0px;
+}
+
+.corr-header {
+ overflow: auto;
+}
+
+.author {
+ font-weight: bold;
+ float: left;
+ margin-top: 3px;
+}
+
diff --git a/korektury/static/korektury/opraf.js b/korektury/static/korektury/opraf.js
new file mode 100644
index 00000000..d39c0797
--- /dev/null
+++ b/korektury/static/korektury/opraf.js
@@ -0,0 +1,256 @@
+function place_comments_one_div(img_id, comments)
+{
+ var img = document.getElementById(img_id);
+ if( img == null ) {
+ return;
+ }
+ var par = img.parentNode;
+ var w = img.clientWidth;
+ var h = img.clientHeight;
+ var w_skip = 10;
+ var h_skip = 5;
+ var pointer_min_h = 30;
+
+ var bott_max = 0;
+ var comments_sorted = comments.sort(function (a,b) {
+ return a[2] - b[2];
+ //pokus o hezci kladeni poiteru, ale nic moc
+ if( a[3] < b[3] ) {
+ return (a[2] + pointer_min_h)- b[2];
+ } else {
+ return (a[2] - pointer_min_h)- b[2];
+ }
+
+ });
+ //console.log("w:" + w);
+ for (c in comments_sorted) {
+ var id = comments_sorted[c][0];
+ var x = comments_sorted[c][1];
+ var y = comments_sorted[c][2];
+
+ var el = document.getElementById(id);
+ var elp = document.getElementById(id + "-pointer");
+
+ if( el == null || elp == null ) {
+ continue;
+ }
+
+ par.appendChild(elp);
+ par.appendChild(el);
+
+ var delta_y = (y > bott_max) ? 0: bott_max - y + h_skip;
+
+ elp.style.left = x;
+ elp.style.top = y ;
+ elp.style.width = w - x + w_skip;
+ elp.style.height = pointer_min_h + delta_y;
+ elp.img_id = img_id;
+ el.img_id = img_id;
+
+ el.style.position = 'absolute';
+ el.style.left = w + w_skip;
+ el.style.top = y + delta_y;
+
+ var bott = el.offsetTop + el.offsetHeight;
+ bott_max = ( bott_max > bott ) ? bott_max : bott;
+
+ //console.log( "par.w:" + par.style.width);
+
+ }
+ if( par.offsetHeight < bott_max ) {
+ //par.style.height = bott_max;
+ //alert("preteklo to:"+ par.offsetHeight +",mx:" + bott_max );
+ par.style.height = bott_max;
+
+ }
+}
+
+// ctrl-enter submits form
+function textarea_onkey(ev)
+{
+ //console.log("ev:" + ev.keyCode + "," + ev.ctrlKey);
+ if( (ev.keyCode == 13 || ev.keyCode == 10 ) && ev.ctrlKey ) {
+ var form = document.getElementById('commform');
+ if( form ) {
+ save_scroll(form);
+ //form.action ='';
+ form.submit();
+ }
+ return true;
+ }
+ return false;
+}
+
+//hide comment form
+function close_commform() {
+ var formdiv = document.getElementById('commform-div');
+ if( formdiv == null ) {
+ alert("form null");
+ return true;
+ }
+ formdiv.style.display = 'none';
+ return false;
+}
+
+// show comment form, when clicked to image
+function img_click(element, ev) {
+ var body_class = document.body.className;
+ switch(body_class){
+ case "comitting":
+ if (!confirm("Právě jsou zanášeny korektury, opravdu chcete přidat novou?"))
+ return;
+ break;
+ case "deprecated":
+ if (!confirm("Toto PDF je již zastaralé, opravdu chcete vytvořit korekturu?"))
+ return;
+ break;
+ }
+
+ var dx, dy;
+ var par = element.parentNode;
+ if( ev.pageX != null ) {
+ dx = ev.pageX - par.offsetLeft;
+ dy = ev.pageY - par.offsetTop;
+ } else { //IE
+ dx = ev.offsetX;
+ dy = ev.offsetY;
+ }
+ var img_id = element.id;
+ if( element.img_id != null ) {
+ // click was to '-pointer'
+ img_id = element.img_id;
+ }
+ return show_form(img_id, dx, dy, '', '', '', '');
+}
+
+// show comment form, when 'edit' or 'comment' button pressed
+function box_edit(button, action)
+{
+ var divbox = button.parentNode.parentNode.parentNode;
+ var id = divbox.id;
+ var divpointer = document.getElementById(divbox.id + '-pointer');
+
+ var text;
+ if (action == 'update') {
+ var text_el = document.getElementById(divbox.id + '-text');
+ text = text_el.innerHTML.unescapeHTML();
+
+ } else {
+ text = '';
+ }
+
+ var dx = parseInt(divpointer.style.left);
+ var dy = parseInt(divpointer.style.top);
+ //alert('not yet 2:' + text + text_el); // + divpointer.style.top "x" + divpo );
+ id = id.substring(2);
+ return show_form(divbox.img_id, dx, dy, id, text, action);
+}
+
+// show comment form when 'update-comment' button pressed
+function update_comment(button)
+{
+ var divbox = button.parentNode.parentNode.parentNode.parentNode;
+ var id = divbox.id;
+ var divpointer = document.getElementById(divbox.id + '-pointer');
+ var dx = parseInt(divpointer.style.left);
+ var dy = parseInt(divpointer.style.top);
+
+ var commentdiv = button.parentNode.parentNode.parentNode;
+ var id = commentdiv.id.substring(1);
+ var text = document.getElementById('kt' + id).innerHTML.unescapeHTML();
+
+ return show_form(divbox.img_id, dx, dy, id, text, 'update-comment');
+}
+
+//fill up comment form and show him
+function show_form(img_id, dx, dy, id, text, action) {
+ var form = document.getElementById('commform');
+ var formdiv = document.getElementById('commform-div');
+ var textarea = document.getElementById('commform-text');
+ var inputX = document.getElementById('commform-x');
+ var inputY = document.getElementById('commform-y');
+ var inputImgId = document.getElementById('commform-img-id');
+ var inputId = document.getElementById('commform-id');
+ var inputAction = document.getElementById('commform-action');
+ var img = document.getElementById(img_id);
+
+ if( formdiv == null || textarea == null ) {
+ alert("form null");
+ return 1;
+ }
+
+ //form.action = "#" + img_id;
+
+ // set hidden values
+ inputX.value = dx;
+ inputY.value = dy;
+ inputImgId.value = img_id;
+ inputId.value = id;
+ inputAction.value = action;
+ textarea.value = text;
+
+ //textarea.value = "dxy:"+ dx + "x" + dy + "\n" + 'id:' + img_id;
+
+ // show form
+ formdiv.style.display = 'block';
+ formdiv.style.left = dx;
+ formdiv.style.top = dy;
+
+ img.parentNode.appendChild(formdiv);
+
+ textarea.focus();
+
+ return true;
+
+}
+
+function box_onmouseover(box, stat)
+{
+ var id = box.id;
+ var pointer = document.getElementById(box.id + '-pointer');
+ switch (stat){
+ case 'done':
+ pointer.className = 'pointer-done-hi';
+ break;
+ case 'wontfix':
+ pointer.className = 'pointer-wontfix-hi';
+ break;
+ default:
+ pointer.className = 'pointer-hi';
+ }
+}
+
+function box_onmouseout(box, stat)
+{
+ var id = box.id;
+ var pointer = document.getElementById(box.id + '-pointer');
+ switch (stat){
+ case 'done':
+ pointer.className = 'pointer-done';
+ break;
+ case 'wontfix':
+ pointer.className = 'pointer-wontfix';
+ break;
+ default:
+ pointer.className = 'pointer';
+ }
+}
+
+function save_scroll(form)
+{
+ //alert('save_scroll:' + document.body.scrollTop);
+ form.scroll.value = document.body.scrollTop;
+ //alert('save_scroll:' + form.scroll.value);
+ return true;
+}
+
+
+String.prototype.unescapeHTML = function () {
+ return(
+ this.replace(/&/g,'&').
+ replace(/>/g,'>').
+ replace(/</g,'<').
+ replace(/"/g,'"')
+ );
+};
+
diff --git a/korektury/static/korektury/png/.gitignore b/korektury/static/korektury/png/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/korektury/static/korektury/png/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/korektury/static/korektury/tmp/.gitignore b/korektury/static/korektury/tmp/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/korektury/static/korektury/tmp/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/korektury/templates/korektury/opraf.html b/korektury/templates/korektury/opraf.html
new file mode 100644
index 00000000..bb354a7e
--- /dev/null
+++ b/korektury/templates/korektury/opraf.html
@@ -0,0 +1,185 @@
+
+
+
+
+
+ Korektury {{pdf.nazev}}
+
+
+
Korektury {{pdf.nazev}}
+ {% if pdf.status = 'zanaseni' %}
Probíhá zanášení korektur, zvažte, zda chcete přidávat nové
{% endif %}
+ {% if pdf.status = 'zastarale' %}
Toto PDF je již zastaralé, nepřidávejte nové korektury
{% endif %}
+ {{pdf.komentar}}
+
+ Klikni na chybu, napiš komentář |
+ ls |
+ help | |
+ hlavní stránka |
+ wiki |
+
+
+
+
+
+
+
+
+ {% for i in img_indexes %}
+
+
+
+
+ {% endfor %}
+
+
+
+
+
+
Změnit stav PDF:
+ Aktuální: {{pdf.status}}
+
+
+
+
+
+
+
+ Děkujeme opravovatelům: {% for autor,pocet in zasluhy.items %} {{autor}}({{pocet}}) {% endfor %}