Compare commits

..

No commits in common. "7da9aa5fe34c7c2e74d5908235a1c2456b7acdb7" and "b637aed7ab35b8f2d68a451d1cfdf37dc627edde" have entirely different histories.

4 changed files with 21 additions and 17 deletions

View file

@ -102,6 +102,7 @@ form {
top:0px; top:0px;
} }
#commform-div { #commform-div {
display: none;
position: absolute; position: absolute;
background-color: white; background-color: white;
border: 1px solid; border: 1px solid;

View file

@ -46,8 +46,6 @@ function place_comments_one_div(img_id, comments)
el.pointer = elp; el.pointer = elp;
el.img_id = img_id; el.img_id = img_id;
el.x = x
el.y = y
el.style.position = 'absolute'; el.style.position = 'absolute';
el.style.left = w + w_skip; el.style.left = w + w_skip;
el.style.top = y + delta_y; el.style.top = y + delta_y;
@ -103,28 +101,34 @@ function toggle_visibility(oprava){
// show comment form, when 'comment' button pressed // show comment form, when 'comment' button pressed
function comment(op) function comment(op)
{ {
return show_form(op.img_id, op.x, op.y, op.dataset.opid, "", "comment"); var divpointer = op.pointer;
var dx = parseInt(divpointer.style.left);
var dy = parseInt(divpointer.style.top);
return show_form(op.img_id, dx, dy, op.dataset.opid, "", "comment");
} }
// show comment form when 'update-comment' button pressed // show comment form when 'update-comment' button pressed
function update_comment(oid,ktid) function update_comment(oid,ktid)
{ {
var divbox = document.getElementById(oid); var divbox = document.getElementById(oid);
var divpointer = divbox.pointer;
var dx = parseInt(divpointer.style.left);
var dy = parseInt(divpointer.style.top);
var text = document.getElementById(ktid).textContent; var text = document.getElementById(ktid).textContent;
return show_form(divbox.img_id, divbox.x, divbox.y, ktid.substring(2), text, 'update-comment'); return show_form(divbox.img_id, dx, dy, ktid.substring(2), text, 'update-comment');
} }
function oprava_onmouseover(op) function box_onmouseover(box)
{ {
var pointer = op.pointer; var pointer = box.pointer;
pointer.classList.remove('pointer'); pointer.classList.remove('pointer');
pointer.classList.add('pointer-hi'); pointer.classList.add('pointer-hi');
} }
function oprava_onmouseout(op) function box_onmouseout(box)
{ {
var pointer = op.pointer; var pointer = box.pointer;
pointer.classList.remove('pointer-hi'); pointer.classList.remove('pointer-hi');
pointer.classList.add('pointer'); pointer.classList.add('pointer');
} }

View file

@ -1,4 +1,4 @@
<div id="commform-div" style="display: none"> <div id="commform-div">
<form action='' id="commform" method="POST"> <form action='' id="commform" method="POST">
{% csrf_token %} {% csrf_token %}
<input size="24" name="au" value="{{user.first_name}} {{user.last_name}}" readonly/> <input size="24" name="au" value="{{user.first_name}} {{user.last_name}}" readonly/>
@ -57,8 +57,6 @@
return 1; return 1;
} }
if (formdiv.style.display !== 'none' && !confirm("Zavřít předchozí okénko přidávání korektury / editace komentáře?")) return 1;
//form.action = "#" + img_id; //form.action = "#" + img_id;
// set hidden values // set hidden values

View file

@ -11,11 +11,12 @@
data-opravastatus="{{o.status}}" data-opravastatus="{{o.status}}"
data-opravazobrazit="true" data-opravazobrazit="true"
data-opid="{{o.id}}" data-opid="{{o.id}}"
onmouseover='oprava_onmouseover(this)' onmouseover='box_onmouseover(this)'
onmouseout='oprava_onmouseout(this)' onmouseout='box_onmouseout(this)'
> >
<div class='corr-body'> <div class='corr-body' id='op{{o.id}}-body'>
{% for k in o.komentare %} {% for k in o.komentare %}
{% include "korektury/korekturovatko/__komentar.html" %} {% include "korektury/korekturovatko/__komentar.html" %}
<hr> <hr>
@ -23,7 +24,7 @@
</div> </div>
<div class='corr-header'> <div class='corr-header'>
<span class='float-right'> <span class='float-right'>
<span class='corr-buttons'> <span id='op{{o.id}}-buttons' class='corr-buttons'>
<form action='' method='POST'> <form action='' method='POST'>
{% csrf_token %} {% csrf_token %}
<input type='hidden' name='id' value='{{o.id}}'> <input type='hidden' name='id' value='{{o.id}}'>
@ -54,7 +55,7 @@
</span> </span>
<button type='button' onclick='toggle_visibility(this.parentElement.parentElement.parentElement);' title='Skrýt/Zobrazit'> <button type='button' onclick='toggle_visibility(this.parentElement.parentElement.parentElement);' title='Skrýt/Zobrazit'>
<img class='toggle-button' src="{% static "korektury/imgs/hide.png" %}"/> <img id='op{{o.id}}-toggleimg' class='toggle-button' src="{% static "korektury/imgs/hide.png" %}"/>
</button> </button>
</span> </span>