<commit_before>
app.pageguide = {};

/* THE DEFAULT PAGE GUIDE */

var defaultGuide = {
  id: 'default-guide',
  title: 'Default Guide',
  steps: [
    {
      target: '#dataTab',
      content: $('#help-text-dataTab').html(),
      direction: 'top',
      arrow: {offsetX: 45, offsetY: 10}
    },
    {
      target: '#activeTab',
      content: $('#help-text-activeTab').html(),
      direction: 'top',
      arrow: {offsetX: 65, offsetY: 10}
    },
    {
      target: '.olControlZoom',
      content: $('#help-text-olControlZoom').html(),
      direction: 'right',
      arrow: {offsetX: 0, offsetY: 0}
    },
    {
      target: '#basemaps',
      content: $('#help-text-basemaps').html(),
      direction: 'left',
      arrow: {offsetX: -95, offsetY: 10}
    }
  ]
}

var defaultGuideOverrides = {
  events: {
    open: function () {
      //alert("The guide has begun!");
      //open the basemaps buttons and keep them open
      $('#basemaps').addClass('open');
      app.pageguide.preventBasemapsClose = true;
      //increase the z-value of SimpleLayerSwitcher so it falls on top of the pageguide icon
      $('#SimpleLayerSwitcher_30').css('z-index', 1100);
      //adjust the pageguide icon so it is left of the open basemaps buttons 
      for (var i=0; i < defaultGuide.steps.length; i++) {
        if ( defaultGuide.steps[i].target === '#basemaps' ) {
            defaultGuide.steps[i].arrow.offsetX = 0;
        }
      }      
      $('#dataTab').tab('show');
    },
    close: function () {
      //alert("The guide has ended!");
      //return the zindex of the SimpleLayerSwitcher to its original value
      $('#SimpleLayerSwitcher_30').css('z-index', 1005);
      //deactivate the prevention of the basemaps buttons closing
      app.pageguide.preventBasemapsClose = true;
      //close the basemaps buttons
      $('#basemaps').removeClass('open');
      //return the offset of the pageguide icon so it doesn't move out of place as the guide closes
      for (var i=0; i < defaultGuide.steps.length; i++) {
        if ( defaultGuide.steps[i].target === '#basemaps' ) {
            defaultGuide.steps[i].arrow.offsetX = -95;
        }
      }
      //return the map state to what it was before the pageguide began
      app.loadState(app.pageguide.state);
      app.saveStateMode = true;
    }
  },
  step: {
    events: {
      select: function() {
        if ($(this).data('idx') === 0) {
            $('#dataTab').tab('show');
        } else if ($(this).data('idx') === 1) {
            $('#activeTab').tab('show');
        } else {
            $('#dataTab').tab('show');
            //$('#basemaps').addClass('open');<commit_msg>ensuring layers panel is shown during each step of the default tutorial<commit_after>
app.pageguide = {};

/* THE DEFAULT PAGE GUIDE */

var defaultGuide = {
  id: 'default-guide',
  title: 'Default Guide',
  steps: [
    {
      target: '#dataTab',
      content: $('#help-text-dataTab').html(),
      direction: 'top',
      arrow: {offsetX: 45, offsetY: 10}
    },
    {
      target: '#activeTab',
      content: $('#help-text-activeTab').html(),
      direction: 'top',
      arrow: {offsetX: 65, offsetY: 10}
    },
    {
      target: '.olControlZoom',
      content: $('#help-text-olControlZoom').html(),
      direction: 'right',
      arrow: {offsetX: 0, offsetY: 0}
    },
    {
      target: '#basemaps',
      content: $('#help-text-basemaps').html(),
      direction: 'left',
      arrow: {offsetX: -95, offsetY: 10}
    }
  ]
}

var defaultGuideOverrides = {
  events: {
    open: function () {
      //alert("The guide has begun!");
      //open the basemaps buttons and keep them open
      $('#basemaps').addClass('open');
      app.pageguide.preventBasemapsClose = true;
      //increase the z-value of SimpleLayerSwitcher so it falls on top of the pageguide icon
      $('#SimpleLayerSwitcher_30').css('z-index', 1100);
      //adjust the pageguide icon so it is left of the open basemaps buttons 
      for (var i=0; i < defaultGuide.steps.length; i++) {
        if ( defaultGuide.steps[i].target === '#basemaps' ) {
            defaultGuide.steps[i].arrow.offsetX = 0;
        }
      }      
      $('#dataTab').tab('show');
    },
    close: function () {
      //alert("The guide has ended!");
      //return the zindex of the SimpleLayerSwitcher to its original value
      $('#SimpleLayerSwitcher_30').css('z-index', 1005);
      //deactivate the prevention of the basemaps buttons closing
      app.pageguide.preventBasemapsClose = true;
      //close the basemaps buttons
      $('#basemaps').removeClass('open');
      //return the offset of the pageguide icon so it doesn't move out of place as the guide closes
      for (var i=0; i < defaultGuide.steps.length; i++) {
        if ( defaultGuide.steps[i].target === '#basemaps' ) {
            defaultGuide.steps[i].arrow.offsetX = -95;
        }
      }
      //return the map state to what it was before the pageguide began
      app.loadState(app.pageguide.state);
      app.saveStateMode = true;
    }
  },
  step: {
    events: {
      select: function() {
        if ($(this).data('idx') === 0) {
            app.viewModel.showLayers(true);
            $('#dataTab').tab('show');
        } else if ($(this).data('idx') === 1) {
            app.viewModel.showLayers(true);
            $('#activeTab').tab('show');
        } else {
            app.viewModel.showLayers(true);
            $('#dataTab').tab('show');
            //$('#basemaps').addClass('open');
{'fraction_non_alphanumeric': 0.16230461650308978, 'fraction_numerical': 0.011995637949836423, 'mean_word_length': 2.36163714111179, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '946353', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1681, 'n_words': 437}