From bbdade396e39dc3e4dae4dff15e3919a7a5a0262 Mon Sep 17 00:00:00 2001 From: Saranya Balasubramanian Date: Mon, 9 Dec 2024 14:00:10 +0100 Subject: [PATCH 1/4] Put "unclear" in parantheses --- apis_ontology/static/scripts/show_popup.js | 11 +++++++++++ apis_ontology/static/styles/tei.css | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/apis_ontology/static/scripts/show_popup.js b/apis_ontology/static/scripts/show_popup.js index 61325a3..7ae8737 100644 --- a/apis_ontology/static/scripts/show_popup.js +++ b/apis_ontology/static/scripts/show_popup.js @@ -43,6 +43,17 @@ let behaviors = { } return result; }, + + // Handle the unclear element + "unclear": function(e) { + let result = document.createElement("span"); + result.classList.add("unclear"); + result.textContent = e.textContent; + // using CSS instead + // result.textContent = `(${e.textContent})`; + + return result; + }, } }; diff --git a/apis_ontology/static/styles/tei.css b/apis_ontology/static/styles/tei.css index 8aad333..2151be1 100644 --- a/apis_ontology/static/styles/tei.css +++ b/apis_ontology/static/styles/tei.css @@ -1,3 +1,11 @@ +.unclear::before { + content: "("; +} + +.unclear::after { + content: ")"; +} + .break { font-family: Arial, Helvetica, sans-serif; font-size: 80%; From d4264e15a5cac11273c84bcee251ca412a522f56 Mon Sep 17 00:00:00 2001 From: Saranya Balasubramanian Date: Mon, 9 Dec 2024 14:12:36 +0100 Subject: [PATCH 2/4] style foreign tag in Italics the language from xml:lang attribute is shown as tooltip using title --- apis_ontology/static/scripts/show_popup.js | 10 ++++++++++ apis_ontology/static/styles/tei.css | 3 +++ 2 files changed, 13 insertions(+) diff --git a/apis_ontology/static/scripts/show_popup.js b/apis_ontology/static/scripts/show_popup.js index 7ae8737..c280acc 100644 --- a/apis_ontology/static/scripts/show_popup.js +++ b/apis_ontology/static/scripts/show_popup.js @@ -54,6 +54,16 @@ let behaviors = { return result; }, + + // Show foreign tag in italics + "foreign": function(e) { + let result = document.createElement("span"); + result.classList.add("foreign"); + result.textContent = e.textContent; + result.title = e.getAttribute("xml:lang") + return result; + }, + } }; diff --git a/apis_ontology/static/styles/tei.css b/apis_ontology/static/styles/tei.css index 2151be1..70db132 100644 --- a/apis_ontology/static/styles/tei.css +++ b/apis_ontology/static/styles/tei.css @@ -1,3 +1,6 @@ +.foreign{ + font-style: italic; +} .unclear::before { content: "("; } From 903035da5c8fea651160d5b7f12c3cdbb624f57e Mon Sep 17 00:00:00 2001 From: Saranya Balasubramanian Date: Mon, 9 Dec 2024 14:59:24 +0100 Subject: [PATCH 3/4] LG as quote --- apis_ontology/static/scripts/show_popup.js | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/apis_ontology/static/scripts/show_popup.js b/apis_ontology/static/scripts/show_popup.js index c280acc..a766cc1 100644 --- a/apis_ontology/static/scripts/show_popup.js +++ b/apis_ontology/static/scripts/show_popup.js @@ -11,6 +11,42 @@ let behaviors = { } return result; }, + // Handle the LG element + "lg": function(e) { + let result = document.createElement("quote"); // Use a
for segments + result.classList.add("lg"); + + // Process child nodes and append + for (let n of Array.from(e.childNodes)) { + // Call the appropriate behavior for each child node + let behavior = behaviors.tei[n.nodeName.toLowerCase()]; + if (behavior) { + result.appendChild(behavior(n)); // Process child nodes based on their type + } else { + result.appendChild(n.cloneNode(true)); // Clone nodes that don't have specific behavior + } + } + return result; + }, + + // Handle the LG element + "l": function(e) { + let result = document.createElement("div"); // Use a
for segments + result.classList.add("l"); + + // Process child nodes and append + for (let n of Array.from(e.childNodes)) { + // Call the appropriate behavior for each child node + let behavior = behaviors.tei[n.nodeName.toLowerCase()]; + if (behavior) { + result.appendChild(behavior(n)); // Process child nodes based on their type + } else { + result.appendChild(n.cloneNode(true)); // Clone nodes that don't have specific behavior + } + } + return result; + }, + "lb": ["$@n "], // Hyperlink the rs tag and include type and ref in its title From bcaf031a7581b94471bd683a3bc7dab123637063 Mon Sep 17 00:00:00 2001 From: Saranya Balasubramanian Date: Mon, 9 Dec 2024 15:13:36 +0100 Subject: [PATCH 4/4] discard milestone --- apis_ontology/static/scripts/show_popup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apis_ontology/static/scripts/show_popup.js b/apis_ontology/static/scripts/show_popup.js index a766cc1..0b11927 100644 --- a/apis_ontology/static/scripts/show_popup.js +++ b/apis_ontology/static/scripts/show_popup.js @@ -100,6 +100,11 @@ let behaviors = { return result; }, + // Discard milestone + "milestone": function(e) { + return null; + }, + } };