hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 1 | /** |
| 2 | * Guided Tour to explain the UI |
| 3 | * |
| 4 | * @author Helge Stallkamp |
| 5 | */ |
| 6 | |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 7 | |
| 8 | define(['lib/intro', 'vc', 'hint', 'menu', 'vc/doc', 'vc/docgroup'], function(introClass, vcClass, hintClass, menuClass, docClass, docGroup) { |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 9 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 10 | //needed for localization of labels and contents of the tour |
| 11 | const loc = KorAP.Locale; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 12 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 13 | //labels for nextStep, previousStep, done and abort |
| 14 | loc.TOUR_lskip = loc.TOUR_lskip || "Abort"; |
| 15 | loc.TOUR_lprev = loc.TOUR_lprev || "Back"; |
| 16 | loc.TOUR_lnext = loc.TOUR_lnext || "Next"; |
| 17 | loc.TOUR_ldone = loc.TOUR_ldone || "Done"; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 18 | |
| 19 | //localization guided tour gTstartSearch |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 20 | loc.TOUR_sear1 = loc.TOUR_sear1 || "Enter your search enquiry here."; |
hebasta | d090a51 | 2019-07-10 16:36:01 +0200 | [diff] [blame] | 21 | loc.TOUR_sear2 = loc.TOUR_sear2 || "For example the search for '" + loc.TOUR_Qexample + "'."; |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 22 | loc.TOUR_searAnnot = loc.TOUR_searAnnot || "Annotation helper"; |
| 23 | loc.TOUR_annotAss = loc.TOUR_annotAss || "The assistant displays the annotations of the different layers and helps to formulate queries."; |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 24 | loc.TOUR_vccho1 = loc.TOUR_vccho1 || "Choose corpus"; |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 25 | loc.TOUR_vccho2 = loc.TOUR_vccho2 || "Define your corpus here."; |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 26 | loc.TOUR_vcStat1 = loc.TOUR_vcStat1 || "Click here to display corpus statistic."; |
| 27 | loc.TOUR_vcStat2 = loc.TOUR_vcStat2 || "Corpus statistic"; |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 28 | loc.TOUR_qlfield = loc.TOUR_qlfield|| "Selection of the query language: You can use KorAP with different languages."; |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 29 | loc.TOUR_help = loc.TOUR_help || "Help and more information about KorAP."; |
| 30 | loc.TOUR_glimpse = loc.TOUR_glimpse || "Select to show only the first hits in arbitrary order."; |
| 31 | loc.TOUR_seargo = loc.TOUR_seargo || "Start the search."; |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 32 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 33 | //localization guided Tour gTshowResults |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 34 | loc.TOUR_kwic = loc.TOUR_kwic || "KWIC result (keyword in context)"; |
| 35 | loc.TOUR_snippet = loc.TOUR_snippet || "Click on a match to show a larger snippet."; |
| 36 | loc.TOUR_snippetb = loc.TOUR_snippetb || "Display of larger snippet"; |
| 37 | loc.TOUR_metadatab = loc.TOUR_metadatab || "Click here to display the metadata."; |
| 38 | loc.TOUR_metadata = loc.TOUR_metadata || "Metadata"; |
| 39 | loc.TOUR_tokenb = loc.TOUR_tokenb || "Click here to display the token annotations."; |
| 40 | loc.TOUR_token = loc.TOUR_token || "KorAP supports multiple annotations."; |
| 41 | loc.TOUR_treeb = loc.TOUR_treeb || "Display further annotations." |
| 42 | loc.TOUR_tree = loc.TOUR_tree || "Further annotations can be displayed as tree and arch views." |
| 43 | loc.TOUR_tourdone = loc.TOUR_tourdone || "Have fun with KorAP!"; |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 44 | |
| 45 | //localization of button labels |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 46 | let labelOptions = { |
| 47 | 'skipLabel': loc.TOUR_lskip, |
| 48 | 'prevLabel': loc.TOUR_lprev, |
| 49 | 'nextLabel': loc.TOUR_lnext, |
| 50 | 'doneLabel': loc.TOUR_ldone, |
| 51 | 'showStepNumbers': false, |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 52 | }; |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 53 | |
| 54 | var doe = document; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 55 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 56 | return{ |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 57 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 58 | /** |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 59 | * Guided Tour gTstartSearch: Explains the search functionality |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 60 | */ |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 61 | gTstartSearch:function(elparam){ |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 62 | let intro = introClass(); |
| 63 | intro.setOptions(labelOptions); |
| 64 | intro.setOption('doneLabel', loc.TOUR_seargo); |
| 65 | |
| 66 | //for testing purposes |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 67 | if(elparam){ |
| 68 | doe = elparam; |
| 69 | } |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 70 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 71 | let input = doe.querySelector("#q-field"); |
| 72 | input.value=""; |
| 73 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 74 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 75 | //steps of the example tour |
| 76 | let Steps =[ |
| 77 | { |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 78 | element: '#q-field', |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 79 | intro: loc.TOUR_sear1, |
| 80 | position: 'bottom' |
| 81 | }, |
| 82 | { |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 83 | element: '#q-field', |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 84 | intro: loc.TOUR_sear2, |
| 85 | position: 'bottom' |
| 86 | }, |
| 87 | { |
| 88 | element: '#hint', |
| 89 | intro: loc.TOUR_searAnnot, |
| 90 | position: 'bottom' |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 91 | }, |
| 92 | { |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 93 | element: doe.querySelector("#hint > .menu.hint"), |
| 94 | intro: loc.TOUR_annotAss, |
| 95 | position: 'bottom', |
| 96 | }, |
| 97 | { |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 98 | element:'#vc-choose', |
| 99 | intro: loc.TOUR_vccho1, |
| 100 | position: "bottom", |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 101 | }, |
| 102 | { |
| 103 | element:'#vc-view', |
| 104 | intro: loc.TOUR_vccho2, |
| 105 | position: "bottom", |
| 106 | }, |
| 107 | { |
hebasta | d090a51 | 2019-07-10 16:36:01 +0200 | [diff] [blame] | 108 | element: doe.querySelector('.statistic'), |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 109 | intro: loc.TOUR_vcStat1, |
hebasta | d090a51 | 2019-07-10 16:36:01 +0200 | [diff] [blame] | 110 | position: "left", |
| 111 | }, |
| 112 | { |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 113 | element: doe.querySelector('.stattable'), |
| 114 | intro: loc.TOUR_vcStat2, |
| 115 | position: "bottom", |
| 116 | }, |
| 117 | { |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 118 | element: doe.querySelector('#ql-field').parentNode, |
| 119 | intro: loc.TOUR_qlfield, |
| 120 | position: "bottom", |
| 121 | }, |
| 122 | { |
| 123 | element:'#glimpse', |
| 124 | intro: loc.TOUR_glimpse, |
| 125 | position: "bottom", |
| 126 | }, |
| 127 | { |
| 128 | element:'#view-tutorial', |
| 129 | intro: loc.TOUR_help, |
| 130 | position: "bottom", |
| 131 | }, |
| 132 | { |
| 133 | element: '#qsubmit', |
| 134 | intro: loc.TOUR_seargo, |
| 135 | position: "bottom", |
| 136 | }, |
| 137 | ]; |
| 138 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 139 | //pass in the Steps array created earlier |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 140 | intro.setOptions({steps: Steps}); |
| 141 | this.testPrerequ(Steps, intro); |
| 142 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 143 | //changes before executing the single steps |
| 144 | intro.onbeforechange(function(targetedElement){ |
| 145 | switch(targetedElement.id){ |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 146 | case "q-field": |
hebasta | d090a51 | 2019-07-10 16:36:01 +0200 | [diff] [blame] | 147 | /* |
| 148 | * TODO: |
| 149 | * #268 is not merged at the time beeing: |
| 150 | * introJs.currentStep() merge requested https://github.com/usablica/intro.js/pull/268/files |
| 151 | */ |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 152 | if(this._currentStep == 1){ |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 153 | targetedElement.value = loc.TOUR_Qexample; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 154 | } |
| 155 | break; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 156 | case "vc-view": |
| 157 | vchoo = doe.querySelector("#vc-choose"); |
| 158 | vcv = doe.querySelector("#vc-view"); |
| 159 | KorAP._delete.apply(KorAP.vc.root()); |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 160 | |
| 161 | KorAP.vc.fromJson(loc.TOUR_vcQuery); |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 162 | if(!(vcv.querySelector(".active"))){ |
| 163 | vchoo.click(); |
hebasta | d090a51 | 2019-07-10 16:36:01 +0200 | [diff] [blame] | 164 | /* |
| 165 | * Intro.js caches elements at the beginning, so element and position has to be set again. |
| 166 | */ |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 167 | intro._introItems[6].element = doe.querySelector('.statistic'); |
| 168 | intro._introItems[6].position = "left"; |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 169 | } |
| 170 | break; |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 171 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 172 | /* |
| 173 | * Sets button labels for the last step of the tour |
| 174 | * Because Kalamar is a multipage webapplication, this tours starts by |
| 175 | * completion the gTshowResults Tour. Therefore, the skip-button is removed |
| 176 | * and the label of the done button changed. |
| 177 | */ |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 178 | case "qsubmit": |
| 179 | intro.setOption('hideNext', true); |
| 180 | break; |
| 181 | } |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 182 | |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 183 | if(this._currentStep == 7){ |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 184 | let statbut = doe.querySelector('.statistic'); |
| 185 | statbut.click(); |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 186 | intro._introItems[7].element = doe.querySelector(".stattable"); |
| 187 | intro._introItems[7].position = "bottom"; |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 188 | } |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 189 | }); |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 190 | |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 191 | intro.onbeforeexit(function(){ |
| 192 | if(KorAP.Hint.active() && KorAP.Hint.active().dontHide){ |
| 193 | KorAP.Hint.unshow(); |
| 194 | } |
| 195 | }); |
| 196 | |
| 197 | intro.onchange(function(targetElement) { |
| 198 | var that = this; |
| 199 | switch(this._currentStep){ |
| 200 | //hides Hint if back button is pressed |
| 201 | case 2: |
| 202 | if(KorAP.Hint.active()){ |
| 203 | KorAP.Hint.unshow(); |
| 204 | } |
| 205 | break; |
| 206 | case 3: |
| 207 | KorAP.Hint.show(false); |
| 208 | KorAP.Hint.active().dontHide = true; |
| 209 | intro._introItems[3].element = doe.querySelector(".menu.roll.hint"); |
| 210 | intro._introItems[3].position = doe.querySelector("bottom"); |
| 211 | break; |
| 212 | case 4: |
| 213 | KorAP.Hint.unshow(); |
| 214 | break; |
| 215 | } |
| 216 | }); |
| 217 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 218 | // Execute at the end of the tour (By clicking at the done-Button) |
| 219 | intro.oncomplete(function(){ |
| 220 | KorAP.session.set("tour", true); |
hebasta | 94e47cb | 2019-07-24 22:24:27 +0200 | [diff] [blame] | 221 | doe.getElementById("qsubmit").click(); |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 222 | }); |
| 223 | |
| 224 | return intro; |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 225 | }, |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 226 | |
| 227 | |
| 228 | /* Guided Tour to explain the different views of the results */ |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 229 | gTshowResults: function(elparam){ |
| 230 | //for testing purposes |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 231 | if(elparam){ |
| 232 | doe = elparam; |
| 233 | } |
| 234 | let tourR = introClass(); |
| 235 | let StepsSR = [ |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 236 | //Step 1, intro_item 0 |
| 237 | { |
| 238 | element: '#search', |
| 239 | intro: loc.TOUR_kwic , |
| 240 | position: "auto", |
| 241 | }, |
| 242 | //Step 2, intro_item 1 |
| 243 | { |
| 244 | element: doe.querySelector("#search > ol > li"), |
| 245 | intro: loc.TOUR_snippet, |
| 246 | position: "bottom", |
| 247 | }, |
| 248 | //Step 3, intro_item 2 |
| 249 | { |
| 250 | element: doe.querySelector("#search > ol > li"), |
| 251 | intro: loc.TOUR_snippetb, |
| 252 | position: "bottom", |
| 253 | }, |
| 254 | //Step 4, intro_item 3 |
| 255 | { |
| 256 | element: doe.querySelector(".action > .metatable"), |
| 257 | intro: loc.TOUR_metadatab, |
| 258 | position: "bottom", |
| 259 | }, |
| 260 | //Step 5, intro_item 4 |
| 261 | { |
| 262 | element: doe.querySelector(".view.metatable"), |
| 263 | intro: loc.TOUR_metadata, |
| 264 | position: "auto", |
| 265 | }, |
| 266 | //Step 6, intro_item 5 |
| 267 | { |
| 268 | element: doe.querySelector(".action > .info"), |
| 269 | intro: loc.TOUR_tokenb, |
| 270 | position: "bottom", |
| 271 | }, |
| 272 | //Step 7, intro_item 6 |
| 273 | { |
| 274 | element: doe.querySelector(".view.tokentable"), |
| 275 | intro: loc.TOUR_token, |
| 276 | position: "auto", |
| 277 | }, |
| 278 | //Step 8, intro_item 7 |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 279 | { |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 280 | element: doe.querySelector(".tree"), |
| 281 | intro: loc.TOUR_treeb, |
| 282 | position: "bottom", |
| 283 | }, |
| 284 | //Step 9, intro_item 8 |
| 285 | { |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 286 | element: doe.querySelector(".view.relations"), |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 287 | intro: loc.TOUR_tree, |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 288 | position: "bottom", |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 289 | }, |
| 290 | //Step 10, intro_item 9 |
| 291 | { |
| 292 | intro: loc.TOUR_tourdone, |
| 293 | } |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 294 | ] |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 295 | |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 296 | tourR.setOptions({steps:StepsSR}); |
| 297 | tourR.setOptions(labelOptions); |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 298 | |
| 299 | tourR.onbeforeexit(function(){ |
| 300 | KorAP.session.set("tour", false); |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 301 | }); |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 302 | //See also: https://introjs.com/docs/intro/options/ |
| 303 | tourR.setOption('scrollToElement', true); |
| 304 | tourR.setOption('scrollTo','tooltip'); |
| 305 | this.testPrerequ(StepsSR, tourR); |
| 306 | |
| 307 | //TODO see also: introJS.totalSteps() merge requested: //github.com/usablica/intro.js/pull/268/files |
| 308 | tourR.onbeforechange(function(targetedElement){ |
| 309 | |
| 310 | if(this._currentStep == 1){ |
| 311 | KorAP.session.set("tour", false); |
| 312 | } |
| 313 | |
| 314 | if(this._currentStep == 2){ |
| 315 | doe.querySelector("#search > ol > li").click(); |
| 316 | tourR._introItems[3].element = doe.querySelector('.action > .metatable'); |
| 317 | tourR._introItems[3].position = "bottom"; |
| 318 | } |
| 319 | |
| 320 | if(this._currentStep == 4){ |
| 321 | doe.querySelector(".metatable").click(); |
| 322 | tourR._introItems[4].element = doe.querySelector('.view.metatable'); |
| 323 | tourR._introItems[5].element = doe.querySelector('.action > .info'); |
| 324 | tourR._introItems[5].position = "bottom"; |
| 325 | } |
| 326 | |
| 327 | if(this._currentStep == 6){ |
| 328 | doe.querySelector(".info").click(); |
| 329 | tourR._introItems[6].element = doe.querySelector('.view.tokentable'); |
| 330 | tourR._introItems[7].element = doe.querySelector('.tree'); |
| 331 | tourR._introItems[7].position = "bottom"; |
| 332 | } |
| 333 | |
| 334 | if(this._currentStep == 8){ |
| 335 | doe.querySelector(".tree").click(); |
| 336 | document.querySelectorAll(".button-group-list")[0].querySelectorAll('li')[1].click(); |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 337 | tourR._introItems[8].element = doe.querySelector(".view.relations"); |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 338 | } |
| 339 | }); |
hebasta | f95226b | 2019-09-19 11:37:00 +0200 | [diff] [blame] | 340 | |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 341 | return tourR; |
| 342 | }, |
hebasta | 87f1b1f | 2019-07-30 13:03:23 +0200 | [diff] [blame] | 343 | /* |
| 344 | * The total number of steps and the text of the tooltips are needed for jasmine testing. |
| 345 | */ |
| 346 | testPrerequ: function(steps, tour){ |
| 347 | //TODO see also: introJS.totalSteps() merge requested: //github.com/usablica/intro.js/pull/268/files |
| 348 | let StepsT = steps; |
| 349 | let gtour = tour; |
| 350 | gtour.stepCount = StepsT.length; |
| 351 | |
| 352 | //Array of intro content needed for efficient testing |
| 353 | gtour.testIntros = []; |
| 354 | |
| 355 | for(let i = 0; i< StepsT.length; i++){ |
| 356 | gtour.testIntros.push(StepsT[i].intro); |
| 357 | } |
| 358 | }, |
hebasta | 5df796f | 2019-05-21 15:27:12 +0200 | [diff] [blame] | 359 | |
hebasta | 75cfca5 | 2019-02-19 13:15:27 +0100 | [diff] [blame] | 360 | } |
| 361 | }); |