diff --git a/korektury/static/korektury/opraf.js b/korektury/static/korektury/opraf.js index 08b6149e..eb319459 100644 --- a/korektury/static/korektury/opraf.js +++ b/korektury/static/korektury/opraf.js @@ -22,7 +22,6 @@ function place_comments_one_div(img_id, comments) } }); - //console.log("w:" + w); for (c in comments_sorted) { var id = comments_sorted[c][0]; var x = comments_sorted[c][1]; @@ -53,13 +52,8 @@ function place_comments_one_div(img_id, comments) 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; } @@ -74,12 +68,9 @@ function place_comments() { // 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 =''; + if( form ) { form.submit(); } return true; @@ -155,7 +146,7 @@ function box_edit(oid, action) var text; if (action == 'update') { var text_el = document.getElementById(oid + '-text'); - text = text_el.textContent; // FIXME původně tu bylo innerHTML.unescapeHTML() + text = text_el.textContent; } else { text = ''; @@ -164,7 +155,6 @@ function box_edit(oid, action) var dx = parseInt(divpointer.style.left); var dy = parseInt(divpointer.style.top); var divbox = document.getElementById(oid); - //alert('not yet 2:' + text + text_el); // + divpointer.style.top "x" + divpo ); id = oid.substring(2); return show_form(divbox.img_id, dx, dy, id, text, action); } @@ -177,7 +167,7 @@ function update_comment(oid,ktid) var dy = parseInt(divpointer.style.top); var divbox = document.getElementById(oid); - var text = document.getElementById(ktid).textContent; // FIXME původně tu bylo innerHTML.unescapeHTML() + var text = document.getElementById(ktid).textContent; return show_form(divbox.img_id, dx, dy, ktid.substring(2), text, 'update-comment'); } @@ -225,7 +215,6 @@ function show_form(img_id, dx, dy, id, text, action) { function box_onmouseover(box) { - var id = box.id; var pointer = document.getElementById(box.id + '-pointer'); pointer.classList.remove('pointer'); pointer.classList.add('pointer-hi'); @@ -233,20 +222,11 @@ function box_onmouseover(box) function box_onmouseout(box) { - var id = box.id; var pointer = document.getElementById(box.id + '-pointer'); pointer.classList.remove('pointer-hi'); pointer.classList.add('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; -} - function toggle_corrections(aclass) { var stylesheets = document.styleSheets; @@ -271,16 +251,6 @@ function toggle_corrections(aclass) } } place_comments(); - + } - -String.prototype.unescapeHTML = function () { - return( - this.replace(/&/g,'&'). - replace(/>/g,'>'). - replace(/</g,'<'). - replace(/"/g,'"') - ); -}; - diff --git a/korektury/templates/korektury/korekturovatko/__edit_komentar.html b/korektury/templates/korektury/korekturovatko/__edit_komentar.html index 7e6462ba..067bcd03 100644 --- a/korektury/templates/korektury/korekturovatko/__edit_komentar.html +++ b/korektury/templates/korektury/korekturovatko/__edit_komentar.html @@ -1,5 +1,5 @@
-
+ {% csrf_token %} diff --git a/korektury/templates/korektury/korekturovatko/__komentar.html b/korektury/templates/korektury/korekturovatko/__komentar.html index 8e95374f..50f2042c 100644 --- a/korektury/templates/korektury/korekturovatko/__komentar.html +++ b/korektury/templates/korektury/korekturovatko/__komentar.html @@ -5,7 +5,7 @@
{{k.autor}}
- + {% csrf_token %} @@ -21,4 +21,4 @@
{{k.text|linebreaks}}
- \ No newline at end of file + diff --git a/korektury/templates/korektury/korekturovatko/__oprava.html b/korektury/templates/korektury/korekturovatko/__oprava.html index d3b2f3fd..321bd81d 100644 --- a/korektury/templates/korektury/korekturovatko/__oprava.html +++ b/korektury/templates/korektury/korekturovatko/__oprava.html @@ -19,7 +19,7 @@
- + {% csrf_token %} @@ -66,4 +66,4 @@
- \ No newline at end of file +