content/hifi-content/Experiences/LoadTest/SignUpApp/loadEBApp.js
2022-02-13 23:16:46 +01:00

57 lines
No EOL
1.5 KiB
JavaScript

// loadApplauseApp.js
//
// Loads the applause app on to a user's device while they are in the vicinity
// Created by Liv Erickson 6/18/2018
//
// Copyright 2018 High Fidelity Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function(){
var EB_APP_LOCATION = "http://hifi-content.s3-us-west-1.amazonaws.com/Experiences/LoadTest/SignUpApp/eventBriteSignUp.js";
var LoadEB = function() {};
function hasApp () {
var runningScriptList = ScriptDiscoveryService.getRunning();
runningScriptList.forEach(function (scriptInfo) {
if (scriptInfo.url === EB_APP_LOCATION) {
return true;
}
});
return false;
}
LoadEB.prototype = {
preload: function() {
if (!hasApp()) {
ScriptDiscoveryService.loadScript(EB_APP_LOCATION);
}
},
unload: function() {
if (hasApp()) {
ScriptDiscoveryService.stopScript(EB_APP_LOCATION);
}
}
};
return new LoadEB();
});
// var properties = Entities.getEntityProperties(entityID, ["name", "userData"]);
// try {
// var userData = JSON.parse(properties.userData);
// if (userData.eventName) {
// appSettingsName = HAS_EB_APP_SETTING + eventName;
// }
// } catch (e) {
// console.error("Issue parsing userData for feedbackLoader", e);
// }