Преглед изворни кода

Add guides and catalogs to OA

Alessia пре 1 година
родитељ
комит
6531fc2da3
2 измењених фајлова са 28 додато и 17 уклоњено
  1. 4 7
      js/OA.js
  2. 24 10
      js/advanced_search.js

+ 4 - 7
js/OA.js

@@ -26,6 +26,7 @@ var img_sc = "";
 var img_g1858 = "";
 var img_g1888 = "";
 var img_p1912 = "";
+var img_m1956 = "";
 
 function handle_OAdata(json) {
 
@@ -312,7 +313,6 @@ function handle_Bibliography(json) {
   var g1858Img = "";
   var g1888Img = "";
   var p1912Img = "";
-  var img_m1956 = "";
 
   $.each(
       json['results']['bindings'],
@@ -457,11 +457,10 @@ function handle_SchedeStoriche(json) {
   console.log(json['results']['bindings']);
 
   const schede = [];
+  var m1956Img = "";
 
   let suffix = ["0", "1", "2", "3", "4", "5"];
 
-  var m1956Img = "";
-
   $.each(
       json['results']['bindings'],
       function (index, value) {
@@ -506,8 +505,6 @@ function handle_SchedeStoriche(json) {
         
       });
 
-  console.log(schede);
-
   if (schede.length == 0) {
     $("#btn_schedastorica").css("display", "none");
   }/* else {
@@ -518,7 +515,7 @@ function handle_SchedeStoriche(json) {
   if (m1956Img == "") {
     $("#btn_marchini1956").css("display", "none");
   } else {
-    document.getElementById("image_papini1912_min").innerHTML = m1956Img;
+    document.getElementById("image_marchini1956_min").innerHTML = m1956Img;
   }
 
   
@@ -686,7 +683,7 @@ function show_M1956(){
   document.getElementById("image_papini1912_min").style.display = "none";
   document.getElementById("image_marchini1956_min").style.display = "block";
   document.getElementById("img_title").innerHTML = "Marchini 1956";
-  document.getElementById("expandedImg").src = img_p1912;
+  document.getElementById("expandedImg").src = img_m1956;
 }
 
 

+ 24 - 10
js/advanced_search.js

@@ -188,22 +188,36 @@ function populateOptions(selector, myArray) {
 		} else if (inputText == "Data"){
 			var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
 			<option selected value="0">Da</option> \
+			<input type="number" id="inputchoiceSelector_'+ numberId +'_a" name="start" min="1000" max="2099" step="1" value="1300" /></div></div>\
+			<div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box">A <select style="display:none;" id ="choice_selector-' + numberId + '_b" value=' + numberId + '_b" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			<option selected value="0">A</option> \
+			<input type="number" id="inputchoiceSelector_'+ numberId +'_b" name="end" min="1000" max="2099" step="1" value="1900" /></div></div>\
+			</select></div></div></div>';
+			/*var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			<option selected value="0">Da</option> \
 			<input type="date" id="inputchoiceSelector_'+ numberId +'_a" name="start" value="1300-01-01"> \
 			</select></div></div> \
 			<div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box">A <select style="display:none;" id ="choice_selector-' + numberId + '_b" value=' + numberId + '_b" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
 			<option selected value="0">A</option> \
 			<input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
-			</select></div></div></div>';
+			</select></div></div></div>';*/
 		}
 		else if (inputText == "Date"){
 			var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
 			<option selected value="0">Data inizio opera</option> \
+			<input type="number" id="inputchoiceSelector_'+ numberId +'_a" name="start" min="1000" max="2099" step="1" value="1300" /></div></div>\
+			<div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box">A <select style="display:none;" id ="choice_selector-' + numberId + '_b" value=' + numberId + '_b" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			<option selected value="0">Data fine opera</option> \
+			<input type="number" id="inputchoiceSelector_'+ numberId +'_b" name="end" min="1000" max="2099" step="1" value="1900" /></div></div>\
+			</select></div></div></div>';
+			/*var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			<option selected value="0">Data inizio opera</option> \
 			<input type="date" id="inputchoiceSelector_'+ numberId +'_a" name="start" value="1300-01-01"> \
 			</select></div></div> \
 			<div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box">A <select style="display:none;" id ="choice_selector-' + numberId + '_b" value=' + numberId + '_b" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
 			<option selected value="0">Data fine opera</option> \
 			<input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
-			</select></div></div></div>';
+			</select></div></div></div>';*/
 		}
 		else if (inputText == "Data partenza"){
 			var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
@@ -777,7 +791,7 @@ function constructQuery(params) {
 			?event_end crm:P4_has_time-span ?uri_date_end . \
 			?uri_date_end rdfs:label ?end ; \
 			time:hasEnd ?date_end . \
-			FILTER (?date_end <= \""+ params[i][1] +"\"^^xsd:date)";
+			FILTER (?date_start <= \""+ params[i][1] +"\"^^xsd:date)";
 		}
 		if (params[i][0] == "Data partenza inizio" && (params[i][1] != "")) {
 			dpi = " ?send_date";
@@ -819,15 +833,15 @@ function constructQuery(params) {
 			diop = " ?time_start";
 
 			data_opera_inizio = "?event_start ?pp ?subject ; \
+			crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
 			crm:P4_has_time-span ?uri_time_start . \
 			?uri_time_start rdfs:label ?time_start; \
-			time:hasBeginning ?date_start ; \
-			time:hasEnd ?date_end . \
-			FILTER (?date_start >= \""+ params[i][1] +"\"^^xsd:date)";
+			time:year ?date_start . \
+			FILTER (?date_start >= \""+ params[i][1] +"\"^^xsd:integer)";
 		}
 		if (params[i][0] == "Data fine opera" && (params[i][1] != "")) {
 
-			data_opera_fine = "FILTER (?date_end <= \""+ params[i][1] +"\"^^xsd:date)";
+			data_opera_fine = "FILTER (?date_start <= \""+ params[i][1] +"\"^^xsd:integer)";
 		}
 
 	}
@@ -844,7 +858,7 @@ function constructQuery(params) {
 
 	query = prefixes + " SELECT DISTINCT ?subject ?label ?identifier " + dm + mt + locl + tec + at
 	+ sg + tt + tp + nt + rf + np + nf + pt + ln + lm + gr + dn + dts + oc + qf + ga + mit 
-	+ des + lp + la + dp + da + dpi + dai + diop + lin + alin + ed + lem + dt + st + fn + ttx + " \
+	+ des + lp + la + dp + da + dpi + dai + diop + lin + alin + ed + lem + dt + st + ttx + " \
 	WHERE {GRAPH " + search_graph + " {?subject ?property ?object } \
 	?subject rdfs:label ?label . " 
 	+ search_identifier + infObj + letter_event + label + search_type + dimensione + materia + localizzazione + tecnica 
@@ -1232,10 +1246,10 @@ function renameCol(param) {
 		return ("Data");
 	}
 	else if (param == "start") {
-		return ("Estremo temporale inferiore");
+		return ("Data");
 	}
 	else if (param == "end") {
-		return ("Estremo temporale superiore");
+		return ("Fine");
 	}
 	else if (param == "send_date") {
 		return ("Data partenza");