Skip Tutorial Topic
This commit is contained in:
1 parent
54c4134a4a
commit
1d0d354bd5
2 files changed
+57
-3
No files matched your search
@@ -308,3 +308,14 @@ li > .tutorial-font-small {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 2px 8px;
|
||||
font-size: 125%;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
background-color: #bcd643;
|
||||
border-radius: 5px;
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ function newTutorialSpace() {
|
||||
status: 'Skipped'
|
||||
}
|
||||
saveTutorial(currentNode.payload, tutorial)
|
||||
advance()
|
||||
advance(true)
|
||||
}
|
||||
|
||||
function previous() {
|
||||
@@ -603,7 +603,7 @@ function newTutorialSpace() {
|
||||
}
|
||||
}
|
||||
|
||||
function advance() {
|
||||
function advance(isSkipping) {
|
||||
let found
|
||||
let advanced
|
||||
|
||||
@@ -615,7 +615,11 @@ function newTutorialSpace() {
|
||||
}
|
||||
case 'Playing Topic': {
|
||||
found = false
|
||||
findNextNode(tutorialRootNode)
|
||||
if (isSkipping === true) {
|
||||
findNextTopic(tutorialRootNode)
|
||||
} else {
|
||||
findNextNode(tutorialRootNode)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'Playing Step': {
|
||||
@@ -713,6 +717,45 @@ function newTutorialSpace() {
|
||||
findNextNode(tutorialTopic, found)
|
||||
}
|
||||
}
|
||||
|
||||
function findNextTopic(node) {
|
||||
for (let i = 0; i < node.tutorialTopics.length; i++) {
|
||||
|
||||
if (advanced === true) {
|
||||
return
|
||||
}
|
||||
|
||||
let tutorialTopic = node.tutorialTopics[i]
|
||||
if (found === true) {
|
||||
if (resumeModeActivated !== true) {
|
||||
currentNode = tutorialTopic
|
||||
currentStatus = 'Playing Topic'
|
||||
advanced = true
|
||||
navigationStack.push(currentNode)
|
||||
findTutorialNode(currentNode)
|
||||
return
|
||||
} else {
|
||||
let tutorial = {
|
||||
status: undefined
|
||||
}
|
||||
loadTutorial(tutorialTopic.payload, tutorial)
|
||||
if (tutorial.status !== 'Done') {
|
||||
currentNode = tutorialTopic
|
||||
currentStatus = 'Playing Topic'
|
||||
advanced = true
|
||||
navigationStack.push(currentNode)
|
||||
findTutorialNode(currentNode)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tutorialTopic.id === currentNode.id) {
|
||||
found = true
|
||||
} else {
|
||||
findNextTopic(tutorialTopic, found)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildHTML() {
|
||||
|
||||
Reference in new issue
Block a user