Skip to content
Snippets Groups Projects
Commit 1b54d7c2 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

js/ : prettification (vscode prettier) avec tabs=2

parent a7935d37
Branches
No related tags found
No related merge requests found
Showing
with 819 additions and 800 deletions
......@@ -67,18 +67,24 @@ CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
def groups_view(
group_ids=(),
fmt="html",
# Options pour listes:
with_codes=0,
etat=None,
with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail)
with_archives=0, # ajoute colonne avec noms fichiers archivés
with_paiement=0,
with_archives=0,
with_annotations=0,
with_bourse=0,
formsemestre_id=None, # utilise si aucun groupe selectionné
formsemestre_id=None,
):
"""Affichage des étudiants des groupes indiqués
group_ids: liste de group_id
fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
Options pour listes:
with_paiement: si vrai, ajoute colonnes infos paiement droits
et finalisation inscription (lent car interrogation portail)
with_archives: ajoute colonne avec noms fichiers archivés
formsemestre_id est utilisé si aucun groupe selectionné pour construire la liste des groupes.
"""
# Informations sur les groupes à afficher:
groups_infos = DisplayedGroupsInfos(
......
$(function () {
$("div#export_help").accordion({
heightStyle: "content",
......@@ -14,36 +13,36 @@ $(function () {
// -> surligne le cas sélectionné
function display(r, c, row, col) {
if ((row != r) && (row != '*')) return 'none';
if ((col != c) && (col != '*')) return 'none';
return '';
if (row != r && row != "*") return "none";
if (col != c && col != "*") return "none";
return "";
}
function show_tag(all_rows, all_cols, tag) {
// Filtrer tous les étudiants
all_rows.split(',').forEach(function (r) {
all_cols.split(',').forEach(function (c) {
all_rows.split(",").forEach(function (r) {
all_cols.split(",").forEach(function (c) {
etudiants = r + c.substring(1);
$(etudiants).css("display", "none");
})
})
});
});
// sauf le tag
$('.' + tag).css('display', '');
$("." + tag).css("display", "");
}
function show_filtres(effectifs, filtre_row, filtre_col) {
$("#compte").html(effectifs);
if ((filtre_row == '') && (filtre_col == '')) {
if (filtre_row == "" && filtre_col == "") {
$("#sans_filtre").css("display", "");
$("#filtre_row").css("display", "none");
$("#filtre_col").css("display", "none");
} else {
$("#sans_filtre").css("display", "none");
if (filtre_row == '') {
if (filtre_row == "") {
$("#filtre_row").css("display", "none");
$("#filtre_col").css("display", "");
$("#filtre_col").html("Filtre sur code étape: " + filtre_col);
} else if (filtre_col == '') {
} else if (filtre_col == "") {
$("#filtre_row").css("display", "");
$("#filtre_col").css("display", "none");
$("#filtre_row").html("Filtre sur semestre: " + filtre_row);
......@@ -56,26 +55,38 @@ function show_filtres(effectifs, filtre_row, filtre_col) {
}
}
function doFiltrage(all_rows, all_cols, row, col, effectifs, filtre_row, filtre_col) {
show_filtres(effectifs, filtre_row, filtre_col)
all_rows.split(',').forEach(function (r) {
all_cols.split(',').forEach(function (c) {
function doFiltrage(
all_rows,
all_cols,
row,
col,
effectifs,
filtre_row,
filtre_col
) {
show_filtres(effectifs, filtre_row, filtre_col);
all_rows.split(",").forEach(function (r) {
all_cols.split(",").forEach(function (c) {
etudiants = r + c.substring(1);
$(etudiants).css("display", display(r, c, row, col));
});
});
$('.repartition td').css("background-color", "");
$('.repartition th').css("background-color", "");
$(".repartition td").css("background-color", "");
$(".repartition th").css("background-color", "");
if (row == '*' && col == '*') { // Aucun filtre
} else if (row == '*') { // filtrage sur 1 colonne
if (row == "*" && col == "*") {
// Aucun filtre
} else if (row == "*") {
// filtrage sur 1 colonne
$(col).css("background-color", "lightblue");
} else if (col == '*') { // Filtrage sur 1 ligne
$(row + '>td').css("background-color", "lightblue");
$(row + '>th').css("background-color", "lightblue");
} else { // filtrage sur 1 case
$(row + '>td' + col).css("background-color", "lightblue");
} else if (col == "*") {
// Filtrage sur 1 ligne
$(row + ">td").css("background-color", "lightblue");
$(row + ">th").css("background-color", "lightblue");
} else {
// filtrage sur 1 case
$(row + ">td" + col).css("background-color", "lightblue");
}
// Modifie le titre de la section pour indiquer la sélection:
......
// Affichage anciens (non BUT) bulletin de notes
// (uses jQuery)
// Change visibility of UE details (les <tr> de classe "notes_bulletin_row_mod" suivant)
// La table a la structure suivante:
// <tr class="notes_bulletin_row_ue"><td><span class="toggle_ue">+/-</span>...</td>...</tr>
......@@ -15,7 +14,7 @@ function toggle_vis_ue(e, new_state) {
var tr = e.parentNode.parentNode;
if (new_state == undefined) {
// current state: use alt attribute of current image
if (e.childNodes[0].alt == '+') {
if (e.childNodes[0].alt == "+") {
new_state = false;
} else {
new_state = true;
......@@ -25,26 +24,30 @@ function toggle_vis_ue(e, new_state) {
var tr = tr.nextSibling;
//while ((tr != null) && sibl.tagName == 'TR') {
var current = true;
while ((tr != null) && current) {
if ((tr.nodeType == 1) && (tr.tagName == 'TR')) {
while (tr != null && current) {
if (tr.nodeType == 1 && tr.tagName == "TR") {
for (var i = 0; i < tr.classList.length; i++) {
if ((tr.classList[i] == 'notes_bulletin_row_ue') || (tr.classList[i] == 'notes_bulletin_row_sum_ects'))
if (
tr.classList[i] == "notes_bulletin_row_ue" ||
tr.classList[i] == "notes_bulletin_row_sum_ects"
)
current = false;
}
if (current) {
if (new_state) {
tr.style.display = 'none';
tr.style.display = "none";
} else {
tr.style.display = 'table-row';
tr.style.display = "table-row";
}
}
}
tr = tr.nextSibling;
}
if (new_state) {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
e.innerHTML =
'<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
} else {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
e.innerHTML =
'<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
}
}
......@@ -13,12 +13,11 @@ var CURRENTWEEKCOLOR = "yellow";
// get all tr elements from this class
// (no getElementBuClassName)
function getTRweek(week) {
var tablecal = document.getElementById('maincalendar');
var all = tablecal.getElementsByTagName('tr');
var tablecal = document.getElementById("maincalendar");
var all = tablecal.getElementsByTagName("tr");
var res = [];
for (var i = 0; i < all.length; i++) {
if (all[i].className == week)
res[res.length] = all[i];
if (all[i].className == week) res[res.length] = all[i];
}
return res;
}
......@@ -26,11 +25,10 @@ function getTRweek( week ) {
var HIGHLIGHTEDCELLS = [];
function deselectweeks() {
for (var i = 0; i < HIGHLIGHTEDCELLS.length; i++) {
var row = rows[i];
if (row) {
if (row.className.match('currentweek')) {
if (row.className.match("currentweek")) {
row.style.backgroundColor = CURRENTWEEKCOLOR;
} else {
row.style.backgroundColor = WEEKDAYCOLOR;
......@@ -44,7 +42,7 @@ function deselectweeks() {
function highlightweek(el) {
deselectweeks();
var week = el.className;
if ((week == 'wkend') || (week.substring(0,2) != 'wk')) {
if (week == "wkend" || week.substring(0, 2) != "wk") {
return; /* does not hightlight weekends */
}
rows = getTRweek(week);
......@@ -58,7 +56,7 @@ function highlightweek(el) {
// click on a day
function wclick(el) {
monday = el.className;
form = document.getElementById('formw');
form.datelundi.value = monday.substr(2).replace(/_/g,'/').split(' ')[0];
form = document.getElementById("formw");
form.datelundi.value = monday.substr(2).replace(/_/g, "/").split(" ")[0];
form.submit();
}
......@@ -2,5 +2,4 @@ function submit_form() {
$("#config_logos_form").submit();
}
$(function () {
})
\ No newline at end of file
$(function () {});
......@@ -13,7 +13,7 @@ les balises (fermées par défaut sauf si attribut open déjà activé dans le c
*/
const ID_ATTRIBUTE = "ds_id"
const ID_ATTRIBUTE = "ds_id";
function genere_id(detail, idnum) {
let id = "ds_" + idnum;
......@@ -47,7 +47,7 @@ function restore_detail(detail, id) {
}
function add_listener(detail) {
detail.addEventListener('toggle', (e) => {
detail.addEventListener("toggle", (e) => {
let id = e.target.getAttribute(ID_ATTRIBUTE);
let ante = e.target.getAttribute("open");
if (ante == null) {
......@@ -56,16 +56,16 @@ function add_listener(detail) {
localStorage.setItem(id, true);
}
e.stopPropagation();
})
});
}
function reset_ds() {
let idnum = 0;
keepDetails = true;
details = document.querySelectorAll("details")
details = document.querySelectorAll("details");
details.forEach(function (detail) {
let id = genere_id(detail, idnum);
console.log("Processing " + id)
console.log("Processing " + id);
if (keepDetails) {
restore_detail(detail, id);
} else {
......@@ -76,7 +76,7 @@ function reset_ds() {
});
}
window.addEventListener('load', function() {
window.addEventListener("load", function () {
console.log("details/summary persistence ON");
reset_ds();
})
});
function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post(SCO_URL + '/partition_set_attr',
$.post(
SCO_URL + "/partition_set_attr",
{
'partition_id': partition_id,
'attr': attr_name,
'value': attr_value
partition_id: partition_id,
attr: attr_name,
value: attr_value,
},
function (result) {
sco_message(result);
});
}
);
return;
}
// Met à jour bul_show_rank lorsque checkbox modifiees:
function update_rk(e) {
var partition_id = $(e).attr('data-partition_id');
var partition_id = $(e).attr("data-partition_id");
var v;
if (e.checked)
v = '1';
else
v = '0';
_partition_set_attr(partition_id, 'bul_show_rank', v);
if (e.checked) v = "1";
else v = "0";
_partition_set_attr(partition_id, "bul_show_rank", v);
}
function update_show_in_list(e) {
var partition_id = $(e).attr('data-partition_id');
var partition_id = $(e).attr("data-partition_id");
var v;
if (e.checked)
v = '1';
else
v = '0';
if (e.checked) v = "1";
else v = "0";
_partition_set_attr(partition_id, 'show_in_lists', v);
_partition_set_attr(partition_id, "show_in_lists", v);
}
......@@ -15,10 +15,11 @@ $().ready(function () {
function update_bonus_description() {
var ue_type = $("#tf_type")[0].value;
if (ue_type == "1") { /* UE SPORT */
if (ue_type == "1") {
/* UE SPORT */
$("#bonus_description").show();
var query = "/ScoDoc/get_bonus_description/default";
$.get(query, '', function (data) {
$.get(query, "", function (data) {
$("#bonus_description").html(data);
});
} else {
......@@ -30,29 +31,38 @@ function update_bonus_description() {
function update_ue_list() {
let ue_id = $("#tf_ue_id")[0].value;
let ue_code = $("#tf_ue_code")[0].value;
let query = SCO_URL + "/Notes/ue_sharing_code?ue_code=" + ue_code + "&hide_ue_id=" + ue_id + "&ue_id=" + ue_id;
$.get(query, '', function (data) {
let query =
SCO_URL +
"/Notes/ue_sharing_code?ue_code=" +
ue_code +
"&hide_ue_id=" +
ue_id +
"&ue_id=" +
ue_id;
$.get(query, "", function (data) {
$("#ue_list_code").html(data);
});
}
function set_ue_parcour(checkbox) {
let url = checkbox.dataset.setter;
const checkboxes = document.querySelectorAll('#choix_parcours input[type="checkbox"]:checked');
const checkboxes = document.querySelectorAll(
'#choix_parcours input[type="checkbox"]:checked'
);
const parcours_ids = [];
checkboxes.forEach(function (checkbox) {
parcours_ids.push(checkbox.value);
});
fetch(url, {
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json'
"Content-Type": "application/json",
},
body: JSON.stringify(parcours_ids)
body: JSON.stringify(parcours_ids),
})
.then(response => response.json())
.then(data => {
.then((response) => response.json())
.then((data) => {
if (data.status == 404) {
sco_error_message(data.message);
} else {
......@@ -60,4 +70,3 @@ function set_ue_parcour(checkbox) {
}
});
}
// Mécanisme d'auto-complétion (choix) d'un étudiant
// Il faut un champs #etudiant (text input) et à coté un champ hidden etudid qui sera rempli.
// utilise autoComplete.js, source https://tarekraafat.github.io/autoComplete.js
......@@ -22,19 +21,21 @@ function etud_autocomplete_config(with_dept = false) {
}
},
// Data source 'Object' key to be searched
keys: ["nom"]
keys: ["nom"],
},
events: {
input: {
selection: (event) => {
const prenom = sco_capitalize(event.detail.selection.value.prenom);
const selection = with_dept ? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})` : `${event.detail.selection.value.nom} ${prenom}`;
const selection = with_dept
? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})`
: `${event.detail.selection.value.nom} ${prenom}`;
// store etudid
const etudidField = document.getElementById('etudid');
const etudidField = document.getElementById("etudid");
etudidField.value = event.detail.selection.value.id;
autoCompleteJS.input.value = selection;
}
}
},
},
},
resultsList: {
element: (list, data) => {
......@@ -48,7 +49,7 @@ function etud_autocomplete_config(with_dept = false) {
// Append message element to the results list
list.prepend(message);
// Efface l'etudid
const etudidField = document.getElementById('etudid');
const etudidField = document.getElementById("etudid");
etudidField.value = "";
}
},
......@@ -58,8 +59,10 @@ function etud_autocomplete_config(with_dept = false) {
highlight: true,
element: (item, data) => {
const prenom = sco_capitalize(data.value.prenom);
item.innerHTML += with_dept ? ` ${prenom} (${data.value.dept_acronym})` : ` ${prenom}`;
item.innerHTML += with_dept
? ` ${prenom} (${data.value.dept_acronym})`
: ` ${prenom}`;
},
},
}
};
}
// Tableau recap evaluations du semestre
$(function () {
$('table.evaluations_recap').DataTable(
{
$("table.evaluations_recap").DataTable({
paging: false,
searching: true,
info: false,
autoWidth: false,
fixedHeader: {
header: true,
footer: false
footer: false,
},
orderCellsTop: true, // cellules ligne 1 pour tri
aaSorting: [], // Prevent initial sorting
colReorder: true,
"columnDefs": [
columnDefs: [
{
// colonne date, triable (XXX ne fonctionne pas)
targets: ["date"],
"type": "string",
type: "string",
},
],
dom: 'Bfrtip',
dom: "Bfrtip",
buttons: [
{
extend: 'copyHtml5',
text: 'Copier',
exportOptions: { orthogonal: 'export' }
extend: "copyHtml5",
text: "Copier",
exportOptions: { orthogonal: "export" },
},
{
extend: 'excelHtml5',
exportOptions: { orthogonal: 'export' },
title: document.querySelector('table.evaluations_recap').dataset.filename
extend: "excelHtml5",
exportOptions: { orthogonal: "export" },
title: document.querySelector("table.evaluations_recap").dataset
.filename,
},
],
})
});
});
......@@ -2,13 +2,10 @@
// Menu choix parcours:
$(function () {
$('#parcours_sel').multiselect(
{
$("#parcours_sel").multiselect({
includeSelectAllOption: true,
nonSelectedText:'Choisir le(s) parcours...',
selectAllValue: '',
nonSelectedText: "Choisir le(s) parcours...",
selectAllValue: "",
numberDisplayed: 3,
}
);
});
});
......@@ -4,25 +4,37 @@ var apo_mod_editor = null;
$(document).ready(function () {
var table_options = {
"paging": false,
"searching": false,
"info": false,
paging: false,
searching: false,
info: false,
/* "autoWidth" : false, */
"fixedHeader": {
"header": true,
"footer": true
fixedHeader: {
header: true,
footer: true,
},
"orderCellsTop": true, // cellules ligne 1 pour tri
"aaSorting": [], // Prevent initial sorting
orderCellsTop: true, // cellules ligne 1 pour tri
aaSorting: [], // Prevent initial sorting
};
$('table#formation_table_recap').DataTable(table_options);
let table_editable = document.querySelector("table#formation_table_recap.apo_editable");
$("table#formation_table_recap").DataTable(table_options);
let table_editable = document.querySelector(
"table#formation_table_recap.apo_editable"
);
if (table_editable) {
let apo_ue_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_ue_save_url;
apo_ue_editor = new ScoFieldEditor("table#formation_table_recap tr.ue td.apo", apo_ue_save_url, false);
let apo_mod_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_mod_save_url;
apo_mod_editor = new ScoFieldEditor("table#formation_table_recap tr.mod td.apo", apo_mod_save_url, false);
let apo_ue_save_url = document.querySelector(
"table#formation_table_recap.apo_editable"
).dataset.apo_ue_save_url;
apo_ue_editor = new ScoFieldEditor(
"table#formation_table_recap tr.ue td.apo",
apo_ue_save_url,
false
);
let apo_mod_save_url = document.querySelector(
"table#formation_table_recap.apo_editable"
).dataset.apo_mod_save_url;
apo_mod_editor = new ScoFieldEditor(
"table#formation_table_recap tr.mod td.apo",
apo_mod_save_url,
false
);
}
});
......@@ -8,7 +8,6 @@ function change_semestre_id() {
$(".sem" + semestre_id).show();
}
$(window).on('load', function () {
$(window).on("load", function () {
change_semestre_id();
});
function compute_moyenne() {
var notes = $(".tf_field_note input").map(
function () { return parseFloat($(this).val()); }
).get();
var notes = $(".tf_field_note input")
.map(function () {
return parseFloat($(this).val());
})
.get();
// les coefs sont donnes (ECTS en BUT)
let coefs = $("form.tf_ext_edit_ue_validations").data("ue_coefs");
// ou saisis (formations classiques)
if (coefs == 'undefined') {
coefs = $(".tf_field_coef input").map(
function () { return parseFloat($(this).val()); }
).get();
if (coefs == "undefined") {
coefs = $(".tf_field_coef input")
.map(function () {
return parseFloat($(this).val());
})
.get();
}
var N = notes.length;
var dp = 0.;
var sum_coefs = 0.;
var dp = 0;
var sum_coefs = 0;
for (var i = 0; i < N; i++) {
if (!(isNaN(notes[i]) || isNaN(coefs[i]))) {
dp += notes[i] * coefs[i];
......@@ -38,7 +39,10 @@ function enable_disable_fields_cb() {
}
function enable_disable_fields(select_elt) {
// input fields controled by this menu
var input_fields = $(select_elt).parent().parent().find('input:not(.ext_coef_disabled)');
var input_fields = $(select_elt)
.parent()
.parent()
.find("input:not(.ext_coef_disabled)");
var disabled = false;
if ($(select_elt).val() === "None") {
disabled = true;
......@@ -46,26 +50,24 @@ function enable_disable_fields(select_elt) {
input_fields.each(function () {
if (disabled) {
let cur_value = $(this).val();
$(this).data('saved-value', cur_value);
$(this).data("saved-value", cur_value);
$(this).val("");
} else {
let saved_value = $(this).data('saved-value');
if (typeof saved_value == 'undefined') {
saved_value = '';
let saved_value = $(this).data("saved-value");
if (typeof saved_value == "undefined") {
saved_value = "";
}
if (saved_value) {
$(this).val(saved_value);
}
}
});
input_fields.prop('disabled', disabled);
input_fields.prop("disabled", disabled);
}
function setup_text_fields() {
$(".ueext_valid_select").each(
function () {
$(".ueext_valid_select").each(function () {
enable_disable_fields(this);
}
);
});
}
$().ready(function () {
......
......@@ -61,7 +61,7 @@ function submit_group_selector() {
}
function show_current_tab() {
if (document.getElementsByClassName("nav-tabs").length < 0) {
if (document.getElementsByClassName("nav-tabs").length > 0) {
$('.nav-tabs [href="#' + CURRENT_TAB_HASH + '"]').tab("show");
}
}
......@@ -150,35 +150,23 @@ $().ready(function () {
if (element.hasClass("default_group")) {
// click sur groupe "tous"
// deselectionne les autres
$("#group_ids_sel option:selected").each(function (
index,
opt
) {
$("#group_ids_sel option:selected").each(function (index, opt) {
if (opt.value != default_group_id) {
$("#group_ids_sel").multiselect(
"deselect",
opt.value
);
$("#group_ids_sel").multiselect("deselect", opt.value);
}
});
} else {
// click sur un autre item
// si le groupe "tous" est selectionne et que l'on coche un autre, le deselectionner
var default_is_selected = false;
$("#group_ids_sel option:selected").each(function (
index,
opt
) {
$("#group_ids_sel option:selected").each(function (index, opt) {
if (opt.value == default_group_id) {
default_is_selected = true;
return false;
}
});
if (default_is_selected) {
$("#group_ids_sel").multiselect(
"deselect",
default_group_id
);
$("#group_ids_sel").multiselect("deselect", default_group_id);
}
}
}
......
// active les menus des codes "manuels" (année, RCUEs)
function enable_manual_codes(elt) {
$(".jury_but select.manual").prop("disabled", !elt.checked);
......@@ -19,13 +17,17 @@ function change_menu_code(elt) {
elt.parentElement.parentElement.classList.remove("recorded");
}
// Si RCUE passant en ADJ, change les menus des UEs associées ADJR
if (elt.classList.contains("code_rcue")
&& elt.dataset.niveau_id
&& elt.value == "ADJ"
&& elt.value != elt.dataset.orig_recorded) {
let ue_selects = elt.parentElement.parentElement.parentElement.querySelectorAll(
"select.ue_rcue_" + elt.dataset.niveau_id);
ue_selects.forEach(select => {
if (
elt.classList.contains("code_rcue") &&
elt.dataset.niveau_id &&
elt.value == "ADJ" &&
elt.value != elt.dataset.orig_recorded
) {
let ue_selects =
elt.parentElement.parentElement.parentElement.querySelectorAll(
"select.ue_rcue_" + elt.dataset.niveau_id
);
ue_selects.forEach((select) => {
if (select.value != "ADM") {
select.value = "ADJR";
change_menu_code(select); // pour changer les styles
......@@ -51,7 +53,7 @@ $(function () {
const noms = JSON.parse(noms_str);
const cur_idx = etudids.indexOf(etudid);
let prev_idx = -1;
let next_idx = -1
let next_idx = -1;
if (cur_idx != -1) {
if (cur_idx > 0) {
prev_idx = cur_idx - 1;
......@@ -93,13 +95,15 @@ let IS_SUBMITTING = false;
function get_form_state() {
let codes = [];
// il n'y a que des <select>
document.querySelectorAll("select").forEach(sel => codes.push(sel.value));
document.querySelectorAll("select").forEach((sel) => codes.push(sel.value));
return codes.join();
}
$('document').ready(function () {
$("document").ready(function () {
FORM_STATE = get_form_state();
document.querySelector("form#jury_but").addEventListener('submit', jury_form_submit);
document
.querySelector("form#jury_but")
.addEventListener("submit", jury_form_submit);
});
function is_modified() {
......@@ -111,8 +115,8 @@ function jury_form_submit(event) {
}
window.addEventListener("beforeunload", function (e) {
if ((!IS_SUBMITTING) && is_modified()) {
var confirmationMessage = 'Changements non enregistrés !';
if (!IS_SUBMITTING && is_modified()) {
var confirmationMessage = "Changements non enregistrés !";
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
}
......
......@@ -3,32 +3,41 @@
var ScoMarkerIcons = {};
$().ready(function () {
$('#lyc_map_canvas').gmap(
{ 'center': '48.955741,2.34141',
'zoom' : 8,
'mapTypeId': google.maps.MapTypeId.ROADMAP
}).bind('init', function(event, map) {
$("#lyc_map_canvas")
.gmap({
center: "48.955741,2.34141",
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP,
})
.bind("init", function (event, map) {
for (var i = 0; i < lycees_coords.length; i++) {
var lycee = lycees_coords[i];
var nb = lycee['number'];
var nb = lycee["number"];
var icon;
if (nb in ScoMarkerIcons) {
icon = ScoMarkerIcons[nb];
} else {
icon = new google.maps.MarkerImage( 'https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + nb + '|FF0000|000000' );
icon = new google.maps.MarkerImage(
"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" +
nb +
"|FF0000|000000"
);
ScoMarkerIcons[nb] = icon; // cache
}
$('#lyc_map_canvas').gmap(
'addMarker',
{'position': lycee['position'], 'bounds': true, 'nomlycee' : lycee['name'], 'icon' : icon }
).click(
function() {
$('#lyc_map_canvas').gmap('openInfoWindow', {'content': this.nomlycee}, this);
}
$("#lyc_map_canvas")
.gmap("addMarker", {
position: lycee["position"],
bounds: true,
nomlycee: lycee["name"],
icon: icon,
})
.click(function () {
$("#lyc_map_canvas").gmap(
"openInfoWindow",
{ content: this.nomlycee },
this
);
});
}
});
});
/* Page édition module */
$(document).ready(function () {
});
$(document).ready(function () {});
// Edition tags sur modules
$(function () {
$('.module_tag_editor').tagEditor({
initialTags: '',
placeholder: 'Tags du module ...',
$(".module_tag_editor").tagEditor({
initialTags: "",
placeholder: "Tags du module ...",
forceLowercase: false,
onChange: function (field, editor, tags) {
$.post('module_tag_set',
{
$.post("module_tag_set", {
module_id: field.data("module_id"),
taglist: tags.join()
taglist: tags.join(),
});
},
autocomplete: {
delay: 200, // ms before suggest
position: { collision: 'flip' }, // automatic menu position up/down
source: "module_tag_search"
position: { collision: "flip" }, // automatic menu position up/down
source: "module_tag_search",
},
});
// version readonly
readOnlyTags($('.module_tag_editor_ro'));
readOnlyTags($(".module_tag_editor_ro"));
$('.sco_tag_checkbox').click(function() {
if( $(this).is(':checked')) {
$(".sco_tag_checkbox").click(function () {
if ($(this).is(":checked")) {
$(".sco_tag_edit").show();
} else {
$(".sco_tag_edit").hide();
}
});
});
......@@ -8,30 +8,25 @@ function change_ue_inscr(elt) {
} else {
url = elt.dataset.url_desinscr;
}
$.post(url,
{},
function (result) {
$.post(url, {}, function (result) {
sco_message("changement inscription UE enregistré");
}
);
});
}
$(function () {
$("table#but_ue_inscriptions").DataTable(
{
$("table#but_ue_inscriptions").DataTable({
paging: false,
searching: true,
info: false,
autoWidth: false,
fixedHeader: {
header: true,
footer: false
footer: false,
},
orderCellsTop: true, // cellules ligne 1 pour tri
aaSorting: [], // Prevent initial sorting
"oLanguage": {
"sSearch": "Chercher :"
}
}
);
oLanguage: {
sSearch: "Chercher :",
},
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment