Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
96cda0b4
Commit
96cda0b4
authored
Feb 01, 2021
by
Mathias Goebel
🎠
Browse files
feat: remove unused module
parent
5e632069
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/app.xql
deleted
100644 → 0
View file @
5e632069
xquery version "3.1";
module namespace app="http://textgrid.de/ns/SADE/templates";
import module namespace templates="http://exist-db.org/xquery/templates" ;
import module namespace config="http://textgrid.de/ns/SADE/config" at "config/config.xqm";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
(:~
: returns an html snippet with the current project title from conf.xml, can be
: can be a clickable title within a navbar that triggers a sidebar
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:project-id($node as node(), $model as map(*)) {
element {$node/name()} { $node/@*[not(local-name() => starts-with("data-template")) ],
<div data-target=".sidebar-collapse" data-toggle="collapse" id="sidebar-toggle">
<span class="glyphicon glyphicon-list"> </span> {' ' || config:get('project-title')}
</div>}
};
(:~
: Collects information from <a href="https://www.uni-goettingen.de/de/publikationen/303721.html">
: Fontane-Arbeitstelle website</a>.
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:publications($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/publikationen/303721.html"
timeout="3"/>
let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
return
($response//*:li[@class="content"])[position() lt 5]
};
(:~
: Collects information from <a href="https://www.uni-goettingen.de/de/publikationen/303721.html">
: Fontane-Arbeitstelle website</a>.
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:presentations($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/vortr%C3%A4ge-und-pr%C3%A4sentationen/303717.html" timeout="3"/>
let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
for $item in ($response//*:li[@class="content"])[position() lt 5]
return
element li { for $i in $item/node() return local:nodeTest($i) }
};
declare function local:nodeTest($node){
typeswitch ($node)
case element(a) return element a {
attribute href {if(starts-with($node/@href, '/de/document')) then 'https://www.uni-goettingen.de'||$node/@href else $node/@href},
attribute target {'_blank'},
if (starts-with($node/text(), 'Power Point' )) then substring-after($node/text(), 'Power Point') else $node/text()
}
default return $node
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment