Commit 9524d1d2 authored by barth23's avatar barth23
Browse files

Merge commit '9972f31d'

# Conflicts:
#	modules/architrave/sendmail.xqm
#	post-install.xq
#	templates/js/contact.js
parents b5eecad2 9972f31d
......@@ -44,10 +44,10 @@
<lang key="en">Workshop2018</lang>
<lang key="fr">Journée d’études 2018</lang>
</word>
<word key="colloquium2020">
<lang key="de">Tagung 2020</lang>
<lang key="en">colloquium2020</lang>
<lang key="fr">Colloque 2020</lang>
<word key="colloquium2021">
<lang key="de">Tagung 2021</lang>
<lang key="en">colloquium2021</lang>
<lang key="fr">Colloque 2021</lang>
</word>
<word key="Contact">
<lang key="de">Kontakt</lang>
......@@ -374,7 +374,7 @@
<word key="synopticView">
<lang key="de">Synoptische Ansicht</lang>
<lang key="en">synoptic view</lang>
<lang key="fr">Afficher les fenêtres côte à côte</lang>
<lang key="fr">Vue synoptique</lang>
</word>
<word key="textualView">
<lang key="de">Textkritische Ansicht</lang>
......
......@@ -163,8 +163,9 @@ declare function local:page-numbers() {
for $pb in $doc//tei:pb
let $view := xs:integer($pb/@n)
let $fws := local:addFollowingFws($pb)[position() > 1]
let $noCorrFws := functx:remove-elements-deep($fws, 'corr')
let $noExpanFws := functx:remove-elements-deep($noCorrFws, 'expan')
let $noCorrFws := functx:remove-elements-deep($fws, 'tei:corr')
let $noExpanFws := functx:remove-elements-deep($noCorrFws, 'tei:expan')
(: let $x := util:log-system-out(' '):)
(: let $a := util:log-system-out($pb):)
(: let $y := util:log-system-out($noExpanFws):)
......
xquery version "3.1";
module namespace semapi_helper="http://architrave.eu/ns/semapi_helper";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace mail="http://exist-db.org/xquery/mail";
declare function semapi_helper:launch_mail($mailnode) {
let $pass := "pass"
return
mail:send-email($mailnode, (), "UTF-8")
};
\ No newline at end of file
......@@ -147,6 +147,42 @@ declare function local:countFW($length,$body) {
return string-join($fwNumbers,',')
};
declare function transformXML:cacheFullXmlAndMetadata($tgURI as xs:string) {
let $doc-name := $tgURI || '.xml'
let $tglab-base-uri := 'https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:'
let $target-base-path := '/db/apps/sade-architrave/textgrid/'
let $doc := doc($tglab-base-uri || $tgURI || '/data')
let $doc-meta := doc($tglab-base-uri || $tgURI || '/metadata')
let $store-result := xmldb:store($target-base-path || '/data', $tgURI || '.xml', $doc, "text/xml")
let $store-meta-result := xmldb:store($target-base-path || '/meta', $tgURI || '.xml', $doc-meta, "text/xml")
return true()
};
declare function transformXML:cacheAllEditions() {
let $result := (
(: de :)
transformXML:cacheFullXmlAndMetadata('34zmq'), (: harrach :)
transformXML:cacheFullXmlAndMetadata('34zs7'), (: sturm :)
transformXML:cacheFullXmlAndMetadata('3ptwg'), (: corfey :)
transformXML:cacheFullXmlAndMetadata('3qr4f'), (: neumann :)
transformXML:cacheFullXmlAndMetadata('34znb'), (: pitzler :)
transformXML:cacheFullXmlAndMetadata('3c0m2'), (: knesebeck :)
(: fr :)
transformXML:cacheFullXmlAndMetadata('3czfj'), (: harrach :)
transformXML:cacheFullXmlAndMetadata('3q4rq'), (: sturm :)
transformXML:cacheFullXmlAndMetadata('3r0fv'), (: corfey :)
transformXML:cacheFullXmlAndMetadata('3r3nn'), (: neumann :)
transformXML:cacheFullXmlAndMetadata('350mg'), (: pitzler :)
transformXML:cacheFullXmlAndMetadata('3czn9') (: knesebeck :)
)
return $result
};
declare function transformXML:importFromTGRep($tgURI as xs:string, $filenameOutput as xs:string) {
let $login := xmldb:login("/db", "admin", "" )
let $pathInput := 'https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:'
......@@ -444,8 +480,8 @@ return
case element ( tei:geogName ) return $node
case element ( tei:persName ) return $node
case element ( tei:rs ) return $node
case element ( tei:del ) return
<span class="del"><strike>{string($node)}</strike></span>
case element ( tei:del ) return $node
(: <span class="del"><strike>{string($node)}</strike></span> :)
case element ( tei:unclear ) return
<span class="unclear">{string($node)}[?]</span>
case element ( tei:space ) return
......
......@@ -119,8 +119,9 @@ declare function local:get-distinct-name($item) {
{
if ($letter_value = "button_unnamed") then
for $entity in $entityElements[@type='unidentified']
order by normalize-unicode(local:get-unidentified-label($entity), 'NFKD')
let $label := local:get-unidentified-label($entity)
let $normalized-label := normalize-unicode($label, 'NFKD') (: this is actually case-folding :)
order by $normalized-label collation 'http://exist-db.org/collation?lang=fr' (: it seems we can get away with the French collation for both languages :)
return
element xhtml:li
{
......
......@@ -8,7 +8,7 @@
</submenu>
<submenu label-en="Edition" label-de="Edition" label="Édition">
<item label-en="Overview" label-de="Übersicht" label="Introduction" link="content.html?id=87983766"/>
<item label-en="corpus" label-de="Quellenkorpus" label="Corpus de sources" link="overview.html"/>
<item label-en="corpus" label-de="Quellenkorpus" label="Corpus des sources" link="overview.html"/>
<item class="divider"/>
<item label-en="Pitzler" label-de="Pitzler" label="Pitzler" link="view.html?edition=34znb&amp;page=1&amp;translation=350mg"/>
<item label-en="Harrach" label-de="Harrach" label="Harrach" link="view.html?edition=34zmq&amp;page=1&amp;translation=3czfj"/>
......
......@@ -104,6 +104,7 @@ let $use-template :=
else true()
let $data-xconf := $target || "/textgrid/data/collection.xconf"
let $store-xconf := xmldb:store("/db/system/config" || $target || "/textgrid/data", "collection.xconf", doc( $data-xconf ))
let $cache := transformXML:cacheAllEditions()
let $reindex := xmldb:reindex($target || "/textgrid/data")
(: import XML files from TGRep and transform them into HTML :)
......@@ -161,5 +162,3 @@ let $parameters :=
return
util:log-system-out($file-name || " saved.")
)
......@@ -356,6 +356,15 @@ body.hide-refs #translation-container .fa-external-link-square-alt {
font-size: 0.75em;
}
del gap::after {
content: '[–]';
display: inline-block; /* workaround to avoid parent strikethrough */
}
[rend*='strikethrough'] {
text-decoration: line-through;
}
add[place=above] {
vertical-align: super;
font-size: 0.75em;
......
<div data-template="templates:surround" data-template-with="templates/page_index.html" data-template-at="content-container">
<style>
.nav-pills a:hover {
background-color: #eeeeee;
}
.nav-pills a:hover {
background-color: #eeeeee;
}
</style>
<div class="arch-content p-content" id="content">
<h1 data-template="lang:translate" data-template-content="Guidelines"/>
<nav>
<div class="nav nav-pills" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-transcription-tab" data-toggle="tab" href="#nav-transcription" role="tab" aria-controls="nav-transcription" aria-selected="true">
<div class="nav nav-pills" id="nav-tab" role="tablist" style="display: none">
<a class="nav-item nav-link active" id="nav-transcription-tab" data-toggle="tab" href="#nav-transcription" role="tab" aria-controls="nav-transcription" aria-selected="true" onclick="toTab('transcription')">
<span data-template="lang:translate" data-template-content="Transcription Guidelines"/>
</a>
<a class="nav-item nav-link" id="nav-translation-tab" data-toggle="tab" href="#nav-translation" role="tab" aria-controls="nav-translation" aria-selected="false">
<a class="nav-item nav-link" id="nav-translation-tab" data-toggle="tab" href="#nav-translation" role="tab" aria-controls="nav-translation" aria-selected="false" onclick="toTab('translation')">
<span data-template="lang:translate" data-template-content="Translation Guidelines"/>
</a>
<a class="nav-item nav-link" id="nav-encoding-tab" data-toggle="tab" href="#nav-encoding" role="tab" aria-controls="nav-encoding" aria-selected="false">
<span data-template="lang:translate" data-template-content="Encoding Guidelines"/>
</a>
<a class="nav-item nav-link" id="nav-register-guide-tab" data-toggle="tab" href="#nav-register-guide" role="tab" aria-controls="nav-register-guide" aria-selected="false">
<a class="nav-item nav-link" id="nav-register-tab" data-toggle="tab" href="#nav-register" role="tab" aria-controls="nav-register" aria-selected="false" onclick="toTab('register')">
<span data-template="lang:translate" data-template-content="Register Guidelines"/>
</a>
<a class="nav-item nav-link" id="nav-encoding-tab" data-toggle="tab" href="#nav-encoding" role="tab" aria-controls="nav-encoding" aria-selected="false" onclick="toTab('encoding')">
<span data-template="lang:translate" data-template-content="Encoding Guidelines"/>
</a>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-content" id="nav-tabContent" style="display: none">
<div class="tab-pane fade show active" id="nav-transcription" role="tabpanel" aria-labelledby="nav-transcription-tab">
<br/>
<div data-template="confluence:confluence" data-template-id="58499672"/>
......@@ -35,11 +35,28 @@
<br/>
<div data-template="confluence:confluence" data-template-id="64974540"/>
</div>
<div class="tab-pane fade" id="nav-register-guide" role="tabpanel" aria-labelledby="nav-register-guide-tab">
<div class="tab-pane fade" id="nav-register" role="tabpanel" aria-labelledby="nav-register-tab">
<br/>
<div data-template="confluence:confluence" data-template-id="108139194"/>
</div>
</div>
<script type="text/javascript" src="templates/js/search.js"/>
<script>
// keeps bootstrap tab functionality and changes the uri fragment
function toTab(tab) {
const url = AtUrl.current()
url.updateHashParams({'tab': tab})
document.location.hash = url.formatHash()
}
// triggers correct tab loading on page load
window.addEventListener('DOMContentLoaded', event =&gt; {
const tab = AtUrl.current().hashParams()['tab'] || 'transcription'
jQuery(`#nav-${tab}-tab`).tab('show')
jQuery('#nav-tab, #nav-tabContent').show()
})
</script>
</div>
<!-- / .container -->
......
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/index_surround.html" data-template-at="content-container">
<div class="arch-content p-content">
<div class="row align-items-start">
......@@ -84,7 +83,7 @@
<div class="col-8 offset-1 col-lg-12 offset-lg-0">
<a href="content.html?id=64974546">
<p class="font-weight-bolder">
<span data-template="lang:translate" data-template-content="colloquium2020"/>
<span data-template="lang:translate" data-template-content="colloquium2021"/>
</p>
</a>
</div>
......
......@@ -1844,7 +1844,7 @@
{
"type": "Feature",
"properties": {
"id": "textgrid:3pg0w",
"id": "textgrid:3w4n9",
"visitor": "Corfey",
"color": "#6699ff",
"type": "",
......@@ -1856,8 +1856,8 @@
"geometry": {
"type": "Point",
"coordinates": [
4.891504,
44.932896
0.890278,
44.111111
]
}
},
......@@ -4641,6 +4641,26 @@
]
}
},
{
"type": "Feature",
"properties": {
"id": "textgrid:3pfvk",
"visitor": "Knesebeck",
"color": "#ff0066",
"type": "",
"label": "",
"labelNum": 67,
"edition": "3c0m2",
"page": 145
},
"geometry": {
"type": "Point",
"coordinates": [
7.62571,
51.96236
]
}
},
{
"type": "Feature",
"properties": {
......
......@@ -51,7 +51,7 @@ class ParisMap extends BaseMap {
//Paris 1733 Overlay
let paris1733 = L.tileLayer(`templates/itinerary/raster/Tiles/{z}/{x}/{y}.png`, {
let paris1733 = L.tileLayer(`${baseUrl}/raster/Tiles/{z}/{x}/{y}.png`, {
minZoom: 12,
maxZoom: 17,
opacity: 0.7,
......
......@@ -1251,7 +1251,7 @@ function addLiElement(number, fw) {
$('#ulPageNumbers').append('<li class="pageElement d-flex justify-content-center"><a href="#" onclick="setNewPage(' + number + ');this.blur();return false;"><span>' + number + suffix + '</span></a></li>');
}
/* delets all page numbers to enable adding new ones */
/* deletes all page numbers to enable adding new ones */
function deleteAllLis() {
var ul = document.getElementById('ulPageNumbers');
if (ul) {
......
......@@ -70,17 +70,17 @@
<div data-template="confluence:confluence" data-template-id="64974535"/>
<br/>
<nav>
<div class="nav nav-pills" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-Pitzler-tab" data-toggle="tab" href="#nav-Pitzler" role="tab" aria-controls="nav-Pitzler" aria-selected="true" onclick="loadEditionInformation('Pitzler')">Pitzler</a>
<a class="nav-item nav-link" id="nav-Harrach-tab" data-toggle="tab" href="#nav-Harrach" role="tab" aria-controls="nav-Harrach" aria-selected="false" onclick="loadEditionInformation('Harrach')">Harrach</a>
<a class="nav-item nav-link" id="nav-Corfey-tab" data-toggle="tab" href="#nav-Corfey" role="tab" aria-controls="nav-Corfey" aria-selected="false" onclick="loadEditionInformation('Corfey')">Corfey</a>
<a class="nav-item nav-link" id="nav-Knesebeck-tab" data-toggle="tab" href="#nav-Knesebeck" role="tab" aria-controls="nav-Knesebeck" aria-selected="false" onclick="loadEditionInformation('Knesebeck')">Knesebeck</a>
<a class="nav-item nav-link" id="nav-Sturm-tab" data-toggle="tab" href="#nav-Sturm" role="tab" aria-controls="nav-Sturm" aria-selected="false" onclick="loadEditionInformation('Sturm')">Sturm</a>
<a class="nav-item nav-link" id="nav-Neumann-tab" data-toggle="tab" href="#nav-Neumann" role="tab" aria-controls="nav-Neumann" aria-selected="false" onclick="loadEditionInformation('Neumann')">Neumann</a>
<div class="nav nav-pills" id="nav-tab" role="tablist" style="display: none">
<a class="nav-item nav-link active" id="nav-Pitzler-tab" data-toggle="tab" href="#nav-Pitzler" role="tab" aria-controls="nav-Pitzler" aria-selected="true" onclick="toEdition('Pitzler')">Pitzler</a>
<a class="nav-item nav-link" id="nav-Harrach-tab" data-toggle="tab" href="#nav-Harrach" role="tab" aria-controls="nav-Harrach" aria-selected="false" onclick="toEdition('Harrach')">Harrach</a>
<a class="nav-item nav-link" id="nav-Corfey-tab" data-toggle="tab" href="#nav-Corfey" role="tab" aria-controls="nav-Corfey" aria-selected="false" onclick="toEdition('Corfey')">Corfey</a>
<a class="nav-item nav-link" id="nav-Knesebeck-tab" data-toggle="tab" href="#nav-Knesebeck" role="tab" aria-controls="nav-Knesebeck" aria-selected="false" onclick="toEdition('Knesebeck')">Knesebeck</a>
<a class="nav-item nav-link" id="nav-Sturm-tab" data-toggle="tab" href="#nav-Sturm" role="tab" aria-controls="nav-Sturm" aria-selected="false" onclick="toEdition('Sturm')">Sturm</a>
<a class="nav-item nav-link" id="nav-Neumann-tab" data-toggle="tab" href="#nav-Neumann" role="tab" aria-controls="nav-Neumann" aria-selected="false" onclick="toEdition('Neumann')">Neumann</a>
</div>
</nav>
<br/>
<div class="tab-content" id="nav-tabContent">
<div class="tab-content" id="nav-tabContent" style="display: none">
<div class="row arch-edition-teaser">
<div class="col-md-6 col-lg-4 mb-6">
<div class="p-sm-breakout">
......@@ -94,13 +94,13 @@
<h2 id="arch-edition-title">
Lorem ipsum dolor sit amet
</h2>
<ul>
<li>
<i class="fa fa-address-book"/>
<ul class="arch-icon-list">
<li class="d-flex">
<i class="fas fa-address-book fa-fw mt-1"/>
<span id="arch-edition-author">lorem ipsum dolor sit amet</span>
</li>
<li>
<i class="fa fa-address-card"/>
<li class="d-flex">
<i class="fas fa-address-card fa-fw mt-1"/>
<span id="arch-edition-pages" class="arch-author">67 lorems</span>
</li>
<!--<li>
......@@ -172,6 +172,7 @@
</div>
</div>
</div>
<script type="text/javascript" src="templates/js/search.js"/>
<script>
<!-- Directly toggle tabs via href -->
/*$(document).ready(function() {
......@@ -191,6 +192,30 @@
});
return result;
}
// keeps bootstrap tab functionality and changes the uri fragment triggering
// loadEditionInformation in the url change handler
function toEdition(author) {
console.log(author)
const url = AtUrl.current()
url.updateHashParams({'author': author})
document.location.hash = url.formatHash()
}
// monitors url for hash changes, triggers metadata loading if necessary
window.addEventListener('hashchange', event =&gt; {
const author = AtUrl.current().hashParams()['author']
loadEditionInformation(author)
})
// triggers correct metadata and tab loading on page load
window.addEventListener('DOMContentLoaded', event =&gt; {
const author = AtUrl.current().hashParams()['author'] || 'Pitzler'
loadEditionInformation(author)
jQuery(`#nav-${author}-tab`).tab('show')
jQuery('#nav-tab, #nav-tabContent').show()
})
function loadEditionInformation(edition) {
var lang=getParameter("lang");
var editionID="";
......@@ -326,7 +351,6 @@
document.getElementById('arch-download-de').download=downloadTextDE;
document.getElementById('arch-download-fr').download=downloadTextFR;
}
loadEditionInformation("Pitzler");
</script>
</div>
\ No newline at end of file
......@@ -16,16 +16,16 @@
min-height: 38.5rem;
}
#register_ul_css &gt; ul {
#register_ul_css > ul {
list-style: none;
/*width: 200px; */
text-indent: -20px; /* key property */
margin-left: 20px; /* key property */
}
#register_ul_css &gt; ul &gt; li { margin-bottom: 10px; }
#register_ul_css > ul > li { margin-bottom: 10px; }
.btn-group &gt; .btn:not(:first-child),
.btn-group > .btn:not(:first-child),
.btn-group:not(:first-child) {
margin-left: 0px; }
......@@ -38,7 +38,10 @@
.arch-content {
min-height: 40rem; }
*/
#register-tabs .btn {
cursor: pointer;
}
</style>
<!-- error modal for error messages -->
......@@ -61,12 +64,12 @@
<div class="row arch-list-view-content p-content">
<div class="col-md-6 ">
<div class="col-md-6" id="register-tabs" style="display: none">
<div class="arch-list-view-radio-slider">
<div class="btn-toolbar btn-group-toggle btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="register_button" id="option1" value="persons" autocomplete="off" checked="checked"/>
<label class="btn btn-primary">
<input type="radio" name="register_button" id="option1" value="persons" autocomplete="off"/>
<i class="fas fa-user"/>
 
<span data-template="lang:translate" data-template-content="register_persons"/>
......@@ -88,8 +91,8 @@
<div class="arch-list-view-radio-slider">
<div class="btn-toolbar btn-group-toggle btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="letter_button" value="AaÄä" autocomplete="off" checked="checked"/>
<label class="btn btn-primary">
<input type="radio" name="letter_button" value="AaÄä" autocomplete="off"/>
A
</label>
<label class="btn btn-primary">
......@@ -231,8 +234,6 @@
tracker[text].push(e)
}
console.log(tracker)
for (const [text, elements] of Object.entries(tracker)) {
if (elements.length > 1) {
for (const e of elements) {
......@@ -247,7 +248,6 @@
const distinction = link.getAttribute('distinct-name')
if (distinction != '') {
console.log(distinction)
const clean = distinction.
replace(/^[^A-Za-z]/, '').
replace(/[^A-Za-z]$/, '').
......@@ -255,79 +255,74 @@
element.textContent = `${element.textContent} (${clean})`
}
}
// LOAD CONTENT FOR INITAL BUTTON
/////////////////////////////////
// LOAD INITIAL REGISTER BUTTON VALUE
var button_value = $("input[name='register_button']:checked").attr("value");
// LOAD PARAMETER FOR FIRST OPTION (persons) in selected language:
var language = $("span &gt; lang").attr("key");
// LOAD INITIAL LETTER VALUE
var letter_value = $("input[name='letter_button']:checked").attr("value");
var letter_text = $("input[name='letter_button']:checked").parent()[0].innerText;
$.post("modules/architrave/transform_register.xq",
{
button_parameter: button_value,
language_parameter: language,
letter_value_parameter: letter_value,
letter_text_parameter: letter_text
},
function(data,status){
$( '#register_content' ).html(data);
fixEscapes('#register_content')
distinguishDuplicates('#register_content')
});
// page state handling
// extract relevant parameters from the url with defaults
function registerParams() {
const url = AtUrl.current()
const defaults = {register: 'persons', letter: 'AaÄä'}
const params = url.hashParams()
params['lang'] = url.params()['lang']
// HANDLING WHEN REGISTER RADIO BUTTON IS CHANGED
/////////////////////////////////
$("input[name='register_button']").change(function(){
// LOAD *CHANGED* VALUES
var button_value = $("input[name='register_button']:checked").attr("value");
var letter_value = $("input[name='letter_button']:checked").attr("value");
var letter_text = $("input[name='letter_button']:checked").parent()[0].innerText;
$.post("modules/architrave/transform_register.xq",
{
button_parameter: button_value,
language_parameter: language,
letter_value_parameter: letter_value,
letter_text_parameter: letter_text
},
function(data,status){
$( '#register_content' ).html(data);
fixEscapes('#register_content')
distinguishDuplicates('#register_content')
});
});
// HANDLING WHEN LETTER BUTTON IS CHANGED
/////////////////////////////////
$("input[name='letter_button']").change(function(){
// LOAD *CHANGED* VALUES
var button_value = $("input[name='register_button']:checked").attr("value");
var letter_value = $("input[name='letter_button']:checked").attr("value");
var letter_text = $("input[name='letter_button']:checked").parent()[0].innerText;
$.post("modules/architrave/transform_register.xq",
{
button_parameter: button_value,
language_parameter: language,
letter_value_parameter: letter_value,
letter_text_parameter: letter_text
},
function(data,status){
$( '#register_content' ).html(data);
const result = {...defaults, ...params}
result['letter'] = decodeURIComponent(result['letter'])
return result
}
// fetch the register data for the requested page and insert them into the
// page
function fetchRegisters() {
const url = 'modules/architrave/transform_register.xq'
const params = {
button_parameter: registerParams()['register'],
language_parameter: registerParams()['lang'],
letter_value_parameter: registerParams()['letter'],
letter_text_parameter: $("input[name='letter_button']:checked").parent()[0].innerText
}
$.post(url, params, (data, status) => {
$( '#register_content' ).html(data)
fixEscapes('#register_content')
distinguishDuplicates('#register_content')
});
});
distinguishDuplicates('#register_content')
})
}
// sync url with radio button state, called on button click
function updateUrl() {
const params = {
register: $("input[name='register_button']:checked").attr("value"),
letter: $("input[name='letter_button']:checked").attr("value"),
}
const url = AtUrl.current()
url.updateHashParams(params)
document.location.hash = url.formatHash()
}
// sync radio button state with url params, called on page load
function setRadios() {
const {register, letter} = registerParams()
let radio = document.querySelector(`input[name='register_button'][value='${register}']`)
radio.checked = true
radio.parentElement.classList.add('active')
radio = document.querySelector(`input[name='letter_button'][value='${letter}']`)