-# this class will register itself just before application starts loading, right after framework is ready
-
-# if localStorage.disableWebSocket?
-#   if localStorage.disableWebSocket is "true"
-#     window.WebSocket = null
-# else if KD.config.kites.disableWebSocketByDefault
-#   window.WebSocket = null
-
 KD.extend
   newKodingLaunchDate: do ->
     d = new Date()

  registerRoutes: (appName, routes) ->

    @registerRoute appName, route, handler for own route, handler of routes


  showEnforceLoginModal: ->

    return  if KD.isLoggedIn()
    if Cookies.get('doNotForceRegistration') or location.search.indexOf('sr=1') > -1
      Cookies.set 'doNotForceRegistration', 'true'
      return

    {appManager} = KD.singletons
    appManager.tell 'Account', 'showRegistrationNeededModal'


  registerRoute: (appName, route, handler) ->

    if (new Date createdAt) > KD.newKodingLaunchDate
      Cookies.set 'koding082014', 'koding082014'

  config       : {}
  apiUri       : null
  appsUri      : null
  singleton    : KD.getSingleton.bind KD
  appClasses   : {}
  appScripts   : {}
