add access to previous tours

This commit is contained in:
Hiroyasu Nishiyama
2022-06-21 21:47:57 +09:00
parent 1af56a7f00
commit 10835968fb
8 changed files with 430 additions and 4 deletions

View File

@@ -97,7 +97,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();
@@ -198,15 +201,27 @@ RED.sidebar.help = (function() {
label: RED._("sidebar.help.nodeHelp"),
children: [],
expanded: true
}
};
var tours = RED.tourGuide.list().map(function (item) {
return {
icon: "fa fa-repeat",
label: item.label,
tour: item.path,
};
});
var helpData = [
{
id: 'changelog',
label: "Node-RED v"+RED.settings.version,
content: getChangelog
},
nodeHelp
]
nodeHelp,
{
id: "tours",
label: "Tours",
children: tours
},
];
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
if (subflows.length > 0) {
nodeHelp.children.push({

View File

@@ -433,9 +433,35 @@ RED.tourGuide = (function() {
})
}
function listTour() {
return [
{
id: "2_3",
label: "3.0.0-beta.3 (latest)",
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"
},
{
id: "first_flow",
label: "First flow",
path: "./tours/first-flow.js"
},
];
}
return {
load: loadTour,
run: run,
list: listTour,
reset: function() {
RED.settings.set("editor.tours.welcome",'');
}