Loading plugins/pager/pager.xqm +10 −9 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ declare %rest:GET %output:method("html") %output:indent("no") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}.html") function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $n as xs:integer){ let $routeDoc := if(starts-with($route,'doc/')) then tokenize($route, 'doc/')[last()] Loading @@ -38,11 +38,12 @@ function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $ let $html := xslt:transform($xml, $xsltDoc, $xsltParams) (:return max.config:getXSLTAddons($project, $route):) let $res := <div id='pagerBlocks'> let $res := <div id='text'> <div id='pagerBlocks'> <h2 class="subpart titreVolume">{$transformedTitle}</h2> {$navLinks} {$html} </div> </div></div> return max.html:render($project, $route, $res) }; Loading @@ -50,7 +51,7 @@ function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $ declare %rest:GET %output:method("html") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}/{$id}") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}/{$id}.html") function max.plugin.pager:paginateWithTarget($project as xs:string, $route as xs:string, $n as xs:integer, $id){ let $html := max.plugin.pager:paginate($project, $route, $n) return copy $c := $html Loading Loading @@ -94,15 +95,15 @@ declare function max.plugin.pager:paginateNodes( let $navLinks := <div id="pagerNav"> {if($startPage = 1) (:adds first page link if needed:) then () else <a id="firstPage" href="{$hrefPrefixPath || '1'}"><<</a> else <a id="firstPage" href="{$hrefPrefixPath || '1'}.html"><<</a> } {for $i in (xs:integer($startPage) to xs:integer($endPage)) return <a href="{$hrefPrefixPath || $i}" href="{$hrefPrefixPath || $i}.html" class="{if($i=$currentPage) then 'curPageLink' else 'pageLink'}">{$i}</a>} { if($endPage = $nbPages) (:adds last page link if needed:) then () else <a id="lastPage" href="{$hrefPrefixPath || $nbPages}">>></a> else <a id="lastPage" href="{$hrefPrefixPath || $nbPages}.html">>></a> } </div> (:queries current page's blocks:) Loading Loading
plugins/pager/pager.xqm +10 −9 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ declare %rest:GET %output:method("html") %output:indent("no") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}.html") function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $n as xs:integer){ let $routeDoc := if(starts-with($route,'doc/')) then tokenize($route, 'doc/')[last()] Loading @@ -38,11 +38,12 @@ function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $ let $html := xslt:transform($xml, $xsltDoc, $xsltParams) (:return max.config:getXSLTAddons($project, $route):) let $res := <div id='pagerBlocks'> let $res := <div id='text'> <div id='pagerBlocks'> <h2 class="subpart titreVolume">{$transformedTitle}</h2> {$navLinks} {$html} </div> </div></div> return max.html:render($project, $route, $res) }; Loading @@ -50,7 +51,7 @@ function max.plugin.pager:paginate($project as xs:string, $route as xs:string, $ declare %rest:GET %output:method("html") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}/{$id}") %rest:path("/{$project}/{$route=.*\.xml}/page/{$n}/{$id}.html") function max.plugin.pager:paginateWithTarget($project as xs:string, $route as xs:string, $n as xs:integer, $id){ let $html := max.plugin.pager:paginate($project, $route, $n) return copy $c := $html Loading Loading @@ -94,15 +95,15 @@ declare function max.plugin.pager:paginateNodes( let $navLinks := <div id="pagerNav"> {if($startPage = 1) (:adds first page link if needed:) then () else <a id="firstPage" href="{$hrefPrefixPath || '1'}"><<</a> else <a id="firstPage" href="{$hrefPrefixPath || '1'}.html"><<</a> } {for $i in (xs:integer($startPage) to xs:integer($endPage)) return <a href="{$hrefPrefixPath || $i}" href="{$hrefPrefixPath || $i}.html" class="{if($i=$currentPage) then 'curPageLink' else 'pageLink'}">{$i}</a>} { if($endPage = $nbPages) (:adds last page link if needed:) then () else <a id="lastPage" href="{$hrefPrefixPath || $nbPages}">>></a> else <a id="lastPage" href="{$hrefPrefixPath || $nbPages}.html">>></a> } </div> (:queries current page's blocks:) Loading