From 2d938f971ececa14f755f0e1f7f70c24192f912a Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 2 Mar 2021 12:15:46 +0530 Subject: [PATCH] prototype a replacement for the current help menu --- www/common/common-ui-elements.js | 37 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 8b5101fb7..b2e9229a9 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1092,29 +1092,30 @@ define([ return e; }; - UIElements.createHelpMenu = function (common, categories) { + UIElements.createHelpMenu = function (common /*, categories */) { var type = common.getMetadataMgr().getMetadata().type || 'pad'; - var elements = []; - if (Messages.help && Messages.help.generic) { - Object.keys(Messages.help.generic).forEach(function (el) { - elements.push(setHTML(h('li'), Messages.help.generic[el])); - }); - } - if (categories) { - categories.forEach(function (cat) { - var msgs = Messages.help[cat]; - if (msgs) { - Object.keys(msgs).forEach(function (el) { - elements.push(setHTML(h('li'), msgs[el])); - }); - } - }); + + var apps = { + pad: 'richtext', + code: 'code', + slide: 'slides', + sheet: 'sheets', + poll: 'poll', + kanban: 'kanban', + whiteboard: 'whiteboard', + }; + + var href = "https://docs.cryptpad.fr/en/user_guide/applications.html"; + if (apps[type]) { + href = "https://docs.cryptpad.fr/en/user_guide/apps/" + apps[type] + ".html"; } + var content = setHTML(h('p'), Messages.help.generic.more); + $(content).find('a').attr('href', href); + var text = h('p.cp-help-text', [ - h('h1', Messages.help.title), - h('ul', elements) + content ]); common.fixLinks(text);