Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ exclude-result-prefixes="#all"
<xsl:template match="button[contains-token(@class, 'btn-edit-constructors')]" mode="ixsl:onclick">"
<xsl:variable name="type" select="ixsl:get(., 'dataset.resourceType')" as="xs:anyURI"/>

<xsl:for-each select="ixsl:page()//body">
<xsl:for-each select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]">
<xsl:call-template name="ldh:LoadConstructors">
<xsl:with-param name="type" select="$type"/>
</xsl:call-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,10 @@ WHERE
<xsl:variable name="href" select="?headers?location" as="xs:anyURI"/>

<xsl:call-template name="ldh:DocumentNavigate">
<xsl:with-param name="uri" select="$href"/>
<xsl:with-param name="doc-uri" select="ac:absolute-path($href)"/>
<xsl:with-param name="fragment" select="ac:fragment-id($href)"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:function>

<xsl:function name="ldh:row-form-submit-violation" ixsl:updating="yes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ exclude-result-prefixes="#all"
<xsl:sequence select="xs:anyURI(ixsl:location())"/>
</xsl:function>

<xsl:function name="ldh:query-params" as="map(xs:string, xs:string*)">
<xsl:sequence select="ixsl:query-params()"/>
</xsl:function>
<!-- ldh:query-params is defined once in imports/default.xsl and works in both contexts via ldh:request-uri -->

<xsl:function name="ldh:base-uri" as="xs:anyURI">
<xsl:param name="arg" as="node()"/> <!-- ignored -->
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ ORDER BY DESC(?created)
<ul class="well well-small nav nav-list">
<xsl:apply-templates select="$results/rdf:RDF/rdf:Description[not(@rdf:about = $doc-uri)]" mode="xhtml:ListItem">
<xsl:sort select="ac:label(.)" order="ascending" lang="{$ldt:lang}"/>
<xsl:with-param name="mode" select="ixsl:query-params()?mode[1]" tunnel="yes"/> <!-- TO-DO: support multiple modes -->
<xsl:with-param name="mode" select="ldh:query-params()?mode[1]" tunnel="yes"/> <!-- TO-DO: support multiple modes -->
<xsl:with-param name="render-id" select="false()" tunnel="yes"/>
</xsl:apply-templates>
</ul>
Expand Down Expand Up @@ -847,10 +847,13 @@ ORDER BY DESC(?created)
<!-- opens modal dialog to show instances of a class -->
<xsl:template match="button[contains-token(@class, 'btn-class')]" mode="ixsl:onclick">
<xsl:variable name="class-uri" select="xs:anyURI(ixsl:get(., 'dataset.classUri'))"/>
<xsl:variable name="container-id" select="'class-instances-container'" as="xs:string"/>
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
<xsl:variable name="modal-id" select="'class-instances-modal-' || $pane-id" as="xs:string"/>
<xsl:variable name="container-id" select="'class-instances-container-' || $pane-id" as="xs:string"/>

<xsl:variable name="modal" as="element()">
<div class="modal modal-constructor fade in" id="class-instances-modal">
<div class="modal modal-constructor modal-class-instances fade in" id="{$modal-id}" data-container-id="{$container-id}">
<div class="modal-header">
<button type="button" class="close">×</button>
<legend>
Expand Down Expand Up @@ -895,6 +898,7 @@ ORDER BY DESC(?created)

<xsl:call-template name="ldh:ShowModalForm">
<xsl:with-param name="form" select="$modal"/>
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>

<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
Expand Down Expand Up @@ -975,7 +979,7 @@ ORDER BY DESC(?created)
</xsl:template>

<!-- close modals when a link inside them is clicked -->
<xsl:template match="div[@id = ('class-instances-modal', 'geo-modal', 'latest-modal', 'search-modal')]//a[@href]" mode="ixsl:onclick" priority="1">
<xsl:template match="div[contains-token(@class, 'modal-class-instances') or contains-token(@class, 'modal-geo') or contains-token(@class, 'modal-latest') or contains-token(@class, 'modal-search')]//a[@href]" mode="ixsl:onclick" priority="1">
<xsl:variable name="modal" select="ancestor::div[contains-token(@class, 'modal')][@id][1]" as="element()"/>

<!-- remove the modal -->
Expand All @@ -988,11 +992,14 @@ ORDER BY DESC(?created)

<!-- opens modal dialog to show geo resources -->
<xsl:template match="button[contains-token(@class, 'btn-geo')]" mode="ixsl:onclick">
<xsl:variable name="container-id" select="'geo-container'" as="xs:string"/>
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
<xsl:variable name="modal-id" select="'geo-modal-' || $pane-id" as="xs:string"/>
<xsl:variable name="container-id" select="'geo-container-' || $pane-id" as="xs:string"/>
<xsl:variable name="select-string" select="$geo-resources-string" as="xs:string"/>

<xsl:variable name="modal" as="element()">
<div class="modal modal-constructor fade in" id="geo-modal">
<div class="modal modal-constructor modal-geo fade in" id="{$modal-id}" data-container-id="{$container-id}">
<div class="modal-header">
<button type="button" class="close">×</button>
<legend>
Expand All @@ -1009,7 +1016,7 @@ ORDER BY DESC(?created)
</div>
</div>
</div>

<div id="{$container-id}" class="row-fluid" typeof="&ldh;View">
<div class="main span12">
<!-- View results will be rendered here -->
Expand All @@ -1030,6 +1037,7 @@ ORDER BY DESC(?created)

<xsl:call-template name="ldh:ShowModalForm">
<xsl:with-param name="form" select="$modal"/>
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>

<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
Expand Down Expand Up @@ -1096,11 +1104,14 @@ ORDER BY DESC(?created)

<!-- opens modal dialog to show latest resources -->
<xsl:template match="button[contains-token(@class, 'btn-latest')]" mode="ixsl:onclick">
<xsl:variable name="container-id" select="'latest-container'" as="xs:string"/>
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
<xsl:variable name="modal-id" select="'latest-modal-' || $pane-id" as="xs:string"/>
<xsl:variable name="container-id" select="'latest-container-' || $pane-id" as="xs:string"/>
<xsl:variable name="select-string" select="$latest-resources-string" as="xs:string"/>

<xsl:variable name="modal" as="element()">
<div class="modal modal-constructor fade in" id="latest-modal">
<div class="modal modal-constructor modal-latest fade in" id="{$modal-id}" data-container-id="{$container-id}">
<div class="modal-header">
<button type="button" class="close">×</button>
<legend>
Expand Down Expand Up @@ -1138,6 +1149,7 @@ ORDER BY DESC(?created)

<xsl:call-template name="ldh:ShowModalForm">
<xsl:with-param name="form" select="$modal"/>
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>

<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
Expand Down Expand Up @@ -1216,10 +1228,13 @@ ORDER BY DESC(?created)
<xsl:template match="form[contains-token(@class, 'search-form')]" mode="ixsl:onsubmit">
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
<xsl:variable name="text" select=".//input[@name = 'q']/ixsl:get(., 'value')" as="xs:string?"/>
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
<xsl:variable name="target" select="id('tab-content', ixsl:page())/div[contains-token(@class, 'tab-pane')][contains-token(@class, 'active')]/div[contains-token(@class, 'document-body')]/div[contains-token(@class, 'content-body')]" as="element()"/>
<xsl:variable name="pane-id" select="$target/ancestor::div[contains-token(@class, 'tab-pane')]/@id" as="xs:string"/>
<xsl:variable name="modal-id" select="'search-modal-' || $pane-id" as="xs:string"/>
<xsl:variable name="container-id" select="'search-results-container-' || $pane-id" as="xs:string"/>

<xsl:variable name="modal" as="element()">
<div class="modal modal-constructor fade in" id="search-modal">
<div class="modal modal-constructor modal-search fade in" id="{$modal-id}" data-container-id="{$container-id}">
<div class="modal-header">
<button type="button" class="close">×</button>
<legend>
Expand Down Expand Up @@ -1267,6 +1282,7 @@ ORDER BY DESC(?created)

<xsl:call-template name="ldh:ShowModalForm">
<xsl:with-param name="form" select="$modal"/>
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>

<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`'))">
Expand All @@ -1286,7 +1302,7 @@ ORDER BY DESC(?created)
</xsl:call-template>
</xsl:if>

<xsl:for-each select="id('search-modal', ixsl:page())//input[@name = 'q']">
<xsl:for-each select="id($modal-id, ixsl:page())//input[@name = 'q']">
<xsl:sequence select="ixsl:call(., 'focus', [])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:for-each>
</xsl:template>
Expand All @@ -1295,7 +1311,7 @@ ORDER BY DESC(?created)
<xsl:template match="form[contains-token(@class, 'search-form-modal')]" mode="ixsl:onsubmit">
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
<xsl:variable name="text" select=".//input[@name = 'q']/ixsl:get(., 'value')" as="xs:string?"/>
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
<xsl:variable name="container-id" select="ancestor::div[contains-token(@class, 'modal')][@data-container-id][1]/@data-container-id" as="xs:string"/>
<xsl:variable name="cache" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`')" as="item()"/>

<xsl:choose>
Expand All @@ -1316,11 +1332,11 @@ ORDER BY DESC(?created)
</xsl:template>

<!-- in-modal search input: debounced live search (form-submit handles Enter) -->
<xsl:template match="div[@id = 'search-modal']//input[@name = 'q']" mode="ixsl:onkeyup">
<xsl:template match="div[contains-token(@class, 'modal-search')]//input[@name = 'q']" mode="ixsl:onkeyup">
<xsl:param name="delay" select="400" as="xs:integer"/>
<xsl:variable name="key-code" select="ixsl:get(ixsl:event(), 'code')" as="xs:string"/>
<xsl:variable name="text" select="ixsl:get(., 'value')" as="xs:string?"/>
<xsl:variable name="container-id" select="'search-results-container'" as="xs:string"/>
<xsl:variable name="container-id" select="ancestor::div[contains-token(@class, 'modal')][@data-container-id][1]/@data-container-id" as="xs:string"/>
<xsl:variable name="cache" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $container-id || '`')" as="item()"/>

<xsl:choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ extension-element-prefixes="ixsl"
<xsl:param name="base" as="xs:anyURI?"/>
<xsl:param name="endpoint" as="xs:anyURI?"/>
<xsl:param name="application" as="xs:anyURI?"/>
<xsl:param name="about" as="xs:anyURI"/>
<xsl:param name="object-metadata" as="document-node()?" tunnel="yes"/>

<div>
Expand All @@ -444,6 +445,7 @@ extension-element-prefixes="ixsl"

<xsl:apply-templates select="." mode="bs2:DocumentBody">
<xsl:with-param name="mode" select="$mode"/>
<xsl:with-param name="about" select="$about"/>
</xsl:apply-templates>
</div>
</xsl:template>
Expand All @@ -454,7 +456,7 @@ extension-element-prefixes="ixsl"
<xsl:param name="id" as="xs:string?"/>
<xsl:param name="class" select="'document-body'" as="xs:string?"/>
<xsl:param name="mode" as="xs:anyURI"/>
<xsl:param name="about" select="ac:absolute-path(ldh:base-uri(.))" as="xs:anyURI"/>
<xsl:param name="about" as="xs:anyURI"/>
<xsl:param name="object-metadata" as="document-node()?" tunnel="yes"/>

<div>
Expand All @@ -464,9 +466,7 @@ extension-element-prefixes="ixsl"
<xsl:if test="$class">
<xsl:attribute name="class" select="$class"/>
</xsl:if>
<xsl:if test="$about">
<xsl:attribute name="about" select="$about"/>
</xsl:if>
<xsl:attribute name="about" select="$about"/>

<xsl:apply-templates select="." mode="bs2:ActionBar">
<xsl:with-param name="active-mode" select="$mode"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ exclude-result-prefixes="#all"
</xsl:function>

<xsl:function name="ldh:query-params" as="map(xs:string, xs:string*)">
<xsl:sequence select="ldh:parse-query-params(substring-after(ldh:request-uri(), '?'))"/>
<!-- ac:document-uri strips the URL's #fragment so it doesn't get glued onto the last query value -->
<xsl:sequence select="ldh:parse-query-params(substring-after(ac:document-uri(ldh:request-uri()), '?'))"/>
</xsl:function>

<xsl:function name="ldh:base-uri" as="xs:anyURI" use-when="system-property('xsl:product-name') = 'SAXON'">
Expand Down Expand Up @@ -329,7 +330,7 @@ exclude-result-prefixes="#all"

<xsl:function name="ldh:parse-query-params" as="map(xs:string, xs:string*)">
<xsl:param name="query-string" as="xs:string"/>

<xsl:sequence select="map:merge(
tokenize($query-string, '&amp;')[normalize-space()]
!
Expand Down Expand Up @@ -534,8 +535,8 @@ exclude-result-prefixes="#all"
<!-- subject resource -->
<xsl:template match="@rdf:about" mode="xhtml:Anchor">
<!-- <xsl:param name="graph" as="xs:anyURI?" tunnel="yes"/>-->
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="id" as="xs:string?"/>
<xsl:param name="title" select="." as="xs:string?"/>
<xsl:param name="class" as="xs:string?"/>
Expand All @@ -551,8 +552,8 @@ exclude-result-prefixes="#all"
</xsl:template>

<xsl:template match="@rdf:about | @rdf:resource" mode="svg:Anchor">
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="id" select="$fragment" as="xs:string?"/>
<xsl:param name="label" select="if (parent::rdf:Description) then ac:svg-label(..) else ac:svg-object-label(.)" as="xs:string"/>
<xsl:param name="title" select="$label" as="xs:string"/>
Expand All @@ -573,8 +574,8 @@ exclude-result-prefixes="#all"

<!-- proxy link URIs if they are external -->
<xsl:template match="@rdf:resource | srx:uri" priority="2">
<xsl:param name="fragment" select="if (starts-with(., ldt:base())) then (if (contains(., '#')) then substring-after(., '#') else ()) else encode-for-uri(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(xs:anyURI(.), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="fragment" select="ac:fragment-id(.)" as="xs:string?"/>
<xsl:param name="href" select="ldh:href(ac:document-uri(xs:anyURI(.)), map{}, $fragment)" as="xs:anyURI"/>
<xsl:param name="id" as="xs:string?"/>
<xsl:param name="title" select="." as="xs:string?"/>
<xsl:param name="class" as="xs:string?"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ exclude-result-prefixes="#all">
<xsl:with-param name="mode" select="ac:mode(root())"/>
<xsl:with-param name="base" select="ldt:base()"/>
<xsl:with-param name="endpoint" select="sd:endpoint()"/>
<xsl:with-param name="about" select="ac:absolute-path(ldh:base-uri(.))"/>
<xsl:with-param name="object-metadata" select="$object-metadata" tunnel="yes"/>
</xsl:apply-templates>
</div>
Expand Down
Loading
Loading