function show_div(num) {
for (i = 0; i < num; i++) $("#fld_" + i.toString()).show();
}
function one_div(idx, num) {
for (i = 0; i < num; i++) (idx == i) ? $("#fld_" + i).show() : $("#fld_" + i).hide();
}
function content_adapt() { // getView {purl}
var language = ['','en','es','de','pt','fr'];
// keys
var code = getCookie('druyd1');
if(code == '' || code == '[]'){
code = '{}';
setCookie('druyd1',code,365);
}
var obj = JSON.parse(code);
// base
var cookie = getCookie('druyd0');
if(cookie != '' && cookie.length > 0){
url_structure = window.location.href.split('/');
structure_arr = url_structure[url_structure.length-2].split('-');
slang = url_structure[url_structure.length-1];
nlang = language.indexOf(slang.substring(0,2));
if(nlang == undefined){ nlang = 1; }
var code = getCookie('druyd1');
var obj = JSON.parse(code);
student = obj.student;
if(student == ''){
student = user_data[0];
}
if(structure_arr.length == 2){
ref = url_structure[url_structure.length-2].split('-')[1];
$('body').css('cursor', 'progress');
$.ajax({
type:'POST',
url: '/getCourse',
data: JSON.stringify([ref, nlang]),
contentType:'application/json',
dataType: 'json',
success: function(data){
cnt = 1;
$('#name').html("
"); txt = ""; for(var i = 0;i < data[1].length;i++){ txt = txt + "
" + data[0][1] + ":" + data[0][2] + "
"); txt = ""; for(var i = 0;i < data[1].length;i++){ txt = txt + "
" + data[1][i][1] + "
"; for(var j = 0;j < data[2].length;j++){ if(data[2][j][6] == data[1][i][0]){ // lecture (id, name, description, code, conduct, hour, 0, url_invitation) txt = txt + "";
txt = txt + "
";
cnt++;
}
}
}
$('#strct').html(txt);
}
});
$('body').css('cursor', 'default');
}
}
}
$(document).ready(function () {
var idx = 0;
var num = parseInt("1", 10) || 0;
function resizeContent(){
const headH = $('#head').length ? $('#head').height() : 0;
const toolbarH = $('#sb-toolbar').outerHeight() || 0;
const H = window.innerHeight - headH - toolbarH - 16;
$("#sb-content").css({ height: H + "px" });
}
resizeContent();
$(window).on("resize", resizeContent);
function lr_show(){
$("#lr").removeClass("d-none").addClass("d-flex");
}
function lr_hide(){
$("#lr").removeClass("d-flex").addClass("d-none");
$("#cnt").text("");
}
function renderMode(){
const v = $('#select input[type=radio]:checked').val(); // "1"|"2"|"3"
if (v === "2") {
lr_show();
$("#cnt").text((idx + 1) + " of " + num);
one_div(idx, num);
$("#fld_video").hide();
} else if (v === "3") {
lr_hide();
one_div(-1, num);
$("#fld_video").show();
} else {
lr_hide();
show_div(num);
$("#fld_video").hide();
}
}
// Bind radios
$('#select input[type=radio]').off('change.story').on('change.story', function () {
resizeContent();
renderMode();
});
// Initial correct state (fixes: lr visible at start / missing text on first select)
renderMode();
// Arrows (only meaningful in mode 2)
$("#left").off('click.story').on('click.story', function () {
idx--; if (idx < 0) idx = num - 1;
$("#cnt").text((idx + 1) + " of " + num);
one_div(idx, num);
});
$("#right").off('click.story').on('click.story', function () {
idx++; if (idx > num - 1) idx = 0;
$("#cnt").text((idx + 1) + " of " + num);
one_div(idx, num);
});
// Toggle index-panel
$("#ctrl").off('click.story').on('click.story', function () {
if ($("#index-panel").is(":visible")) {
$("#index-panel").hide();
$('#mainSplitter').jqxSplitter({ panels: [{ size: '0%' }, { size: '100%' }] });
$("#arrow").attr("src", "/static/icons/chevronright32b.png");
} else {
$("#index-panel").show();
$('#mainSplitter').jqxSplitter({ panels: [{ size: '25%' }, { size: '75%' }] });
$("#arrow").attr("src", "/static/icons/chevronleft32b.png");
}
});
// Rabbit back: aquí lo dejamos disabled hasta que conectes tu stack real
// $("#rabbit-back").prop("disabled", false).on("click", function(){ ... });
});
";
txt = txt + "";
txt = txt + "" + data[2][j][4] + " " + data[2][j][5] + " " + data[2][j][3] + " " + data[2][j][1] + "";
txt = txt + "";
txt = txt + "
";
txt = txt + "";
txt = txt + "
";
txt = txt + "";
if(data[2][j][2].length > 0){
txt = txt + "" + data[2][j][2] + "
"; } if(data[2][j][7] == ''){ txt = txt + "Invitation ZOOM:Non programmé.
"; } else { txt = txt + "Invitation ZOOM:" + data[2][j][7] + "
"; } txt = txt + "Content
"; // list storyboard txt = txt + "";
for(var k = 0;k < data[3].length;k++){
if(data[2][j][0] == data[3][k][3]){
if(data[3][k][5] == ''){
txt = txt + "
";
txt = txt + "
";
txt = txt + ""; } if(data[2][j][7] == ''){ txt = txt + "Invitation ZOOM:Non programmé.
"; } else { txt = txt + "Invitation ZOOM:" + data[2][j][7] + "
"; } txt = txt + "Content
"; // list storyboard txt = txt + "
| • "+data[3][k][1]+" | |
| • "+data[3][k][1]+" | |
| • "+data[3][k][1]+" |
