-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from Det-Kongelige-Bibliotek/development
Development
- Loading branch information
Showing
33 changed files
with
534 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"use strict"; | ||
function ie_message() { | ||
if (is_ie()){ | ||
var notification = document.querySelectorAll('.org-11bfca9f-f278-4d0e-8384-2a2d064e8f6c.ie_message'); | ||
if (notification){ | ||
notification[0].classList.remove('hidden'); | ||
} | ||
|
||
} | ||
} | ||
|
||
function is_ie(){ | ||
var ua = window.navigator.userAgent; | ||
var msie = ua.indexOf("MSIE "); | ||
|
||
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number | ||
{ | ||
return true; | ||
} | ||
else // If another browser, return 0 | ||
{ | ||
return false; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
function closeBanner(){ | ||
var banner = document.getElementById('ie_banner'); | ||
banner.style.display = 'none'; | ||
} | ||
|
||
window.addEventListener('load', ie_message, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
var infos = document.querySelectorAll('a.info[title="Tekstkritik"]'); | ||
|
||
for (var i = 0; i < infos.length; i++) { | ||
var info = infos[i]; | ||
info.dataset.toggle = "modal"; | ||
info.dataset.target = "#info_modal"; | ||
|
||
info.addEventListener("click", function (event) { | ||
event.preventDefault() | ||
let modal = document.getElementById('info_modal'); | ||
let modal_body = modal.getElementsByClassName('modal-body')[0]; | ||
let text_critic = this.parentElement.nextElementSibling; | ||
modal_body.innerHTML = text_critic.innerHTML; | ||
text_critic.setAttribute("style", "display: none !important"); | ||
let witnesses = text_critic.querySelectorAll('.witness[title]'); | ||
let modal_footer = modal.getElementsByClassName('modal-footer')[0]; | ||
modal_footer.innerHTML = '<div style="flex: 0 0 100%;"><b>]</b>: Lemma symbol</div>'; | ||
for (var i = 0; i < witnesses.length; i++) { | ||
modal_footer.innerHTML += '<div style="flex: 0 0 100%;"><b>' + witnesses[i].innerHTML + '</b>: ' + witnesses[i].getAttribute('title')+'</div>'; | ||
} | ||
|
||
}); | ||
} |
27 changes: 27 additions & 0 deletions
27
app/assets/javascripts/text_service/show_relevant_text_possibilities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use strict"; | ||
|
||
function show_relevant_text_possibilities() { | ||
|
||
let pageBreaks = document.querySelectorAll('.symbol.pagination.edition'); | ||
pageBreaks.forEach(function(pageBreak) { | ||
pageBreak.parentElement.style.display = 'inline'; | ||
pageBreak.innerHTML = '<span class="hidden">🗏</span> ' + pageBreak.innerHTML; | ||
}); | ||
|
||
pageBreaks = document.querySelectorAll('.symbol.pagination.other'); | ||
pageBreaks.forEach(function(pageBreak) { | ||
pageBreak.innerHTML = '🗏 ' + pageBreak.innerHTML; | ||
}); | ||
|
||
let types = ['quote', 'comment', 'translation', 'modernized', 'info', 'person', 'place', 'title', 'pagination.other']; | ||
types.forEach(function(type) | ||
{ | ||
var symbols = document.querySelectorAll('.symbol.' + type); | ||
if (symbols.length != 0){ | ||
var button = document.getElementById(type); | ||
button.classList.remove("hidden"); | ||
} | ||
}); | ||
} | ||
|
||
window.addEventListener('load', show_relevant_text_possibilities(), false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function toggle_infos() { | ||
let text_infos = document.querySelectorAll("span.symbol.info"); | ||
if (this.checked) { | ||
for (i = 0; i < text_infos.length; i++) { | ||
text_infos[i].style.display = 'inline'; | ||
text_infos[i].classList.add('icon', 'info'); | ||
text_infos[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_infos.length; i++) { | ||
text_infos[i].style.display = 'none'; | ||
text_infos[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_infos = document.getElementById('Show_infos'); | ||
if (show_infos) { | ||
show_infos.addEventListener('click', toggle_infos, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function toggle_location() { | ||
let text_locations = document.querySelectorAll("span.symbol.place"); | ||
if (this.checked) { | ||
for (i = 0; i < text_locations.length; i++) { | ||
text_locations[i].style.display = 'inline'; | ||
text_locations[i].classList.add('icon', 'location_on'); | ||
text_locations[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_locations.length; i++) { | ||
text_locations[i].style.display = 'none'; | ||
text_locations[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_locations = document.getElementById('Show_locations'); | ||
if (show_locations) { | ||
show_locations.addEventListener('click', toggle_location, false); | ||
} |
22 changes: 22 additions & 0 deletions
22
app/assets/javascripts/text_service/toggle_modernisation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function toggle_modernizations() { | ||
let text_modernizations = document.querySelectorAll("span.symbol.modernized"); | ||
if (this.checked) { | ||
for (i = 0; i < text_modernizations.length; i++) { | ||
text_modernizations[i].style.display = 'inline'; | ||
text_modernizations[i].classList.add('icon', 'filter_vintage'); | ||
text_modernizations[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_modernizations.length; i++) { | ||
text_modernizations[i].style.display = 'none'; | ||
text_modernizations[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_modernizations = document.getElementById('Show_modernizations'); | ||
if (show_modernizations) { | ||
show_modernizations.addEventListener('click', toggle_modernizations, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"use strict"; | ||
|
||
function toggle_pagebreak() { | ||
let text_pagebreaks = document.querySelectorAll(".symbol.pagination.other"); | ||
if (this.checked) { | ||
for (i = 0; i < text_pagebreaks.length; i++) { | ||
text_pagebreaks[i].style.display = 'inline'; | ||
text_pagebreaks[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_pagebreaks.length; i++) { | ||
text_pagebreaks[i].style.display = 'none'; | ||
text_pagebreaks[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
|
||
text_pagebreaks = document.querySelectorAll(".symbol.pagination.edition"); | ||
if (this.checked) { | ||
for (i = 0; i < text_pagebreaks.length; i++) { | ||
text_pagebreaks[i].style.position = 'static'; | ||
text_pagebreaks[i].firstChild.classList.remove('hidden'); | ||
} | ||
} else { | ||
for (i = 0; i < text_pagebreaks.length; i++) { | ||
text_pagebreaks[i].style.position = 'absolute'; | ||
text_pagebreaks[i].firstChild.classList.add('hidden'); | ||
} | ||
} | ||
} | ||
|
||
let show_pagebreaks = document.getElementById('Show_pagebreaks'); | ||
if (show_pagebreaks) { | ||
show_pagebreaks.addEventListener('click', toggle_pagebreak, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use strict"; | ||
|
||
function toggle_person() { | ||
let text_persons = document.querySelectorAll("span.symbol.person"); | ||
if (this.checked) { | ||
for (i = 0; i < text_persons.length; i++) { | ||
text_persons[i].style.display = 'inline'; | ||
text_persons[i].classList.add('icon', 'person'); | ||
} | ||
} else { | ||
for (i = 0; i < text_persons.length; i++) { | ||
text_persons[i].style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_persons = document.getElementById('Show_persons'); | ||
if (show_persons) { | ||
show_persons.addEventListener('click', toggle_person, false); | ||
} |
10 changes: 5 additions & 5 deletions
10
...ascripts/text_service/qutation_service.js → ...s/text_service/toggle_qutation_service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/assets/javascripts/text_service/toggle_related_texts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Created by bimo on 9/28/18. | ||
*/ | ||
"use strict"; | ||
|
||
function toggleRelatedTexts() { | ||
let text_possibility_toolbar = document.getElementsByClassName("relatedTextsToolbar")[0]; | ||
let btn = document.getElementById("toggleRelatedTexts"); | ||
|
||
if (btn.classList.contains('active')) { | ||
text_possibility_toolbar.classList.add('hidden'); | ||
} else { | ||
text_possibility_toolbar.classList.remove('hidden'); | ||
} | ||
|
||
btn.classList.toggle("active"); | ||
} |
23 changes: 23 additions & 0 deletions
23
app/assets/javascripts/text_service/toggle_text_comments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
function toggle_text_comments() { | ||
let text_comments = document.querySelectorAll("span.symbol.comment"); | ||
if (this.checked) { | ||
for (i = 0; i < text_comments.length; i++) { | ||
text_comments[i].style.display = 'inline'; | ||
text_comments[i].classList.add('icon', 'comment'); | ||
text_comments[i].parentElement.classList.add ('show_comments'); | ||
|
||
} | ||
} else { | ||
for (i = 0; i < text_comments.length; i++) { | ||
text_comments[i].style.display = 'none'; | ||
text_comments[i].parentElement.classList.remove ('show_comments'); | ||
} | ||
} | ||
} | ||
|
||
let show_comments = document.getElementById('Show_comments'); | ||
if (show_comments) { | ||
show_comments.addEventListener('click', toggle_text_comments, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function toggle_title() { | ||
let text_titles = document.querySelectorAll("span.symbol.title"); | ||
if (this.checked) { | ||
for (i = 0; i < text_titles.length; i++) { | ||
text_titles[i].style.display = 'inline'; | ||
text_titles[i].classList.add('icon', 'title'); | ||
text_titles[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_titles.length; i++) { | ||
text_titles[i].style.display = 'none'; | ||
text_titles[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_titles = document.getElementById('Show_titles'); | ||
if (show_titles) { | ||
show_titles.addEventListener('click', toggle_title, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function toggle_translation() { | ||
let text_translations = document.querySelectorAll("span.symbol.translation"); | ||
if (this.checked) { | ||
for (i = 0; i < text_translations.length; i++) { | ||
text_translations[i].style.display = 'inline'; | ||
text_translations[i].classList.add('icon', 'translate'); | ||
text_translations[i].parentElement.style.display = 'inline'; | ||
} | ||
} else { | ||
for (i = 0; i < text_translations.length; i++) { | ||
text_translations[i].style.display = 'none'; | ||
text_translations[i].parentElement.style.display = 'none'; | ||
} | ||
} | ||
} | ||
|
||
let show_translations = document.getElementById('Show_translations'); | ||
if (show_translations) { | ||
show_translations.addEventListener('click', toggle_translation, false); | ||
} |
Oops, something went wrong.