Pārlūkot izejas kodu

get single context with an error

Alessia 1 gadu atpakaļ
vecāks
revīzija
cbbadbbd44
2 mainītis faili ar 66 papildinājumiem un 78 dzēšanām
  1. 66 0
      site2/js/ricerca.js
  2. 0 78
      site2/pages/singleContext.html

+ 66 - 0
site2/js/ricerca.js

@@ -83,6 +83,7 @@ function processSingleContext(response){
   }
   else {
     console.log(response);
+    createPage(response[0]);
   }
 }
 
@@ -701,6 +702,71 @@ function goToSingleContext(num, parole, periodi, brani) {
     });
 }
 
+//CREATE NEW PAGE FOR SINGLE CONTEXT
+
+function createPage(elem) {
+  var contesto = elem['contesto'];
+/*
+  var contesto = elem['contesto'];
+  var annoF = elem["Anno finale"];
+  var anniI = elem["Anno iniziale"];
+  var area_generica = elem["Area generica"];
+  var area_specifica = elem["Area specifica"];
+  var autore = elem["Autore"];
+  var curatore = Curatore;
+  var data_cod = Data codificata;
+  var data_des = descrittiva
+  var forma = Forma
+  var genere = Genere
+  var iq = IQ
+  var rif_organico = Rif_organico
+  var rig = Rig_completo
+  var tipo = Tipo
+  var titolo = Titolo
+  var titolo_abb = Titolo Abbreviato
+  var cat_gr
+  var cod
+  var col
+  var disambiguatore
+  var elemlen
+  var formattazione
+  var highlight
+  var highlights_combined
+  var lemma
+  var links
+  var mappa
+  var ntx
+  var numbrano
+  var numorg
+  var numperiod
+  var pag
+  var pfin
+  var piniz
+  var pitxt
+  var riga
+  var sigla
+  var stanza
+  var tipostanza
+  var verso
+  var vol
+  var note = "";
+  var testo_associato = "";*/
+
+  console.log(elem);
+
+ // if (elem.hasOwnProperty('contesto')) {
+ //   contesto = elem["contesto"];
+  // }
+
+  //var opened = window.open("pages/singleContext.html");
+  //opened.write("<h2>" + contesto + "</h2>");
+
+  var win = window.open("");
+  win.document.body.innerHTML = "<p>" + contesto + "</p>";
+  
+}
+
+
 $(document).on("click", ".deleteCC", function (ev) {
   var deleteID = "occ_" + this.id;
   const element = document.getElementById(deleteID);

+ 0 - 78
site2/pages/singleContext.html

@@ -1,78 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-   <meta charset="unicode">
-   <meta http-equiv="X-UA-Compatible" content="IE=edge">
-   <meta name="viewport" content="width=device-width, initial-scale=1.0">
-   <title>SEARCH PROGETTO 2023</title>
-   <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
-   <link rel="stylesheet" href="../css/mystyle.css">
-   <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
-<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
-<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
-   <header>
-      <!-- Navbar -->
-      <nav class="navbar navbar-expand-lg navbar-light bg-white">
-         <div class="container-fluid">
-            <button class="navbar-toggler" type="button" data-mdb-toggle="collapse" data-mdb-target="#navbarExample01"
-               aria-controls="navbarExample01" aria-expanded="false" aria-label="Toggle navigation">
-               <i class="fas fa-bars"></i>
-            </button>
-            <div class="collapse navbar-collapse" id="navbarExample01">
-               <ul class="navbar-nav me-auto mb-2 mb-lg-0">
-                  <li class="nav-item active">
-                     <a class="nav-link" aria-current="page" href="#">Home</a>
-                  </li>
-                  <li class="nav-item">
-                     <a class="nav-link" href="#">Il progetto 2023</a>
-                  </li>
-                  <li class="nav-item">
-                     <a class="nav-link" href="http://dariah.cnr.it/">DARIAH-IT</a>
-                  </li>
-                  <li class="nav-item">
-                     <a class="nav-link" href="http://www.ovi.cnr.it/">CNR OVI</a>
-                  </li>
-               </ul>
-            </div>
-         </div>
-      </nav>
-      <!-- Navbar -->
-   </header>
-
-<body>
-
-   <script type="text/javascript" src="../js/ricerca.js"></script>
-
-   <div class="container">
-
-    <div class="row">
-        <div class ="col">
-            <div class="row">
-                <div class="col left-col filters"></div>
-                <div class="col right-col single-context">
-                    <div class="row" id="single-context-text"></div>
-                    <div class="row" id="single-context-notes"></div>
-                    <div class="row" id="single-context-associates"></div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-   </div>
-
-   <div id="loader" class="loader" style="display:none;"></div>
-
-   <footer>
-      <div>
-         <img src="../img/dariah-logo.jpeg" />
-      </div>
-   </footer>
-
-   <script src="../vendor/jquery/jquery.min.js"></script>
-
-</body>
-
-
-</html>