Skip to content

Commit

Permalink
LG as quote
Browse files Browse the repository at this point in the history
  • Loading branch information
gythaogg committed Dec 9, 2024
1 parent d4264e1 commit 903035d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions apis_ontology/static/scripts/show_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,42 @@ let behaviors = {
}
return result;
},
// Handle the LG element
"lg": function(e) {
let result = document.createElement("quote"); // Use a <div> 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 <div> 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": ["<span class=\"break\">$@n&nbsp;</span>"],

// Hyperlink the rs tag and include type and ref in its title
Expand Down

0 comments on commit 903035d

Please sign in to comment.