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}
// 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);
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: '/getProgram',
data: JSON.stringify([ref,nlang]),
contentType:'application/json',
dataType: 'json',
success: function(data){
var txt = '';
txt = "
"; txt = txt + data[0][0]; txt = txt + "
"; txt = txt + "
";
txt = txt + "
"; txt = txt + "
";
txt = txt + "
";
txt = txt + "
\n"; $('#program').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(){ ... }); });
Program " + data[0][1] + "
"; txt = txt + data[0][0]; txt = txt + "
"; txt = txt + "
CALENDAR
"; txt = txt + "| Code | Topic | Date | Hour |
|---|---|---|---|
| " + data[1][i][1] + " | |||
| " + data[2][j][3] + " | " + data[2][j][1] + " | " + data[2][j][4] + " | " + data[2][j][5] + " |
"; txt = txt + "
PARAMETERS
"; txt = txt + "| Item | Date |
|---|---|
| Course close date | " + data[0][2] + " |
| Exame from | " + data[0][3] + " |
| Exam until | " + data[0][4] + " |
| Course approve grade | "+ data[0][7] + " |
| Cases fraction | " + data[0][8] + "% |
| Exam fraction | " + data[0][9] + "% |
| Minimum grade for exam | " + data[0][10] + " |
| Sociogram | Yes |
| Sociogram | No |
| Shifts | " + data[0][12] + " |
| Rotate | Yes |
| Rotate | No |
\n"; $('#program').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(){ ... }); });
