Commit ee6f409b authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

mod@seq

parent acc63eb5
......@@ -407,6 +407,7 @@ switch ($develop)
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'del') or contains(request:get-cookie-value('del'), 'inactive')) then ' inactive' else ()}" id="delBtn">del</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'add') or contains(request:get-cookie-value('add'), 'inactive')) then ' inactive' else ()}" id="addBtn">add</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'mod') or contains(request:get-cookie-value('mod'), 'inactive')) then ' inactive' else ()}" id="modBtn">mod</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'seq') or contains(request:get-cookie-value('seq'), 'inactive')) then ' inactive' else ()}" id="seqBtn">seq</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'latn') or contains(request:get-cookie-value('latn'), 'inactive')) then ' inactive' else ()}" id="latnBtn">Latn</button>
<button class="btn btn-default{ if(not(request:get-cookie-names() = 'script') or contains(request:get-cookie-value('script'), 'inactive')) then ' inactive' else ()}" id="scriptBtn">script
<div class="BtnExt">
......@@ -438,28 +439,27 @@ declare function f-misc:textgridStatus($node as node(), $model as map(*)) {
let $status := if( exists( $status ) ) then $status else <ok/>
return
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")),
xmldb:store($col, $res, <div>{$status}</div>))
else if($active and $lastMod < (current-dateTime() - xs:dayTimeDuration("PT5M")))
xmldb:store($col, $res, $status))
else if($active and $lastMod < (current-dateTime() - xs:dayTimeDuration("PT2H")))
then
let $status := httpclient:get(xs:anyURI($url), false(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := if( exists( $status ) ) then $status else <ok/>
return
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")), xmldb:store($col, $res, <div>{$status}</div>))
(xmldb:login($col, config:get("sade.user"), config:get("sade.password")), xmldb:store($col, $res, $status))
else ()
let $doc := doc( $col || "/" || $res )
return
if( $doc//ok ) then () else
for $message at $pos in $doc/div/node()
let $status := $message/tokenize(@class, '\s+')[last()]
let $status := $doc/xhtml:div[@class]/tokenize(@class, '\s+')[last()]
return
<div class="alert alert-{if($status = "error") then "danger" else $status}">
if( $doc//ok ) then () else
<div class="alert alert-{$status}">
<h4>TextGrid-Statusmeldung</h4>
{if($pos gt 1) then () else <p>Es liegt eine aktuelle Meldung zum TextGrid Repository vor. Einige
<p>Es liegt eine aktuelle Meldung zum TextGrid Repository vor. Einige
Funktionen, z.Bsp die Darstellung der Faksimiles, sind vom TextGrid
Repository abhängig und daher evtl. davon betroffen. Hier folgt die
Meldung von TextGrid.</p>}
Meldung von TextGrid.</p>
<h5>Status: {$status}</h5>
{for $i at $pos in $message//xhtml:p[@lang="de"] return (if($pos gt 1) then <hr/> else (),$i)}
{for $i at $pos in $doc/xhtml:div//xhtml:p[@lang="de"] return (if($pos gt 1) then <hr/> else (),$i)}
</div>
};
......
......@@ -521,7 +521,7 @@ declare function fontaneTransfo:surfaceDiv($node as node(), $inital as xs:string
}
}
else
(
(
element xhtml:div {
fontaneTransfo:surface($node),
if($node/@type = ('clipping', 'additional'))
......@@ -543,14 +543,14 @@ declare function fontaneTransfo:surfaceDiv($node as node(), $inital as xs:string
fontaneTransfo:noteParser($i)
}
}
}
else ()
)};
declare function fontaneTransfo:surface($n) {
attribute class {
'surface',
'surface',
(if($n/@type) then (' tei'||$n/@type) else ''),
string($n/@subtype),
if( string($n/@subtype)="Kalenderblatt") then if(ends-with($n/@n, 'v')) then 'verso' else 'recto' else (),
......@@ -613,6 +613,11 @@ attribute class {
string($n/@type),
string($n/@subtype),
if (exists($n/preceding-sibling::tei:addSpan) and $n/preceding-sibling::tei:addSpan/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id ) then 'addSpan' else(),
if (exists($n/preceding-sibling::tei:mod[@seq])
and
$n/preceding-sibling::tei:mod[@seq]/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id
)
then 'mod-seq-'|| string($n/preceding-sibling::tei:mod[@seq][substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id]/@seq) else(),
if ($n/tei:figure) then 'figure' else(),
fontaneTransfo:segStyle($n),
if( $n/@type="illustration" and $n/parent::tei:line) then "verticalMiddel" else (),
......@@ -680,12 +685,12 @@ attribute style {
(: let $image := ($n/ancestor::tei:surface)[1]/substring-after(@facs, "textgridrep.org/") || ".1":)
let $svgg := $link/ancestor::tei:TEI//svg:g[@id = $link/parent::tei:linkGrp/substring-after(@facs, '#')]
let $image := substring-before($svgg//svg:image/@xlink:href, ".") || ".1"
let $image := substring-before($svgg//svg:image/@xlink:href, ".") || ".1"
let $x := number($svgg//svg:rect[@id = $shape]/substring-before(@x, '%'))
let $y := number($svgg//svg:rect[@id = $shape]/substring-before(@y, '%'))
let $w := number($svgg//svg:rect[@id = $shape]/substring-before(@width, '%'))
let $h := number($svgg//svg:rect[@id = $shape]/substring-before(@height, '%'))
let $rotation := sum( ($n/ancestor-or-self::tei:*/@rotate) )
let $rotation := if($rotation != 0) then 360 - $rotation else 0
......@@ -1106,10 +1111,10 @@ then
return
(: 'https://textgridlab.org/1.0/digilib/rest/digilib?fn='|| $image || '&amp;dh=500&amp;dw=500&amp;wx='||$x||'&amp;wy='||$y||'&amp;ww='||$w||'&amp;wh='||$h||"&amp;mo=png":)
'https://textgridlab.org/1.0/digilib/rest/IIIF/'|| $image || '/pct:' || string-join(($x, $y, $w, $h), ",") || '/,500/0/default.jpg'
(: https://textgridlab.org/1.0/digilib/rest/IIIF/textgrid:164g9.1/pct:7.747474581830108,5.289308105687416,84.44747294194818,89.91823779668606/,1000/0/default.jpg:)
else
(: typical cover :)
let
......@@ -1148,7 +1153,7 @@ $resolution := switch ($type)
case 'surface-empty' return ("", 300)
case 'figure' return ("", 500)
default return ("",1000),
(: wx , wy :)
$offset := switch($type)
case 'figure' return
......@@ -1188,7 +1193,7 @@ $range := if ($n = 'none') then (1, 1)
number(substring-before($covertble//svg:rect[@id = $shape][1]/@width, '%')) ,
number(substring-before($covertble//svg:rect[@id = $shape][1]/@height, '%')) )
else if (contains($n, 'outer')) then (
number(($bindingWidth div 10) * $dpcm div $image-width) * 100,
number(($bindingHeight div 10) * $dpcm div $image-height) * 100 )
else (
......@@ -1196,7 +1201,7 @@ $range := if ($n = 'none') then (1, 1)
number((($surfaceHeight div 10) + 0.5) * $dpcm div $image-height) * 100 )
return if($type = 'total') then concat($scaler, $image, $resolution, '&amp;mo=png')
else
else
string-join(($scaler, $image, "pct:" || string-join(($offset[1], $offset[2], $range[1], $range[2]), ","), string-join($resolution, ","), 0, "default.jpg" ), "/")
(: https://textgridlab.org/1.0/digilib/rest/IIIF/textgrid:164g9.1/pct:7.747474581830108,5.289308105687416,84.44747294194818,89.91823779668606/,1000/0/default.jpg:)
......
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