mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
add access to previous tours
This commit is contained in:
@@ -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({
|
||||
|
@@ -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",'');
|
||||
}
|
||||
|
Reference in New Issue
Block a user