Loading rxq/html.xqm +12 −17 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ declare function max.html:render( 'projectId' : $projectId, 'prettyName' : max.config:getProjectPrettyName($projectId), 'data' : max.config:getProjectData($projectId), 'baseURI' : max.config:getBaseURI(), 'home' : max.config:getBaseURI() || $projectId || '/accueil.html', 'baseURI' : max.util:getRelativeRootPath($projectId), 'home' : max.util:getRelativeRootPath($projectId) || 'accueil.html', 'menu' : $menu, 'navigationSelect' : $navigationSelect, 'textOptions' : $textOptions, Loading Loading @@ -102,8 +102,7 @@ Generates global js script import tags declare %private function max.html:buildJavascript($projectId, $pageId, $fragmentId){ <script type="text/javascript"> const rootURI = "{substring-before(max.config:getBaseURI(), $max.cons:BASE_DIR)}"; const baseURI="{max.config:getBaseURI()}"; const baseURI="{max.util:getRelativeRootPath($projectId)}"; const projectId="{$projectId}"; const route ="{$pageId}"; const fragmentId ="{$fragmentId}"; Loading @@ -124,18 +123,14 @@ as element(script)* if (file:exists( file:parent(file:parent(static-base-uri())) || "/editions/" || $projectId || "/ui/js/" || $projectId || ".js")) then <script type="text/javascript" src='{max.config:getBaseURI() || $projectId || "/ui/js/" || $projectId || ".js"}'/> else if (file:exists( file:parent(file:parent(static-base-uri())) || $projectId || "/ui/js/" || $projectId || ".js")) then <script type="text/javascript" src='{max.config:getBaseURI() || $projectId || "/ui/js/" || $projectId || ".js"}'/> src='{max.util:getRelativeRootPath($projectId) || "ui/js/" || $projectId || ".js"}'/> else () let $pluginsFolder := file:parent(file:parent(static-base-uri())) || $max.cons:PLUGIN_FOLDER_NAME let $pluginsJS := for $plugin in max.config:getEnabledPluginNames($projectId) for $file in file:list($pluginsFolder || "/" || $plugin, true(), $plugin||".js") let $publicjs := max.config:getBaseURI() || "plugins/" || $plugin || '/' || let $publicjs := max.util:getRelativeRootPath($projectId) || "plugins/" || $plugin || '/' || substring-before($file, ".") || ".js" return <script type="module" Loading @@ -160,7 +155,7 @@ as element(link)* if (file:exists(file:parent(file:parent(static-base-uri())) || '/editions/' || $projectId || "/ui/css/" || $projectId || '.css')) then <link rel="stylesheet" type="text/css" href="{max.config:getBaseURI() || $projectId || '/ui/css/' || $projectId || '.css'}"/> href="{max.util:getRelativeRootPath($projectId)|| 'ui/css/' || $projectId || '.css'}"/> else () let $pluginsCSS := Loading @@ -171,7 +166,7 @@ as element(link)* then <link rel="stylesheet" type="text/css" href="{max.config:getBaseURI() || "plugins/" || $pluginAddon || '/' || $pluginAddon || '.css'}"/> href="{max.util:getRelativeRootPath($projectId)|| "plugins/" || $pluginAddon || '/' || $pluginAddon || '.css'}"/> else () return ($pluginsCSS, $cssProject) Loading @@ -184,7 +179,7 @@ declare %private function max.html:buildMenu( $fragmentId as xs:string ?) as item()+ { let $params := map {'projectId' : $projectId, 'selectedTarget' : $menuId||'.html', 'baseURI' : max.config:getBaseURI()} let $params := map {'projectId' : $projectId, 'selectedTarget' : $menuId||'.html', 'baseURI' : max.util:getRelativeRootPath(())} (:menu translation:) let $translatedXmlMenu := copy $c := doc("../editions/" || $projectId || "/" || $max.cons:MENU_FILE) Loading Loading @@ -243,8 +238,8 @@ declare function max.html:getFooter($project){ } catch * { <footer> <img id='biblissima' class='footer-logos' src='{max.config:getBaseURI()}core/ui/images/logos/biblissima.png'/> <img id='invav' class='footer-logos' src='{max.config:getBaseURI()}core/ui/images/logos/investissement-davenir.png'/> <img id='biblissima' class='footer-logos' src='{max.util:getRelativeRootPath($project)}core/ui/images/logos/biblissima.png'/> <img id='invav' class='footer-logos' src='{max.util:getRelativeRootPath($project)}core/ui/images/logos/investissement-davenir.png'/> </footer> } }; Loading @@ -263,7 +258,7 @@ declare function max.html:getNavbarForDocument($project, $doc, $selectedId){ map { 'selectedId' : $selectedId, 'project' : $project, 'baseuri' : max.config:getBaseURI(), 'baseuri' : max.util:getRelativeRootPath($project), 'prevArrow' : $selectedId != string(($xml//ul//li/@data-target)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@data-target)[last()]) } Loading Loading @@ -376,7 +371,7 @@ declare function max.html:invokePluginXQueries($project, $routeDoc, $id){ xquery:eval(xs:anyURI($pluginXQ), map { 'baseURI' : max.config:getBaseURI(), 'baseURI' : max.util:getRelativeRootPath(()), 'dbPath': $dbPath, 'project' : $project, 'doc' : $routeDoc, Loading Loading
rxq/html.xqm +12 −17 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ declare function max.html:render( 'projectId' : $projectId, 'prettyName' : max.config:getProjectPrettyName($projectId), 'data' : max.config:getProjectData($projectId), 'baseURI' : max.config:getBaseURI(), 'home' : max.config:getBaseURI() || $projectId || '/accueil.html', 'baseURI' : max.util:getRelativeRootPath($projectId), 'home' : max.util:getRelativeRootPath($projectId) || 'accueil.html', 'menu' : $menu, 'navigationSelect' : $navigationSelect, 'textOptions' : $textOptions, Loading Loading @@ -102,8 +102,7 @@ Generates global js script import tags declare %private function max.html:buildJavascript($projectId, $pageId, $fragmentId){ <script type="text/javascript"> const rootURI = "{substring-before(max.config:getBaseURI(), $max.cons:BASE_DIR)}"; const baseURI="{max.config:getBaseURI()}"; const baseURI="{max.util:getRelativeRootPath($projectId)}"; const projectId="{$projectId}"; const route ="{$pageId}"; const fragmentId ="{$fragmentId}"; Loading @@ -124,18 +123,14 @@ as element(script)* if (file:exists( file:parent(file:parent(static-base-uri())) || "/editions/" || $projectId || "/ui/js/" || $projectId || ".js")) then <script type="text/javascript" src='{max.config:getBaseURI() || $projectId || "/ui/js/" || $projectId || ".js"}'/> else if (file:exists( file:parent(file:parent(static-base-uri())) || $projectId || "/ui/js/" || $projectId || ".js")) then <script type="text/javascript" src='{max.config:getBaseURI() || $projectId || "/ui/js/" || $projectId || ".js"}'/> src='{max.util:getRelativeRootPath($projectId) || "ui/js/" || $projectId || ".js"}'/> else () let $pluginsFolder := file:parent(file:parent(static-base-uri())) || $max.cons:PLUGIN_FOLDER_NAME let $pluginsJS := for $plugin in max.config:getEnabledPluginNames($projectId) for $file in file:list($pluginsFolder || "/" || $plugin, true(), $plugin||".js") let $publicjs := max.config:getBaseURI() || "plugins/" || $plugin || '/' || let $publicjs := max.util:getRelativeRootPath($projectId) || "plugins/" || $plugin || '/' || substring-before($file, ".") || ".js" return <script type="module" Loading @@ -160,7 +155,7 @@ as element(link)* if (file:exists(file:parent(file:parent(static-base-uri())) || '/editions/' || $projectId || "/ui/css/" || $projectId || '.css')) then <link rel="stylesheet" type="text/css" href="{max.config:getBaseURI() || $projectId || '/ui/css/' || $projectId || '.css'}"/> href="{max.util:getRelativeRootPath($projectId)|| 'ui/css/' || $projectId || '.css'}"/> else () let $pluginsCSS := Loading @@ -171,7 +166,7 @@ as element(link)* then <link rel="stylesheet" type="text/css" href="{max.config:getBaseURI() || "plugins/" || $pluginAddon || '/' || $pluginAddon || '.css'}"/> href="{max.util:getRelativeRootPath($projectId)|| "plugins/" || $pluginAddon || '/' || $pluginAddon || '.css'}"/> else () return ($pluginsCSS, $cssProject) Loading @@ -184,7 +179,7 @@ declare %private function max.html:buildMenu( $fragmentId as xs:string ?) as item()+ { let $params := map {'projectId' : $projectId, 'selectedTarget' : $menuId||'.html', 'baseURI' : max.config:getBaseURI()} let $params := map {'projectId' : $projectId, 'selectedTarget' : $menuId||'.html', 'baseURI' : max.util:getRelativeRootPath(())} (:menu translation:) let $translatedXmlMenu := copy $c := doc("../editions/" || $projectId || "/" || $max.cons:MENU_FILE) Loading Loading @@ -243,8 +238,8 @@ declare function max.html:getFooter($project){ } catch * { <footer> <img id='biblissima' class='footer-logos' src='{max.config:getBaseURI()}core/ui/images/logos/biblissima.png'/> <img id='invav' class='footer-logos' src='{max.config:getBaseURI()}core/ui/images/logos/investissement-davenir.png'/> <img id='biblissima' class='footer-logos' src='{max.util:getRelativeRootPath($project)}core/ui/images/logos/biblissima.png'/> <img id='invav' class='footer-logos' src='{max.util:getRelativeRootPath($project)}core/ui/images/logos/investissement-davenir.png'/> </footer> } }; Loading @@ -263,7 +258,7 @@ declare function max.html:getNavbarForDocument($project, $doc, $selectedId){ map { 'selectedId' : $selectedId, 'project' : $project, 'baseuri' : max.config:getBaseURI(), 'baseuri' : max.util:getRelativeRootPath($project), 'prevArrow' : $selectedId != string(($xml//ul//li/@data-target)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@data-target)[last()]) } Loading Loading @@ -376,7 +371,7 @@ declare function max.html:invokePluginXQueries($project, $routeDoc, $id){ xquery:eval(xs:anyURI($pluginXQ), map { 'baseURI' : max.config:getBaseURI(), 'baseURI' : max.util:getRelativeRootPath(()), 'dbPath': $dbPath, 'project' : $project, 'doc' : $routeDoc, Loading