<commit_before>var __ = require('underscore'),
    Backbone = require('backbone'),
    $ = require('jquery');
Backbone.$ = $;

var homeView = require('./views/homeVw'),
    userPageView = require('./views/userPageVw'),
    aboutView = require('./views/aboutVw'),
    donateView = require('./views/donateVw'),
    settingsView = require('./views/settingsVw');

module.exports = Backbone.Router.extend({

  initialize: function(options){
    this.options = options || {};
    /*
    expects options.userModel from app.js
     */
    //this.socketView = new socketView({model: options.userModel});
    this.socketView = options.socketView;
  },

  routes: {
    "": "userPage",
    "home": "home",
    "myPage": "userPage",
    "userPage": "userPage",
    "userPage/:userID(/:state)(/:itemHash)": "userPage",
    "customizePage": "customizePage",
    "sellItem": "sellItem",
    "purchases": "purchases",
    "sales": "sales",
    "cases": "cases",
    "notifications": "notifications",
    "settings": "settings",
    "about": "about",
    "support": "donate"
  },

  newView: function(view){
    this.view && (this.view.close ? this.view.close() : this.view.remove());
    this.view = view;
    $('body').removeClass("userPage");//add other body style classes if they are created
    $('#obContainer').removeClass("box-borderDashed"); //remove customization styling if present
    //clear address bar. This will be replaced on the user page
    window.obEventBus.trigger("setAddressBar", "");
  },

  home: function(){
    this.newView(new homeView({
      userModel: this.options.userModel,
      socketView: this.socketView
    }));
  },

  userPage: function(userID, state, itemHash){
    this.newView(new userPageView({
      userModel: this.options.userModel,
      userID: userID,
      state: state,
      itemHash: itemHash,
      socketView: this.socketView
    }));
    $('body').addClass("userPage");
  },

  customizePage: function(){
    console.log("customizePage");
  },

  sellItem: function(){
    this.newView(new userPageView({
      userModel: this.options.userModel,
      userID: this.options.userModel.get('guid'),
      state: 'itemNew'
    }));
    $('body').addClass("userPage");
  },

  purchases: function(){
    console.log("purchases");
  },

  sales: function(){
    console.log("sales");
  },

  cases: function(){
    console.log("cases");
  },

  notifications: function(){
    console.log("notifications");
  },

  settings: function(){
    this.newView(new settingsView({userModel: this.options.userModel}));
  },

  about: function(){
    this.newView(new aboutView());
    console.log("about");
  },

  donate: function(){
    this.newView(new donateView());
    console.log("support");
  }

});<commit_msg>cleanup loading screen<commit_after>var __ = require('underscore'),
    Backbone = require('backbone'),
    $ = require('jquery');
Backbone.$ = $;

var homeView = require('./views/homeVw'),
    userPageView = require('./views/userPageVw'),
    aboutView = require('./views/aboutVw'),
    donateView = require('./views/donateVw'),
    settingsView = require('./views/settingsVw');

module.exports = Backbone.Router.extend({

  initialize: function(options){
    this.options = options || {};
    /*
    expects options.userModel from app.js
     */
    //this.socketView = new socketView({model: options.userModel});
    this.socketView = options.socketView;
  },

  routes: {
    "": "userPage",
    "home": "home",
    "myPage": "userPage",
    "userPage": "userPage",
    "userPage/:userID(/:state)(/:itemHash)": "userPage",
    "customizePage": "customizePage",
    "sellItem": "sellItem",
    "purchases": "purchases",
    "sales": "sales",
    "cases": "cases",
    "notifications": "notifications",
    "settings": "settings",
    "about": "about",
    "support": "donate"
  },

  cleanup: function(){
    "use strict";
    $('.js-loadingModal').addClass('hide'); //hide modal if it is still visible
  },

  newView: function(view){
    "use strict";
    $('body').removeClass("userPage");//add other body style classes if they are created
    $('#obContainer').removeClass("box-borderDashed"); //remove customization styling if present
    this.view && (this.view.close ? this.view.close() : this.view.remove());
    this.view = view;
    //clear address bar. This will be replaced on the user page
    window.obEventBus.trigger("setAddressBar", "");
  },

  home: function(){
    "use strict";
    this.cleanup();
    this.newView(new homeView({
      userModel: this.options.userModel,
      socketView: this.socketView
    }));
  },

  userPage: function(userID, state, itemHash){
    "use strict";
    this.cleanup();
    this.newView(new userPageView({
      userModel: this.options.userModel,
      userID: userID,
      state: state,
      itemHash: itemHash,
      socketView: this.socketView
    }));
    $('body').addClass("userPage");
  },

  customizePage: function(){
    "use strict";
    this.cleanup();
    console.log("customizePage");
  },

  sellItem: function(){
    "use strict";
    this.cleanup();
    this.newView(new userPageView({
      userModel: this.options.userModel,
      userID: this.options.userModel.get('guid'),
      state: 'itemNew'
    }));
    $('body').addClass("userPage");
  },

  purchases: function(){
    "use strict";
    this.cleanup();
    console.log("purchases");
  },

  sales: function(){
    "use strict";
    this.cleanup();
    console.log("sales");
  },

  cases: function(){
    "use strict";
    this.cleanup();
    console.log("cases");
  },

  notifications: function(){
    "use strict";
    this.cleanup();
    console.log("notifications");
  },

  settings: function(){
    "use strict";
    this.cleanup();
    this.newView(new settingsView({userModel: this.options.userModel}));
  },

  about: function(){
    "use strict";
    this.cleanup();
    this.newView(new aboutView());
  },

  donate: function(){
    "use strict";
    this.cleanup();
    this.newView(new donateView());
  }

});
{'fraction_non_alphanumeric': 0.17915417915417917, 'fraction_numerical': 0.0, 'mean_word_length': 3.2845934379457917, 'pattern_counts': {'":': 28, '<': 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': '3892211', 'n_tokens_mistral': 1900, 'n_tokens_neox': 1880, 'n_words': 371}