<commit_before>var Game = {};

Game.Loader = (function() {
  var Loader = function() {
    this.resources = [{
      name: 'ch1',
      type:'json',
      src: 'assets/images/ch1.json'
    }, {
      name: 'ch1',
      type: 'image',
      src: 'assets/images/ch1.png'
    }, {
      name: 'dialog',
      type: 'image',
      src: 'assets/images/dialog.png'
    }];
  }

  Loader.prototype.init = function() {
    if(!me.video.init("app", 480, 320, false, 'auto', true)) {
      alert('please use a browser that supports the canvas');
    }
    else {
      me.loader.onload = this.loaded.bind(this);
      me.loader.preload(this.resources);
      me.state.change(me.state.LOADING);
    }
  }

  Loader.prototype.loaded = function() {
    me.state.set(me.state.MENU, new Game.MenuScreen());
    me.state.change(me.state.MENU);
  }

  return Loader;
})();

window.onReady(function() {
  var loader = new Game.Loader();
  loader.init();
});<commit_msg>added in mobile defaults.<commit_after>var Game = {};

Game.Loader = (function() {
  var Loader = function() {
    this.resources = [{
      name: 'ch1',
      type:'json',
      src: 'assets/images/ch1.json'
    }, {
      name: 'ch1',
      type: 'image',
      src: 'assets/images/ch1.png'
    }, {
      name: 'dialog',
      type: 'image',
      src: 'assets/images/dialog.png'
    }];
  }

  Loader.prototype.init = function() {
    if(!me.video.init("app", 480, 320, false, 'auto', true)) {
      alert('please use a browser that supports the canvas');
    }
    else {
      me.loader.onload = this.loaded.bind(this);
      me.loader.preload(this.resources);
      me.state.change(me.state.LOADING);
    }
  }

  Loader.prototype.loaded = function() {
    me.state.set(me.state.MENU, new Game.MenuScreen());
    me.state.change(me.state.MENU);
  }

  return Loader;
})();

window.onReady(function() {
  var loader = new Game.Loader();
  loader.init();
  if (me.sys.isMobile && !navigator.isCocoonJS) {
    // Prevent the webview from moving on a swipe
    window.document.addEventListener("touchmove", function (e) {
      e.preventDefault();
      window.scroll(0, 0);
      return false;
    }, false);

    // Scroll away mobile GUI
    (function () {
      window.scrollTo(0, 1);
    }).defer();

    me.event.subscribe(me.event.WINDOW_ONRESIZE, function (e) {
      window.scrollTo(0, 1);
    })

    // Retina viewport settings
    if (window.devicePixelRatio > 1) {
      document.getElementById("viewport").setAttribute(
        "content",
        "width=device-width, initial-scale=0.5, maximum-scale=0.5, user-scalable=0"
      );
    }
  }
});
{'fraction_non_alphanumeric': 0.1729812476081133, 'fraction_numerical': 0.012246460007654038, 'mean_word_length': 2.522911051212938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6836426', 'n_tokens_mistral': 924, 'n_tokens_neox': 887, 'n_words': 168}