var angular = require('angular');
require('./modules');
require('./init');
require('./directives/tabs');
require('./directives/sinoTabs');
require('./directives/sinosearchmodal');
require('./directives/sinoevent');
require('./directives/footerinput');
require('./directives/compile');
require('./directives/longpress');
require('./directives/audioplayer');
require('./directives/imageview');
require('./directives/sinofocus');
require('./directives/contenteditable');
require('./directives/sinoSpeakerView');
require('./directives/waitingpointer');
require('./directives/$toast');
require('./directives/workflowstatus');
require('./directives/sinoListScrollDelegate');
require('./services/CommonService');
require('./services/fileService');
require('./services/localforage');
require('./services/CacheArray');
require('./services/PageableArray');
require('./services/PageableCacheArray');
require('./services/DiscussService');
require('./services/Timer');
require('./services/AudioPlayerService');
require('./formDataRequestInterceptor');
require('./directives/sinoTextarea');
require('./services/CacheFactory');
require('./services/LocalCache');
require('./services/MemCache');
require('./directives/sinoClick');
require('./directives/sinoBreadcrumb');
require('./services/sinoClickService');
require('./directives/onTouchmove');
require('./directives/onTouchend');
require('./directives/onTouchstart');
require('./directives/sinoFooterGroup');
require('./directives/sinoSelectOption');
require('./services/SelectOptionModal');
require('./services/AppConfig');
require('./services/sinoNetwork');
require('./directives/sinoConnected');
require('./services/AppConnected');
require('./directives/sinoConfig');
require('./services/appVersionUpdate');
require('./directives/sinogobackbutton');
require('./services/configService');
require('./directives/sinoClosableFormItemDivider');
require('./directives/sinoClosableMeetItemDivider');
require('./directives/sinoLoadingHint');
require('./directives/sinomodalbackbutton');
require('./directives/sinoFlowSearchInPane');
require('./directives/ionRadioFix');
require('./services/AppModulesAuthVisibleService');
require('./services/AppModules');
require('./services/AppInitStop');
require('./services/CacheService');
require('./services/ContinuousWebSocket');

if (!window.cordova) {
  if (window.localStorage.device) {
    window.device = JSON.parse(window.localStorage.device);
  } else {
    window.device = {
      uuid: (Math.floor(Math.random() * 10000) + '_' + new Date().getTime()),
      name: '浏览器',
      platform: 'Windows 8',
      model: 'chrome'
    };
    window.localStorage.device = JSON.stringify(window.device);
  }
}

module.exports = angular.module('commons');
