');
+ */
+ var cantiche = ["Inferno", "Purgatorio", "Paradiso"];
+ var romani = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X",
+ "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX",
+ "XXI", "XXII", "XXIII", "XXIV", "XXV", "XXVI", "XXVII", "XXVIII", "XXIX", "XXX",
+ "XXXI", "XXXII", "XXXIII", "XXXIV"];
+ var lisidArray = lisid.split('_')
+ /*
+ closeButton.appendTo(buttons);
+ rigaNota.append('
' + cantiche[lisidArray[0]-1] + ", Canto " + romani[lisidArray[1]-1] + ", Verso " + lisidArray[2] + "
");
+ rigaNota.appendTo(commentHeader);
+ buttons.appendTo(commentHeader);
+ commentHeader.appendTo(structGroupCard);
+ structCard.appendTo(structGroupCard);
+ $('#displayinfo').empty();
+ structGroupCard.appendTo($('#displayinfo'));
+ */
+ $('#structHead0').text(cantiche[lisidArray[0] - 1] + ", Canto " + romani[lisidArray[1] - 1] + ", Verso " + lisidArray[2]);
$('#structGroupCard0').attr('style', "display: flex;");
$('#infoCard0').attr('style', "display: none;");
};
-
- emptyStructCard = function(){
+
+ emptyStructCard = function() {
//$('#displayinfo').empty();
//$('#displayinfo').append($(emptyInfo))
$('#infoCard0').attr('style', "display: flex;");
$('#structGroupCard0').attr('style', "display: none;");
};
-
-
+
+
// Funzione di creazione del tab delle clausole grammaticali
- function addGramCla(sortableId,active,tabID,toExpand){
+ function addGramCla(sortableId, active, tabID, toExpand) {
if (active > 0) {
var checkInsert = ' checked="checked"';
} else {
var checkInsert = '';
};
var claText = "Categoria grammaticale:
";
- addLIitem(sortableId,tabID,claText,checkInsert,toExpand);
+ addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
var claClone = document.getElementById("tipogrammaticaleN").cloneNode(true);
- claClone.setAttribute("id","cla" + tabID);
+ claClone.setAttribute("id", "cla" + tabID);
claClone.setAttribute("data-claActive", active);
- claClone.setAttribute("aria-labelledby","cla" + tabID + "-tab");
+ claClone.setAttribute("aria-labelledby", "cla" + tabID + "-tab");
claClone.setAttribute("style", "");
$('#claBody' + tabID).append(claClone);
// se non cambio l'id della select react non rileva l'evento onchange:
- $('#cla' + tabID + " #grammtypesN").attr("id","grammtypes" + tabID);
- $('#cla' + tabID + " #lemma_formaN").attr("id","lemma_forma" + tabID);
- $('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
- $('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
- $('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
+ $('#cla' + tabID + " #grammtypesN").attr("id", "grammtypes" + tabID);
+ $('#cla' + tabID + " #lemma_formaN").attr("id", "lemma_forma" + tabID);
+ $('#cla' + tabID + " #queryTextN").attr("id", "queryText" + tabID);
+ $('#cla' + tabID + " #opzioni_testoN").attr("id", "opzioni_testo" + tabID);
+ $('#cla' + tabID + " #contextDivN").attr("id", "contextDiv" + tabID);
+
+ var unita = $('#unitaRicerca').val();
+ var query = "";
+ var lemma_forma = "";
+ var opzioni = "";
+ switch (unita) {
+ case "forma":
+ case "lemma":
+ query = $('#queryTextUnita').val();
+ lemma_forma = $('#unitaRicerca').val();
+ opzioni = $('#opzioni_testoUnita').val();
+ break;
+ case "frase":
+ case "periodo":
+ case "discorso":
+ case "riferimenti":
+ opzioni = $('#opzioni_testoINIT').val();
+ lemma_forma = $('#lemma_formaINIT').val();
+ query = $('#queryTextINIT').val();
+ break;
+ }
+ $('#queryText' + tabID).val(query);
+ $('#lemma_forma' + tabID).val(lemma_forma);
+ $('#opzioni_testo' + tabID).val(opzioni);
+ //Nik
+ $('#queryText').val(query);
+ $('#lemma_forma').val(lemma_forma);
+ $('#opzioni_testo').val(opzioni);
+
+ $('#queryTextN').val(query);
+ $('#lemma_formaN').val(lemma_forma);
+ $('#opzioni_testoN').val(opzioni);
+
addClaContext(tabID);
}
-
+
// Funzione di creazione delle subclausole grammaticali basate sul valore scelto
- function addCatgramSubcla(tabPaneId,selectedValue){
+ function addCatgramSubcla(tabPaneId, selectedValue) {
var dettagliBox = $("#" + tabPaneId + " .dettaglifiltri");
dettagliBox.html("");
if (Object.keys(categorie).includes(selectedValue)) {
@@ -810,97 +862,97 @@ $(document).ready(function() {
for (var key in keys) {
var vals = categorieJson[filtro][keys[key]]
switch (vals.length) {
- case 2:
- var element = $('
');
- element.attr('class', 'd-flex flex-sm-nowrap pr-0 py-0 mb-1 form-group form-control-sm border justify-content-between bg-light');
- var rbfieldset = $('
');
- var flexdiv1 = $('
');
- var flexdiv2 = $('
');
- var input1 = $('
');
- var input2 = $('
');
- var label1 = $('
');
- var label2 = $('
');
+ case 2:
+ var element = $('
');
+ element.attr('class', 'd-flex flex-sm-nowrap pr-0 py-0 mb-1 form-group form-control-sm border justify-content-between bg-light');
+ var rbfieldset = $('
');
+ var flexdiv1 = $('
');
+ var flexdiv2 = $('
');
+ var input1 = $('
');
+ var input2 = $('
');
+ var label1 = $('
');
+ var label2 = $('
');
- rbfieldset.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
- rbfieldset.attr('class', 'custom-control-inline monMe');
- flexdiv1.attr('class', 'custom-control custom-radio custom-control-inline m-0 mr-2 pb-0');
- flexdiv1.attr('style', 'padding-top: 2px!important;');
- flexdiv2.attr('class', 'custom-control custom-radio custom-control-inline m-0 pb-0');
- flexdiv2.attr('style', 'padding-top: 2px!important;');
- input1.attr('class', 'custom-control-input');
- input2.attr('class', 'custom-control-input');
- input1.attr('type', 'radio');
- input2.attr('type', 'radio');
- input1.attr('id', tabPaneId + vals[0].replace(/\s/g, ''));
- input2.attr('id', tabPaneId + vals[1].replace(/\s/g, ''));
- input1.attr('value', vals[0]);
- input2.attr('value', vals[1]);
- input1.attr('name', tabPaneId + keys[key]);
- input2.attr('name', tabPaneId + keys[key]);
- label1.attr('class', 'custom-control-label form-control-sm custom-control-inline m-0 pl-0 text-muted curPoint');
- label1.attr('style', 'padding-top: 2px!important;');
- label2.attr('class', 'custom-control-label form-control-sm custom-control-inline m-0 pl-0 text-muted curPoint');
- label2.attr('style', 'padding-top: 2px!important;');
- label1.attr('for', tabPaneId + vals[0].replace(/\s/g, ''));
- label2.attr('for', tabPaneId + vals[1].replace(/\s/g, ''));
- label1.append(vals[0]);
- label2.append(vals[1]);
+ rbfieldset.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
+ rbfieldset.attr('class', 'custom-control-inline monMe');
+ flexdiv1.attr('class', 'custom-control custom-radio custom-control-inline m-0 mr-2 pb-0');
+ flexdiv1.attr('style', 'padding-top: 2px!important;');
+ flexdiv2.attr('class', 'custom-control custom-radio custom-control-inline m-0 pb-0');
+ flexdiv2.attr('style', 'padding-top: 2px!important;');
+ input1.attr('class', 'custom-control-input');
+ input2.attr('class', 'custom-control-input');
+ input1.attr('type', 'radio');
+ input2.attr('type', 'radio');
+ input1.attr('id', tabPaneId + vals[0].replace(/\s/g, ''));
+ input2.attr('id', tabPaneId + vals[1].replace(/\s/g, ''));
+ input1.attr('value', vals[0]);
+ input2.attr('value', vals[1]);
+ input1.attr('name', tabPaneId + keys[key]);
+ input2.attr('name', tabPaneId + keys[key]);
+ label1.attr('class', 'custom-control-label form-control-sm custom-control-inline m-0 pl-0 text-muted curPoint');
+ label1.attr('style', 'padding-top: 2px!important;');
+ label2.attr('class', 'custom-control-label form-control-sm custom-control-inline m-0 pl-0 text-muted curPoint');
+ label2.attr('style', 'padding-top: 2px!important;');
+ label1.attr('for', tabPaneId + vals[0].replace(/\s/g, ''));
+ label2.attr('for', tabPaneId + vals[1].replace(/\s/g, ''));
+ label1.append(vals[0]);
+ label2.append(vals[1]);
- input1.appendTo(flexdiv1);
- input2.appendTo(flexdiv2);
- label1.appendTo(flexdiv1);
- label2.appendTo(flexdiv2);
- flexdiv1.appendTo(rbfieldset);
- flexdiv2.appendTo(rbfieldset);
- rbfieldset.appendTo(element);
- var iconR = $(iconReset);
- iconR.appendTo(element);
- element.appendTo(dettagliBox);
- break;
- case 1:
- var element = $('
');
- //element.attr('class', ' d-flex flex-sm-nowrap pr-2 py-1 mb-1 form-group form-control bg-light');
- element.attr('class', 'd-flex flex-sm-nowrap form-group form-control-sm border px-2 mb-1 pt-1 pb-0 bg-light');
- var rbfieldset = $('
');
- flexdiv1 = $('
');
- input1 = $('
');
- label1 = $('
');
- rbfieldset.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
- rbfieldset.attr('class', 'custom-control-inline monMe align-items-center');
- flexdiv1.attr('class', 'custom-control custom-checkbox custom-control-inline');
- flexdiv1.attr('style', 'padding-top: 1px!important;');
- input1.attr('class', 'custom-control-input align-self-center');
- input1.attr('type', 'checkbox');
- input1.attr('id', tabPaneId + vals[0].replace(/\s/g, ''));
- input1.attr('value', vals[0]);
- input1.attr('name', keys[key]);
- label1.attr('class', 'custom-control-label form-control-sm custom-control-inline p-0 text-muted curPoint align-self-start');
- label1.attr('style', 'padding-top: 2px!important;');
- label1.attr('for', tabPaneId + vals[0].replace(/\s/g, ''));
- label1.append(vals[0]);
+ input1.appendTo(flexdiv1);
+ input2.appendTo(flexdiv2);
+ label1.appendTo(flexdiv1);
+ label2.appendTo(flexdiv2);
+ flexdiv1.appendTo(rbfieldset);
+ flexdiv2.appendTo(rbfieldset);
+ rbfieldset.appendTo(element);
+ var iconR = $(iconReset);
+ iconR.appendTo(element);
+ element.appendTo(dettagliBox);
+ break;
+ case 1:
+ var element = $('
');
+ //element.attr('class', ' d-flex flex-sm-nowrap pr-2 py-1 mb-1 form-group form-control bg-light');
+ element.attr('class', 'd-flex flex-sm-nowrap form-group form-control-sm border px-2 mb-1 pt-1 pb-0 bg-light');
+ var rbfieldset = $('
');
+ flexdiv1 = $('
');
+ input1 = $('
');
+ label1 = $('
');
+ rbfieldset.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
+ rbfieldset.attr('class', 'custom-control-inline monMe align-items-center');
+ flexdiv1.attr('class', 'custom-control custom-checkbox custom-control-inline');
+ flexdiv1.attr('style', 'padding-top: 1px!important;');
+ input1.attr('class', 'custom-control-input align-self-center');
+ input1.attr('type', 'checkbox');
+ input1.attr('id', tabPaneId + vals[0].replace(/\s/g, ''));
+ input1.attr('value', vals[0]);
+ input1.attr('name', keys[key]);
+ label1.attr('class', 'custom-control-label form-control-sm custom-control-inline p-0 text-muted curPoint align-self-start');
+ label1.attr('style', 'padding-top: 2px!important;');
+ label1.attr('for', tabPaneId + vals[0].replace(/\s/g, ''));
+ label1.append(vals[0]);
- input1.appendTo(flexdiv1);
- label1.appendTo(flexdiv1);
- flexdiv1.appendTo(rbfieldset);
- rbfieldset.appendTo(element);
- element.appendTo(dettagliBox);
- break;
- default:
- var element = $('
');
- element.attr('class', ' form-group p-0 pb-1 m-0');
- //var select = $('
');
- var select = $('
');
- select.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
- select.attr('title', keys[key]);
- select.attr('name', keys[key]);
- for (var val in vals) {
- var seloption = $('
');
- seloption.attr('value', vals[val]);
- seloption.append(vals[val]);
- seloption.appendTo(select);
- }
- select.appendTo(element);
- element.appendTo(dettagliBox);
+ input1.appendTo(flexdiv1);
+ label1.appendTo(flexdiv1);
+ flexdiv1.appendTo(rbfieldset);
+ rbfieldset.appendTo(element);
+ element.appendTo(dettagliBox);
+ break;
+ default:
+ var element = $('
');
+ element.attr('class', ' form-group p-0 pb-1 m-0');
+ //var select = $('
');
+ var select = $('
');
+ select.attr('id', tabPaneId + keys[key].replace(/\s/g, ''));
+ select.attr('title', keys[key]);
+ select.attr('name', keys[key]);
+ for (var val in vals) {
+ var seloption = $('
');
+ seloption.attr('value', vals[val]);
+ seloption.append(vals[val]);
+ seloption.appendTo(select);
+ }
+ select.appendTo(element);
+ element.appendTo(dettagliBox);
}
}
}
@@ -911,30 +963,30 @@ $(document).ready(function() {
}
// Funzione di creazione del tab delle clausole sintattiche
- function addSyntCla(sortableId,active,tabID,toExpand){
+ function addSyntCla(sortableId, active, tabID, toExpand) {
if (active > 0) {
var checkInsert = ' checked="checked"';
} else {
var checkInsert = '';
};
var claText = "Tipo sintattico:
";
- addLIitem(sortableId,tabID,claText,checkInsert,toExpand);
+ addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
var claClone = document.getElementById("tiposintatticoN").cloneNode(true);
-
- claClone.setAttribute("id","cla" + tabID);
- claClone.setAttribute("data-claActive",active);
- claClone.setAttribute("aria-labelledby","cla" + tabID + "-tab");
+
+ claClone.setAttribute("id", "cla" + tabID);
+ claClone.setAttribute("data-claActive", active);
+ claClone.setAttribute("aria-labelledby", "cla" + tabID + "-tab");
claClone.setAttribute("style", "");
$('#claBody' + tabID).append(claClone);
- //$('#cla' + tabID + " #lemma_formaN").attr("id","lemma_forma" + tabID);
- //$('#cla' + tabID + " #queryTextN").attr("id","queryText" + tabID);
- //$('#cla' + tabID + " #opzioni_testoN").attr("id","opzioni_testo" + tabID);
-// $('#cla' + tabID + " #contextDivN").attr("id","contextDiv" + tabID);
- // addClaContext(tabID);
+ $('#cla' + tabID + " #lemma_formaN").attr("id", "lemma_forma" + tabID);
+ $('#cla' + tabID + " #queryTextN").attr("id", "queryText" + tabID);
+ $('#cla' + tabID + " #opzioni_testoN").attr("id", "opzioni_testo" + tabID);
+ $('#cla' + tabID + " #contextDivN").attr("id", "contextDiv" + tabID);
+ addClaContext(tabID);
}
// Funzione di creazione del tab delle clausole metafore
- function addMetaCla(sortableId,active,tabID,toExpand){
+ function addMetaCla(sortableId, active, tabID, toExpand) {
var checkInsert = ' disabled';
//if (active > 0) {
// var checkInsert = '" checked="checked"';
@@ -942,19 +994,19 @@ $(document).ready(function() {
// var checkInsert = '"';
//};
var claText = "Clausola Metafore - non ancora implementata";
- addLIitem(sortableId,tabID,claText,checkInsert,toExpand);
+ addLIitem(sortableId, tabID, claText, checkInsert, toExpand);
var claClone = document.getElementById("tipometaforaN").cloneNode(true);
- claClone.setAttribute("id","cla" + tabID);
- claClone.setAttribute("data-claActive",active);
- claClone.setAttribute("aria-labelledby","cla" + tabID + "-tab");
+ claClone.setAttribute("id", "cla" + tabID);
+ claClone.setAttribute("data-claActive", active);
+ claClone.setAttribute("aria-labelledby", "cla" + tabID + "-tab");
claClone.setAttribute("style", "");
$('#claBody' + tabID).append(claClone);
}
// Funzione di creazione della parte di definizione del contesto delle clausole
- function addClaContext(tabID){
+ function addClaContext(tabID) {
var contClone = document.getElementById("contextTable-xX0").cloneNode(true);
- contClone.setAttribute("class","row no-gutters px-2 pt-0 pb-2 bg-lida11");
+ contClone.setAttribute("class", "row no-gutters px-2 pt-0 pb-2 bg-lida11");
contClone = contClone.outerHTML.replace(/xX0/g, "xX" + tabID);
contClone = contClone.replace(/-secondary/g, "-success");
contClone = contClone.replace(/sel-canto/g, "sel-canto suxess");
@@ -963,15 +1015,15 @@ $(document).ready(function() {
$("#selectable-xX" + tabID).selectable({
filter: ".sel-canto",
selected: function(event, ui) {
- window["context" + tabID][ui.selected.id.substring(0,1)][ui.selected.id.substring(2)] = 1;
- var tmpFocusBtn = "#plusBtn" + ui.selected.id.substring(0,1) + "-xX" + tabID;
- $(tmpFocusBtn).focus();
+ window["context" + tabID][ui.selected.id.substring(0, 1)][ui.selected.id.substring(2)] = 1;
+ var tmpFocusBtn = "#plusBtn" + ui.selected.id.substring(0, 1) + "-xX" + tabID;
+ $(tmpFocusBtn).focus();
}
});
};
// Funzione di creazione del LI delle condizioni logiche
- function addLogicCond(sortableId,condtype){
+ function addLogicCond(sortableId, condtype) {
condListLen++;
var cloneLI = document.getElementById("condxX4Xx").cloneNode(true);
cloneLI.removeAttribute("style");
@@ -988,19 +1040,19 @@ $(document).ready(function() {
$(sortableId).append($(cloneLI)[0]);
$("#andOrSelect-" + condListLen).val(condtype);
$("#sortable" + condListLen).sortable();
- $("#sortable" + condListLen).sortable( "option", "appendTo", document.body );
+ $("#sortable" + condListLen).sortable("option", "appendTo", document.body);
$("#sortable" + condListLen).sortable({
items: "> li",
handle: ".handle",
- opacity: 0.6,
+ opacity: 0.6,
cursor: 'move',
- update: function() {refreshSortables();}
+ update: function() { refreshSortables(); }
});
refreshConnectWith();
}
// Funzione di creazione del LI di una clausola nella lista sortable
- function addLIitem(sortableId,tabID,claText,checkInsert,toExpand){
+ function addLIitem(sortableId, tabID, claText, checkInsert, toExpand) {
claListLen++;
var cloneLI = document.getElementById("li-claxX1Xx").cloneNode(true);
cloneLI.setAttribute("style", "opacity: 0.1;");
@@ -1008,51 +1060,51 @@ $(document).ready(function() {
cloneLI = cloneLI.replace(/xX2Xx/g, claText)
cloneLI = cloneLI.replace(/xX3Xx"/g, tabID + '" ' + checkInsert)
if (checkInsert == ' disabled') {
- cloneLI = cloneLI.replace(/claCollBtn/g, "claCollBtn " + checkInsert);
+ cloneLI = cloneLI.replace(/claCollBtn/g, "claCollBtn " + checkInsert);
};
$(sortableId).append($(cloneLI)[0]);
- if (toExpand == 1){
+ if (toExpand == 1) {
$("#claCollapse" + tabID).focus();
$("#claCollapse" + tabID).trigger("click");
}
- $("#li-cla" + tabID).fadeTo(1000,1);
+ $("#li-cla" + tabID).fadeTo(1000, 1);
};
// Funzione di refresh della lista clausole nella tab principale e del json della query
- function refreshClaList(){
- /*var l_f = $("form #lemma_forma")[0].options[$("form #lemma_forma")[0].selectedIndex].value;
+ function refreshClaList(editCard = 9999) {
+ var l_f = $("form #lemma_forma")[0].options[$("form #lemma_forma")[0].selectedIndex].value;
var qText = $("form #queryText")[0].value;
- var optText = $("form #opzioni_testo")[0].value;*/
- var l_f = "";
+ var optText = $("form #opzioni_testo")[0].value;
+ /*var l_f = "";
var qText = "";
var optText = "";
- var unitaDiRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
+ var unitaDiRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
if (unitaDiRicerca == "lemma" || unitaDiRicerca == "forma") {
l_f = unitaDiRicerca;
qText = $("#queryTextUnita")[0].value;
optText = $("#opzioni_testoUnita")[0].value;
} else {
- l_f = $("#lemma_formaN")[0].options[$("#lemma_formaN")[0].selectedIndex].value;
- qText = $("#queryTextN")[0].value;
- optText = $("#opzioni_testoN")[0].value;
- }
-
+ l_f = $("#lemma_formaINIT")[0].options[$("#lemma_formaINIT")[0].selectedIndex].value;
+ qText = $("#queryTextINIT")[0].value;
+ optText = $("#opzioni_testoINIT")[0].value;
+ }*/
+
if (qText == "") { //disattivo clausola 0 se il testo e' vuoto
var claActive = 0
} else {
var claActive = 1
};
- queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "lemma_forma": "' + l_f + '", "opzioni_testo": "' + optText + '", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
+ queryJson.Clausola0 = JSON.parse('{"queryText": "' + qText + '", "lemma_forma": "' + l_f + '", "opzioni_testo": "' + optText + '", "TipoClausola": "0", "Attiva": "' + claActive + '"}');
queryJson.Clausola0.contesto = JSON.stringify(window.context0);
queryJson.unitaRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
- var tabsContent = $("#sortable0").find(".claLI");
- if ($(tabsContent).length) {
+ var tabsContent = $("#sortable0").find(".claLI");
+ if ($(tabsContent).length) {
if ($("#li-cla0")[0]) {
- $("#li-cla0")[0].remove();
+ $("#li-cla0")[0].remove();
};
- $(tabsContent).each(function(){
+ $(tabsContent).each(function() {
var claIdNum = $(this).attr('id').substr(6);
- updateClaListItem(claIdNum, "#sortable0");
+ updateClaListItem(claIdNum, "#sortable0", editCard);
});
} else {
if (claListLen == 0 && condListLen == 0) {
@@ -1070,9 +1122,9 @@ $(document).ready(function() {
}
};
}
-
+
// Funzione di creazione del LI nella lista delle clausole nel tab principale, aggiunta della clausola nel JSON
- function updateClaListItem(claIdNum, sortableId){
+ function updateClaListItem(claIdNum, sortableId, editCard) {
var claText = '';
var termText = '';
var checkInsert = '';
@@ -1090,22 +1142,32 @@ $(document).ready(function() {
var optText = "";
var optText_t = "";
var articolo = "Il ";
+ //Nik verificare in cao di modifica delle clausola
var unitaDiRicerca = $("#unitaRicerca")[0].options[$("#unitaRicerca")[0].selectedIndex].value;
- if (unitaDiRicerca == "lemma" || unitaDiRicerca == "forma") {
- l_f = unitaDiRicerca;
- if (l_f == " forma") {
- articolo = "La ";
+ if (editCard == 9999) {
+ if (unitaDiRicerca == "lemma" || unitaDiRicerca == "forma") {
+ l_f = unitaDiRicerca;
+ if (l_f == "forma") {
+ articolo = "La ";
+ }
+ l_f_t = articolo + l_f;
+ qText = $("#queryTextUnita")[0].value;
+ optText = $("#opzioni_testoUnita")[0].value;
+ optText_t = $("#opzioni_testoUnita")[0].options[$("#opzioni_testoUnita")[0].selectedIndex].text;
+ } else {
+ l_f = $("#lemma_formaN")[0].options[$("#lemma_formaN")[0].selectedIndex].value;
+ l_f_t = $("#lemma_formaN")[0].options[$("#lemma_formaN")[0].selectedIndex].text;
+ qText = $("#queryTextN")[0].value;
+ optText = $("#opzioni_testoN")[0].value;
+ optText_t = $("#opzioni_testoN")[0].options[$("#opzioni_testoN")[0].selectedIndex].text;
}
- l_f_t = articolo + l_f;
- qText = $("#queryTextUnita")[0].value;
- optText = $("#opzioni_testoUnita")[0].value;
- optText_t = $("#opzioni_testoUnita")[0].options[$("#opzioni_testoUnita")[0].selectedIndex].text;
} else {
- l_f = $("#lemma_formaN")[0].options[$("#lemma_formaN")[0].selectedIndex].value;
- l_f_t = $("#lemma_formaN")[0].options[$("#lemma_formaN")[0].selectedIndex].text;
- qText = $("#queryTextN")[0].value;
- optText = $("#opzioni_testoN")[0].value;
- optText_t = $("#opzioni_testoN")[0].options[$("#opzioni_testoN")[0].selectedIndex].text;
+ l_f = $("#lemma_forma" + editCard)[0].options[$("#lemma_forma" + editCard)[0].selectedIndex].value;
+ l_f_t = $("#lemma_forma" + editCard)[0].options[$("#lemma_forma" + editCard)[0].selectedIndex].text;
+ qText = $("#queryText" + editCard)[0].value;
+ optText = $("#opzioni_testo" + editCard)[0].value;
+ optText_t = $("#opzioni_testo" + editCard)[0].options[$("#opzioni_testo" + editCard)[0].selectedIndex].text;
+
}
if (qText != "") {
termText = l_f_t + '
' + qText + ' ' + optText_t + '.
';
@@ -1149,8 +1211,15 @@ $(document).ready(function() {
checkInsert = ' disabled';
var jsonTextToParse = '{"queryText": "", "lemma_forma": "", "opzioni_testo": "", "TipoClausola": "' + claType + '", "Attiva": "' + claActive + '"';
};
+ // nik controllare in quale caso si verifica "else"
+ var tabsContentLenght = ($("#sortable0").find(".claLI").length);
if ($("#" + claListItemId)[0]) {
- $("#" + claListItemId + " .clatext").replaceWith('
' + claText + '');
+ if (claListItemId == "li-cla" + tabsContentLenght && editCard == 9999) {
+ $("#" + claListItemId + " .clatext").replaceWith('
' + claText + '');
+ } else {
+ $("#" + "li-cla" + editCard + " .clatext").replaceWith('
' + claText + '');
+
+ }
} else {
addLIitem(sortableId, claIdNum, claText, checkInsert, 0);
};
@@ -1159,12 +1228,12 @@ $(document).ready(function() {
};
// Funzione di refresh dei placeholders e attivazione/disattivazione bottoni nelle liste sortable
- function refreshSortables(){
+ function refreshSortables() {
$("#sortable0").children(".claLI").each(function() {
- if ($(this).find("input")[0].checked){
+ if ($(this).find("input")[0].checked) {
$(this).find('.clatext').css({ opacity: 1 });
};
- if ($(this).find("input")[0].checked == false){
+ if ($(this).find("input")[0].checked == false) {
$(this).find('.clatext').css({ opacity: 0.6 });
};
});
@@ -1178,89 +1247,89 @@ $(document).ready(function() {
var inactiveLI = 0;
var condLIplaceholder = "";
$(this).children("li .claLI").each(function() {
- if ($(this).find("input")[0].checked){
+ if ($(this).find("input")[0].checked) {
activeLI++;
$(this).find('.clatext').css({ opacity: 1 });
};
- if ($(this).find("input")[0].checked == false){
+ if ($(this).find("input")[0].checked == false) {
inactiveLI++;
$(this).find('.clatext').css({ opacity: 0.6 });
};
});
switch (activeLI + activeUL) {
- case 0:
- if ($(placeholderID).length) {
+ case 0:
+ if ($(placeholderID).length) {
- $(placeholderID).fadeOut(300, function(){
- if (inactiveLI > 0){
+ $(placeholderID).fadeOut(300, function() {
+ if (inactiveLI > 0) {
$(placeholderID).text(condLIplaceholderText2d);
} else {
$(placeholderID).text(condLIplaceholderText2);
- };
- $(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
- });
+ };
+ $(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
+ });
} else {
- if (inactiveLI > 0){
+ if (inactiveLI > 0) {
condLIplaceholder = condLIplaceholderPart1 + sortableID.slice(-1) + condLIplaceholderPart2 + condLIplaceholderText2d + '';
} else {
condLIplaceholder = condLIplaceholderPart1 + sortableID.slice(-1) + condLIplaceholderPart2 + condLIplaceholderText2 + '';
- }
- //$("#" + sortableID).append(condLIplaceholder).hide().fadeIn(300);
- $("#" + sortableID).append(function(){
+ }
+ //$("#" + sortableID).append(condLIplaceholder).hide().fadeIn(300);
+ $("#" + sortableID).append(function() {
return $(condLIplaceholder).hide();
});
$(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
-
+
};
- if (inactiveLI == 0){
- $(iconBtn).attr("class","btn btn-sm btn-outline-success iconClClass removeCond text-success border rounded px-1 pb-0");
+ if (inactiveLI == 0) {
+ $(iconBtn).attr("class", "btn btn-sm btn-outline-success iconClClass removeCond text-success border rounded px-1 pb-0");
$(iconBtn).prop("disabled", false);
- $(iconDiv).attr("class","col-md-auto p-0 mr-2 mt-0 text-right text-success");
+ $(iconDiv).attr("class", "col-md-auto p-0 mr-2 mt-0 text-right text-success");
};
break;
- case 1:
- if ($(placeholderID).length) {
- $(placeholderID).fadeOut(300, function(){
- if (inactiveLI > 0){
+ case 1:
+ if ($(placeholderID).length) {
+ $(placeholderID).fadeOut(300, function() {
+ if (inactiveLI > 0) {
$(placeholderID).text(condLIplaceholderText1d);
} else {
$(placeholderID).text(condLIplaceholderText1);
- };
- $(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
- });
+ };
+ $(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
+ });
} else {
- if (inactiveLI > 0){
+ if (inactiveLI > 0) {
condLIplaceholder = condLIplaceholderPart1 + sortableID.slice(-1) + condLIplaceholderPart2 + condLIplaceholderText1d + '';
} else {
condLIplaceholder = condLIplaceholderPart1 + sortableID.slice(-1) + condLIplaceholderPart2 + condLIplaceholderText1 + '';
- }
- //$("#" + sortableID).append(condLIplaceholder).hide().fadeIn(300);
- $("#" + sortableID).append(function(){
+ }
+ //$("#" + sortableID).append(condLIplaceholder).hide().fadeIn(300);
+ $("#" + sortableID).append(function() {
return $(condLIplaceholder).hide();
});
$(placeholderID).fadeTo(100, 0.9).fadeTo(300, 0.6);
};
- $(iconBtn).attr("class","btn btn-sm iconClClass NOremoveCond text-muted border rounded px-1 pb-0");
+ $(iconBtn).attr("class", "btn btn-sm iconClClass NOremoveCond text-muted border rounded px-1 pb-0");
$(iconBtn).prop("disabled", true);
- $(iconDiv).attr("class","col-md-auto p-0 mr-2 mt-0 text-right text-muted");
+ $(iconDiv).attr("class", "col-md-auto p-0 mr-2 mt-0 text-right text-muted");
break;
- case 2:
- if ($(placeholderID).length) {
- $(placeholderID).fadeOut(300, function(){
- $(placeholderID).remove();
- });
+ case 2:
+ if ($(placeholderID).length) {
+ $(placeholderID).fadeOut(300, function() {
+ $(placeholderID).remove();
+ });
//$(placeholderID).remove();
};
- $(iconBtn).attr("class","btn btn-sm iconClClass NOremoveCond text-muted border rounded px-1 pb-0");
+ $(iconBtn).attr("class", "btn btn-sm iconClClass NOremoveCond text-muted border rounded px-1 pb-0");
$(iconBtn).prop("disabled", true);
- $(iconDiv).attr("class","col-md-auto p-0 mr-2 mt-0 text-right text-muted");
+ $(iconDiv).attr("class", "col-md-auto p-0 mr-2 mt-0 text-right text-muted");
break;
default:
- if ($(placeholderID).length) {
- $(placeholderID).fadeOut(300, function(){
- $(placeholderID).remove();
- });
+ if ($(placeholderID).length) {
+ $(placeholderID).fadeOut(300, function() {
+ $(placeholderID).remove();
+ });
//$(placeholderID).remove();
};
};
@@ -1270,16 +1339,16 @@ $(document).ready(function() {
queryJson.EsprLogica = logicExprString.split(' ');
queryJson.LogicaGui = guiLogicString.split(' ');
};
-
+
// Funzione di refresh dei collegamenti tra elementi sortable
- function refreshConnectWith(){
- for (var i=0; i <= condListLen; i++) {
+ function refreshConnectWith() {
+ for (var i = 0; i <= condListLen; i++) {
var cw = "";
- for (var j=0; j <= condListLen; j++) {
+ for (var j = 0; j <= condListLen; j++) {
if (i != j) {
cw = cw + "#sortable" + j + ", ";
};
- $( "#sortable" + i ).sortable( "option", "connectWith", cw.slice(0, -2) );
+ $("#sortable" + i).sortable("option", "connectWith", cw.slice(0, -2));
};
};
};
@@ -1289,10 +1358,10 @@ $(document).ready(function() {
var percentageWidth = (element.width() / element.parent().width()) * 100;
element.width(percentageWidth + '%');
};
-
+
// Funzione di parsing delle clausole e delle condizioni logiche
- function parseCond(sortableList, condType, forGui){
+ function parseCond(sortableList, condType, forGui) {
var condText = "";
var items = $(sortableList).children("li");
var itemsText = [];
@@ -1300,49 +1369,49 @@ $(document).ready(function() {
if ($(this).hasClass("condLI-AND")) {
var andID = "#" + $(this).children("ul").attr("id");
var andText = parseCond(andID, "AND", forGui);
- if (andText.length){
+ if (andText.length) {
itemsText.push(andText);
- };
+ };
};
if ($(this).hasClass("condLI-OR")) {
- var orID = "#" + $(this).children("ul").attr("id");
+ var orID = "#" + $(this).children("ul").attr("id");
var orText = parseCond(orID, "OR", forGui);
- if (orText.length){
+ if (orText.length) {
itemsText.push(orText);
- };
+ };
};
if ($(this).hasClass("claLI")) {
var claNum = "Clausola" + $(this)[0].id.substr(6);
- if (forGui || ($(this).find("input")[0].checked == true)){
+ if (forGui || ($(this).find("input")[0].checked == true)) {
itemsText.push(claNum);
};
};
});
var iTlen = itemsText.length;
switch (iTlen) {
- case 0:
- break;
- case 1:
- if (forGui) {
+ case 0:
+ break;
+ case 1:
+ if (forGui) {
condText = "( " + condType + " " + itemsText[0] + " )";
} else {
- condText += itemsText[0];
- }
- break;
- default:
- condText = "( " + condType + " ";
+ condText += itemsText[0];
+ }
+ break;
+ default:
+ condText = "( " + condType + " ";
for (let i = 0; i < iTlen; i++) {
condText += itemsText[i] + " ";
}
- condText += ")";
- };
+ condText += ")";
+ };
return condText;
};
function hideContextCanti(claIdNum) {
$('#selectable-xX' + claIdNum + " .ui-selected").each(function() {
$(this).attr('style', "display: none;");
- $(this).removeClass( "ui-selected" )
+ $(this).removeClass("ui-selected")
});
};
@@ -1355,7 +1424,7 @@ $(document).ready(function() {
if (queryJson["QueryAvanzata"] == 1) {
$("#cla-Advanced").attr('style', "display: block;");
$("#searchToggle").prop("checked", true);
- } else {
+ } else {
$("#cla-Advanced").attr('style', "display: none;");
$("#searchToggle").prop("checked", false);
};
@@ -1364,8 +1433,8 @@ $(document).ready(function() {
$("#queryText").val(queryJson["Clausola0"].queryText);
$("#opzioni_testo").val(queryJson["Clausola0"].opzioni_testo);
var qText = queryJson["Clausola0"].queryText;
- if (qText !== null && qText !== '') {qText = ' "' + qText + '"';}
- setLemmaForma(qText,queryJson["Clausola0"].lemma_forma);
+ if (qText !== null && qText !== '') { qText = ' "' + qText + '"'; }
+ setLemmaForma(qText, queryJson["Clausola0"].lemma_forma);
resetContext(0);
window.context0 = JSON.parse(queryJson.Clausola0.contesto);
parseContext(0);
@@ -1377,7 +1446,7 @@ $(document).ready(function() {
var claParent = []; // array di coppie [elemento, elemento padre]
var treeLevel = []; // pila di elementi padre
var condNum = 0;
- for (var i=0; i < guiLogicString.length; i++) {
+ for (var i = 0; i < guiLogicString.length; i++) {
switch (guiLogicString[i]) {
case "(":
break;
@@ -1385,13 +1454,13 @@ $(document).ready(function() {
treeLevel.pop();
break;
case "OR":
- claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
- treeLevel.push("#sortable" + ++condNum);
+ claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
+ treeLevel.push("#sortable" + ++condNum);
break;
case "AND":
if (i > 1) {
- claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
- treeLevel.push("#sortable" + ++condNum);
+ claParent.push([guiLogicString[i], treeLevel[treeLevel.length - 1]]);
+ treeLevel.push("#sortable" + ++condNum);
} else {
treeLevel.push("#sortable0");
};
@@ -1400,13 +1469,13 @@ $(document).ready(function() {
claParent.push([guiLogicString[i].replace("Clausola", ""), treeLevel[treeLevel.length - 1]]);
};
};
-
-
- $(claParent).each(function(){
+
+
+ $(claParent).each(function() {
var itm = $(this)[0]
if ($(this)[0] == "OR" || $(this)[0] == "AND") {
- addLogicCond($(this)[1],$(this)[0]);
- }
+ addLogicCond($(this)[1], $(this)[0]);
+ }
if (itm != "OR" && itm != "AND") {
clau2Make = queryJson["Clausola" + itm].TipoClausola;
active = queryJson["Clausola" + itm].Attiva
@@ -1414,15 +1483,15 @@ $(document).ready(function() {
switch (clau2Make) {
case "Grammaticale":
selectedValue = queryJson["Clausola" + itm].typeGramm0;
- addGramCla($(this)[1],active,tabID,0);
- $("#lemma_formaN").val(queryJson["Clausola" + itm].lemma_forma);
- $("#queryTextN").val(queryJson["Clausola" + itm].queryText);
- $("#opzioni_testoN").val(queryJson["Clausola" + itm].opzioni_testo);
- /*$("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
+ addGramCla($(this)[1], active, tabID, 0);
+ $("#lemma_formaINIT").val(queryJson["Clausola" + itm].lemma_forma);
+ $("#queryTexINIT").val(queryJson["Clausola" + itm].queryText);
+ $("#opzioni_testoINIT").val(queryJson["Clausola" + itm].opzioni_testo);
+ $("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
$("#queryText" + tabID).val(queryJson["Clausola" + itm].queryText);
$("#opzioni_testo" + tabID).val(queryJson["Clausola" + itm].opzioni_testo);
- */
-
+
+
if (selectedValue != "all") {
$("#grammtypes" + tabID).val(selectedValue);
addCatgramSubcla("cla" + tabID, selectedValue);
@@ -1446,15 +1515,15 @@ $(document).ready(function() {
parseContext(tabID);
break;
case "Sintattico":
- addSyntCla($(this)[1],active,tabID,0);
- $("#lemma_formaN").val(queryJson["Clausola" + itm].lemma_forma);
- $("#queryTextN").val(queryJson["Clausola" + itm].queryText);
- $("#opzioni_testoN").val(queryJson["Clausola" + itm].opzioni_testo);
- /*$("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
+ addSyntCla($(this)[1], active, tabID, 0);
+ $("#lemma_formaINIT").val(queryJson["Clausola" + itm].lemma_forma);
+ $("#queryTextINIT").val(queryJson["Clausola" + itm].queryText);
+ $("#opzioni_testoINIT").val(queryJson["Clausola" + itm].opzioni_testo);
+ $("#lemma_forma" + tabID).val(queryJson["Clausola" + itm].lemma_forma);
$("#queryText" + tabID).val(queryJson["Clausola" + itm].queryText);
$("#opzioni_testo" + tabID).val(queryJson["Clausola" + itm].opzioni_testo);
- */
-
+
+
if (queryJson["Clausola" + itm].typeSyntax0 != ".+") {
$("#cla" + tabID + " #synttypes").val(queryJson["Clausola" + itm].typeSyntax0);
}
@@ -1465,52 +1534,52 @@ $(document).ready(function() {
parseContext(tabID);
break;
case "Metafora":
- addMetaCla($(this)[1],active,tabID,0);
+ addMetaCla($(this)[1], active, tabID, 0);
break;
default:
- };
- };
+ };
+ };
});
refreshClaList();
- refreshSortables();
+ refreshSortables();
};
-
+
function resetSimpleGui() {
$('#queryText').val("");
- setLemmaForma("","forma");
+ setLemmaForma("", "forma");
$('#opzioni_testo').val("parola");
resetContext(0);
};
-
- function setLemmaForma(qText,newSelection) {
- var newOptions = {['La forma' + qText]: 'forma', ['Il lemma' + qText]: 'lemma', ['Il testo' + qText]: 'testo'};
- $("#lemma_forma").empty();
- $.each(newOptions, function(key,value) {
- $("#lemma_forma").append($("
").attr("value", value).text(key));
- });
- $("#lemma_forma").val(newSelection);
+
+ function setLemmaForma(qText, newSelection) {
+ var newOptions = { ['La forma' + qText]: 'forma', ['Il lemma' + qText]: 'lemma', ['Il testo' + qText]: 'testo' };
+ $("#lemma_forma").empty();
+ $.each(newOptions, function(key, value) {
+ $("#lemma_forma").append($("
").attr("value", value).text(key));
+ });
+ $("#lemma_forma").val(newSelection);
};
-
+
function resetContext(claIdNum) {
$('#selectable-xX' + claIdNum + " .ui-selectee").each(function() {
$(this).attr('style', "line-height: 1.2em");
});
- $('#selectable-xX' + claIdNum + " .ui-selected").removeClass( "ui-selected" )
+ $('#selectable-xX' + claIdNum + " .ui-selected").removeClass("ui-selected")
$('#selectable-xX' + claIdNum + ' .sel-canti-intro').each(function() {
$(this).text("Seleziona i canti:")
});;
$("#contextText-xX" + claIdNum).html("Tutta l'opera.");
window["context" + claIdNum] = JSON.parse(JSON.stringify(contextEmpty));
$('#selectable-xX' + claIdNum + " .show").removeClass("show");
-
+
$("#contextDiv" + claIdNum).hide(); //Nik work around per non mostrare context
};
function resetAdvGui() {
- var tabsContent=$("#cla-TabContent").find(".tab-pane:not(:first)");
+ var tabsContent = $("#cla-TabContent").find(".tab-pane:not(:first)");
if ($(tabsContent).length) {
var claIdNum = '';
- $(tabsContent).each(function(){
+ $(tabsContent).each(function() {
claIdNum = $(this)[0].id.substring(3);
delete window["context" + claIdNum];
$(this).remove();
@@ -1519,21 +1588,21 @@ $(document).ready(function() {
claListLen = 0;
condListLen = 0;
tabID = 0;
- $('#sortable0').html(emptyClaList);
+ $('#sortable0').html(emptyClaList);
};
function parseContext(claIdNum) {
var context = window["context" + claIdNum];
- var contextStringParts = ["","",""];
+ var contextStringParts = ["", "", ""];
var contextString = [];
var rangeHolderS = 0;
var rangeHolderE = -1;
var lastElem = "";
var totCan = 0;
- for (var i=0; i < 3; i++) {
- for (var j=0; j <= context[i].length; j++) {
+ for (var i = 0; i < 3; i++) {
+ for (var j = 0; j <= context[i].length; j++) {
if (context[i][j] == 1) {
- if (j == (rangeHolderE+1)) {
+ if (j == (rangeHolderE + 1)) {
rangeHolderE++;
} else {
rangeHolderS = j;
@@ -1542,10 +1611,10 @@ $(document).ready(function() {
totCan++;
} else {
if (rangeHolderE >= 0) {
- if ( rangeHolderS == rangeHolderE) {
- lastElem = (rangeHolderE+1);
+ if (rangeHolderS == rangeHolderE) {
+ lastElem = (rangeHolderE + 1);
} else {
- lastElem = (rangeHolderS+1) + "-" + (rangeHolderE+1);
+ lastElem = (rangeHolderS + 1) + "-" + (rangeHolderE + 1);
};
rangeHolderE = -1;
};
@@ -1567,18 +1636,18 @@ $(document).ready(function() {
}
};
if ((contextString.toString() != "") && (totCan < 100)) {
- $("#contextText-xX" + claIdNum).html(contextString.toString()+".");
+ $("#contextText-xX" + claIdNum).html(contextString.toString() + ".");
} else {
resetContext(claIdNum)
}
};
-
+
function managePage() {
- if (currPage == 0){
- numeroPagine = Math.ceil(numeroContesti/nRisultatiPerPag);
+ if (currPage == 0) {
+ numeroPagine = Math.ceil(numeroContesti / nRisultatiPerPag);
$("#paginaLista option").remove();
for (let i = 1; i <= numeroPagine; i++) {
- $('#paginaLista').append(`
`);
+ $('#paginaLista').append(`
`);
};
$("#pagPrecedente").addClass("disabled");
if (numeroPagine > 1) {
@@ -1590,7 +1659,7 @@ $(document).ready(function() {
} else {
if ((currPage == 1) && (currPage == numeroPagine)) {
$("#pagPrecedente").addClass("disabled")
- $("#pagSuccessiva").addClass("disabled")
+ $("#pagSuccessiva").addClass("disabled")
} else {
if (currPage == 1) {
$("#pagPrecedente").addClass("disabled")
@@ -1598,23 +1667,23 @@ $(document).ready(function() {
} else {
if (currPage == numeroPagine) {
$("#pagPrecedente").removeClass("disabled")
- $("#pagSuccessiva").addClass("disabled")
+ $("#pagSuccessiva").addClass("disabled")
} else {
$("#pagPrecedente").removeClass("disabled")
- $("#pagSuccessiva").removeClass("disabled")
- }
+ $("#pagSuccessiva").removeClass("disabled")
+ }
}
};
};
- $.manageResultList((currPage-1)*nRisultatiPerPag, nRisultatiPerPag);
+ $.manageResultList((currPage - 1) * nRisultatiPerPag, nRisultatiPerPag);
if (latestPhraseId != "") {
document.getElementById(latestPhraseId).scrollIntoView({
- behavior: "smooth",
- });
+ behavior: "smooth",
+ });
latestPhraseId = "";
}
};
-
+
function incSize(currentSize, incr, min, max) {
fSize = Math.max((parseFloat(currentSize) + incr) % max, min);
return (fSize) + 'px';
@@ -1634,7 +1703,7 @@ $(document).ready(function() {
$("#style2-Boot").prop('disabled', true);
$("#style2-Custom").prop('disabled', true);
$("body").fadeIn(fadeDuration);
- });
+ });
break;
case "style2":
$("body").fadeOut(fadeDuration, function() {
@@ -1644,24 +1713,25 @@ $(document).ready(function() {
$("#style1-Boot").prop('disabled', true);
$("#style1-Custom").prop('disabled', true);
$("body").fadeIn(fadeDuration);
- });
+ });
break;
default:
};
- $('#bgImg').replaceWith(bgImgEl);
- drawMinimap(currentMinimap, false, 0);
- Cookies.set('LiDa_style', newStyle); };
+ $('#bgImg').replaceWith(bgImgEl);
+ drawMinimap(currentMinimap, false, 0);
+ Cookies.set('LiDa_style', newStyle);
+ };
};
-
+
});
$(window).on('load', function() {
- var cantoHeightToSet = $("body")[0].clientHeight*cssCantoHeight;
- var maxCantoHeightToSet = $("body")[0].clientHeight*cssTableMainHeight-110; // 63 padding top + 47 margine bottom
- $(visCantoClass).css("max-height", maxCantoHeightToSet);
- $(visCantoClass).css("height", cantoHeightToSet);
- $(displayCantoId).css("max-height", maxCantoHeightToSet);
+ var cantoHeightToSet = $("body")[0].clientHeight * cssCantoHeight;
+ var maxCantoHeightToSet = $("body")[0].clientHeight * cssTableMainHeight - 110; // 63 padding top + 47 margine bottom
+ $(visCantoClass).css("max-height", maxCantoHeightToSet);
+ $(visCantoClass).css("height", cantoHeightToSet);
+ $(displayCantoId).css("max-height", maxCantoHeightToSet);
$(displayCantoId).css("height", cantoHeightToSet);
var bgImgEl = document.createElement("IMG");
bgImgEl.id = "bgImg";