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/>
|
<show-page-title/>
|
||||||
</title>
|
</title>
|
||||||
<load-css-files/>
|
<load-css-files/>
|
||||||
|
<javascript-global-vars />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<include file="fragments/header-with-nav.xml"/>
|
<include file="fragments/header-with-nav.xml"/>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,15 @@
|
||||||
</foundry:doc-file-desc>
|
</foundry:doc-file-desc>
|
||||||
</foundry:doc-file>
|
</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"
|
<foundry:doc section="user"
|
||||||
type="template-tag">
|
type="template-tag">
|
||||||
<foundry:doc-desc>
|
<foundry:doc-desc>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
-->
|
-->
|
||||||
<load-css-files/>
|
<load-css-files/>
|
||||||
|
|
||||||
|
<javascript-global-vars />
|
||||||
|
|
||||||
<script type="text/javascript" src="js/jquery-1.11.3.min.js">
|
<script type="text/javascript" src="js/jquery-1.11.3.min.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -51,7 +53,8 @@
|
||||||
src="js/js.cookie.js">
|
src="js/js.cookie.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("figure.multiple a.image-attachments").fancybox({
|
$("figure.multiple a.image-attachments").fancybox({
|
||||||
arrows : true,
|
arrows : true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue