Storyboard 
>Model
ID:(1822, 0)
// cnt_storyboard
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++) {
if (idx == i) {
$("#fld_" + i.toString()).show();
} else {
$("#fld_" + i.toString()).hide();
}
}
}
function sound(txt) {
const synth = window.speechSynthesis;
slang = "en";
slang = slang + "-" + slang.toUpperCase();
sentences = txt.replace(/\$/g, '').replace(/<[^>]*>?/gm, '').split(/[\\.!?]/);
for (i = 0; i < sentences.length; i++) {
var utterThis = new SpeechSynthesisUtterance(sentences[i]);
utterThis.lang = slang;
synth.speak(utterThis);
}
}
// adapt
function content_adapt() {
// getWorkStoryboard - content_adapt
// 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 == 1){
$('#title').text("Subject");
$('#cb_main').prop('disabled', true);
$('#review').removeAttr('hidden');
$('#review').prop('disabled', true);
$('#eva').removeAttr('hidden');
$('#clear').removeAttr('hidden');
main_id = obj.id_subject;
$.ajax({
type:'POST',
url: '/getSubjectModel',
data: JSON.stringify(["Select",nlang]),
contentType:'application/json',
dataType: 'json',
success: function(data){
main_idx = getIdxComboBox(main_id, data);
setupCombobox($('#cb_main'), '100%', data, main_idx, false);
if(main_idx == 0){
loadMap(main_id, 0);
} else {
loadMap(main_id, 1);
}
}
});
}
}
en_user_cookie = getCookie('druyd');
if(de_user_cookie != '' && de_user_cookie.length > 0){
user_data = JSON.parse(de_user_cookie);
if(user_data[0] == 1){
$('#save_clipboard').removeAttr('hidden');
$('#load_clipboard').removeAttr('hidden');
}
}
}
// actions
(document).ready(function () {
content_adapt()
// content_action in cnt_storyboard
// getWorkStoryboard - content_action
('#cb_main').on('select',function(event){
if(structure_arr.length == 1){
main_idx = $('#cb_main').jqxComboBox('getSelectedIndex') - 1;
main_id = $('#cb_main').val();
var code = getCookie('druyd1');
if(code == '[]'){ code = '{}'; }
var obj = JSON.parse(code);
obj.id_subject = main_id;
code = JSON.stringify(obj);
setCookie('druyd1',code,365);
if(main_idx == 0){
loadMap(main_id, 0);
} else {
loadMap(main_id, 1);
}
$('#model-content').hide();
}
});
('#model').on('select',function(event){
model_idx =
('#model').jqxComboBox('getSelectedIndex') - 1;
arr = cb_model_list[model_idx+1].value.split('@');
if(model_idx > -1){
$('#description').html(arr[1]);
// table
var html = getModelParameter(model_idx,"Symbol","Text","Parameter","Unit");
$('#parameters2').html(html);
MathJax.Hub.Queue(['Typeset',MathJax.Hub,parameters2]);
// network
draw2();
$('#model-content').show();
} else {
$('#model-content').hide();
}
});
var idx = 0;
var num = "2";
("#lr").hide()
("#content").css({ 'height': (window.innerHeight - $('#head').height() - 16) + 'px' });
('#select input[type=radio]').change(function () {
("#content").css({ 'height': (window.innerHeight - $('#head').height() - 16) + 'px' });
if ((this).val() == 2) {
("#lr").show(num);
cnt = idx + 1
('#cnt').text(cnt.toString() + ' of ' + num.toString());
one_div(idx, num);
("#fld_video").hide();
} else {
$("#lr").hide();
if ($(this).val() == 3) {
one_div(-1, num);
$("#fld_video").show();
} else {
show_div(num);
$("#fld_video").hide();
}
}
});
('#select input[type=label]').click(function () {
});
("#left").click(function () {
idx--;
if (idx < 0) { idx = num - 1; }
cnt = idx + 1
$('#cnt').text(cnt.toString() + ' of ' + num.toString());
one_div(idx, num);
});
("#right").click(function () {
idx++;
if (idx > num - 1) { idx = 0; }
cnt = idx + 1
('#cnt').text(cnt.toString() + ' of ' + num.toString());
one_div(idx, num);
});
("#ctrl").click(function () {
if (
("#index-panel").is(":visible") == true) {
$("#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");
}
});
// radiobuttons of Model
('#networkEquation').on("click", function () {
setNetworkEquation(vgraph_network);
});
$('#networkNumber').on("click", function () {
setNetworkNumber(vgraph_network);
});
});