1
0
forked from ScoDoc/ScoDoc
This commit is contained in:
Emmanuel Viennet 2023-03-22 21:57:40 +01:00
parent 01308561d3
commit 8af5c3ffa0

View File

@ -5,7 +5,7 @@ $().ready(function () {
$("#formnotes .note").bind("blur", valid_note);
$("#formnotes input").bind("paste", paste_text);
$(".btn_masquer_DEM").bind("click", masquer_DEM);
$(".btn_masquer_DEM").bind("click", masquer_DEM);
});
@ -16,7 +16,7 @@ function is_valid_note(v) {
var note_min = parseFloat($("#eval_note_min").text());
var note_max = parseFloat($("#eval_note_max").text());
if (!v.match("^-?[0-9.]*$")) {
if (!v.match("^-?[0-9]*.?[0-9]*$")) {
return (v == "ABS") || (v == "EXC") || (v == "SUPR") || (v == "ATT") || (v == "DEM");
} else {
var x = parseFloat(v);
@ -51,9 +51,9 @@ function save_note(elem, v, etudid) {
'comment': document.getElementById('formnotes_comment').value
},
function (result) {
sco_message("enregistré");
elem.className = "note_saved";
if (result['nbchanged'] > 0) {
sco_message("enregistré");
elem.className = "note_saved";
// il y avait une decision de jury ?
if (result.existing_decisions[0] == etudid) {
if (v != $(elem).attr('data-orig-value')) {
@ -66,8 +66,12 @@ function save_note(elem, v, etudid) {
if (result['history_menu']) {
$("#hist_" + etudid).html(result['history_menu']);
}
$(elem).attr('data-last-saved-value', v);
} else {
$('#sco_msg').html("").show();
sco_message("valeur non enregistrée");
}
$(elem).attr('data-last-saved-value', v)
}
);
}
@ -93,7 +97,7 @@ function paste_text(e) {
var data = clipb.getData('Text');
var list = data.split(/\r\n|\r|\n|\t| /g);
var currentInput = event.currentTarget;
var masquerDEM = document.querySelector("body").classList.contains("masquer_DEM");
var masquerDEM = document.querySelector("body").classList.contains("masquer_DEM");
for (var i = 0; i < list.length; i++) {
currentInput.value = list[i];
@ -102,14 +106,14 @@ function paste_text(e) {
currentInput.dispatchEvent(evt);
var sibbling = currentInput.parentElement.parentElement.nextElementSibling;
while (
sibbling &&
(
sibbling.style.display == "none" ||
(
masquerDEM && sibbling.classList.contains("etud_dem")
)
)
) {
sibbling &&
(
sibbling.style.display == "none" ||
(
masquerDEM && sibbling.classList.contains("etud_dem")
)
)
) {
sibbling = sibbling.nextElementSibling;
}
if (sibbling) {
@ -123,6 +127,6 @@ function paste_text(e) {
}
}
function masquer_DEM(){
document.querySelector("body").classList.toggle("masquer_DEM");
function masquer_DEM() {
document.querySelector("body").classList.toggle("masquer_DEM");
}