From 6c388575022cc10f28ed99e8e414fbc76a67bb00 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Wed, 23 Aug 2017 03:33:03 +0000 Subject: Repaired and extended support for help page translations including table of contents files at the top level. Moved help module javascript to mod_help.js. --- view/js/mod_help.js | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 view/js/mod_help.js (limited to 'view/js') diff --git a/view/js/mod_help.js b/view/js/mod_help.js new file mode 100644 index 000000000..0f85af462 --- /dev/null +++ b/view/js/mod_help.js @@ -0,0 +1,74 @@ +function docoTocToggle() { + if ($('#doco-top-toc').is(':visible')) { + $('#doco-toc-toggle').removeClass('fa-cog').addClass('fa-caret-right'); + } else { + $('#doco-toc-toggle').removeClass('fa-caret-right').addClass('fa-caret-down'); + } + $('#doco-top-toc').toggle(); + + return false; +} + +toc = {}; +// Generate the table of contents in the side nav menu (see view/tpl/help.tpl) +$(document).ready(function () { + // Generate the table of contents in the side nav menu (see view/tpl/help.tpl) + $('#doco-top-toc').toc({content: "#doco-content", headings: "h3,h4,h5,h6"}); + + $(".doco-section").find('a').each(function () { + var url = document.createElement('a'); + url.href = window.location; + var pageName = url.href.split('/').pop().split('#').shift().split('?').shift(); + var linkName = $(this).attr('href').split('/').pop(); + if (pageName === linkName) { + var tocUl = $(this).closest('a').append('