prototype a replacement for the current help menu

pull/1/head
ansuz 4 years ago
parent c691e6f49c
commit 2d938f971e

@ -1092,29 +1092,30 @@ define([
return e; return e;
}; };
UIElements.createHelpMenu = function (common, categories) { UIElements.createHelpMenu = function (common /*, categories */) {
var type = common.getMetadataMgr().getMetadata().type || 'pad'; var type = common.getMetadataMgr().getMetadata().type || 'pad';
var elements = [];
if (Messages.help && Messages.help.generic) { var apps = {
Object.keys(Messages.help.generic).forEach(function (el) { pad: 'richtext',
elements.push(setHTML(h('li'), Messages.help.generic[el])); code: 'code',
}); slide: 'slides',
} sheet: 'sheets',
if (categories) { poll: 'poll',
categories.forEach(function (cat) { kanban: 'kanban',
var msgs = Messages.help[cat]; whiteboard: 'whiteboard',
if (msgs) { };
Object.keys(msgs).forEach(function (el) {
elements.push(setHTML(h('li'), msgs[el])); 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', [ var text = h('p.cp-help-text', [
h('h1', Messages.help.title), content
h('ul', elements)
]); ]);
common.fixLinks(text); common.fixLinks(text);

Loading…
Cancel
Save