Browse Source

Skryvani korektur dle druhu.

export_seznamu_prednasek
parent
commit
3cc3257a51
  1. 33
      korektury/static/korektury/opraf.js
  2. 26
      korektury/templates/korektury/opraf.html

33
korektury/static/korektury/opraf.js

@ -65,6 +65,12 @@ function place_comments_one_div(img_id, comments)
} }
} }
function place_comments() {
for (var i=0; i < comments.length-1; i++) {
place_comments_one_div(comments[i][0], comments[i][1])
}
}
// ctrl-enter submits form // ctrl-enter submits form
function textarea_onkey(ev) function textarea_onkey(ev)
{ {
@ -238,6 +244,33 @@ function save_scroll(form)
return true; return true;
} }
function toggle_corrections(aclass)
{
var stylesheets = document.styleSheets;
var ssheet = null;
for (var i=0;i<stylesheets.length; i++){
if (stylesheets[i].title === "opraf-css"){
ssheet = stylesheets[i];
break;
}
}
if (! ssheet){
return;
}
for (var i=0;i<ssheet.cssRules.length;i++){
var rule = ssheet.cssRules[i];
if (rule.selectorText === '.'+aclass){
if (rule.style.display === ""){
rule.style.display = "none";
} else {
rule.style.display = "";
}
}
}
place_comments();
}
String.prototype.unescapeHTML = function () { String.prototype.unescapeHTML = function () {
return( return(

26
korektury/templates/korektury/opraf.html

@ -3,7 +3,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" media="screen, projection" href="{% static "korektury/opraf.css"%}" /> <link rel="stylesheet" title="opraf-css" type="text/css" media="screen, projection" href="{% static "korektury/opraf.css"%}" />
<script src="{% static "korektury/opraf.js"%}"></script> <script src="{% static "korektury/opraf.js"%}"></script>
<title>Korektury {{pdf.nazev}}</title> <title>Korektury {{pdf.nazev}}</title>
</head> </head>
@ -22,13 +22,25 @@
<a href="https://mam.mff.cuni.cz/wiki">wiki</a> | <a href="https://mam.mff.cuni.cz/wiki">wiki</a> |
<hr /> <hr />
Zobrazit: Zobrazit:
<input type="checkbox" id="k_oprave_checkbox" name="k_oprave_checkbox" checked> <input type="checkbox"
<label for="k_oprave_checkbox">K opravě</labe> id="k_oprave_checkbox"
<input type="checkbox" id="opraveno_checkbox" name="opraveno_checkbox" checked> name="k_oprave_checkbox"
<label for="opraveno_checkbox">Opraveno</labe> onchange="toggle_corrections('k_oprave')" checked>
<input type="checkbox" id="neni_chyba_checkbox" name="neni_chyba_checkbox" checked> <label for="k_oprave_checkbox">K opravě</label>
<input type="checkbox"
id="opraveno_checkbox"
name="opraveno_checkbox"
onchange="toggle_corrections('opraveno')" checked>
<label for="opraveno_checkbox">Opraveno</label>
<input type="checkbox"
id="neni_chyba_checkbox"
name="neni_chyba_checkbox"
onchange="toggle_corrections('neni_chyba')" checked>
<label for="neni_chyba_checkbox">Není chyba</labe> <label for="neni_chyba_checkbox">Není chyba</labe>
<input type="checkbox" id="k_zaneseni_checkbox" name="k_zaneseni_checkbox" checked> <input type="checkbox"
id="k_zaneseni_checkbox"
name="k_zaneseni_checkbox"
onchange="toggle_corrections('k_zaneseni')" checked>
<label for="k_zaneseni_checkbox">K opravě</labe> <label for="k_zaneseni_checkbox">K opravě</labe>
<hr/> <hr/>

Loading…
Cancel
Save