Foundry now provides the <javascript-global-vars /> which can be used in a layout template to create a JavaScript which makes global variables from the XSL also available in JavaScript, for example the dispatcher-prefix.
git-svn-id: https://svn.libreccm.org/ccm/trunk@4828 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
d55b475ae2
commit
7a026a90ec
|
|
@ -7,6 +7,7 @@
|
|||
<show-page-title/>
|
||||
</title>
|
||||
<load-css-files/>
|
||||
<javascript-global-vars />
|
||||
</head>
|
||||
<body>
|
||||
<include file="fragments/header-with-nav.xml"/>
|
||||
|
|
@ -18,4 +19,4 @@
|
|||
</main>
|
||||
<include file="fragments/footer.xml"/>
|
||||
</body>
|
||||
</page-layout>
|
||||
</page-layout>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,16 @@
|
|||
</p>
|
||||
</foundry:doc-file-desc>
|
||||
</foundry:doc-file>
|
||||
|
||||
|
||||
<xsl:template match="javascript-global-vars">
|
||||
<script>
|
||||
<xsl:value-of select="concat('const contextPrefix = "', $context-prefix, '"; ')" />
|
||||
<xsl:value-of select="concat('const dispatcherPrefix = "', $dispatcher-prefix, '"; ')" />
|
||||
<xsl:value-of select="concat('const themePrefix = "', $theme-prefix, '"; ')" />
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<foundry:doc section="user"
|
||||
type="template-tag">
|
||||
<foundry:doc-desc>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
-->
|
||||
<load-css-files/>
|
||||
|
||||
<javascript-global-vars />
|
||||
|
||||
<script type="text/javascript" src="js/jquery-1.11.3.min.js">
|
||||
</script>
|
||||
|
||||
|
|
@ -50,8 +52,9 @@
|
|||
<script type="text/javascript"
|
||||
src="js/js.cookie.js">
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("figure.multiple a.image-attachments").fancybox({
|
||||
arrows : true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue