diff options
author | hubzilla <git@macgirvin.com> | 2016-07-01 11:57:48 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-01 11:57:48 +1000 |
commit | eef8f3b417ef90977649b1a39c98f299be4b5bce (patch) | |
tree | b6684b05aee92729406a90f397ccd446f58863c7 /view/tpl | |
parent | 852b2659e9a71f0542e822aa20efc009e22ff66a (diff) | |
parent | 0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61 (diff) | |
download | volse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.tar.gz volse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.tar.bz2 volse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.zip |
Merge pull request #445 from anaqreon/wiki
Table of contents with links is generated if [toc] is found in Markdown text
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.'); } |