Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them has been replaced with a symlink. Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still be present.
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
(function() {
|
|
var _this;
|
|
var basePath = "http://nerdchallenge.com/hifi/";
|
|
var startupScript = basePath + "scripts/pd_player.js";
|
|
PlayerDetector = function() {
|
|
_this = this;
|
|
};
|
|
|
|
function isScriptRunning(script) {
|
|
script = script.toLowerCase().trim();
|
|
var runningScripts = ScriptDiscoveryService.getRunning();
|
|
for (i in runningScripts) {
|
|
if (runningScripts[i].url.toLowerCase().trim() == script) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|
|
PlayerDetector.prototype = {
|
|
|
|
update: function() {
|
|
var entityID = _this.entityID;
|
|
var props = Entities.getEntityProperties(entityID);
|
|
},
|
|
|
|
preload: function(entityID) {
|
|
print("preload!");
|
|
this.entityID = entityID;
|
|
if (!isScriptRunning(startupScript))
|
|
Script.load(startupScript);
|
|
//Script.update.connect(this.update);
|
|
},
|
|
|
|
unload: function(entityID) {
|
|
print("**** UNLOAD *****");
|
|
Script.update.disconnect(this.update);
|
|
},
|
|
};
|
|
|
|
return new PlayerDetector();
|
|
})
|