Skip to content
intro.js 1012 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
var path = window.location.pathname.replace(/\/index\.php/, '')
var options = {};
var run = false;
Pierre Ozoux's avatar
Pierre Ozoux committed
var oncomplete = function() {}
Pierre Ozoux's avatar
Pierre Ozoux committed

Pierre Ozoux's avatar
Pierre Ozoux committed
var steps_file = {
Pierre Ozoux's avatar
Pierre Ozoux committed
  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!'
  }]
}

Pierre Ozoux's avatar
Pierre Ozoux committed
var steps_settings = {
Pierre Ozoux's avatar
Pierre Ozoux committed
  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/":
Pierre Ozoux's avatar
Pierre Ozoux committed
    options = steps_file;
Pierre Ozoux's avatar
Pierre Ozoux committed
    run = true;
    oncomplete = function() {
      setStatus(0);
Pierre Ozoux's avatar
Pierre Ozoux committed
    };
    break;
Pierre Ozoux's avatar
Pierre Ozoux committed
  case "/settings/user":
Pierre Ozoux's avatar
Pierre Ozoux committed
    options = steps_settings;
Pierre Ozoux's avatar
Pierre Ozoux committed
    run = true;
Pierre Ozoux's avatar
Pierre Ozoux committed
    break;
Pierre Ozoux's avatar
Pierre Ozoux committed
}

if(run){
  introJs().setOptions(options).oncomplete(oncomplete).start();
}