people.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  1. var link = thisUrlParams.link;
  2. prefixes = queryManager['prefixes']['all'];
  3. query = prefixes + (queryManager['querySchedaPersona']['queryInfo']).replace('{URI}', link);
  4. doJsonQuery(query).done(function(data) { handle_data(data); });
  5. queryURL = prefixes + (queryManager['querySchedaPersona']['query']).replace('{URI}', link);
  6. doJsonQuery(queryURL).done(function(data) { handle_map(data); });
  7. queryEx = prefixes + (queryManager['querySchedaPersona']['queryLetters']).replace('{URI}', link);
  8. doJsonQuery(queryEx).done(function(data) { handle_Letters(data); });
  9. queryOA = prefixes + (queryManager['querySchedaPersona']['queryOpere']).replace('{URI}', link);
  10. doJsonQuery(queryOA).done(function(data) { handle_Artwork(data); });
  11. queryOt = prefixes + (queryManager['querySchedaPersona']['queryOtherDoc']).replace('{URI}', link);
  12. doJsonQuery(queryOt).done(function(data) { handle_Other_Documents(data); });
  13. queryGt = prefixes + (queryManager['querySchedaPersona']['queryGettatelliEv']).replace('{URI}', link);
  14. doJsonQuery(queryGt).done(function(data) { handle_Gettatelli(data); });
  15. queryInfoGt = prefixes + (queryManager['querySchedaPersona']['queryInfoGettatelli']).replace('{URI}', link);
  16. doJsonQuery(queryInfoGt).done(function(data) { handle_InfoGettatelli(data); });
  17. queryRel = prefixes + (queryManager['querySchedaPersona']['queryRelazioni']).replace('{URI}', link);
  18. doJsonQuery(queryRel).done(function(data) { handle_Relazioni(data); });
  19. queryRelIn = prefixes + (queryManager['querySchedaPersona']['queryRelazioniInverse']).replace('{URI}', link);
  20. doJsonQuery(queryRelIn).done(function(data) { handle_RelazioniInverse(data); });
  21. queryCom = prefixes + (queryManager['querySchedaPersona']['queryCompagnia']).replace('{URI}', link);
  22. doJsonQuery(queryCom).done(function(data) { handle_Compagnia(data); });
  23. queryEv = prefixes + (queryManager['querySchedaPersona']['queryEventi']).replace('{URI}', link);
  24. doJsonQuery(queryEv).done(function(data) { handle_Events(data); });
  25. queryCon = prefixes + (queryManager['querySchedaPersona']['queryContrassegni']).replace('{URI}', link);
  26. doJsonQuery(queryCon).done(function(data) { handle_Contrassegni(data); });
  27. queryRif = prefixes + (queryManager['querySchedaPersona']['queryRiferimenti']).replace('{URI}', link);
  28. doJsonQuery(queryRif).done(function(data) { handle_Riferimenti(data); });
  29. queryOcc = prefixes + (queryManager['querySchedaPersona']['queryOccupazione']).replace('{URI}', link);
  30. doJsonQuery(queryOcc).done(function(data) { handle_Occupations(data); });
  31. var labelName = "";
  32. function handle_data(json) {
  33. var graph = "";
  34. var label = "";
  35. if ("givenName" in json.results.bindings) {
  36. givenName = value['givenName']['value'];
  37. }
  38. $.each(
  39. json['results']['bindings'],
  40. function (index, value) {
  41. var graph = value['graph']['value'];
  42. var uri = value['uri']['value'];
  43. var label = value['label']['value'];
  44. var name = value['name']['value'];
  45. var givenName = "";
  46. var familyName = "";
  47. var alias = "";
  48. var gender = "";
  49. var patronymic = "";
  50. var occupation = "";
  51. var relative2 = "";
  52. var relative3 = "";
  53. var identifier = "";
  54. var id_type = "";
  55. var birth_date = "";
  56. var birth_place = "";
  57. var death_date = "";
  58. var death_place = "";
  59. var qualification = "";
  60. var group = "";
  61. var type = "";
  62. var provenence = "";
  63. var variants = "";
  64. if ((value.hasOwnProperty('identifier')) && (value.hasOwnProperty('id_type'))) {
  65. $("#identifier").css("display", "flex");
  66. identifier = value['identifier']['value'];
  67. id_type = value['id_type']['value'];
  68. }
  69. if (value.hasOwnProperty('givenName')) {
  70. $("#givenName").css("display", "flex");
  71. givenName = value['givenName']['value'];
  72. }
  73. if (value.hasOwnProperty('familyName')) {
  74. $("#familyName").css("display", "flex");
  75. familyName = value['familyName']['value'].toLowerCase();
  76. familyName = familyName.charAt(0).toUpperCase() + familyName.slice(1);
  77. }
  78. if (value.hasOwnProperty('alias')) {
  79. $("#aliasName").css("display", "flex");
  80. alias = value['alias']['value'];
  81. }
  82. if (value.hasOwnProperty('gender')) {
  83. $("#gender").css("display", "flex");
  84. gender = value['gender']['value'];
  85. }
  86. if (value.hasOwnProperty('patronymic')) {
  87. $("#patronymic").css("display", "flex");
  88. patronymic = value['patronymic']['value'];
  89. }
  90. if (value.hasOwnProperty('provenienza')) {
  91. $("#PlaceProvenence").css("display", "flex");
  92. provenence = value['provenienza']['value'];
  93. }
  94. if (value.hasOwnProperty('occupation')) {
  95. $("#occupation").css("display", "flex");
  96. occupation = value['occupation']['value'];
  97. }
  98. if (value.hasOwnProperty('relative2')) {
  99. relative2 = value['relative2']['value'];
  100. }
  101. if (value.hasOwnProperty('relative3')) {
  102. relative3 = value['relative3']['value'];
  103. }
  104. if (value.hasOwnProperty('qualification')) {
  105. $("#honorific").css("display", "flex");
  106. qualification = value['qualification']['value'];
  107. }
  108. if (value.hasOwnProperty('person_type')) {
  109. $("#type").css("display", "flex");
  110. type = value['person_type']['value'];
  111. }
  112. if (value.hasOwnProperty('Birth_Date')) {
  113. $("#BirthDate").css("display", "flex");
  114. birth_date = value['Birth_Date']['value'];
  115. }
  116. if (value.hasOwnProperty('Birth_Place')) {
  117. $("#BirthPlace").css("display", "flex");
  118. birth_place = value['Birth_Place']['value'];
  119. }
  120. if (value.hasOwnProperty('Death_Date')) {
  121. $("#DeathDate").css("display", "flex");
  122. death_date = value['Death_Date']['value'];
  123. }
  124. if (value.hasOwnProperty('Death_Place')) {
  125. $("#DeathPlace").css("display", "flex");
  126. death_place = value['Death_Place']['value'];
  127. }
  128. if (value.hasOwnProperty('group')) {
  129. $("#groups").css("display", "flex");
  130. group = value['group']['value'];
  131. }
  132. if (value.hasOwnProperty('variants')) {
  133. if (value['variants']['value'] != "| ") {
  134. alert(value['variants']['value']);
  135. $("#otherNames").css("display", "flex");
  136. let strings = value['variants']['value'];
  137. variants = strings.split(";");
  138. }
  139. }
  140. var dataset = get_dataset_name(graph);
  141. var second_name = patronymic;
  142. if (relative2 != "") {
  143. second_name = second_name + " " + relative2;
  144. }
  145. if (relative3 != "") {
  146. second_name = second_name + " " + relative3;
  147. }
  148. if (familyName != "") {
  149. second_name = second_name + " " + familyName;
  150. }
  151. var first_name = "";
  152. if ((givenName != "") || (second_name != "") || (provenence != "")) {
  153. first_name = givenName + " " + second_name + " " + provenence;
  154. } else {
  155. first_name = name;
  156. }
  157. first_name = first_name.replace(",", "");
  158. first_name = titleCase(first_name);
  159. name = titleCase(name);
  160. givenName = titleCase(givenName);
  161. var name_string = "";
  162. if (variants.length>0) {
  163. for (var i=0; i<variants.length; i++) {
  164. let chunk = variants[i].split("| ");
  165. name_string = name_string + "<a href='" + chunk[0] + "'>" + chunk[1] + "</a><br />";
  166. }
  167. }
  168. labelName = first_name;
  169. var Buttons = createHeaderButtons(uri);
  170. var id_snippet = "<div class='col-sm-4'><span class='label'>" + id_type + ":</span></div><div class='col' id='identificatore'>" + identifier + "</div>";
  171. document.getElementById("grafo").innerHTML = dataset;
  172. document.getElementById("nome_persona").innerHTML = first_name;
  173. document.getElementById("nome").innerHTML = name;
  174. document.getElementById("genere").innerHTML = gender;
  175. document.getElementById("nome_proprio").innerHTML = givenName;
  176. document.getElementById("nome_famiglia").innerHTML = familyName;
  177. document.getElementById("patronimico").innerHTML = second_name.replace("di ", "");
  178. document.getElementById("provenienza").innerHTML = provenence;
  179. document.getElementById("identifier").innerHTML = id_snippet;
  180. document.getElementById("alias").innerHTML = alias;
  181. document.getElementById("tipologia").innerHTML = type;
  182. document.getElementById("variants").innerHTML = name_string;
  183. document.getElementById("qualifica").innerHTML = qualification;
  184. document.getElementById("occupazione").innerHTML = occupation;
  185. document.getElementById("data_nascita").innerHTML = birth_date;
  186. document.getElementById("data_morte").innerHTML = death_date;
  187. document.getElementById("luogo_nascita").innerHTML = birth_place;
  188. document.getElementById("luogo_morte").innerHTML = death_place;
  189. document.getElementById("gruppi_appartenenza").innerHTML = group;
  190. document.getElementById("link_buttons").innerHTML = Buttons;
  191. const collection = document.getElementsByClassName("PN");
  192. for (var i=0; i<collection.length; i++) {
  193. collection[i].innerHTML = first_name;
  194. }
  195. });
  196. }
  197. function get_dataset_name(graph) {
  198. var string = "Person";
  199. if (graph == "http://iperion.vm.fedcloud.eu:8890/aspo/onomastica") {
  200. string = string + " / Datini Fond";
  201. }
  202. else if (graph == "http://iperion.vm.fedcloud.eu:8890/mpp/authors"){
  203. string = string + " / Artists";
  204. }
  205. else {
  206. string = string;
  207. }
  208. return (string);
  209. }
  210. function handle_InfoGettatelli(json) {
  211. var card = "";
  212. var uri_card = "";
  213. $.each(
  214. json['results']['bindings'],
  215. function (index, value) {
  216. if ((value.hasOwnProperty('uri_card')) && (value.hasOwnProperty('card'))) {
  217. $("#card").css("display", "flex");
  218. uri_card = value['uri_card']['value'];
  219. card = value['card']['value'];
  220. }
  221. });
  222. var button_obj = "";
  223. if (uri_card != "") {
  224. button_obj = '<button type="button" id="' + uri_card +
  225. '" class="object btn btn-default" alt="oggetto" title="' + uri_card +
  226. '"><i class="fa fa-book"></i><p class="btn-text">Physical object</p></button>';
  227. }
  228. document.getElementById("scheda_anagrafica").innerHTML = card;
  229. document.getElementById("btn_scheda").innerHTML = button_obj;
  230. }
  231. function handle_Gettatelli(json) {
  232. //console.log(json);
  233. var generic = "";
  234. var find = "";
  235. var reunite = "";
  236. var adoption = "";
  237. $.each(
  238. json['results']['bindings'],
  239. function (index, value) {
  240. var event_type = value['event_type']['value'];
  241. var data = value['time_span']['value'];
  242. if (event_type == "Evento generico") {
  243. $("#generic_event").css("display", "flex");
  244. generic = data;
  245. }
  246. else if (event_type == "Ritrovamento") {
  247. $("#find_event").css("display", "flex");
  248. find = data;
  249. }
  250. else if (event_type == "Ricongiungimento") {
  251. $("#reunion_event").css("display", "flex");
  252. reunite = data;
  253. }
  254. else if (event_type == "Adozione") {
  255. $("#adoption_event").css("display", "flex");
  256. adoption = data;
  257. }
  258. });
  259. document.getElementById("anno").innerHTML = generic;
  260. document.getElementById("ritrovamento").innerHTML = find;
  261. document.getElementById("ricongiungimento").innerHTML = reunite;
  262. document.getElementById("adozione").innerHTML = adoption;
  263. }
  264. function handle_Relazioni(json) {
  265. //console.log(json);
  266. var Relazioni = "";
  267. const myArray = []
  268. $.each(
  269. json['results']['bindings'],
  270. function (index, value) {
  271. var tipo = value['relation_type']['value'];
  272. var uri_person = value['uri_person']['value'];
  273. var nome = value['name']['value'];
  274. var principale = "";
  275. var givenName = "";
  276. var familyName = "";
  277. var patronymic = "";
  278. var provenence = "";
  279. if (value.hasOwnProperty('givenName')) {
  280. givenName = value['givenName']['value'];
  281. }
  282. if (value.hasOwnProperty('note')) {
  283. principale = " principale";
  284. }
  285. if (value.hasOwnProperty('familyName')) {
  286. familyName = value['familyName']['value'].toLowerCase();
  287. familyName = familyName.charAt(0).toUpperCase() + familyName.slice(1)
  288. }
  289. if (value.hasOwnProperty('patronymic')) {
  290. patronymic = value['patronymic']['value'];
  291. }
  292. if (value.hasOwnProperty('provenienza')) {
  293. provenence = value['provenienza']['value'];
  294. }
  295. var type = tipo.charAt(0).toUpperCase() + tipo.slice(1) + principale;
  296. if ((type == "Socio") || (type == "Socio principale")) {
  297. type = "Società";
  298. }
  299. if (type == "Mano lettera") {
  300. type = "Altre collaborazioni"
  301. }
  302. var first_name = "";
  303. if ((givenName != "") || (patronymic != "") || (familyName != "") || (provenence != "")) {
  304. first_name = givenName + " " + patronymic + " " + familyName + " " + provenence;
  305. } else {
  306. first_name = nome;
  307. }
  308. myArray.push([type, first_name, uri_person]);
  309. });
  310. const checkRel = [];
  311. for (var i=0; i<myArray.length; i++) {
  312. var key = myArray[i][0];
  313. checkRel.push(key);
  314. }
  315. var params = [];
  316. $.each(checkRel, function(i, el){
  317. if($.inArray(el, params) === -1) params.push(el);
  318. });
  319. for (var i=0; i<params.length; i++) {
  320. var par = params[i];
  321. var par_id = par.replaceAll(" ", "_");
  322. var rel = createDivRelazione(par, par_id);
  323. Relazioni = Relazioni + rel;
  324. }
  325. $(Relazioni).insertAfter( "#groups" );
  326. for (var j=0; j<params.length; j++) {
  327. var el = params[j];
  328. var par = el.replaceAll(" ", "_");
  329. var Colums = "";
  330. for (var i=0; i<myArray.length; i++) {
  331. var text = myArray[i][1];
  332. var link = myArray[i][2];
  333. var rel = myArray[i][0].replaceAll(" ", "_");
  334. if (par == rel) {
  335. var col = createColRelazione(text, link);
  336. Colums = Colums + col;
  337. }
  338. }
  339. document.getElementById(par).innerHTML = Colums;
  340. }
  341. }
  342. function handle_RelazioniInverse(json) {
  343. //console.log(json);
  344. var Relazioni = "";
  345. const myArray = []
  346. $.each(
  347. json['results']['bindings'],
  348. function (index, value) {
  349. var tipo = value['relation_type']['value'];
  350. var uri_person = value['uri_person']['value'];
  351. var nome = "";
  352. var principale = "";
  353. var givenName = "";
  354. var familyName = "";
  355. var patronymic = "";
  356. var provenence = "";
  357. if (value.hasOwnProperty('name')) {
  358. nome = value['name']['value'];
  359. }
  360. if (value.hasOwnProperty('givenName')) {
  361. givenName = value['givenName']['value'];
  362. }
  363. if (value.hasOwnProperty('note')) {
  364. principale = " principale";
  365. }
  366. if (value.hasOwnProperty('familyName')) {
  367. familyName = value['familyName']['value'].toLowerCase();
  368. familyName = familyName.charAt(0).toUpperCase() + familyName.slice(1)
  369. }
  370. if (value.hasOwnProperty('patronymic')) {
  371. patronymic = value['patronymic']['value'];
  372. }
  373. if (value.hasOwnProperty('provenienza')) {
  374. provenence = value['provenienza']['value'];
  375. }
  376. var type = tipo.charAt(0).toUpperCase() + tipo.slice(1) + principale + " di";
  377. if (type == "Socio di") {
  378. type = "Soci";
  379. }
  380. if (type == "Socio principale di") {
  381. type = "Intestatario principale";
  382. }
  383. if (type == "Mano lettera di") {
  384. type = "Collaboratori";
  385. }
  386. var first_name = "";
  387. if ((givenName != "") || (patronymic != "") || (familyName != "") || (provenence != "")) {
  388. first_name = givenName + " " + patronymic + " " + familyName + " " + provenence;
  389. } else {
  390. first_name = nome;
  391. }
  392. myArray.push([type, first_name, uri_person]);
  393. });
  394. const checkRel = [];
  395. for (var i=0; i<myArray.length; i++) {
  396. var key = myArray[i][0];
  397. checkRel.push(key);
  398. }
  399. var params = [];
  400. $.each(checkRel, function(i, el){
  401. if($.inArray(el, params) === -1) params.push(el);
  402. });
  403. for (var i=0; i<params.length; i++) {
  404. var par = params[i];
  405. var par_id = par.replaceAll(" ", "_");
  406. var rel = createDivRelazione(par, par_id);
  407. Relazioni = Relazioni + rel;
  408. }
  409. $(Relazioni).insertAfter( "#groups" );
  410. for (var j=0; j<params.length; j++) {
  411. var el = params[j];
  412. var par = el.replaceAll(" ", "_");
  413. var Colums = "";
  414. for (var i=0; i<myArray.length; i++) {
  415. var text = myArray[i][1];
  416. var link = myArray[i][2];
  417. var rel = myArray[i][0].replaceAll(" ", "_");
  418. if (par == rel) {
  419. var col = createColRelazione(text, link);
  420. Colums = Colums + col;
  421. }
  422. }
  423. document.getElementById(par).innerHTML = Colums;
  424. }
  425. }
  426. function createDivRelazione(type, id){
  427. htmlCode = '\
  428. <div class="row mb-2"> \
  429. <div class="col-sm-4"> \
  430. <span class="label"><RELATIONSHIP></span> \
  431. </div> \
  432. <div class="col record_box" id="<ID_RELATIONSHIP>"></div> \
  433. </div> \
  434. '.replace("<RELATIONSHIP>", type).replace("<ID_RELATIONSHIP>", id);
  435. return htmlCode;
  436. }
  437. function createColRelazione(text, link) {
  438. htmlCode = '\
  439. <div class="row mb-1"> \
  440. <div class="col"><NAME></div> \
  441. <div class="col-auto"> \
  442. <button class="persona btn btn-default" type="button" id="<URI>">\
  443. <i class="fa fa-user" aria-hidden="true">\
  444. <p class="btn-text">Person</p>\
  445. </i>\
  446. </button>\</div> \
  447. </div>\
  448. '.replace("<NAME>", text).replace("<URI>", link);
  449. return htmlCode;
  450. }
  451. function handle_Events(json) {
  452. let events = {};
  453. var i = 0;
  454. $.each(
  455. json['results']['bindings'],
  456. function (index, value) {
  457. var event_type = value['event_type']['value'];
  458. var role = value['role']['value'];
  459. var uri_document = value['uri_document']['value'];
  460. var document = value['document']['value'];
  461. var time_span = "";
  462. var uri_place1 = "";
  463. var uri_place2 = "";
  464. var uri_place3 = "";
  465. var uri_place4 = "";
  466. var place1 = "";
  467. var place2 = "";
  468. var place3 = "";
  469. var place4 = "";
  470. var coords1 = "";
  471. var coords2 = "";
  472. var coords3 = "";
  473. var coords4 = "";
  474. if (value.hasOwnProperty('time_span')) {
  475. time_span = value['time_span']['value'];
  476. }
  477. if (value.hasOwnProperty('uri_place')) {
  478. uri_place1 = value['uri_place']['value'];
  479. }
  480. if (value.hasOwnProperty('coords')) {
  481. coords1 = value['coords']['value'];
  482. }
  483. if (value.hasOwnProperty('place')) {
  484. place1 = value['place']['value'];
  485. place1 = titleCase(place1);
  486. }
  487. if (value.hasOwnProperty('uri_place2')) {
  488. uri_place2 = value['uri_place2']['value'];
  489. }
  490. if (value.hasOwnProperty('coords2')) {
  491. coords2 = value['coords2']['value'];
  492. }
  493. if (value.hasOwnProperty('place2')) {
  494. place2 = value['place2']['value'];
  495. place2 = titleCase(place2);
  496. }
  497. if (value.hasOwnProperty('uri_place3')) {
  498. uri_place3 = value['uri_place3']['value'];
  499. }
  500. if (value.hasOwnProperty('coords3')) {
  501. coords3 = value['coords3']['value'];
  502. }
  503. if (value.hasOwnProperty('place3')) {
  504. place3 = value['place3']['value'];
  505. place3 = titleCase(place3);
  506. }
  507. if (value.hasOwnProperty('uri_place4')) {
  508. uri_place4 = value['uri_place4']['value'];
  509. }
  510. if (value.hasOwnProperty('coords4')) {
  511. coords4 = value['coords4']['value'];
  512. }
  513. if (value.hasOwnProperty('place4')) {
  514. place4 = value['place4']['value'];
  515. place4 = titleCase(place4);
  516. }
  517. let cells = {"evento": event_type, "ruolo": role, "data": time_span, "uri_documento": uri_document, "documento": document, "uri_luogo1": uri_place1, "luogo1": place1, "coords1": coords1, "uri_luogo2": uri_place2, "luogo2": place2, "coords2": coords2, "uri_luogo3": uri_place3, "luogo3": place3, "coords3": coords3, "uri_luogo4": uri_place4, "luogo4": place4, "coords4": coords4};
  518. events[i] = cells;
  519. i++;
  520. });
  521. var thead = '<thead id="ev_thead" class="def_res"><tr>' +
  522. '<th class="col-2">Evento</th>' +
  523. '<th class="col-2">Ruolo</th>' +
  524. '<th class="col-2">Data</th>' +
  525. '<th class="col-3">Luogo</th>' +
  526. '<th class="col-3">Documento</th>' +
  527. '</tr></thead>';
  528. var EventsTable = thead;
  529. EventsTable += '<tbody>';
  530. console.log(events);
  531. for (i in events) {
  532. console.log(events);
  533. var sniPlace = "";
  534. var sniPlace1 = "";
  535. var sniPlace2 = "";
  536. var sniPlace3 = "";
  537. var sniPlace4 = "";
  538. if (events[i]['coords1'] != "") {
  539. sniPlace1 = '<span id="' + events[i]['uri_luogo1'] + '" class="luogo link">' + events[i]['luogo1'] + '</span>';
  540. } else {
  541. sniPlace1 = events[i]['luogo1'];
  542. }
  543. if (events[i]['coords2'] != "") {
  544. sniPlace2 = '<span id="' + events[i]['uri_luogo2'] + '" class="luogo link">' + events[i]['luogo2'] + '</span>';
  545. } else {
  546. sniPlace2 = events[i]['luogo2'];
  547. }
  548. if (events[i]['coords3'] != "") {
  549. sniPlace3 = '<span id="' + events[i]['uri_luogo3'] + '" class="luogo link">' + events[i]['luogo3'] + '</span>';
  550. } else {
  551. sniPlace3 = events[i]['luogo3'];
  552. }
  553. if (events[i]['coords4'] != "") {
  554. sniPlace4 = '<span id="' + events[i]['uri_luogo4'] + '" class="luogo link">' + events[i]['luogo4'] + '</span>';
  555. } else {
  556. sniPlace4 = events[i]['luogo4'];
  557. }
  558. if (sniPlace1 != "") {
  559. sniPlace = sniPlace1;
  560. }
  561. if (sniPlace2 != "") {
  562. sniPlace = sniPlace + " &#60; " + sniPlace2;
  563. }
  564. if (sniPlace3 != "") {
  565. sniPlace = sniPlace + " &#60; " + sniPlace3;
  566. }
  567. if (sniPlace4 != "") {
  568. sniPlace = sniPlace + " &#60; " + sniPlace4;
  569. }
  570. EventsTable += '<tr class="res">' +
  571. '<th class="col-2">' + events[i]['evento'] + '</th>' +
  572. '<th class="col-2">' + events[i]['ruolo'] + '</th>' +
  573. '<th class="col-2">' + events[i]['data'] + '</th>' +
  574. '<th class="col-3">' + sniPlace + '</th>' +
  575. '<th id="' + events[i]['uri_documento'] + '" class="col-3 object link">' + events[i]['documento'] + '</th>' +
  576. '</tr>';
  577. }
  578. EventsTable += '</tbody>';
  579. if (Object.keys(events).length != 0) {
  580. document.getElementById("res_events").innerHTML = EventsTable;
  581. } else {
  582. var eventIcon = "<div id='map_icon' class='no_info_icon'> \
  583. <svg width='30' viewBox='0 0 411 404' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> \
  584. <g id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'> \
  585. <g id='noun-event-1989064' fill='#000000' fill-rule='nonzero'><path d='M31.55,403.44 L380.46,403.44 C397.304,403.44 410.538,389.331 410.538,372.378 L410.538,166.098 L0.378,166.098 L0.378,372.378 C0.378,389.331 14.706,403.44 31.55,403.44 Z' id='Path'></path><polygon id='Path' points='76.94 0.562 129.44 0.562 129.44 69.468 76.94 69.468'></polygon><path d='M410.53,80.08 C410.53,63.236 397.296,49.783 380.452,49.783 L361.311,49.783 L361.311,82.924 C361.311,90.1428 355.186,95.721 347.967,95.721 L269.655,95.721 C262.4362,95.721 256.202,90.1429 256.202,82.924 L256.202,49.783 L155.582,49.783 L155.582,82.924 C155.582,90.1428 149.457,95.721 142.129,95.721 L63.817,95.721 C56.5982,95.721 50.473,90.1429 50.473,82.924 L50.473,49.783 L31.551,49.783 C14.707,49.783 0.379,63.127 0.379,80.08 L0.379,143.846 L410.539,143.846 L410.53,80.08 Z' id='Path'></path><polygon id='Path' points='282.56 0.562 335.06 0.562 335.06 69.468 282.56 69.468'></polygon></g> \
  586. </g> \
  587. </svg> \
  588. <p>No event found</p> \
  589. </div>";
  590. document.getElementById("res_events_container").style.display = "none";
  591. document.getElementById("res_events_no_res").innerHTML = eventIcon;
  592. }
  593. }
  594. function handle_Compagnia(json) {
  595. //console.log(json);
  596. var denominazione = "";
  597. var sede = "";
  598. var uri_sede = "";
  599. var uri_place = "";
  600. $.each(
  601. json['results']['bindings'],
  602. function (index, value) {
  603. if (value.hasOwnProperty('denomination')) {
  604. $("#type_society").css("display", "flex");
  605. denominazione = value['denomination']['value'];
  606. }
  607. if (value.hasOwnProperty('uri_place')) {
  608. $("#sede").css("display", "flex");
  609. uri_place = value['uri_place']['value'];
  610. }
  611. if (value.hasOwnProperty('uri_sede')) {
  612. $("#sede").css("display", "flex");
  613. uri_sede = value['uri_sede']['value'];
  614. }
  615. if (value.hasOwnProperty('sede')) {
  616. sede = value['sede']['value'];
  617. }
  618. });
  619. }
  620. function handle_Contrassegni(json) {
  621. console.log(json);
  622. var id_image = "";
  623. var name_image = "";
  624. var uri = "";
  625. $.each(
  626. json['results']['bindings'],
  627. function (index, value) {
  628. if (value.hasOwnProperty('image')) {
  629. $("#mark_image").css("display", "block");
  630. id_image = value['image']['value'];
  631. }
  632. if (value.hasOwnProperty('contrassegno')) {
  633. name_image = value['contrassegno']['value'];
  634. }
  635. uri = value['uri_image']['value'];
  636. });
  637. var Image = '<div id="' + uri + '" style="cursor:pointer;" class="object"><img style="width:100%;" src="img/contrassegni/' + id_image + '" /></div>'
  638. document.getElementById("contrassegno").innerHTML = Image;
  639. document.getElementById("nome_contrassegno").innerHTML = titleCase(name_image);
  640. }
  641. function handle_Letters(json) {
  642. //console.log(json);
  643. const send = [];
  644. const receive = [];
  645. var i=0;
  646. var j=0;
  647. $.each(
  648. json['results']['bindings'],
  649. function (index, value) {
  650. type = value['type']['value'];
  651. uri = value['document_uri']['value'];
  652. title = value['document_name']['value'];
  653. segnatura = value['segnatura']['value'];
  654. var data = "";
  655. var InfObj = "";
  656. if (value.hasOwnProperty('time_span')) {
  657. data = value['time_span']['value'];
  658. }
  659. if (value.hasOwnProperty('InfObj')) {
  660. InfObj = value['InfObj']['value'];
  661. }
  662. if (type == "Invio") {
  663. send.push([uri, title, segnatura, data, InfObj]);
  664. i++;
  665. } else {
  666. receive.push([uri, title, segnatura, data, InfObj]);
  667. j++;
  668. }
  669. });
  670. var Send_Letters = "";
  671. var Receive_Letters = "";
  672. //POPULATE SEND LETTERS BOX
  673. for (var i=0; i<send.length; i++) {
  674. var letter = "";
  675. var infObject_button = "";
  676. var object_type = "";
  677. if (send[i][4] != "") {
  678. letter = '<div class="col-8"><p><span id="' + send[i][0] + '" class="title_doc lettera">'+ send[i][1] + '</span>';
  679. object_type = "lettera";
  680. infObject_button += '<button type="button" id="' + send[i][4] +
  681. '" class="lettera btn btn-default" alt="lettera" ><i class="fa fa-envelope"></i><p class="btn-text">Letter</p></button>';
  682. } else {
  683. letter = '<div class="col-8"><p><span id="' + send[i][0] + '" class="title_doc object">'+ send[i][1] + '</span>';
  684. object_type = "object";
  685. infObject_button += '<button type="button" id="' + send[i][0] +
  686. '" class="object btn btn-default" alt="oggetto" title="' + send[i][1] +
  687. '"><i class="fa fa-book"></i><p class="btn-text">Physical object</p></button>';
  688. }
  689. if (send[i][2] != "") {
  690. letter = letter + "<br />Mark: " + send[i][2];
  691. }
  692. if (send[i][3] != "") {
  693. letter = letter + "<br />Date: " + send[i][3];
  694. }
  695. letter = letter + '</p></div>';
  696. Send_Letters += '<div class="row res">'+ letter +
  697. '<div class="col d-flex align-items-start justify-content-end">' + infObject_button +
  698. '<button type="button" value="' + object_type + '" id="' + send[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citation</p></button>' +
  699. '<button type="button" value="' + object_type + '" id="' + send[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
  700. '<a href="http://iperion.vm.fedcloud.eu/lodlive/?' + send[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
  701. }
  702. //POPULATE RECEIVE LETTERS BOX
  703. for (var i=0; i<receive.length; i++) {
  704. var letter = "";
  705. var infObject_button = "";
  706. var object_type = "";
  707. if (receive[i][4] != "") {
  708. letter = '<div class="col-8"><p><span id="' + receive[i][0] + '" class="title_doc lettera">'+ receive[i][1] + '</span>';
  709. object_type = "lettera";
  710. infObject_button += '<button type="button" id="' + receive[i][4] +
  711. '" class="lettera btn btn-default" alt="lettera" ><i class="fa fa-envelope"></i><p class="btn-text">Letter</p></button>';
  712. } else {
  713. letter = '<div class="col-8"><p><span id="' + receive[i][0] + '" class="title_doc object">'+ receive[i][1] + '</span>';
  714. object_type = "object";
  715. infObject_button += '<button type="button" id="' + receive[i][0] +
  716. '" class="object btn btn-default" alt="oggetto" title="' + receive[i][1] +
  717. '"><i class="fa fa-book"></i><p class="btn-text">Physical object</p></button>';
  718. }
  719. if (receive[i][2] != "") {
  720. letter = letter + "<br />Mark: " + receive[i][2];
  721. }
  722. if (receive[i][3] != "") {
  723. letter = letter + "<br />Date: " + receive[i][3];
  724. }
  725. letter = letter + '</p></div>';
  726. Receive_Letters += '<div class="row res">'+ letter +
  727. '<div class="col d-flex align-items-start justify-content-end">' + infObject_button +
  728. '<button type="button" value="' + object_type + '" id="' + receive[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citation</p></button>' +
  729. '<button type="button" value="' + object_type + '" id="' + receive[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
  730. '<a href="http://iperion.vm.fedcloud.eu/lodlive/?' + receive[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
  731. }
  732. document.getElementById("l_send").innerHTML = send.length;
  733. document.getElementById("l_receive").innerHTML = receive.length;
  734. document.getElementById("letters_send").innerHTML = Send_Letters;
  735. document.getElementById("letters_receive").innerHTML = Receive_Letters;
  736. if (send.length==0) {
  737. var messaggio = "<p class='no-results'>No resource found for this query</p>";
  738. document.getElementById("letters_send").innerHTML = messaggio;
  739. }
  740. if (receive.length==0) {
  741. var messaggio = "<p class='no-results'>No resource found for this query</p>";
  742. document.getElementById("letters_receive").innerHTML = messaggio;
  743. }
  744. }
  745. function handle_Artwork(json) {
  746. //console.log(json);
  747. const oa = [];
  748. $.each(
  749. json['results']['bindings'],
  750. function (index, value) {
  751. uri = value['subject']['value'];
  752. label = value['label']['value'];
  753. nct = value['nct']['value'];
  754. var data = "";
  755. if (value.hasOwnProperty('time_span')) {
  756. data = value['time_span']['value'];
  757. }
  758. oa.push([uri, label, nct, data]);
  759. });
  760. var Artworks = "";
  761. for (var i=0; i<oa.length; i++) {
  762. var artwork = '<a href=' + oa[i][0] + ' target="_blank">' + oa[i][1] + '</a><br />NCT: ' + oa[i][2];
  763. if (oa[i][3] != "") {
  764. artwork = artwork + "<br />Date: " + oa[i][3];
  765. }
  766. var object_button = '<button type="button" id="' + oa[i][0] +
  767. '" class="artwork btn btn-default" alt="opera d\'arte" title="' + oa[i][1] +
  768. '"><i class="fas fa-paint-brush"></i><p class="btn-text">Artwork</p></button>';
  769. Artworks += '<div class="row res"><div class="col-8"><p>'+ artwork +'</p></div>' +
  770. '<div class="col d-flex align-items-start justify-content-end">' + object_button +
  771. '<button value="OA" type="button" id="' + oa[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citation</p></button>' +
  772. '<button value="OA" type="button" id="' + oa[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
  773. '<a href="http://iperion.vm.fedcloud.eu/lodlive/?' + oa[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
  774. }
  775. document.getElementById("n_oa").innerHTML = oa.length;
  776. document.getElementById("object_oa").innerHTML = Artworks;
  777. if (oa.length==0) {
  778. var messaggio = "<p class='no-results'>No resource found for this query</p>";
  779. document.getElementById("object_oa").innerHTML = messaggio;
  780. }
  781. }
  782. function handle_Other_Documents(json) {
  783. //console.log(json);
  784. const doc = [];
  785. $.each(
  786. json['results']['bindings'],
  787. function (index, value) {
  788. uri = value['document']['value'];
  789. label = value['label']['value'];
  790. var data = "";
  791. var id = "";
  792. if (value.hasOwnProperty('time_span')) {
  793. data = value['time_span']['value'];
  794. }
  795. if (value.hasOwnProperty('id')) {
  796. id = value['id']['value'];
  797. }
  798. doc.push([uri, label, id, data]);
  799. });
  800. var Documents = "";
  801. for (var i=0; i<doc.length; i++) {
  802. var paper = '<div class="col-8"><p><span id="' + doc[i][0] + '" class="title_doc object">'+ doc[i][1] + '</span>';
  803. var object_button = '<button type="button" id="' + doc[i][0] +
  804. '" class="object btn btn-default" alt="oggetto" title="' + doc[i][1] +
  805. '"><i class="fa fa-book"></i><p class="btn-text">Physical object</p></button>';
  806. if (doc[i][2] != "") {
  807. paper = paper + "<br />Mark: " + doc[i][2];
  808. }
  809. if (doc[i][3] != "") {
  810. paper = paper + "<br />Date: " + doc[i][3];
  811. }
  812. paper = paper + '</p></div>';
  813. Documents += '<div class="row res">'+ paper +
  814. '<div class="col d-flex align-items-start justify-content-end">' + object_button +
  815. '<button value="object" type="button" id="' + doc[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citation</p></button>' +
  816. '<button value="object" type="button" id="' + doc[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
  817. '<a href="http://iperion.vm.fedcloud.eu/lodlive/?' + doc[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
  818. }
  819. document.getElementById("n_ass").innerHTML = doc.length;
  820. document.getElementById("other_documents").innerHTML = Documents;
  821. if (doc.length==0) {
  822. var messaggio = "<p class='no-results'>No resource found for this query</p>";
  823. document.getElementById("other_documents").innerHTML = messaggio;
  824. }
  825. }
  826. function handle_Riferimenti(json) {
  827. var uri_same = "";
  828. $.each(
  829. json['results']['bindings'],
  830. function (index, value) {
  831. if (value.hasOwnProperty('uri_same')) {
  832. $("#REF").css("display", "flex");
  833. uri_same += '<a href="' + value['uri_same']['value'] + '">' + value['uri_same']['value'] + '</a><br />';
  834. }
  835. });
  836. console.log(uri_same);
  837. document.getElementById("same_as").innerHTML = uri_same;
  838. }
  839. function handle_Occupations(json) {
  840. var OW = "";
  841. $.each(
  842. json['results']['bindings'],
  843. function (index, value) {
  844. var occupation = "";
  845. var worklocation = "";
  846. if (value.hasOwnProperty('occupation')) {
  847. $("#workHistory").css("display", "flex");
  848. occupation = titleCase(value['occupation']['value']);
  849. }
  850. if (value.hasOwnProperty('worklocation')) {
  851. worklocation = " presso " + titleCase(value['worklocation']['value']);
  852. }
  853. OW += occupation + " " + worklocation + "<br />";
  854. });
  855. document.getElementById("jobs").innerHTML = OW;
  856. }
  857. function handle_map(json) {
  858. //console.log(json);
  859. const locations = [];
  860. const place_names = [];
  861. const place_events = [];
  862. const luoghi = [];
  863. var lat = 0;
  864. var long = 0;
  865. var i=0;
  866. var myPlaces = "";
  867. $.each(
  868. json['results']['bindings'],
  869. function (index, value) {
  870. const loc = []
  871. var uri = value['place']['value'];
  872. var label = value['label']['value'];
  873. var coord = value['coordinates']['value'];
  874. var evento = value['tipo']['value'];
  875. var count = value['count']['value'];
  876. place_events.push([uri, evento, count]);
  877. if (!place_names.includes(uri)) {
  878. place_names.push(uri);
  879. const coordinates = coord.split(", ");
  880. loc.push(uri);
  881. label = titleCase(label);
  882. loc.push(label);
  883. myPlaces += "<div class='item-place-person'><div class='clickPlace item-place-person-label' data-point='"+ coordinates + "'>" + label + "</div><div class='item-place-person-action'><div class='luogo' id='" +
  884. uri + "'><i class='far fa-map' style='cursor:pointer'></i></div></div></div>";
  885. loc.push(coordinates[0]);
  886. lat += parseInt(coordinates[0]);
  887. loc.push(coordinates[1]);
  888. long += parseInt(coordinates[1].replace(/^(\.)/,"0.").replace("-.", "-0."));
  889. locations.push(loc);
  890. i++;
  891. }
  892. });
  893. for (var k=0; k<locations.length; k++) {
  894. const tempArray = [];
  895. var nomeLuogo = locations[k][1];
  896. var lt = locations[k][2];
  897. var lg = locations[k][3];
  898. tempArray.push(nomeLuogo);
  899. tempArray.push(lt);
  900. tempArray.push(lg);
  901. for (var y=0; y<place_events.length; y++) {
  902. var ev = place_events[y][1];
  903. var number = place_events[y][2]
  904. var dict = ev + ": " + number;
  905. if (locations[k][0] == place_events[y][0]) {
  906. tempArray.push(dict);
  907. }
  908. }
  909. luoghi.push(tempArray);
  910. }
  911. //console.log(luoghi);
  912. var latitude = lat/i;
  913. var longitude = long/i;
  914. var mapIcon = "<div id='map_icon' class='no_info_icon'> \
  915. <svg xmlns='http://www.w3.org/2000/svg' width='30' viewBox='0 0 576 512'> \
  916. <path d='M408 120C408 174.6 334.9 271.9 302.8 311.1C295.1 321.6 280.9 321.6 273.2 311.1C241.1 271.9 168 174.6 168 120C168 53.73 221.7 0 288 0C354.3 0 408 53.73 408 120zM288 152C310.1 152 328 134.1 328 112C328 89.91 310.1 72 288 72C265.9 72 248 89.91 248 112C248 134.1 265.9 152 288 152zM425.6 179.8C426.1 178.6 426.6 177.4 427.1 176.1L543.1 129.7C558.9 123.4 576 135 576 152V422.8C576 432.6 570 441.4 560.9 445.1L416 503V200.4C419.5 193.5 422.7 186.7 425.6 179.8zM150.4 179.8C153.3 186.7 156.5 193.5 160 200.4V451.8L32.91 502.7C17.15 508.1 0 497.4 0 480.4V209.6C0 199.8 5.975 190.1 15.09 187.3L137.6 138.3C140 152.5 144.9 166.6 150.4 179.8H150.4zM327.8 331.1C341.7 314.6 363.5 286.3 384 255V504.3L192 449.4V255C212.5 286.3 234.3 314.6 248.2 331.1C268.7 357.6 307.3 357.6 327.8 331.1L327.8 331.1z'/> \
  917. </svg> \
  918. <p>No place found</p> \
  919. </div>";
  920. if (locations.length == 0) {
  921. $("#people_map").css("display", "none");
  922. $("#references_persona").css("display", "none");
  923. document.getElementById("people_map_no_res").innerHTML = mapIcon;
  924. }
  925. document.getElementById("list_places_person").innerHTML = myPlaces;
  926. var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
  927. cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade, Points &copy 2012 LINZ',
  928. cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 17, attribution: cloudmadeAttribution}),
  929. latlng = new L.LatLng(latitude, longitude);
  930. var map = new L.Map('map', {center: latlng, zoom: 5, layers: [cloudmade]});
  931. mapLink = '<a href="https://openstreetmap.org">OpenStreetMap</a>';
  932. var markers = new L.MarkerClusterGroup();
  933. var markerList = [];
  934. var geo = new L.tileLayer(
  935. 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  936. attribution: '&copy; ' + mapLink + ' Contributors',
  937. maxZoom: 18,
  938. }).addTo(map);
  939. function populate() {
  940. for (var i = 0; i < luoghi.length; i++) {
  941. var a = luoghi[i];
  942. var len = a.length;
  943. var title = "<h2>" + titleCase(a[0]) + "</h2>";
  944. for (var k=3; k<len; k++) {
  945. var dix = a[k].replace("Invio:", "Invio lettere:").replace("Ricezione:", "Ricezione lettere:");
  946. title = title + "<p style='font-size: 14px;'>" + dix + " occorrenze</p><hr>";
  947. }
  948. var marker = new L.Marker(new L.LatLng(a[1], a[2]), { title: title });
  949. marker.bindPopup(title);
  950. markers.addLayer(marker);
  951. markerList.push(marker);
  952. }
  953. }
  954. populate();
  955. map.addLayer(markers);
  956. $('.clickPlace').on('click', function(){
  957. // parse lat and lng from the divs data attribute
  958. var latlng = $(this).data().point.split(',');
  959. var lat = latlng[0];
  960. var lng = latlng[1];
  961. var zoom = 10;
  962. // set the view
  963. map.setView([lat, lng], zoom);
  964. });
  965. }
  966. function exchangeLetter(tipo, mittente, uri_mittente, destinatario, uri_destinatario) {
  967. var params = tipo + ";" + mittente + ";" + uri_mittente + ";" + destinatario + ";" + uri_destinatario;
  968. window.open("results.html?params="+ params);
  969. }