Skip to content

Commit 67004fc

Browse files
committed
WYMEditor cross-origin fix
1 parent 0f4168e commit 67004fc

File tree

1 file changed

+5
-2
lines changed
  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client

1 file changed

+5
-2
lines changed

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/form.xsl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ WHERE
140140
</xsl:template>
141141

142142
<xsl:template match="textarea[contains-token(@class, 'wymeditor')]" mode="ldh:RenderRowForm" priority="1">
143-
<!-- call .wymeditor() on textarea to show WYMEditor -->
144-
<xsl:sequence select="ixsl:call(ixsl:call(ixsl:window(), 'jQuery', [ . ]), 'wymeditor', [])[current-date() lt xs:date('2000-01-01')]"/>
143+
<!-- call .wymeditor() on textarea to show WYMEditor with current origin's iframe path -->
144+
<xsl:variable name="iframe-base-path" select="resolve-uri('static/com/atomgraph/linkeddatahub/js/wymeditor/iframe/default/', ldt:base())" as="xs:anyURI"/>
145+
<xsl:variable name="wymeditor-config" select="ldh:new-object()"/>
146+
<ixsl:set-property name="iframeBasePath" select="$iframe-base-path" object="$wymeditor-config"/>
147+
<xsl:sequence select="ixsl:call(ixsl:call(ixsl:window(), 'jQuery', [ . ]), 'wymeditor', [ $wymeditor-config ])[current-date() lt xs:date('2000-01-01')]"/>
145148
<xsl:variable name="wymeditor" select="ixsl:call(ixsl:get(ixsl:window(), 'jQuery'), 'getWymeditorByTextarea', [ . ])" as="item()"/>
146149
<xsl:variable name="char-count" select="sum(.//text()/string-length())" as="xs:integer"/>
147150
<xsl:variable name="iframe" select="ixsl:get($wymeditor, '_iframe')" as="element()"/>

0 commit comments

Comments
 (0)