This commit is contained in:
nicola 2022-10-04 16:22:23 +02:00
commit 17e08d2fbf
5 changed files with 363 additions and 59 deletions

View File

@ -1141,7 +1141,6 @@ a.text-lidaBG1:hover, a.text-lidaBG1:focus {
- spinner-indicator
------------------------------------*/
th{ color: white; }
.modal-busy {
position: fixed;
z-index: 999;

View File

@ -961,12 +961,12 @@
<fieldset id="numero" class="bn">
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="singolare" value="singolare"
name="num"> <label for=" singolare" class="lh-copy">Singolare</label>
<input class="mr2 f6" type="radio" id="singolare" value="Singolare"
name="Numero"> <label for=" singolare" class="lh-copy">Singolare</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="plurale" value="plurale"
name="num"> <label for="plurale" class="lh-copy">Plurale</label>
<input class="mr2 f6" type="radio" id="plurale" value="Plurale"
name="Numero"> <label for="plurale" class="lh-copy">Plurale</label>
</div>
</fieldset>
</div>
@ -975,17 +975,17 @@
<div class=" w-15 pa1 mr2">
<fieldset id="generelemma" class="bn">
<fieldset id="Genere lemma" class="bn">
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="lemmafemminile"
value="lemmafemminile" name="gel"> <label
value="Lemma femminile" name="Genere lemma"> <label
for="lemmafemminile" class="lh-copy">Lemma di genere
femminile</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="lemmamaschile"
value="lemmamaschile" name="gel"> <label
value="Lemma maschile" name="Genere lemma"> <label
for="lemmamaschile" class="lh-copy">Lemma di genere
maschile</label>
</div>
@ -997,13 +997,13 @@
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="formafemminile"
value="formafemminile" name="gef"> <label
value="Forma femminile" name="Genere forma"> <label
for="formafemminile" class="lh-copy">Forma di genere
femminile</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="formamaschile"
value="formamaschile" name="gef"> <label
value="Forma maschile" name="Genere forma"> <label
for="formamaschile" class="lh-copy">Forma di genere
maschile</label>
</div>
@ -1014,8 +1014,8 @@
<div class="fl w-100 w-70-ns ">
<fieldset id="riflpers" class="bn">
<div class="flex items-center mb2">
<input class="mr2" type="checkbox" id="inlocuzione"
value="inlocuzione"> <label for="inlocuzione"
<input class="mr2" name="riflpers" type="checkbox" id="inlocuzione"
value="In locuzione"> <label for="inlocuzione"
class="lh-copy">In locuzione</label>
</div>
@ -1029,12 +1029,12 @@
<div class=" w-15 pa2 mr2">
<select id="declsost"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="declinazionesostantivo" onchange=""
name="Declinazione sostantivo" onchange=""
title="Declinazione sotantivo">
<option value="">Tutte le declinazioni</option>
<option value="dsg">Prima</option>
<option value="dss">Seconda</option>
<option value="dst">Terza</option>
<option value="Prima declinazione">Prima declinazione</option>
<option value="Seconda declinazione">Seconda declinazione</option>
<option value="Terza declinazione">Terza declinazione</option>
</select>
</div>
@ -1054,12 +1054,12 @@
<fieldset id="diatesi" class="bn">
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="attivo" value="attivo"
name="dia"> <label for="attivo" class="lh-copy">Attivo</label>
<input class="mr2 f6" type="radio" id="attivo" value="Attivo"
name="Diatesi"> <label for="Attivo" class="lh-copy">Attivo</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="passivo" value="passivo"
name="dia"> <label for="passivo" class="lh-copy">Passivo</label>
<input class="mr2 f6" type="radio" id="passivo" value="Passivo"
name="Diatesi"> <label for="Passivo" class="lh-copy">Passivo</label>
</div>
</fieldset>
</div>
@ -1074,12 +1074,12 @@
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="transitivo"
value="transitivo" name="tra"> <label for="transitivo"
value="Transitivo" name="Transitivita"> <label for="transitivo"
class="lh-copy">Transitivo</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="intransitivo"
value="intransitivo" name="tra"> <label
value="Intransitivo" name="Transitivita"> <label
for="intransitivo" class="lh-copy">Intransitivo</label>
</div>
</fieldset>
@ -1091,12 +1091,12 @@
<fieldset id="genere" class="bn">
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="femminile" value="femminile"
name="gen"> <label for="femminile" class="lh-copy">Femminile</label>
<input class="mr2 f6" type="radio" id="femminile" value="Femminile"
name="Genere"> <label for="femminile" class="lh-copy">Femminile</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="maschile" value="maschile"
name="gen"> <label for="maschile" class="lh-copy">Maschile</label>
<input class="mr2 f6" type="radio" id="maschile" value="Maschile"
name="Genere"> <label for="maschile" class="lh-copy">Maschile</label>
</div>
</fieldset>
</div>
@ -1104,12 +1104,12 @@
<fieldset id="numero" class="bn">
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="singolare" value="singolare"
name="num"> <label for="" singolare"" class="lh-copy">Singolare</label>
<input class="mr2 f6" type="radio" id="singolare" value="Singolare"
name="Numero"> <label for="" singolare"" class="lh-copy">Singolare</label>
</div>
<div class="flex items-center mb2">
<input class="mr2 f6" type="radio" id="plurale" value="plurale"
name="num"> <label for="plurale" class="lh-copy">Plurale</label>
<input class="mr2 f6" type="radio" id="plurale" value="Plurale"
name="Numero"> <label for="plurale" class="lh-copy">Plurale</label>
</div>
</fieldset>
</div>
@ -1118,12 +1118,12 @@
<fieldset id="riflpers" class="bn">
<div class="flex items-center mb2">
<input class="mr2" type="checkbox" id="impersonale"
value="impersonale" name="personale"> <label for="impersonale"
value="Impersonale" name="Pers"> <label for="impersonale"
class="lh-copy">Impersonale</label>
</div>
<div class="flex items-center mb2">
<input class="mr2" type="checkbox" id="riflessivo"
value="riflessivo" name="riflessivita"> <label for="riflessivo"
value="Riflessivo" name="Rifl"> <label for="riflessivo"
class="lh-copy">Riflessivo</label>
</div>
</fieldset>
@ -1136,13 +1136,13 @@
<select id="coniug"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="coniugazione" onchange="" title="Coniugazione">
name="Coniugazione" onchange="" title="Coniugazione">
<option value="">Qualsiasi coniugazione</option>
<option value="Prima coniugazione">Prima</option>
<option value="Seconda coniugazione">Seconda</option>
<option value="Terza coniugazione">Terza</option>
<option value="Essere">Essere</option>
<option value="Avere">Avere</option>
<option value="Essere coniugazione">Essere</option>
<option value="Avere coniugazione">Avere</option>
</select>
@ -1150,7 +1150,7 @@
<div class=" w-15 pa2">
<select id="tempi"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="tempoverbale" onchange="" title="Macro categoria">
name="Tempi" onchange="" title="Macro categoria">
<option value="">Qualsiasi tempo verbale</option>
<option value="Indicativo presente">Indicativo presente</option>
<option value="Indicativo passato prossimo">Indicativo passato prossimo</option>
@ -1177,37 +1177,37 @@
</div>
<div class=" w-15 pa2">
<select id="persona"
<select id="Persona"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="persona" onchange="" title="Macro categoria">
<option value="">Qualsiasi persona</option>
<option value="Prima pers s">1ª singolare</option>
<option value="Seconda pers s">2ª singolare</option>
<option value="Terza pers s">3ª singolare</option>
<option value="Prima pers p">1ª plurale</option>
<option value="Prima pers p">2ª plurale</option>
<option value="Prima pers p">3ª plurale</option>
<option value="1ª persona singolare">1ª singolare</option>
<option value="2ª persona singolare">2ª singolare</option>
<option value="3ª persona singolare">3ª singolare</option>
<option value="1ª persona plurale">1ª plurale</option>
<option value="2ª persona plurale">2ª plurale</option>
<option value="3ª persona plurale">3ª plurale</option>
</select>
</div>
<div class=" w-15 pa2 mr2">
<select id="funz"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="funzione" onchange="" title="Funzione">
name="Funzione" onchange="" title="Funzione">
<option value="">Tutte le funzioni</option>
<option value="Funz aggettivo">Aggettivo</option>
<option value="Funz sostantivo maschile">Sostantivo maschile</option>
<option value="Funz sostantivo femminile">Sostantivo femminile</option>
<option value="Aggettivo">Aggettivo</option>
<option value="Sostantivo maschile">Sostantivo maschile</option>
<option value="Sostantivo femminile">Sostantivo femminile</option>
</select>
</div>
<div class=" w-15 pa2 mr2">
<select id="decl"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray"
name="declinazione" onchange="" title="Declinazione">
name="Declinazione" onchange="" title="Declinazione">
<option value="">Tutte le declinazioni</option>
<option value="Prima decl">Prima</option>
<option value="Seconda decl">Seconda</option>
<option value="Terza decl">Terza</option>
<option value="Prima declinazione">Prima</option>
<option value="Seconda declinazione">Seconda</option>
<option value="Terza declinazione">Terza</option>
</select>
</div>

244
js/jquery.ui.touch-punch.js vendored Normal file
View File

@ -0,0 +1,244 @@
/*!
* jQuery UI Touch Punch 1.0.8 as modified by RWAP Software
* based on original touchpunch v0.2.3 which has not been updated since 2014
*
* Updates by RWAP Software to take account of various suggested changes on the original code issues
*
* Original: https://github.com/furf/jquery-ui-touch-punch
* Copyright 20112014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Fork: https://github.com/RWAP/jquery-ui-touch-punch
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "jquery", "jquery-ui" ], factory );
} else {
// Browser globals
factory( jQuery );
}
}(function ($) {
// Detect touch support - Windows Surface devices and other touch devices
$.support.mspointer = window.navigator.msPointerEnabled;
$.support.touch = ( 'ontouchstart' in document
|| 'ontouchstart' in window
|| window.TouchEvent
|| (window.DocumentTouch && document instanceof DocumentTouch)
|| navigator.maxTouchPoints > 0
|| navigator.msMaxTouchPoints > 0
);
// Ignore browsers without touch or mouse support
if ((!$.support.touch && !$.support.mspointer) || !$.ui.mouse) {
return;
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
/**
* Get the x,y position of a touch event
* @param {Object} event A touch event
*/
function getTouchCoords (event) {
return {
x: event.originalEvent.changedTouches[0].pageX,
y: event.originalEvent.changedTouches[0].pageY
};
}
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
}
// Prevent "Ignored attempt to cancel a touchmove event with cancelable=false" errors
if (event.cancelable) {
event.preventDefault();
}
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
event.target.dispatchEvent(simulatedEvent);
}
/**
* Handle the jQuery UI widget's touchstart events
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Interaction time
this._startedMove = event.timeStamp;
// Track movement to determine if interaction was a click
self._startPos = getTouchCoords(event);
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return;
}
// Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true;
// Track movement to determine if interaction was a click
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
};
/**
* Handle the jQuery UI widget's touchmove events
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Interaction was moved
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
};
/**
* Handle the jQuery UI widget's touchend events
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
// If the touch interaction did not move, it should trigger a click
// Check for this in two ways - length of time of simulation and distance moved
// Allow for Apple Stylus to be used also
var timeMoving = event.timeStamp - this._startedMove;
if (!this._touchMoved || timeMoving < 500) {
// Simulate the click event
simulateMouseEvent(event, 'click');
} else {
var endPos = getTouchCoords(event);
if ((Math.abs(endPos.x - this._startPos.x) < 10) && (Math.abs(endPos.y - this._startPos.y) < 10)) {
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved || event.originalEvent.changedTouches[0].touchType === 'stylus') {
// Simulate the click event
simulateMouseEvent(event, 'click');
}
}
}
// Unset the flag to determine the touch movement stopped
this._touchMoved = false;
// Unset the flag to allow other widgets to inherit the touch event
touchHandled = false;
};
/**
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
* This method extends the widget with bound touch event handlers that
* translate touch events to mouse events and pass them to the widget's
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Microsoft Surface Support = remove original touch Action
if ($.support.mspointer) {
self.element[0].style.msTouchAction = 'none';
}
// Delegate the touch handlers to the widget's element
self.element.on({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse init method
_mouseInit.call(self);
};
/**
* Remove the touch event handlers
*/
mouseProto._mouseDestroy = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.off({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);
};
}));

View File

@ -372,11 +372,11 @@ $(document).ready(function() {
jsonQuery = buildSQ(queryJson);
queryFields = [];
for (var i in jsonQuery.variables) {
if (jsonQuery.variables[i].value) {
queryFields.push(jsonQuery.variables[i].value);
} else {
//if (jsonQuery.variables[i].value) {
//queryFields.push(jsonQuery.variables[i].value);
//} else {
queryFields.push(jsonQuery.variables[i].variable.value);
}
//}
}
execQuery = new sparqlGenerator().stringify(jsonQuery);
executeQuery();

View File

@ -9,7 +9,7 @@ PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX olires:<https://dantenetwork.it/ontology/OLIRes/>
SELECT (?form as ?IRIForma) (?Rappresentazione as ?Forma) (?lm as ?Lemma) (?textver as ?Verso) ?NumVerso
SELECT (?form as ?IRIForma) (?Rappresentazione as ?Forma) (?lm as ?Lemma) (?textver as ?Verso) (?NumVerso as ?NumeroVerso)
(?t_canto as ?Canto) (?t_cantica as ?Cantica)
@ -107,6 +107,8 @@ function buildSQ(stquery) {
//Nick
if (ftxt==null){
ftxt = document.getElementById("searchValue");
myquery=buildClauseNick(stquery, parsedquery);
return (myquery)
}
@ -137,6 +139,48 @@ function buildSQ(stquery) {
return (parsedquery)
}
//Nick
function buildClauseNick(clause, parsedquery){
clause=clause['filtro-1'];//da modificare
if (clause['query'] != null && clause['query'].trim() != "") {
if (clause['query'].trim().slice(-1) !=='*')
strval="^" +clause['query'].trim()+ "$";
else
strval=clause['query'].trim().slice(0, -1)
parsedquery.where[1].expression.args[1].value = strval;
if (clause['lemma_forma'] != null && clause['lemma_forma'] == 'lemma')
parsedquery.where[1].expression.args[0].value = "lm";
}
else{
parsedquery.where.splice(1, 1)
}
if (clause['categoria'] !=null && clause['categoria'] != "all")
parsedquery.where[0].triples.push(JSON.parse(data21)[clause['categoria']]);
if (clause['tipoClausola'] !=null && Object.keys(sottoCategorie).includes(clause['categoria'].trim())){
//sctmp=JSON.parse(sottoCategorieSostantivi)
sctmp=sottoCategorie[clause['categoria'].trim()]
sctk=Object.keys(sctmp)
for (ke in sctk){
keval=clause[encodeURI(sctk[ke])]
if (keval!=null && keval!=''){
sttmts=sctmp[sctk[ke]]
subcatstat= buildsubcategoryClause(sttmts[keval])
parsedquery.where[0].triples.push(subcatstat);
}
}
}
return parsedquery
}
function buildClause(clause, parsedquery){
@ -198,6 +242,17 @@ function buildsubcategoryClause(sttmnt){
}
/*
{
"b": "VerboVolgareFunzioneAvverbio",
"l": "VerboVolgareFunzioneLocuzione" #CONTROLLARE
}
"Persona" : ["Qualsiasi persona", "1ª persona singolare", "2ª persona singolare", "3ª persona singolare", "1ª persona plurale", "2ª persona plurale", "3ª persona plurale"],
*/
var sottoCategorie = {
"verbovolgare": {"Diatesi": {"Attivo": "TipoDiatesiVerboVolgare:VerboVolgareAttivo", "Passivo": "TipoDiatesiVerboVolgare:VerboVolgarePassivo"},
@ -220,7 +275,14 @@ var sottoCategorie = {
"Imperativo presente": "TipoTempoVerboVolgare:PresenteImperativoVerboVolgare", "Infinito presente": "TipoTempoVerboVolgare:PresenteInfinitoVerboVolgare",
"Infinito passato": "TipoTempoVerboVolgare:PassatoInfinitoVerboVolgare", "Participio presente": "TipoTempoVerboVolgare:PresenteParticipioVerboVolgare",
"Participio passato": "TipoTempoVerboVolgare:PassatoParticipioVerboVolgare", "Gerundio presente": "TipoTempoVerboVolgare:PresenteGerundioVerboVolgare",
"Gerundio passato": "TipoTempoVerboVolgare:PassatoGerundioVerboVolgare"}
"Gerundio passato": "TipoTempoVerboVolgare:PassatoGerundioVerboVolgare"},
"Funzione": {"Aggettivo":"TipoFunzioneVerboVolgare:VerboVolgareFunzioneAggettivo", "Sostantivo maschile":"TipoFunzioneVerboVolgare:VerboVolgareFunzioneSostantivoMaschile",
"Sostantivo femminile":"TipoFunzioneVerboVolgare:VerboVolgareFunzioneSostantivoFemminile"},
"Declinazione": {"Prima declinazione":"TipoDeclinazioneVerboVolgare:PrimaDeclinazioneVerboVolgare", "Seconda declinazione":"TipoDeclinazioneVerboVolgare:SecondaDeclinazioneVerboVolgare",
"Terza declinazione":"TipoDeclinazioneVerboVolgare:TerzaDeclinazioneVerboVolgare"},
"Persona": {"1ª persona singolare": "TipoPersonaVerboVolgare:PrimaPersonaSingolareVerboVolgare", "2ª persona singolare": "TipoPersonaVerboVolgare:SecondaPersonaSingolareVerboVolgare",
"3ª persona singolare": "TipoPersonaVerboVolgare:TerzaPersonaSingolareVerboVolgare", "1ª persona plurale": "TipoPersonaVerboVolgare:PrimaPersonaPluraleVerboVolgare",
"2ª persona plurale": "TipoPersonaVerboVolgare:SecondaPersonaPluraleVerboVolgare", "3ª persona plurale": "TipoPersonaVerboVolgare:TerzaPersonaPluraleVerboVolgare"}
},
@ -239,8 +301,7 @@ var sottoCategorie = {
"avverbiovolgare": "filtriavverbio",
"preposizionevolgare": "filtripreposizione",
"congiunzionevolgare": "filtricongiunzione",
"onomasticavolgare": {
"Tipo" :{"Nome proprio":"TipoDellOnomasticaVolgare:NomeProprio", "Nome proprio separato":"TipoDellOnomasticaVolgare:NomeProprioSeparato",
"onomasticavolgare": {"Tipo" :{"Nome proprio":"TipoDellOnomasticaVolgare:NomeProprio", "Nome proprio separato":"TipoDellOnomasticaVolgare:NomeProprioSeparato",
"Titolo": "TipoDellOnomasticaVolgare:Titolo"}
},