diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:50:38 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:50:38 -0400 |
commit | 7124c0aee5486aab74272c81ceb3e383b2e3a7f7 (patch) | |
tree | d556c7638dbfbc1deef6a2ff10c2105fa2c18dd7 /view/tpl | |
parent | 81da9f99e4ee111623a1ba302a6ab18e369756e9 (diff) | |
download | volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.tar.gz volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.tar.bz2 volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.zip |
Replace homemade table of content generator with existing jQuery plugin. Now toc is linked to document headings.
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 1d8570828..7617808f4 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -190,6 +190,7 @@ $(document).ready(function () { wiki_refresh_page_list(); + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); // Show Edit tab first. Otherwise the Ace editor does not load. $("#wiki-nav-tabs li:eq(1) a").tab('show'); }); @@ -203,6 +204,7 @@ $.post("wiki/{{$channel}}/preview", {content: editor.getValue(), resource_id: window.wiki_resource_id}, function (data) { if (data.success) { $('#wiki-preview').html(data.html); + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); } else { window.console.log('Error previewing page.'); } |