Commit 05426f7b authored by Jérôme Chauveau's avatar Jérôme Chauveau
Browse files

side_toc route + js fetch test

parent bb0fcf6c
Loading
Loading
Loading
Loading
+3
Changes for plugins/side_toc/side_toc.js: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ class SideTocPlugin extends Plugin{

  run(){
    console.log("plugin side toc running");

    fetch(`${baseURI}side_toc.html?doc=${route}`).then((res) => console.debug(res))

    // if(document.getElementById('text') && document.getElementById(fragmentId)){
    if(document.getElementById('text') && fragmentId){
        this.highlightTreeNode('details_'+fragmentId)
−14

File deleted.

+12
Changes for plugins/side_toc/side_toc.xqm: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
module namespace max.plugin.side_toc = 'pddn/max/plugin/side_toc';
import module namespace max.toc = 'pddn/max/toc' at '../../rxq/toc.xqm';
declare
%rest:GET
%output:method("html")
%rest:query-param("doc", "{$doc}")
%rest:path("/{$project}/side_toc.html")
function max.plugin.side_toc:toc($project, $doc){
    let $toc := max.toc:getDocumentTOC($project, $doc)
(:    let $input := <input type="hidden" name="currentTocItem" value="{$project}/{$doc}/{$id}"></input>:)
    return <div class='side-toc'>{$toc}</div>
};
 No newline at end of file