Prechádzať zdrojové kódy

Fixed link on information object

Alessia 1 rok pred
rodič
commit
e855c41872
1 zmenil súbory, kde vykonal 7 pridanie a 4 odobranie
  1. 7 4
      js/search.js

+ 7 - 4
js/search.js

@@ -338,7 +338,8 @@ function InfObj_handle_json(json) {
 				highlight = str.substring(ind, wl);
 				second_chunk = str.substring(wl, end);
 
-				var snippet = first_chunk + "<span class='sharp'>" + highlight + "</span>" + second_chunk ;
+				var snippet = first_chunk + highlight + second_chunk ;
+				//var snippet = first_chunk + "<span class='sharp'>" + highlight + "</span>" + second_chunk ;
 
 				if (value.hasOwnProperty('types')) {
 						tipo = value['types']['value'];
@@ -349,12 +350,14 @@ function InfObj_handle_json(json) {
 					}
 				
 				if (tipo.includes("lettera")) {
+					link_name = value['subject']['value'];
 					resource_type = "lettera";
 					link_type = "lettera";
 					infObject_button  += '<button type="button" id="' + value['subject']['value'] + 
 					'" class="lettera btn btn-default" alt="lettera" title="' + value['label']['value'] + 
 					'"><i class="fa fa-envelope"></i><p class="btn-text">Scheda Lettera</p></button>';
 				} else {
+					link_name = value['Physical_Object']['value'];
 					resource_type = "object";
 					link_type = "object";
 					infObject_button  += '<button type="button" id="' + value['Physical_Object']['value'] + 
@@ -362,12 +365,12 @@ function InfObj_handle_json(json) {
 					'"><i class="fa fa-book"></i><p class="btn-text">Scheda Oggetto</p></button>';
 				}
 
-				'<div class="row res"><div class="col-8"><p>' + graph_name + '<br />' +
-			'<span id="' + value['subject']['value'] + '" class="title_doc luogo">' + value['label']['value'] + '</span></p></div>'
+				//'<div class="row res"><div class="col-8"><p>' + graph_name + '<br />' +
+			//'<span id="' + value['subject']['value'] + '" class="title_doc luogo">' + value['label']['value'] + '</span></p></div>'
 
 				information += /*INIZIO DIV*/ '<div class="row res"><div class="col-8"><p>'+ snippet+'</p>' + 
 				'In: ' + graph_name + ';<br />' +
-				'<span id="' + value['subject']['value'] + '" class="title_doc ' + link_type + '">' + value['label']['value'] + id + 
+				'<span id="' + link_name + '" class="title_doc ' + link_type + '">' + value['label']['value'] + id + 
 				'</span>;<br /><i>' + tipo + '</i><br /></div>' + 
 				'<div class="col d-flex align-items-start justify-content-end">' + infObject_button +
 				'<button type="button" value="' + resource_type + '" id="' + value['subject']['value'] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citazione</p></button>' +