Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manifest_unityclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"author": "Imagine Learning",
"version": "1.80.6643",
"manifest_version": 2,
"offline_enabled": true,
"offline_enabled": false,
"minimum_chrome_version": "56",
"kiosk_enabled": true,
"description": "Imagine Language & Literacy® teaches language and literacy to students around the world through engaging, interactive instruction.",
"app": {
"background": {
"scripts": ["underscore.js","encoding.js","common.js","log-full.js","mime.js","buffer.js","request.js","stream.js","chromesocketxhr.js","connection.js","webapp.js","websocket.js","handlers.js","httplib.js","upnp.js","background.js"]
Expand All @@ -19,7 +20,6 @@
"webview",
"alarms",
"storage",
"power",
"system.network",
"audioCapture",
{"fileSystem":["write","directory","retainEntries"]}
Expand Down
5 changes: 5 additions & 0 deletions parseSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,10 @@ function convertServerSettingsToUrl(serverSettings, launchUrl) {
}
}

//if no environment set then default to production
if(url.indexOf("env") < 0) {
url += (url.indexOf('?') < 0 ? '?' : '&') + 'env=production';
}

return url;
}
57 changes: 15 additions & 42 deletions webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
this.fs = null
this.streams = {}
this.upnp = null
//force load the internal IL directory
//force load the internal IL directory
var self = this;
chrome.runtime.getPackageDirectoryEntry(
function (directoryEntry) {
directoryEntry.getDirectory('IL', { create: false }, function (ilEntry) {
self.on_entry(ilEntry);
function (directoryEntry) {
directoryEntry.getDirectory('IL', { create: false }, function (ilEntry) {
self.on_entry(ilEntry);

});
});
});
});
if (opts.entry) {
this.on_entry(opts.entry)
}
Expand Down Expand Up @@ -91,19 +91,6 @@
lasterr: this.lasterr
}
},
updatedSleepSetting: function() {
if (! this.started) {
chrome.power.releaseKeepAwake()
return
}
if (this.opts.optPreventSleep) {
console.log('requesting keep awake system')
chrome.power.requestKeepAwake(chrome.power.Level.SYSTEM)
} else {
console.log('releasing keep awake system')
chrome.power.releaseKeepAwake()
}
},
on_entry: function(entry) {
var fs = new WSC.FileSystem(entry)
this.fs = fs
Expand Down Expand Up @@ -142,10 +129,6 @@
if (this.on_status_change) { this.on_status_change() }
},
start_success: function(data) {
if (this.opts.optPreventSleep) {
console.log('requesting keep awake system')
chrome.power.requestKeepAwake(chrome.power.Level.SYSTEM)
}
var callback = this.start_callback
this.start_callback = null
this.registerIdle()
Expand All @@ -155,9 +138,6 @@
this.change()
},
error: function(data) {
if (this.opts.optPreventSleep) {
chrome.power.releaseKeepAwake()
}
this.interface_retry_count=0
var callback = this.start_callback
this.starting = false
Expand All @@ -181,13 +161,6 @@
return
}
this.clearIdle()

if (true || this.opts.optPreventSleep) {
if (WSC.VERBOSE)
console.log('trying release keep awake')
if (chrome.power)
chrome.power.releaseKeepAwake()
}
// TODO: remove hidden.html ensureFirewallOpen
// also - support multiple instances.

Expand Down Expand Up @@ -310,12 +283,12 @@
onPortmapResult: function(result) {
var gateway = this.upnp.validGateway
console.log('portmap result',result,gateway)
if (result && ! result.error) {
if (gateway.device && gateway.device.externalIP) {
var extIP = gateway.device.externalIP
this.extra_urls = [{url:'http://'+extIP+':' + this.port}]
}
}
if (result && ! result.error) {
if (gateway.device && gateway.device.externalIP) {
var extIP = gateway.device.externalIP
this.extra_urls = [{url:'http://'+extIP+':' + this.port}]
}
}
this.onReady()
},
onReady: function() {
Expand Down Expand Up @@ -356,14 +329,14 @@
this.sockInfo = m
this.port = m.localPort
callback({port:m.localPort})
return
return
}
this.doTryListenOnPort(state, callback)
this.doTryListenOnPort(state, callback)
}
}.bind(this))
},
doTryListenOnPort: function(state, callback) {
var opts = this.opts.optBackground ? {name:"WSCListenSocket", persistent:true} : {}
var opts = this.opts.optBackground ? {name:"WSCListenSocket", persistent:true} : {}
sockets.tcpServer.create(opts, this.onServerSocket.bind(this,state,callback))
},
onServerSocket: function(state,callback,sockInfo) {
Expand Down