<commit_before>// ****************************************** //
//                    App                     //
// ****************************************** //
window.AdmoApp = BaseObject.create({
  Screens: {},
  kinectOn: true,
  //Used to store the reference to the $scope
  //@deprecated! do not use
  angularScope: null,

  currentState: 1,
  currentScreen: null,
  defaultScreen: null,
  globalComponents:null,

  switchingScreens: false,

  setScreen: function(newScreen) {
    // Ignore if there is no change, or if a transition is in progress
    if (this.switchingScreens || (newScreen == this.currentScreen))
      return;
    this.switchingScreens = true;

    console.log('Switched screen: ' + newScreen);

    var delay = 0;
    if (this.currentScreen) {
      this.currentScreen._hidden();
      delay = this.currentScreen.transition
    }

    this.currentScreen = newScreen;
    this.currentScreen._init();
    window.setTimeout(this.showScreen, delay);
  },

  setGlobalComponents: function(gc){
    console.log(gc);
    this.globalComponents = gc;
    this.globalComponents._init();
    $('#global-components').html(this.globalComponents._getHtml());
    this.globalComponents._shown();
  },

  showScreen: function() {
    if(!this.currentScreen) return;
    $('#screen').addClass(this.currentScreen.getCss());
    $('#screen').html(this.currentScreen._getHtml());
    this.currentScreen._shown();
    this.switchingScreens = false;
  },
  reload: function(data){
    //Force reload the browser even if there is some one in view.
    window.location.reload(true);
  },

  setState: function(newState) {
    if (newState != this.currentState) {
      var oldState = this.currentState;
      // More stuff could happen here...
      this.currentState = newState;
      this.stateChanged(oldState, newState);
      console.log('switched state from : '+ oldState +' to ' + newState);
    }
  },

  stateChanged: function(oldState,newState) {

  },

  handleConfig: function(config){
    AdmoConfig.cmsConfig = config;
    //Can't include the hostname at appstart up since we wont know it then.
    Bugsnag.metaData.unit.hostname = AdmoConfig.cmsConfig.hostname;
    console.log("Updating config to",AdmoConfig.cmsConfig);<commit_msg>Setting class not adding it<commit_after>// ****************************************** //
//                    App                     //
// ****************************************** //
window.AdmoApp = BaseObject.create({
  Screens: {},
  kinectOn: true,
  //Used to store the reference to the $scope
  //@deprecated! do not use
  angularScope: null,

  currentState: 1,
  currentScreen: null,
  defaultScreen: null,
  globalComponents:null,

  switchingScreens: false,

  setScreen: function(newScreen) {
    // Ignore if there is no change, or if a transition is in progress
    if (this.switchingScreens || (newScreen == this.currentScreen))
      return;
    this.switchingScreens = true;

    console.log('Switched screen: ' + newScreen);

    var delay = 0;
    if (this.currentScreen) {
      this.currentScreen._hidden();
      delay = this.currentScreen.transition
    }

    this.currentScreen = newScreen;
    this.currentScreen._init();
    window.setTimeout(this.showScreen, delay);
  },

  setGlobalComponents: function(gc){
    console.log(gc);
    this.globalComponents = gc;
    this.globalComponents._init();
    $('#global-components').html(this.globalComponents._getHtml());
    this.globalComponents._shown();
  },

  showScreen: function() {
    if(!this.currentScreen) return;
    //Can't use addclass or set class because it changes over time.
    $('#screen').attr("class",this.currentScreen.getCss());
    $('#screen').html(this.currentScreen._getHtml());
    this.currentScreen._shown();
    this.switchingScreens = false;
  },
  reload: function(data){
    //Force reload the browser even if there is some one in view.
    window.location.reload(true);
  },

  setState: function(newState) {
    if (newState != this.currentState) {
      var oldState = this.currentState;
      // More stuff could happen here...
      this.currentState = newState;
      this.stateChanged(oldState, newState);
      console.log('switched state from : '+ oldState +' to ' + newState);
    }
  },

  stateChanged: function(oldState,newState) {

  },

  handleConfig: function(config){
    AdmoConfig.cmsConfig = config;
    //Can't include the hostname at appstart up since we wont know it then.
    Bugsnag.metaData.unit.hostname = AdmoConfig.cmsConfig.hostname;
    console.log("Updating config to",AdmoConfig.cmsConfig);
{'fraction_non_alphanumeric': 0.15932868352223192, 'fraction_numerical': 0.0008718395815170009, 'mean_word_length': 3.253012048192771, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2870204', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1317, 'n_words': 308}