Loading max.xq +1 −1 Changes for max.xq: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ declare %private function max:applySearchMarkup($html as node(), $search as xs:s let $markedHtml := if ($search) then max.util:markSearchedText($html, $search, ()) max.util:markSearchedText($html, $search, $focusTarget) else $html let $focusedHtml := Loading plugins/search/search.xqm +4 −2 Changes for plugins/search/search.xqm: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -95,7 +95,9 @@ function max.plugin.search:search($project,$search, $docs as item()*){ let $docList := if(count($docs) > 0(: = $max.plugin.search:ALL_TXT:)) then $docs else for $d in collection($dbPath) return base-uri($d) else for $d in collection($dbPath) where not(max.config:isIgnored(replace(base-uri($d), ".+/([^/]+)$", "$1"), $project)) return base-uri($d) for $docPath in $docList let $res := Loading @@ -103,7 +105,7 @@ function max.plugin.search:search($project,$search, $docs as item()*){ let $hits := for $hit in ft:mark($h[.//text() contains text {$search}]) let $path := replace($docPath, $dbPath||"/", '') let $b2txt:= max.config:getBaseURI() ||$project ||$path||"/"|| string($h/@xml:id) let $b2txt:= max.config:getBaseURI() ||$project ||$path||"/"|| string($h/@xml:id)||'.html' return <div class='hit'> <span class='search-b2txt'><a href='{$b2txt}'>{string($h/@xml:id)}</a></span> <div>{$hit}</div> Loading rxq/html.xqm +2 −2 Changes for rxq/html.xqm: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -249,8 +249,8 @@ declare function max.html:getNavbarForDocument($project, $doc, $selectedId){ 'selectedId' : $selectedId, 'project' : $project, 'baseuri' : max.config:getBaseURI(), 'prevArrow' : $selectedId != string(($xml//ul//li/@id)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@id)[last()]) 'prevArrow' : $selectedId != string(($xml//ul//li/@data-target)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@data-target)[last()]) } )/*[1] else () Loading rxq/util.xqm +4 −2 Changes for rxq/util.xqm: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -305,7 +305,8 @@ declare function max.util:getDocumentTitleXQueryFile($xmlFormat as xs:string){ Returns project's doc toc XSL :) declare function max.util:getProjectDocumentTOCXSL($projectId){ let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/"|| $max.cons:DOCUMENT_TOC_XSL_FILEPATH let $xmlFormat:=max.config:getXMLFormat($projectId) let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/" || $xmlFormat|| "/" || $max.cons:DOCUMENT_TOC_XSL_FILEPATH return if(file:exists($xsltFile)) then $xsltFile else file:parent(file:parent(static-base-uri())) || "ui/xsl/" || max.config:getXMLFormat($projectId) ||'/'|| $max.cons:DOCUMENT_TOC_XSL_FILEPATH Loading @@ -317,11 +318,12 @@ declare function max.util:getProjectLayoutTemplate($projectId) { return if(file:exists($customTemplate)) then $customTemplate else if (doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/template) then file:parent(file:parent(static-base-uri())) || "editions/" || doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/template/@file else "../ui/templates/"||max.config:getXMLFormat($projectId) ||".html" }; (: Returns project's default XSLT to apply on text :) Loading ui/js/MaxTEI.js +2 −1 Changes for ui/js/MaxTEI.js: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -110,8 +110,9 @@ class MaxTEI extends AbstractMax { //local function : find next or previous nav link let nextOrPrevious = function (step) { let current = $("#navigation-tool").find('button').attr("data-target").replace("selected-", "");//remove 'selected' prefix let newCurrent = current.replaceAll(".", "\\.") let links = $('#dropdown-navigation').find('li'); let position = links.index(document.querySelector('li[data-target='+current+']')); let position = links.index(document.querySelector('li[data-target='+newCurrent+']')); console.log(position); let nextOrPrevious = links.get(position + step); window.location.href = $(nextOrPrevious).find('a').attr("href"); Loading Loading
max.xq +1 −1 Changes for max.xq: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ declare %private function max:applySearchMarkup($html as node(), $search as xs:s let $markedHtml := if ($search) then max.util:markSearchedText($html, $search, ()) max.util:markSearchedText($html, $search, $focusTarget) else $html let $focusedHtml := Loading
plugins/search/search.xqm +4 −2 Changes for plugins/search/search.xqm: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -95,7 +95,9 @@ function max.plugin.search:search($project,$search, $docs as item()*){ let $docList := if(count($docs) > 0(: = $max.plugin.search:ALL_TXT:)) then $docs else for $d in collection($dbPath) return base-uri($d) else for $d in collection($dbPath) where not(max.config:isIgnored(replace(base-uri($d), ".+/([^/]+)$", "$1"), $project)) return base-uri($d) for $docPath in $docList let $res := Loading @@ -103,7 +105,7 @@ function max.plugin.search:search($project,$search, $docs as item()*){ let $hits := for $hit in ft:mark($h[.//text() contains text {$search}]) let $path := replace($docPath, $dbPath||"/", '') let $b2txt:= max.config:getBaseURI() ||$project ||$path||"/"|| string($h/@xml:id) let $b2txt:= max.config:getBaseURI() ||$project ||$path||"/"|| string($h/@xml:id)||'.html' return <div class='hit'> <span class='search-b2txt'><a href='{$b2txt}'>{string($h/@xml:id)}</a></span> <div>{$hit}</div> Loading
rxq/html.xqm +2 −2 Changes for rxq/html.xqm: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -249,8 +249,8 @@ declare function max.html:getNavbarForDocument($project, $doc, $selectedId){ 'selectedId' : $selectedId, 'project' : $project, 'baseuri' : max.config:getBaseURI(), 'prevArrow' : $selectedId != string(($xml//ul//li/@id)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@id)[last()]) 'prevArrow' : $selectedId != string(($xml//ul//li/@data-target)[1]), 'nextArrow' : $selectedId != string(($xml//ul//li/@data-target)[last()]) } )/*[1] else () Loading
rxq/util.xqm +4 −2 Changes for rxq/util.xqm: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -305,7 +305,8 @@ declare function max.util:getDocumentTitleXQueryFile($xmlFormat as xs:string){ Returns project's doc toc XSL :) declare function max.util:getProjectDocumentTOCXSL($projectId){ let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/"|| $max.cons:DOCUMENT_TOC_XSL_FILEPATH let $xmlFormat:=max.config:getXMLFormat($projectId) let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/" || $xmlFormat|| "/" || $max.cons:DOCUMENT_TOC_XSL_FILEPATH return if(file:exists($xsltFile)) then $xsltFile else file:parent(file:parent(static-base-uri())) || "ui/xsl/" || max.config:getXMLFormat($projectId) ||'/'|| $max.cons:DOCUMENT_TOC_XSL_FILEPATH Loading @@ -317,11 +318,12 @@ declare function max.util:getProjectLayoutTemplate($projectId) { return if(file:exists($customTemplate)) then $customTemplate else if (doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/template) then file:parent(file:parent(static-base-uri())) || "editions/" || doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/template/@file else "../ui/templates/"||max.config:getXMLFormat($projectId) ||".html" }; (: Returns project's default XSLT to apply on text :) Loading
ui/js/MaxTEI.js +2 −1 Changes for ui/js/MaxTEI.js: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -110,8 +110,9 @@ class MaxTEI extends AbstractMax { //local function : find next or previous nav link let nextOrPrevious = function (step) { let current = $("#navigation-tool").find('button').attr("data-target").replace("selected-", "");//remove 'selected' prefix let newCurrent = current.replaceAll(".", "\\.") let links = $('#dropdown-navigation').find('li'); let position = links.index(document.querySelector('li[data-target='+current+']')); let position = links.index(document.querySelector('li[data-target='+newCurrent+']')); console.log(position); let nextOrPrevious = links.get(position + step); window.location.href = $(nextOrPrevious).find('a').attr("href"); Loading