Commit c64729ca authored by sendler's avatar sendler 🐢
Browse files

modify register.js for correct display of content

parent 7b5d7ebc
...@@ -189,14 +189,6 @@ try { ...@@ -189,14 +189,6 @@ try {
function setRegElement(element, content) { function setRegElement(element, content) {
try {
$(element).text(content)
} catch (e) {
console.log(e)
}
}
function setRegElementHTML(element, content) {
try { try {
$(element).html(content) $(element).html(content)
} catch (e) { } catch (e) {
...@@ -1484,7 +1476,7 @@ function getRestAPIPerson(textGridURI) { ...@@ -1484,7 +1476,7 @@ function getRestAPIPerson(textGridURI) {
console.log("getting description"); console.log("getting description");
output = data.person.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text']; output = data.person.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text'];
if (typeof output === 'string') { if (typeof output === 'string') {
setRegElementHTML('#regPersonDescription', output) setRegElement('#regPersonDescription', output)
} else { } else {
console.log("no string"); console.log("no string");
hideRegElementDescription('#regPersonDescription') hideRegElementDescription('#regPersonDescription')
...@@ -1672,7 +1664,7 @@ function getRestAPIPlaces(textGridURI) { ...@@ -1672,7 +1664,7 @@ function getRestAPIPlaces(textGridURI) {
try { try {
output = data.place.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text']; output = data.place.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text'];
if (typeof output === 'string') { if (typeof output === 'string') {
setRegElementHTML('#regPlaceDescription', output) setRegElement('#regPlaceDescription', output)
} else { } else {
hideRegElementDescription('#regPlaceDescription') hideRegElementDescription('#regPlaceDescription')
} }
...@@ -1839,7 +1831,7 @@ function getRestAPIWorks(textGridURI) { ...@@ -1839,7 +1831,7 @@ function getRestAPIWorks(textGridURI) {
try { try {
output = data.item.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text']; output = data.item.note.filter(el => el['type'] == 'description').filter(el => el['xml:lang'] == lang)[0]['#text'];
if (typeof output === 'string') { if (typeof output === 'string') {
setRegElementHTML('#regWorkDescription', output) setRegElement('#regWorkDescription', output)
} else { } else {
hideRegElementDescription('#regWorkDescription') hideRegElementDescription('#regWorkDescription')
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment