lib/js/PageView.js
function(id) {
      var t = this;

      // Is there a tour running already?
      if (t.tourView) {
        t.tourView.stop();
      }

      // Load the Tour and start it
      var tour = new UI.Tour({id:id});
      tour.fetch(function(err){
        if (err) {
          alert("Error: Cannot open tour id: " + id);
          console.error(e);
          return;
        }

        // Go to the first page
        var pages = tour.get('pages');
        if (!pages.length) {
          alert('No pages in tour: ' + tour.get('title'));
          return;
        }

        // Save the current tour, and navigate to it
        localStorage.currentTour = JSON.stringify(tour);
        t.navigateTo(pages[0].url);
      });
    }
function(id) {
      var t = this;

      // Is there a tour running already?
      if (t.tourView) {
        t.tourView.stop();
      }

      // Load the Tour and start it
      var tour = new UI.Tour({id:id});
      tour.fetch(function(err){
        if (err) {
          alert("Error: Cannot open tour id: " + id);
          console.error(e);
          return;
        }

        // Go to the first page
        var pages = tour.get('pages');
        if (!pages.length) {
          alert('No pages in tour: ' + tour.get('title'));
          return;
        }

        // Save the current tour, and navigate to it
        localStorage.currentTour = JSON.stringify(tour);
        t.navigateTo(pages[0].url);
      });
    }
function ( id ) { var t = this ; // Is there a tour running already? if ( t . tourView ) { t . tourView . stop ( ) ; } // Load the Tour and start it var tour = new UI . Tour ( { id : id } ) ; tour . fetch ( function ( err ) { if ( err ) { alert ( "Error: Cannot open tour id: " + id ) ; console . error ( e ) ; return ; } // Go to the first page var pages = tour . get ( 'pages' ) ; if ( ! pages . length ) { alert ( 'No pages in tour: ' + tour . get ( 'title' ) ) ; return ; } // Save the current tour, and navigate to it localStorage . currentTour = JSON . stringify ( tour ) ; t . navigateTo ( pages [ 0 ] . url ) ; } ) ; }
Run the tour specified by id
Run the tour specified by id