<commit_before>// Ionic Starter App

angular.module('starter', ['ionic', 'ionic.contrib.frostedGlass',
    'angularMoment', 'picture', 'ranking', 'guessword', 'word', 'intro',
    'register', 'profile', 'lobby', 'sketch', 'chat', 'room',
  ])
  .run(function($ionicPlatform, amMoment) {
    $ionicPlatform.ready(function() {
      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
      // for form inputs)
      if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);
      }
      if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
      }
    });
    amMoment.changeLocale('ko');
  })
  .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
    // if none of the above states are matched, use this as the fallback
    $ionicConfigProvider.views.maxCache(0);
    $urlRouterProvider.otherwise('/intro');
  })
  .factory('chatSocket', function($rootScope, $location) {
    var socketUrl = $location.protocol() + '://' + $location.host() + ':' + $location.port() + '/chat-socket';
    console.log(socketUrl);

    var socket = io.connect('/chat');
    console.log(socket);

    return {
      on: function(eventName, callback) {
        socket.on(eventName, function() {
          var args = arguments;
          $rootScope.$apply(function() {
            callback.apply(socket, args);
          });
        });
      },
      emit: function(eventName, data, callback) {
        socket.emit(eventName, data, function() {
          var args = arguments;
          $rootScope.$apply(function() {
            if (callback) {
              callback.apply(socket, args);
            }
          });
        });
      },<commit_msg>Fix to use built socket connect url when io.connect().<commit_after>// Ionic Starter App

angular.module('starter', ['ionic', 'ionic.contrib.frostedGlass',
    'angularMoment', 'picture', 'ranking', 'guessword', 'word', 'intro',
    'register', 'profile', 'lobby', 'sketch', 'chat', 'room',
  ])
  .run(function($ionicPlatform, amMoment) {
    $ionicPlatform.ready(function() {
      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
      // for form inputs)
      if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);
      }
      if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
      }
    });
    amMoment.changeLocale('ko');
  })
  .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
    // if none of the above states are matched, use this as the fallback
    $ionicConfigProvider.views.maxCache(0);
    $urlRouterProvider.otherwise('/intro');
  })
  .factory('chatSocket', function($rootScope, $location) {
    var socketUrl = $location.protocol() + '://' + $location.host() + ':' + $location.port() + '/chat';
    var socket = io.connect(socketUrl);

    return {
      on: function(eventName, callback) {
        socket.on(eventName, function() {
          var args = arguments;
          $rootScope.$apply(function() {
            callback.apply(socket, args);
          });
        });
      },
      emit: function(eventName, data, callback) {
        socket.emit(eventName, data, function() {
          var args = arguments;
          $rootScope.$apply(function() {
            if (callback) {
              callback.apply(socket, args);
            }
          });
        });
      },
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.0005376344086021505, 'mean_word_length': 2.6768774703557314, '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': '2918790', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1063, 'n_words': 228}