Skip to content

Commit

Permalink
Chart onchange fixes
Browse files Browse the repository at this point in the history
Scroll elements that fail validation into view
  • Loading branch information
namedgraph committed Nov 24, 2023
1 parent 7858b37 commit ad44db3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ exclude-result-prefixes="#all"
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="container" select="ancestor::div[@about][1]" as="element()?"/>
<xsl:variable name="content-uri" select="xs:anyURI($container/@about)" as="xs:anyURI"/>
<xsl:variable name="container" select="ancestor::div[contains-token(@class, 'sparql-content')]" as="element()?"/>
<xsl:variable name="content-uri" select="if ($container/@about) then $container/@about else xs:anyURI(ac:absolute-path(base-uri()) || '#' || $content-id)" as="xs:anyURI"/>
<xsl:variable name="chart-canvas-id" select="ancestor::form/following-sibling::div/@id" as="xs:string"/>
<xsl:variable name="results" select="if (ixsl:contains(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results')) then ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results') else root(ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'content'))" as="document-node()"/>

Expand Down Expand Up @@ -244,8 +244,8 @@ exclude-result-prefixes="#all"
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="container" select="ancestor::div[@about][1]" as="element()?"/>
<xsl:variable name="content-uri" select="xs:anyURI($container/@about)" as="xs:anyURI"/>
<xsl:variable name="container" select="ancestor::div[contains-token(@class, 'sparql-content')]" as="element()?"/>
<xsl:variable name="content-uri" select="if ($container/@about) then $container/@about else xs:anyURI(ac:absolute-path(base-uri()) || '#' || $content-id)" as="xs:anyURI"/>
<xsl:variable name="chart-canvas-id" select="ancestor::form/following-sibling::div/@id" as="xs:string"/>
<xsl:variable name="results" select="if (ixsl:contains(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results')) then ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results') else root(ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'content'))" as="document-node()"/>

Expand Down Expand Up @@ -274,8 +274,8 @@ exclude-result-prefixes="#all"
<xsl:sequence select="ixsl:get(ixsl:call(ixsl:get($select, 'selectedOptions'), 'item', [ . ]), 'value')"/>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="container" select="ancestor::div[@about][1]" as="element()?"/>
<xsl:variable name="content-uri" select="xs:anyURI($container/@about)" as="xs:anyURI"/>
<xsl:variable name="container" select="ancestor::div[contains-token(@class, 'sparql-content')]" as="element()?"/>
<xsl:variable name="content-uri" select="if ($container/@about) then $container/@about else xs:anyURI(ac:absolute-path(base-uri()) || '#' || $content-id)" as="xs:anyURI"/>
<xsl:variable name="chart-canvas-id" select="ancestor::form/following-sibling::div/@id" as="xs:string"/>
<xsl:variable name="results" select="if (ixsl:contains(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results')) then ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'results') else root(ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $content-uri || '`'), 'content'))" as="document-node()"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,18 @@ exclude-result-prefixes="#all"
<xsl:choose>
<!-- query string value missing/invalid, throw an error -->
<xsl:when test="not($query-string) or not($query-type)">
<ixsl:set-style name="border-color" select="'#ff0039'" object="$textarea/following-sibling::div[contains-token(@class, 'CodeMirror')]"/> <!-- YASQE container -->
<xsl:for-each select="$textarea/following-sibling::div[contains-token(@class, 'CodeMirror')]"> <!-- YASQE container -->
<ixsl:set-style name="border-color" select="'#ff0039'"/>
<xsl:sequence select="ixsl:call(., 'scrollIntoView', [])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:for-each>
<ixsl:set-style name="border-color" select="()" object="$title-input"/>
</xsl:when>
<!-- query title value missing, throw an error -->
<xsl:when test="not($title-input/ixsl:get(., 'value'))">
<ixsl:set-style name="border-color" select="'#ff0039'" object="$title-input"/>
<xsl:for-each select="$title-input">
<ixsl:set-style name="border-color" select="'#ff0039'"/>
<xsl:sequence select="ixsl:call(., 'scrollIntoView', [])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:for-each>
<ixsl:set-style name="border-color" select="()" object="$textarea/following-sibling::div[contains-token(@class, 'CodeMirror')]"/> <!-- YASQE container -->
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit ad44db3

Please sign in to comment.