Add core:show-welcome-tour action and logic to display on first-run

This commit is contained in:
Nick O'Leary
2021-09-27 16:42:51 +01:00
parent e20cfb3dae
commit e9e03c945b
8 changed files with 151 additions and 43 deletions

View File

@@ -535,19 +535,18 @@ var RED = (function() {
setTimeout(function() {
loader.end();
checkFirstRun();
},100);
}
function showAbout() {
$.get('red/about', function(data) {
// data will be strictly markdown. Any HTML should be escaped.
data = RED.utils.sanitize(data);
var aboutHeader = '<div style="text-align:center;">'+
'<img width="50px" src="red/images/node-red-icon.svg" />'+
'</div>';
RED.sidebar.help.set(aboutHeader+RED.utils.renderMarkdown(data));
});
function checkFirstRun() {
if (RED.settings.theme("tours") === false) {
return;
}
if (!RED.settings.get("editor.view.view-show-welcome-tours", true)) {
return;
}
RED.actions.invoke("core:show-welcome-tour", RED.settings.get("editor.tours.welcome"));
}
function buildMainMenu() {
@@ -696,9 +695,6 @@ var RED = (function() {
$("#red-ui-main-container").show();
RED.actions.add("core:show-about", showAbout);
loadPluginList();
}