From 217ec46222babb371830b0365b0211a175ee0a5e Mon Sep 17 00:00:00 2001 From: Faye Li Date: Fri, 17 Feb 2017 10:54:40 -0800 Subject: [PATCH] able to switch camera and clean up code --- .../render/photobooth/html/photobooth.html | 31 +++---------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/scripts/developer/utilities/render/photobooth/html/photobooth.html b/scripts/developer/utilities/render/photobooth/html/photobooth.html index b23b65cfdd..e60cb2764d 100644 --- a/scripts/developer/utilities/render/photobooth/html/photobooth.html +++ b/scripts/developer/utilities/render/photobooth/html/photobooth.html @@ -69,38 +69,15 @@ "data": eventData }; EventBridge.emitWebEvent(JSON.stringify(eventObject)); - }; - - function loaded () { - openEventBridge(function () { - emit("onLoad", {value: "faye"}); - - var elModelURL = document.getElementById("model-url"); - var elReloadModelButton = document.getElementById("reload-model-button"); - var elCamera = document.getElementById("property-camera"); - //var elLightingPreset = document.getElementById("property-lighting-preset"); - var elPictureButton = document.getElementById("picture-button"); - - elReloadModelButton.addEventListener('click', function() { - emit("onClickReloadModelButton", {value: elModelURL.value}); - }); - elCamera.addEventListener('change', function() { - emit("onSelectCamera", {value: this.value}); - }); - // elLightingPreset.addEventListener('change', function() { - // emit("onSelectLightingPreset", {value: "faye"}); - // }); - elPictureButton.addEventListener('click', function() { - emit("onClickPictureButton", {value: "faye"}); - }); - }); } + $(document).ready(function() { // Send a ready event to hifi emit("ready", null); + // Send an event when camera selection changes $("#property-camera").on('change', function() { - console.log("ok"); - emit("onSelectCamera", {value: this.val()}); + console.log($("#property-camera").val()); + emit("onSelectCamera", {value: $("#property-camera").val()}); }); // Send an event to hifi to trigger snapshot $("#picture-button").click(function() {