mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #3717 from node-red/tour-help
List welcome tours in help sidebar
This commit is contained in:
@@ -20,10 +20,8 @@ RED.sidebar.help = (function() {
|
||||
var helpSection;
|
||||
var panels;
|
||||
var panelRatio;
|
||||
var helpTopics = [];
|
||||
var treeList;
|
||||
var tocPanel;
|
||||
var helpIndex = {};
|
||||
|
||||
function resizeStack() {
|
||||
var h = $(content).parent().height() - toolbar.outerHeight();
|
||||
@@ -97,7 +95,10 @@ RED.sidebar.help = (function() {
|
||||
var pendingContentLoad;
|
||||
treeList.on('treelistselect', function(e,item) {
|
||||
pendingContentLoad = item;
|
||||
if (item.nodeType) {
|
||||
if (item.tour) {
|
||||
RED.tourGuide.run(item.tour);
|
||||
}
|
||||
else if (item.nodeType) {
|
||||
showNodeTypeHelp(item.nodeType);
|
||||
} else if (item.content) {
|
||||
helpSection.empty();
|
||||
@@ -189,7 +190,6 @@ RED.sidebar.help = (function() {
|
||||
}
|
||||
|
||||
function refreshHelpIndex() {
|
||||
helpTopics = [];
|
||||
var modules = RED.nodes.registry.getModuleList();
|
||||
var moduleNames = Object.keys(modules);
|
||||
moduleNames.sort();
|
||||
@@ -198,15 +198,32 @@ RED.sidebar.help = (function() {
|
||||
label: RED._("sidebar.help.nodeHelp"),
|
||||
children: [],
|
||||
expanded: true
|
||||
}
|
||||
};
|
||||
var tours = RED.tourGuide.list().map(function (item) {
|
||||
return {
|
||||
icon: "fa fa-play-circle-o",
|
||||
label: item.label,
|
||||
tour: item.path,
|
||||
};
|
||||
});
|
||||
var helpData = [
|
||||
{
|
||||
id: 'changelog',
|
||||
label: "Node-RED v"+RED.settings.version,
|
||||
content: getChangelog
|
||||
label: "Node-RED",
|
||||
children: [
|
||||
{
|
||||
id: 'changelog',
|
||||
label: RED._("sidebar.help.changeLog"),
|
||||
content: getChangelog
|
||||
},
|
||||
{
|
||||
label: RED._("tourGuide.welcomeTours"),
|
||||
children: tours
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
nodeHelp
|
||||
]
|
||||
];
|
||||
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
|
||||
if (subflows.length > 0) {
|
||||
nodeHelp.children.push({
|
||||
|
@@ -433,9 +433,30 @@ RED.tourGuide = (function() {
|
||||
})
|
||||
}
|
||||
|
||||
function listTour() {
|
||||
return [
|
||||
{
|
||||
id: "2_3",
|
||||
label: "3.0.0-beta.3",
|
||||
path: "./tours/welcome.js"
|
||||
},
|
||||
{
|
||||
id: "2_2",
|
||||
label: "2.2.0",
|
||||
path: "./tours/2.2/welcome.js"
|
||||
},
|
||||
{
|
||||
id: "2_1",
|
||||
label: "2.1.0",
|
||||
path: "./tours/2.1/welcome.js"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
return {
|
||||
load: loadTour,
|
||||
run: run,
|
||||
list: listTour,
|
||||
reset: function() {
|
||||
RED.settings.set("editor.tours.welcome",'');
|
||||
}
|
||||
|
Reference in New Issue
Block a user