blob: afe2c83f8fff4fcab93b8f8831b1a97831db5db2 [file] [log] [blame]
hebasta75cfca52019-02-19 13:15:27 +01001/**
2 * Guided Tour to explain the UI
3 *
4 * @author Helge Stallkamp
5 */
Akrone51eaa32020-11-10 09:35:53 +01006"use strict";
hebasta75cfca52019-02-19 13:15:27 +01007
Akrone51eaa32020-11-10 09:35:53 +01008define(['lib/intro', 'vc', 'hint', 'menu', 'vc/doc', 'vc/docgroup'],
9 function(introClass, vcClass, hintClass, menuClass, docClass, docGroup) {
hebasta5df796f2019-05-21 15:27:12 +020010
hebasta75cfca52019-02-19 13:15:27 +010011 //needed for localization of labels and contents of the tour
12 const loc = KorAP.Locale;
hebasta5df796f2019-05-21 15:27:12 +020013
hebastaa84c7a92021-10-26 21:12:40 +020014 //labels for nextStep, previousStep and done
hebasta75cfca52019-02-19 13:15:27 +010015 loc.TOUR_lprev = loc.TOUR_lprev || "Back";
16 loc.TOUR_lnext = loc.TOUR_lnext || "Next";
17 loc.TOUR_ldone = loc.TOUR_ldone || "Done";
hebastaca61f812019-11-11 22:25:27 +010018 loc.TOUR_ldoneSearch = loc.TOUR_ldoneSearch || "Search";
19
hebasta5df796f2019-05-21 15:27:12 +020020 //localization guided tour gTstartSearch
hebastaa84c7a92021-10-26 21:12:40 +020021 loc.TOUR_welcti = loc.TOUR_welcti || "<span class='tgreeting'> Welcome to our guided tour! </span>";
22 loc.TOUR_welc = loc.TOUR_welc || "This tour should give you a quick introduction to KorAP. " +
hebasta84a7e0e2021-11-03 19:11:33 +010023 "We lead you step by step through an example.";
hebastaee7b8a82020-01-20 12:45:04 +010024 loc.TOUR_sear1 = loc.TOUR_sear1 || "Input field for the query, for example the search for '" + loc.TOUR_Qexample + "'.";
hebastaf95226b2019-09-19 11:37:00 +020025 loc.TOUR_searAnnot = loc.TOUR_searAnnot || "Annotation helper";
26 loc.TOUR_annotAss = loc.TOUR_annotAss || "The assistant displays the annotations of the different layers and helps to formulate queries.";
hebastafa118342021-11-02 19:56:01 +010027 loc.TOUR_vccho1 = loc.TOUR_vccho1 || "Choose corpus";
28 loc.TOUR_vccho2ti = loc.TOUR_vccho2ti || "Corpus Assistant (1)";
hebasta75cfca52019-02-19 13:15:27 +010029 loc.TOUR_vccho2 = loc.TOUR_vccho2 || "Define your corpus here.";
hebastafa118342021-11-02 19:56:01 +010030 loc.TOUR_vccho3ti = loc.TOUR_vccho3ti || "Corpus Assistant (2)";
31 loc.TOUR_vccho3 = loc.TOUR_vccho3 || "Several of the available metadata can be choosen in a drop down box.";
32 loc.TOUR_vccho4ti = loc.TOUR_vccho4ti || "Corpus Assistant (3)";
33 loc.TOUR_vccho4 = loc.TOUR_vccho4 || "For example to request all documents with the document sigle " + loc.TOUR_DocSigle + " .";
hebasta94e47cb2019-07-24 22:24:27 +020034 loc.TOUR_vcStat1 = loc.TOUR_vcStat1 || "Click here to display corpus statistic.";
35 loc.TOUR_vcStat2 = loc.TOUR_vcStat2 || "Corpus statistic";
hebasta84a7e0e2021-11-03 19:11:33 +010036 loc.TOUR_qlfield = loc.TOUR_qlfield|| "Selection of the query language: You can use KorAP with different query languages.";
hebasta1e2d98e2019-10-30 15:58:17 +010037 loc.TOUR_help = loc.TOUR_help || "Help and information about KorAP.";
hebastaca61f812019-11-11 22:25:27 +010038 loc.TOUR_glimpse = loc.TOUR_glimpse || "Select this to show only the first hits in undefined order.";
hebasta1e2d98e2019-10-30 15:58:17 +010039 loc.TOUR_seargo = loc.TOUR_seargo || "Start the search";
hebasta87f1b1f2019-07-30 13:03:23 +020040
hebasta5df796f2019-05-21 15:27:12 +020041 //localization guided Tour gTshowResults
hebasta87f1b1f2019-07-30 13:03:23 +020042 loc.TOUR_kwic = loc.TOUR_kwic || "KWIC result (keyword in context)";
43 loc.TOUR_snippet = loc.TOUR_snippet || "Click on a match to show a larger snippet.";
hebasta1e2d98e2019-10-30 15:58:17 +010044 loc.TOUR_snippetb = loc.TOUR_snippetb || "Snippet";
45 loc.TOUR_metadatab = loc.TOUR_metadatab || "Display of metadata";
hebasta87f1b1f2019-07-30 13:03:23 +020046 loc.TOUR_metadata = loc.TOUR_metadata || "Metadata";
hebasta1e2d98e2019-10-30 15:58:17 +010047 loc.TOUR_tokenb = loc.TOUR_tokenb || "Display of token annotations";
hebasta87f1b1f2019-07-30 13:03:23 +020048 loc.TOUR_token = loc.TOUR_token || "KorAP supports multiple annotations.";
hebasta1e2d98e2019-10-30 15:58:17 +010049 loc.TOUR_treeb = loc.TOUR_treeb || "Display further annotations"
hebasta87f1b1f2019-07-30 13:03:23 +020050 loc.TOUR_tree = loc.TOUR_tree || "Further annotations can be displayed as tree and arch views."
51 loc.TOUR_tourdone = loc.TOUR_tourdone || "Have fun with KorAP!";
hebasta75cfca52019-02-19 13:15:27 +010052
53 //localization of button labels
hebastaee7b8a82020-01-20 12:45:04 +010054 let labelOpts= {
hebasta5df796f2019-05-21 15:27:12 +020055 'prevLabel': loc.TOUR_lprev,
56 'nextLabel': loc.TOUR_lnext,
57 'doneLabel': loc.TOUR_ldone,
hebastaee7b8a82020-01-20 12:45:04 +010058 'showStepNumbers': false
59 };
60
61 //usability options of tours
62 let usabilityOpts ={
63 'showBullets': false,
hebastaa84c7a92021-10-26 21:12:40 +020064 'overlayOpacity': 0.5,
hebastaee7b8a82020-01-20 12:45:04 +010065 'exitOnOverlayClick': false,
hebastaa84c7a92021-10-26 21:12:40 +020066 'disableInteraction': true,
67 'tooltipClass': 'customTooltip',
hebastaee7b8a82020-01-20 12:45:04 +010068 'hidePrev': true
hebasta75cfca52019-02-19 13:15:27 +010069 };
hebasta87f1b1f2019-07-30 13:03:23 +020070
71 var doe = document;
hebasta5df796f2019-05-21 15:27:12 +020072
hebasta75cfca52019-02-19 13:15:27 +010073 return{
hebasta5df796f2019-05-21 15:27:12 +020074
hebasta75cfca52019-02-19 13:15:27 +010075 /**
hebasta5df796f2019-05-21 15:27:12 +020076 * Guided Tour gTstartSearch: Explains the search functionality
hebasta75cfca52019-02-19 13:15:27 +010077 */
hebasta5df796f2019-05-21 15:27:12 +020078 gTstartSearch:function(elparam){
hebasta5df796f2019-05-21 15:27:12 +020079 let intro = introClass();
hebastaee7b8a82020-01-20 12:45:04 +010080 intro.setOptions(labelOpts);
hebastaca61f812019-11-11 22:25:27 +010081 /*
82 * Sets button labels for the last step of the tour
83 * Because Kalamar is a multipage webapplication, this tours starts by
84 * completion the gTshowResults Tour. Therefore the label of the done button changed.
85 */
86 intro.setOption('doneLabel', loc.TOUR_ldoneSearch );
hebastaee7b8a82020-01-20 12:45:04 +010087 intro.setOptions(usabilityOpts);
hebastaca61f812019-11-11 22:25:27 +010088
hebasta5df796f2019-05-21 15:27:12 +020089 //for testing purposes
hebasta75cfca52019-02-19 13:15:27 +010090 if(elparam){
91 doe = elparam;
92 }
hebasta5df796f2019-05-21 15:27:12 +020093
hebasta75cfca52019-02-19 13:15:27 +010094 let input = doe.querySelector("#q-field");
95 input.value="";
96
hebasta5df796f2019-05-21 15:27:12 +020097
hebasta75cfca52019-02-19 13:15:27 +010098 //steps of the example tour
99 let Steps =[
hebastafa118342021-11-02 19:56:01 +0100100 //Step 1, intro_item 0
hebasta2f7e5402021-11-02 20:09:38 +0100101 {
102 element: '#link-guided-tour',
hebastaa84c7a92021-10-26 21:12:40 +0200103 title: loc.TOUR_welcti,
hebasta1e2d98e2019-10-30 15:58:17 +0100104 intro: loc.TOUR_welc,
hebasta2f7e5402021-11-02 20:09:38 +0100105 position: 'right',
hebasta1e2d98e2019-10-30 15:58:17 +0100106 },
hebastafa118342021-11-02 19:56:01 +0100107 //Step 2, intro_item 1
hebasta1e2d98e2019-10-30 15:58:17 +0100108 {
hebasta84a7e0e2021-11-03 19:11:33 +0100109 title: loc.TOUR_sear1ti,
hebastaf95226b2019-09-19 11:37:00 +0200110 element: '#q-field',
hebasta75cfca52019-02-19 13:15:27 +0100111 intro: loc.TOUR_sear1,
112 position: 'bottom'
113 },
hebastafa118342021-11-02 19:56:01 +0100114 //Step 3, intro_item 2
hebasta75cfca52019-02-19 13:15:27 +0100115 {
hebasta84a7e0e2021-11-03 19:11:33 +0100116 title: loc.TOUR_searAnnotti,
hebasta75cfca52019-02-19 13:15:27 +0100117 element: '#hint',
118 intro: loc.TOUR_searAnnot,
hebastafa118342021-11-02 19:56:01 +0100119 position: 'auto'
hebasta5df796f2019-05-21 15:27:12 +0200120 },
hebastafa118342021-11-02 19:56:01 +0100121 //Step 4, intro_item 3
hebasta5df796f2019-05-21 15:27:12 +0200122 {
hebasta84a7e0e2021-11-03 19:11:33 +0100123 title: loc.TOUR_annotAssti,
hebastaf95226b2019-09-19 11:37:00 +0200124 element: doe.querySelector("#hint > .menu.hint"),
125 intro: loc.TOUR_annotAss,
126 position: 'bottom',
hebastafa118342021-11-02 19:56:01 +0100127 },
128 //Step 5, intro_item 4
hebastaf95226b2019-09-19 11:37:00 +0200129 {
hebastafa118342021-11-02 19:56:01 +0100130 title: loc.TOUR_vccho1ti,
hebasta75cfca52019-02-19 13:15:27 +0100131 element:'#vc-choose',
132 intro: loc.TOUR_vccho1,
133 position: "bottom",
hebasta5df796f2019-05-21 15:27:12 +0200134 },
hebastafa118342021-11-02 19:56:01 +0100135 //Step 6, intro_item 5
hebasta5df796f2019-05-21 15:27:12 +0200136 {
hebasta84a7e0e2021-11-03 19:11:33 +0100137 title: loc.TOUR_vccho2ti,
hebasta5df796f2019-05-21 15:27:12 +0200138 element:'#vc-view',
139 intro: loc.TOUR_vccho2,
140 position: "bottom",
141 },
hebastafa118342021-11-02 19:56:01 +0100142 //Step 7, intro_item 6
143 {
144 title: loc.TOUR_vccho3ti,
145 element: doe.querySelector('#vc-view * .doc > menu'),
146 intro: loc.TOUR_vccho3,
147 position: "left",
148 },
149 //Step 8, intro_item 7
150 {
151 title: loc.TOUR_vccho4ti,
152 element: doe.querySelector('#vc-view * .doc'),
153 intro: loc.TOUR_vccho4,
154 position: "left",
155 },
156 //Step 9, intro_item 8
hebasta5df796f2019-05-21 15:27:12 +0200157 {
hebasta84a7e0e2021-11-03 19:11:33 +0100158 title: loc.TOUR_vcStat1ti,
hebastad090a512019-07-10 16:36:01 +0200159 element: doe.querySelector('.statistic'),
hebasta94e47cb2019-07-24 22:24:27 +0200160 intro: loc.TOUR_vcStat1,
hebastad090a512019-07-10 16:36:01 +0200161 position: "left",
162 },
hebastafa118342021-11-02 19:56:01 +0100163 //Step 10, intro_item 9
hebastad090a512019-07-10 16:36:01 +0200164 {
hebasta84a7e0e2021-11-03 19:11:33 +0100165 title: loc.TOUR_vcStat2ti,
hebasta94e47cb2019-07-24 22:24:27 +0200166 element: doe.querySelector('.stattable'),
167 intro: loc.TOUR_vcStat2,
168 position: "bottom",
169 },
hebastafa118342021-11-02 19:56:01 +0100170 //Step 11, intro_item 10
hebasta94e47cb2019-07-24 22:24:27 +0200171 {
hebasta84a7e0e2021-11-03 19:11:33 +0100172 title: loc.TOUR_qlfieldti,
hebasta5df796f2019-05-21 15:27:12 +0200173 element: doe.querySelector('#ql-field').parentNode,
174 intro: loc.TOUR_qlfield,
175 position: "bottom",
176 },
177 {
hebasta84a7e0e2021-11-03 19:11:33 +0100178 title: loc.TOUR_glimpseti,
hebastabd53f822021-10-26 21:50:06 +0200179 element: doe.querySelector('#glimpse').parentNode,
hebasta5df796f2019-05-21 15:27:12 +0200180 intro: loc.TOUR_glimpse,
181 position: "bottom",
182 },
183 {
hebasta84a7e0e2021-11-03 19:11:33 +0100184 title: loc.TOUR_helpti,
hebasta5df796f2019-05-21 15:27:12 +0200185 element:'#view-tutorial',
186 intro: loc.TOUR_help,
187 position: "bottom",
188 },
189 {
hebasta84a7e0e2021-11-03 19:11:33 +0100190 title: loc.TOUR_seargoti,
hebasta5df796f2019-05-21 15:27:12 +0200191 element: '#qsubmit',
192 intro: loc.TOUR_seargo,
193 position: "bottom",
194 },
195 ];
196
hebasta75cfca52019-02-19 13:15:27 +0100197 //pass in the Steps array created earlier
hebasta87f1b1f2019-07-30 13:03:23 +0200198 intro.setOptions({steps: Steps});
199 this.testPrerequ(Steps, intro);
hebastaca61f812019-11-11 22:25:27 +0100200
hebasta5df796f2019-05-21 15:27:12 +0200201 //changes before executing the single steps
202 intro.onbeforechange(function(targetedElement){
203 switch(targetedElement.id){
hebastaf95226b2019-09-19 11:37:00 +0200204 case "q-field":
hebastad090a512019-07-10 16:36:01 +0200205 /*
206 * TODO:
207 * #268 is not merged at the time beeing:
208 * introJs.currentStep() merge requested https://github.com/usablica/intro.js/pull/268/files
209 */
hebastaf95226b2019-09-19 11:37:00 +0200210 targetedElement.value = loc.TOUR_Qexample;
hebasta5df796f2019-05-21 15:27:12 +0200211 break;
hebasta5df796f2019-05-21 15:27:12 +0200212 case "vc-view":
Akron0b37f3e2021-02-09 10:32:03 +0100213 let vchoo = doe.querySelector("#vc-choose");
214 let vcv = doe.querySelector("#vc-view");
hebasta5df796f2019-05-21 15:27:12 +0200215 KorAP._delete.apply(KorAP.vc.root());
hebasta5df796f2019-05-21 15:27:12 +0200216 if(!(vcv.querySelector(".active"))){
217 vchoo.click();
hebastad090a512019-07-10 16:36:01 +0200218 /*
219 * Intro.js caches elements at the beginning, so element and position has to be set again.
220 */
hebastafa118342021-11-02 19:56:01 +0100221 intro._introItems[8].element = doe.querySelector('.statistic');
222 intro._introItems[8].position = "left";
hebasta5df796f2019-05-21 15:27:12 +0200223 }
hebastafa118342021-11-02 19:56:01 +0100224 intro._introItems[7].element = doe.querySelector('#vc-view * .doc');
225 intro._introItems[7].position = "left";
226 break;
hebasta5df796f2019-05-21 15:27:12 +0200227 }
hebastafa118342021-11-02 19:56:01 +0100228 if(this._currentStep == 9){
hebasta94e47cb2019-07-24 22:24:27 +0200229 let statbut = doe.querySelector('.statistic');
230 statbut.click();
hebastafa118342021-11-02 19:56:01 +0100231 intro._introItems[9].element = doe.querySelector(".stattable");
232 intro._introItems[9].position = "bottom";
hebasta94e47cb2019-07-24 22:24:27 +0200233 }
hebasta75cfca52019-02-19 13:15:27 +0100234 });
hebasta5df796f2019-05-21 15:27:12 +0200235
hebastaf95226b2019-09-19 11:37:00 +0200236 intro.onbeforeexit(function(){
237 if(KorAP.Hint.active() && KorAP.Hint.active().dontHide){
238 KorAP.Hint.unshow();
239 }
hebastafa118342021-11-02 19:56:01 +0100240 if (KorAP._vcKeyMenu.dontHide){
241 KorAP._vcKeyMenu.dontHide = false;
242 KorAP._vcKeyMenu.hide();
243 }
hebastaf95226b2019-09-19 11:37:00 +0200244 });
245
246 intro.onchange(function(targetElement) {
247 var that = this;
248 switch(this._currentStep){
249 //hides Hint if back button is pressed
hebastaee7b8a82020-01-20 12:45:04 +0100250 case 2:
hebastaf95226b2019-09-19 11:37:00 +0200251 if(KorAP.Hint.active()){
252 KorAP.Hint.unshow();
253 }
254 break;
hebastaee7b8a82020-01-20 12:45:04 +0100255 case 3:
hebastaf95226b2019-09-19 11:37:00 +0200256 KorAP.Hint.show(false);
257 KorAP.Hint.active().dontHide = true;
hebastaee7b8a82020-01-20 12:45:04 +0100258 intro._introItems[3].element = doe.querySelector(".menu.roll.hint");
259 intro._introItems[3].position = doe.querySelector("bottom");
hebastaf95226b2019-09-19 11:37:00 +0200260 break;
hebastaee7b8a82020-01-20 12:45:04 +0100261 case 4:
hebastafa118342021-11-02 19:56:01 +0100262 KorAP.Hint.unshow();
263 KorAP._vcKeyMenu.dontHide = false;
hebastaf95226b2019-09-19 11:37:00 +0200264 break;
hebastafa118342021-11-02 19:56:01 +0100265 case 6:
266 let vccbut = doe.querySelector('#vc-view * .doc > span');
267 vccbut.click();
268 KorAP._vcKeyMenu.dontHide = true;
269 intro._introItems[6].element = doe.querySelector('#vc-view * .menu.roll');
270 intro._introItems[6].position = "left";
271 break;
272 case 7:
273 KorAP._vcKeyMenu.dontHide = false;
274 KorAP._vcKeyMenu.hide();
275 KorAP.vc.fromJson(loc.TOUR_vcQuery);
276 intro._introItems[7].element = doe.querySelector('#vc-view * .doc');
277 intro._introItems[7].position = "left";
hebastaf95226b2019-09-19 11:37:00 +0200278 }
279 });
280
hebasta5df796f2019-05-21 15:27:12 +0200281 // Execute at the end of the tour (By clicking at the done-Button)
282 intro.oncomplete(function(){
283 KorAP.session.set("tour", true);
hebasta94e47cb2019-07-24 22:24:27 +0200284 doe.getElementById("qsubmit").click();
hebasta5df796f2019-05-21 15:27:12 +0200285 });
286
287 return intro;
hebasta75cfca52019-02-19 13:15:27 +0100288 },
hebasta5df796f2019-05-21 15:27:12 +0200289
290
291 /* Guided Tour to explain the different views of the results */
hebastaca61f812019-11-11 22:25:27 +0100292 gTshowResults: function(elparam){
293
294 let tourR = introClass();
hebastaee7b8a82020-01-20 12:45:04 +0100295 tourR.setOptions(usabilityOpts);
hebastaca61f812019-11-11 22:25:27 +0100296
hebasta87f1b1f2019-07-30 13:03:23 +0200297 //for testing purposes
hebasta5df796f2019-05-21 15:27:12 +0200298 if(elparam){
299 doe = elparam;
300 }
hebasta5df796f2019-05-21 15:27:12 +0200301 let StepsSR = [
hebasta87f1b1f2019-07-30 13:03:23 +0200302 //Step 1, intro_item 0
303 {
304 element: '#search',
305 intro: loc.TOUR_kwic ,
306 position: "auto",
307 },
308 //Step 2, intro_item 1
309 {
310 element: doe.querySelector("#search > ol > li"),
311 intro: loc.TOUR_snippet,
312 position: "bottom",
313 },
314 //Step 3, intro_item 2
315 {
316 element: doe.querySelector("#search > ol > li"),
317 intro: loc.TOUR_snippetb,
318 position: "bottom",
319 },
320 //Step 4, intro_item 3
321 {
322 element: doe.querySelector(".action > .metatable"),
323 intro: loc.TOUR_metadatab,
324 position: "bottom",
325 },
326 //Step 5, intro_item 4
327 {
328 element: doe.querySelector(".view.metatable"),
329 intro: loc.TOUR_metadata,
330 position: "auto",
331 },
332 //Step 6, intro_item 5
333 {
334 element: doe.querySelector(".action > .info"),
335 intro: loc.TOUR_tokenb,
336 position: "bottom",
337 },
338 //Step 7, intro_item 6
339 {
340 element: doe.querySelector(".view.tokentable"),
341 intro: loc.TOUR_token,
342 position: "auto",
343 },
344 //Step 8, intro_item 7
hebasta5df796f2019-05-21 15:27:12 +0200345 {
hebasta87f1b1f2019-07-30 13:03:23 +0200346 element: doe.querySelector(".tree"),
347 intro: loc.TOUR_treeb,
348 position: "bottom",
349 },
350 //Step 9, intro_item 8
351 {
hebastaf95226b2019-09-19 11:37:00 +0200352 element: doe.querySelector(".view.relations"),
hebasta87f1b1f2019-07-30 13:03:23 +0200353 intro: loc.TOUR_tree,
hebastaf95226b2019-09-19 11:37:00 +0200354 position: "bottom",
hebasta87f1b1f2019-07-30 13:03:23 +0200355 },
356 //Step 10, intro_item 9
357 {
358 intro: loc.TOUR_tourdone,
359 }
hebasta5df796f2019-05-21 15:27:12 +0200360 ]
hebasta5df796f2019-05-21 15:27:12 +0200361
hebasta87f1b1f2019-07-30 13:03:23 +0200362 tourR.setOptions({steps:StepsSR});
hebastaee7b8a82020-01-20 12:45:04 +0100363 tourR.setOptions(labelOpts);
hebastaf95226b2019-09-19 11:37:00 +0200364
365 tourR.onbeforeexit(function(){
366 KorAP.session.set("tour", false);
hebasta87f1b1f2019-07-30 13:03:23 +0200367 });
hebasta87f1b1f2019-07-30 13:03:23 +0200368 //See also: https://introjs.com/docs/intro/options/
369 tourR.setOption('scrollToElement', true);
370 tourR.setOption('scrollTo','tooltip');
371 this.testPrerequ(StepsSR, tourR);
372
373 //TODO see also: introJS.totalSteps() merge requested: //github.com/usablica/intro.js/pull/268/files
374 tourR.onbeforechange(function(targetedElement){
375
376 if(this._currentStep == 1){
377 KorAP.session.set("tour", false);
378 }
379
380 if(this._currentStep == 2){
381 doe.querySelector("#search > ol > li").click();
382 tourR._introItems[3].element = doe.querySelector('.action > .metatable');
383 tourR._introItems[3].position = "bottom";
384 }
385
386 if(this._currentStep == 4){
387 doe.querySelector(".metatable").click();
388 tourR._introItems[4].element = doe.querySelector('.view.metatable');
389 tourR._introItems[5].element = doe.querySelector('.action > .info');
390 tourR._introItems[5].position = "bottom";
391 }
392
393 if(this._currentStep == 6){
394 doe.querySelector(".info").click();
395 tourR._introItems[6].element = doe.querySelector('.view.tokentable');
396 tourR._introItems[7].element = doe.querySelector('.tree');
397 tourR._introItems[7].position = "bottom";
398 }
399
400 if(this._currentStep == 8){
401 doe.querySelector(".tree").click();
hebasta7fa6f082019-11-17 19:00:52 +0100402 let collect = document.querySelectorAll(".button-group-list")[0].querySelectorAll('li');
403 for(let i = 0; i < collect.length; i++){
404 if (collect[i].innerText == loc.TOUR_Relations) {
405 collect[i].click();
406 break;
407 }
408 }
hebastaf95226b2019-09-19 11:37:00 +0200409 tourR._introItems[8].element = doe.querySelector(".view.relations");
hebasta87f1b1f2019-07-30 13:03:23 +0200410 }
411 });
hebastaf95226b2019-09-19 11:37:00 +0200412
hebasta5df796f2019-05-21 15:27:12 +0200413 return tourR;
414 },
hebasta87f1b1f2019-07-30 13:03:23 +0200415 /*
416 * The total number of steps and the text of the tooltips are needed for jasmine testing.
417 */
418 testPrerequ: function(steps, tour){
419 //TODO see also: introJS.totalSteps() merge requested: //github.com/usablica/intro.js/pull/268/files
420 let StepsT = steps;
421 let gtour = tour;
422 gtour.stepCount = StepsT.length;
423
424 //Array of intro content needed for efficient testing
425 gtour.testIntros = [];
426
427 for(let i = 0; i< StepsT.length; i++){
428 gtour.testIntros.push(StepsT[i].intro);
429 }
430 },
hebasta5df796f2019-05-21 15:27:12 +0200431
hebasta75cfca52019-02-19 13:15:27 +0100432 }
433});