Skip to content

Commit

Permalink
Pass $textarea-id to bs2:QueryForm
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 17, 2023
1 parent db30553 commit b308f44
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ exclude-result-prefixes="#all"
<!-- save chart -->

<xsl:template match="button[contains-token(@class, 'btn-save-chart')]" mode="ixsl:onclick">
<xsl:variable name="textarea-id" select="'query-string'" as="xs:string"/>
<xsl:variable name="textarea-id" select="'query-string'" as="xs:string"/> <!-- TO-DO: fix -->
<xsl:variable name="yasqe" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.yasqe'), $textarea-id)"/>
<xsl:variable name="query-string" select="ixsl:call($yasqe, 'getValue', [])" as="xs:string"/> <!-- get query string from YASQE -->
<xsl:variable name="service-uri" select="xs:anyURI(ixsl:get(id('query-service'), 'value'))" as="xs:anyURI?"/> <!-- TO-DO: fix content-embedded queries -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,12 +978,14 @@ LIMIT 100]]></sp:text>
</rdf:RDF>
</xsl:document>
</xsl:variable>
<xsl:variable name="textarea-id" select="'id' || ac:uuid()" as="xs:string"/>
<xsl:variable name="controls" as="node()*">
<xsl:call-template name="bs2:QueryForm">
<!-- <xsl:with-param name="mode" select="$mode"/>
<xsl:with-param name="service" select="$service"/>
<xsl:with-param name="endpoint" select="$endpoint"/>
<xsl:with-param name="query" select="$query"/>-->
<xsl:with-param name="textarea-id" select="$textarea-id"/>
<xsl:with-param name="default-query" select="$default-query"/>
</xsl:call-template>
</xsl:variable>
Expand Down Expand Up @@ -1021,8 +1023,8 @@ LIMIT 100]]></sp:text>
</div>
</xsl:result-document>

<!-- initialize wymeditor textarea -->
<xsl:apply-templates select="key('elements-by-class', 'wymeditor', .)" mode="ldh:PostConstruct"/>
<!-- initialize yasqe textarea -->
<xsl:variable name="yasqe" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.yasqe'), $textarea-id)"/>
</xsl:for-each>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ LIMIT 100</xsl:param>
<xsl:param name="class" as="xs:string?"/>
<xsl:param name="accept-charset" select="'UTF-8'" as="xs:string?"/>
<xsl:param name="enctype" as="xs:string?"/>
<xsl:param name="textarea-id" as="xs:string"/>
<!--<xsl:param name="uri" as="xs:anyURI?"/>-->
<xsl:param name="mode" as="xs:anyURI*"/>
<xsl:param name="service" as="xs:anyURI?"/>
Expand Down Expand Up @@ -117,7 +118,11 @@ LIMIT 100</xsl:param>
</option>
</select>

<textarea id="query-string" name="query" class="span12" rows="15">
<textarea name="query" class="span12" rows="15">
<xsl:if test="$textarea-id">
<xsl:attribute name="textarea-id" select="$textarea-id"/>
</xsl:if>

<xsl:value-of select="if ($query) then $query else $default-query"/>
</textarea>

Expand Down Expand Up @@ -162,7 +167,7 @@ LIMIT 100</xsl:param>

<xsl:template match="form[contains-token(@class, 'form-open-query')]" mode="ixsl:onsubmit" priority="1">
<xsl:param name="container" select="id('content-body', ixsl:page())" as="element()"/>
<xsl:variable name="textarea-id" select="'query-string'" as="xs:string"/>
<xsl:variable name="textarea-id" select="'query-string'" as="xs:string"/> <!-- TO-DO: fix -->
<xsl:variable name="form" select="." as="element()"/>
<xsl:variable name="query" select="$form//input[@name = 'query']/ixsl:get(., 'value')" as="xs:string"/>
<xsl:variable name="service" select="$form//input[@name = 'service']/ixsl:get(., 'value')" as="xs:anyURI?"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ WHERE
<xsl:param name="category" as="xs:string?"/>
<xsl:param name="series" as="xs:string*"/>
<xsl:param name="push-state" select="true()" as="xs:boolean"/>
<xsl:param name="textarea-id" select="'query-string'" as="xs:string"/>
<xsl:param name="textarea-id" select="'query-string'" as="xs:string"/> <!-- TO-DO: fix -->
<xsl:param name="query" as="xs:string?"/>
<xsl:param name="endpoint" as="xs:anyURI?"/>
<xsl:param name="content-method" select="xs:QName('ixsl:replace-content')" as="xs:QName"/>
Expand Down

0 comments on commit b308f44

Please sign in to comment.