<commit_before>/*
  ROUTES.JS
 */
riot.route.stop(); //clear all route callbacks

app.currentPage = null;

app.goTo = function (pageName) {
  var pageNode = document.querySelector(pageName);
  if (app.currentPage) {
    app.currentPage.classList.remove('show');
  }
  pageNode.classList.add('show');
  app.currentPage = pageNode;
};

riot.route(function() {
  console.info("this page is not defined. Redirect to Inventory");
  riot.route('/inventory', 'Inventory');
});

riot.route('/', function(){
  console.info('no page defined. Redirecting to inventory');
  riot.route('/inventory', 'Inventory');
});

riot.route('/inventory', function(){
  app.goTo('inventory');
});

riot.route('/scanner', function() {<commit_msg>redesigns router to trigger show/hide events<commit_after>/*
  ROUTES.JS
 */
riot.route.stop(); //clear all route callbacks

app.currentPage = null;

app.goTo = function (pageName) {
  var nextPageTag = riot.vdom.find(function (tag) {
    return tag.root.localName === pageName
  });
  
  if (app.currentPage) {
    app.currentPage.root.classList.remove('show');
    app.currentPage.trigger('hide');
  }
  
  app.currentPage = nextPageTag;
  
  app.currentPage.root.classList.add('show');
  app.currentPage.trigger('show');
};

riot.route(function() {
  console.info("this page is not defined. Redirect to Inventory");
  riot.route('/inventory', 'Inventory');
});

riot.route('/', function(){
  console.info('no page defined. Redirecting to inventory');
  riot.route('/inventory', 'Inventory');
});

riot.route('/inventory', function(){
  app.goTo('inventory');
});

riot.route('/scanner', function() {
{'fraction_non_alphanumeric': 0.18249075215782984, 'fraction_numerical': 0.0, 'mean_word_length': 4.4280936454849495, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7025076', 'n_tokens_mistral': 546, 'n_tokens_neox': 533, 'n_words': 105}