2018-08-28 14:49:03 +02:00
|
|
|
class APIManager extends window.classes.BaseObject
|
2018-09-17 19:43:24 +02:00
|
|
|
constructor: (@args) ->
|
2018-08-28 14:49:03 +02:00
|
|
|
super "APIManager"
|
|
|
|
|
2018-09-17 19:43:24 +02:00
|
|
|
init: () ->
|
|
|
|
me = @
|
|
|
|
return console.error "No class found" unless @args and @args.length > 0
|
|
|
|
cname = (@args.splice 0,1)[0].trim()
|
2018-08-28 14:49:03 +02:00
|
|
|
@ready()
|
|
|
|
.then () ->
|
|
|
|
if mobilecheck()
|
|
|
|
mobileConsole.init()
|
|
|
|
# load the class
|
|
|
|
return if not cname or cname is ""
|
|
|
|
return console.error("Cannot find class ", cname) unless window.classes[cname]
|
2018-09-17 19:43:24 +02:00
|
|
|
(new window.classes[cname](me.args)).init()
|
2018-08-28 14:49:03 +02:00
|
|
|
.catch ( m, s ) ->
|
|
|
|
console.error(m, s)
|
|
|
|
|
|
|
|
APIManager.dependencies = [
|
|
|
|
"/assets/scripts/mobile_console.js"
|
|
|
|
]
|
|
|
|
|
|
|
|
makeclass "APIManager", APIManager
|