aggiunti commenti, modifica gestione rapp. commento/commentatore

This commit is contained in:
cesare 2023-12-18 09:19:22 +01:00
parent 4d8a028671
commit 7ffcdd7924
3 changed files with 2419 additions and 1888 deletions

View File

@ -983,44 +983,44 @@ function resetFrasi(){
} }
function createModuleCommentatore(collapse, commento, num, id, pos){ function createModuleCommentatore(collapse, commento, num, id, pos){
let jsonCommento=JSON.parse(commento.replaceAll("'", '"').replaceAll("+", '"'));
var urlCommento = jsonCommento.Commento;
var esitoCommento = jsonCommento.Rapporto; let tmpcomm='['+commento+']'
let jsonCommento=JSON.parse(tmpcomm.replaceAll("'", '"').replaceAll("+", '"'));
var autoreCommento = jsonCommento.Autore
//var commentoCommentatore = commento.split(',');
var minLength = ($('#displaynote').width() / $('#Test').width() * 2 * 32); var minLength = ($('#displaynote').width() / $('#Test').width() * 2 * 32);
var divContent = $('<div class="d-flex align-content-start flex-wrap text-muted">'); var divContent = $('<div class="d-flex align-content-start flex-wrap text-muted">');
var divTesto = $('<div class="pl-0 pr-3 py-1">') var divTesto = $('<div class="pl-0 pr-3 py-1">')
var nota; var nota='';
/* var lenmod=0
var urlCommento = commentoCommentatore[0]; for (el in jsonCommento){
var position = urlCommento.indexOf("https"); var urlCommento = jsonCommento[el].Commento;
urlCommento = urlCommento.substring(position)
urlCommento = urlCommento.replaceAll("'", ""); var esitoCommento = jsonCommento[el].Rapporto;
var esitoCommento = commentoCommentatore[3];
esitoCommento = esitoCommento.replace("'Rapporto': ", "") var autoreCommento = jsonCommento[el].Autore
esitoCommento = esitoCommento.replaceAll("'", "");
esitoCommento = esitoCommento.replaceAll('}', "");
var autoreCommento = commentoCommentatore[1]+' '+commentoCommentatore[2];
autoreCommento = autoreCommento.replace(" 'Autore':", "")
autoreCommento = autoreCommento.replaceAll("'", "");
*/
if (autoreCommento == "") { if (autoreCommento == "") {
autoreCommento = "Commento" autoreCommento = "Commento"
} }
if (esitoCommento == "") { if (esitoCommento == "") {
esitoCommento = "Rapporto nullo" esitoCommento = "Rapporto nullo"
} }
if (urlCommento == "") { if (nota.length>0){
nota = '<b>Rapporto commento/commentatore: </b>'+esitoCommento+' Commento nullo, '+'</b><br>'; nota=nota+' - '
} else {
nota = '<b>Rapporto commento/commentatore: </b><i>'+esitoCommento +' <a href="'+urlCommento+'"target="_blank">' + autoreCommento+ '</i></a> ' + '</b><br>';
} }
if (urlCommento == "") {
//nota = '<b>Rapporto commento/commentatore: </b>'+esitoCommento+' Commento nullo, '+'</b><br>';
nota = nota+'<i>'+esitoCommento+' Commento nullo'+'</i>'//+'<br>';
} else {
//nota = '<b>Rapporto commento/commentatore: </b><i>'+esitoCommento +' <a href="'+urlCommento+'"target="_blank">' + autoreCommento+ '</i></a> ' + '</b><br>';
nota = nota+'<i>'+esitoCommento +' <a href="'+urlCommento+'"target="_blank">' + autoreCommento+ '</i></a>' //+ '</b><br>';
}
lenmod=lenmod+esitoCommento.length + autoreCommento.length
//divTesto.append(nota);
}
nota='<b>Rapporto commento/commentatore:</b> '+nota
divTesto.append(nota); divTesto.append(nota);
divContent.append(divTesto); divContent.append(divTesto);
if ((esitoCommento.length + autoreCommento.length + 32) > minLength) { if (lenmod+32 > 1000){//minLength) {
var divModule = $('<div class="module pb-0">'); var divModule = $('<div class="module pb-0">');
var divNote = $('<div class="collapse" id="collapse'+num+'Note'+id+ '_' + pos +'" aria-expanded="false">') var divNote = $('<div class="collapse" id="collapse'+num+'Note'+id+ '_' + pos +'" aria-expanded="false">')
divModule.append('<a class="read-more collapsed" data-toggle="collapse" href="#collapse'+num+'Note'+id+ '_' + pos +'" role="button"></a>') divModule.append('<a class="read-more collapsed" data-toggle="collapse" href="#collapse'+num+'Note'+id+ '_' + pos +'" role="button"></a>')

File diff suppressed because one or more lines are too long

View File

@ -129,7 +129,6 @@ WHERE {
###condizioni sintattiche end ###condizioni sintattiche end
}` }`
// ?cl syntit:hasClauseType syntit:Dichiarativa.
ontoSparqlQuerySynt = ` ontoSparqlQuerySynt = `
PREFIX ecrm: <http://erlangen-crm.org/current/> PREFIX ecrm: <http://erlangen-crm.org/current/>
@ -368,7 +367,7 @@ function parseJsonClause(op, tokens, nowhere) {
} }
} }
//MULTIPLE CONDITIONS
function buildSPQuery(guiquery) { function buildSPQuery(guiquery) {
theguiQ = ''; theguiQ = '';
theguiQ = guiquery; theguiQ = guiquery;