Skip to content

Commit

Permalink
removing redundancy and simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
riedde committed Oct 9, 2024
1 parent 169d2a9 commit 9e90557
Showing 1 changed file with 66 additions and 149 deletions.
215 changes: 66 additions & 149 deletions add/index.xql
Original file line number Diff line number Diff line change
Expand Up @@ -46,145 +46,63 @@ let $comment := comment{"
"
}

let $eoEditionFileNone := <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title>Edirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>

<!-- **CSS** -->
<link rel="stylesheet" href="resources/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/tipped/tipped.css"/>

<!-- **Raphael JS** -->
<script type="text/javascript" src="resources/js/raphael-min.js"/>

<!-- **Leaflet** -->
<link rel="stylesheet" href="resources/leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.css"/>
<script type="text/javascript" src="resources/leaflet-0.7.3/leaflet.js"/>
<script type="text/javascript" src="resources/facsimileLayer/FacsimileLayer.js"/>
<script src="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.js"/>

<!-- **Open Sea Dragon** -->
<script type="text/javascript" src="resources/js/openseadragon.min.js"/>

<!-- **JQUERY** -->
<script type="text/javascript" src="resources/jquery/jquery-2.1.3.js" charset="utf-8"/>

<!-- **ACE** -->
<script src="resources/js/ace/ace.js" type="text/javascript" charset="utf-8"/>
<script src="resources/js/ace/mode-xml.js" type="text/javascript" charset="utf-8"/>

<link rel="stylesheet" href="resources/EdiromOnline-all.css"/>

</head>
<body class="x-body">
<div class="container" style="margin: 8.75%;">
<img src="resources/pix/ViFE-logo-small-144x144-trans.png"/>
<h1 style="margin-top:5px;">Edirom Online</h1>
<h3 class="navigatorCategoryTitle">Es wurden keine Editionen gefunden.</h3>
</div>
</body>
</html>

let $eoEditionFileSingle := <html>
<head>
<meta charset="UTF-8"/>
<title>{if($editionUri) then(edition:getName($editionUri)) else()} – Edirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>

<!-- **CSS** -->
<link rel="stylesheet" href="resources/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/tipped/tipped.css"/>

<script>
var debug=false;
</script>

<!-- **Raphael JS** -->
<script type="text/javascript" src="resources/js/raphael-min.js"/>

<!-- **Leaflet** -->
<link rel="stylesheet" href="resources/leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.css"/>
<script type="text/javascript" src="resources/leaflet-0.7.3/leaflet.js"/>
<script type="text/javascript" src="resources/facsimileLayer/FacsimileLayer.js"/>
<script src="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.js"/>

<!-- **Open Sea Dragon** -->
<script type="text/javascript" src="resources/js/openseadragon.min.js"/>

<!-- **JQUERY** -->
<script type="text/javascript" src="resources/jquery/jquery-2.1.3.js" charset="utf-8"/>

<!-- **ACE** -->
<script src="resources/js/ace/ace.js" type="text/javascript" charset="utf-8"/>
<script src="resources/js/ace/mode-xml.js" type="text/javascript" charset="utf-8"/>

<link rel="stylesheet" href="resources/EdiromOnline-all.css"/>
<!-- TODO if prefs css then include here -->
{
if ($preferences//entry[@key = "additional_css_path" and @value != ''])
then
<link rel="stylesheet" href="{string-join((request:get-context-path(), substring-after($preferences//entry[@key = 'additional_css_path']/@value, 'xmldb:exist:///db/')), '/')}"/>
else ()
}
<script type="text/javascript" src="app.js"/>

<!-- **WHERE TO OPEN LINKS** -->
<base target="_blank"/>

</head>
<body>
<script type="text/javascript" src="resources/js/tipped/tipped.js"/>
</body>
</html>
let $eoEditionFileMulti := <html>
<head>
<meta charset="UTF-8"/>
<title>Edirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>

<!-- **CSS** -->
<link rel="stylesheet" href="resources/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/tipped/tipped.css"/>

<!-- **Raphael JS** -->
<script type="text/javascript" src="resources/js/raphael-min.js"/>

<!-- **Leaflet** -->
<link rel="stylesheet" href="resources/leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.css"/>
<script type="text/javascript" src="resources/leaflet-0.7.3/leaflet.js"/>
<script type="text/javascript" src="resources/facsimileLayer/FacsimileLayer.js"/>
<script src="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.js"/>

<!-- **Open Sea Dragon** -->
<script type="text/javascript" src="resources/js/openseadragon.min.js"/>

<!-- **JQUERY** -->
<script type="text/javascript" src="resources/jquery/jquery-2.1.3.js" charset="utf-8"/>

<!-- **ACE** -->
<script src="resources/js/ace/ace.js" type="text/javascript" charset="utf-8"/>
<script src="resources/js/ace/mode-xml.js" type="text/javascript" charset="utf-8"/>

<link rel="stylesheet" href="resources/EdiromOnline-all.css"/>

</head>
<body class="x-body">
<div class="container" style="margin: 8.75%;">
<img src="resources/pix/ViFE-logo-small-144x144-trans.png"/>
<h1 style="margin-top:5px;">Edirom Online</h1>
<h3 class="navigatorCategoryTitle">Bitte Edition auswählen</h3>
<ul>
let $eoIndexPage := <html>
<head>
<meta charset="UTF-8"/>
<title>dirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>

<!-- **CSS** -->
<link rel="stylesheet" href="resources/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/tipped/tipped.css"/>

<!-- **Raphael JS** -->
<script type="text/javascript" src="resources/js/raphael-min.js"/>

<!-- **Leaflet** -->
<link rel="stylesheet" href="resources/leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.css"/>
<script type="text/javascript" src="resources/leaflet-0.7.3/leaflet.js"/>
<script type="text/javascript" src="resources/facsimileLayer/FacsimileLayer.js"/>
<script src="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.js"/>

<!-- **Open Sea Dragon** -->
<script type="text/javascript" src="resources/js/openseadragon.min.js"/>

<!-- **JQUERY** -->
<script type="text/javascript" src="resources/jquery/jquery-2.1.3.js" charset="utf-8"/>

<!-- **ACE** -->
<script src="resources/js/ace/ace.js" type="text/javascript" charset="utf-8"/>
<script src="resources/js/ace/mode-xml.js" type="text/javascript" charset="utf-8"/>

<link rel="stylesheet" href="resources/EdiromOnline-all.css"/>
{
if(($eoEditionFilesCount gt 1 or $eoEditionFilesCount eq 0) and not($edition)) then
()
else
(<!-- TODO if prefs css then include here -->,
if ($preferences//entry[@key = "additional_css_path" and @value != ''])
then
<link rel="stylesheet" href="{string-join((request:get-context-path(), substring-after($preferences//entry[@key = 'additional_css_path']/@value, 'xmldb:exist:///db/')), '/')}"/>
else (),
<script type="text/javascript" src="app.js"/>,
<!-- **WHERE TO OPEN LINKS** -->,
<base target="_blank"/>)
}
</head>
<body class="x-body">
{if(($eoEditionFilesCount gt 1 or $eoEditionFilesCount eq 0) and not($edition)) then
(<div class="container" style="margin: 8.75%;">
<img src="resources/pix/ViFE-logo-small-144x144-trans.png"/>
<h1 style="margin-top:5px;">Edirom Online</h1>
{if($eoEditionFilesCount eq 0 and not($edition)) then
(<h3 class="navigatorCategoryTitle">Es wurden keine Editionen gefunden.</h3>)
else
(<h3 class="navigatorCategoryTitle">Bitte Edition auswählen</h3>,
<ul>
{
for $eoEditionFile in $eoEditionFiles
let $editionUri := document-uri($eoEditionFile/root())
Expand All @@ -202,14 +120,13 @@ let $eoEditionFileMulti := <html>
)
}
</ul>
</div>
</body>
</html>

)
}
</div>)
else
(<script type="text/javascript" src="resources/js/tipped/tipped.js"/>)
}
</body>
</html>
return
if(not($edition)) then
$eoEditionFileNone
else if($eoEditionFilesCount > 1 and not($edition)) then
($comment, $eoEditionFileMulti)
else
($comment, $eoEditionFileSingle)
($comment, $eoIndexPage)

0 comments on commit 9e90557

Please sign in to comment.