var path = window.location.pathname.replace(/\/index\.php/, '') var options = {}; var run = false; var oncomplete = function() {} var steps_file = { steps: [{ title: 'Welcome on files!', intro: 'Hello World! 👋' }, { element: document.querySelector('.avatardiv'), intro: 'This step focuses on the avatar' }, { title: 'Farewell!', intro: 'And this is our final step!' }] } var steps_settings = { steps: [{ title: 'Welcome on settings/user!', intro: 'Hello World! 👋' }, { element: document.querySelector('.avatardiv'), intro: 'This step focuses on the avatar' }, { title: 'Farewell!', intro: 'And this is our final step!' }] } switch(path){ case "/apps/files/": options = steps_file; run = true; oncomplete = function() { setStatus(0); }; break; case "/settings/user": options = steps_settings; run = true; break; } if(run){ introJs().setOptions(options).oncomplete(oncomplete).start(); }