diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 97e16fcf11..17eb0ad88f 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -103,13 +103,14 @@ var elIgnoreForCollisions = document.getElementById("property-ignore-for-collisions"); var elCollisionsWillMove = document.getElementById("property-collisions-will-move"); var elLifetime = document.getElementById("property-lifetime"); + var elScriptURL = document.getElementById("property-script-url"); - var elBoxSection = document.getElementById("box-section"); + var elBoxSections = document.querySelectorAll(".box-section"); var elBoxColorRed = document.getElementById("property-box-red"); var elBoxColorGreen = document.getElementById("property-box-green"); var elBoxColorBlue = document.getElementById("property-box-blue"); - var elLightSection = document.getElementById('light-section'); + var elLightSections = document.querySelectorAll(".light-section"); var elLightSpotLight = document.getElementById("property-light-spot-light"); var elLightDiffuseRed = document.getElementById("property-light-diffuse-red"); var elLightDiffuseGreen = document.getElementById("property-light-diffuse-green"); @@ -129,14 +130,14 @@ var elLightExponent = document.getElementById("property-light-exponent"); var elLightCutoff = document.getElementById("property-light-cutoff"); - var elModelSection = document.getElementById("model-section"); + var elModelSections = document.querySelectorAll(".model-section"); var elModelURL = document.getElementById("property-model-url"); var elModelAnimationURL = document.getElementById("property-model-animation-url"); var elModelAnimationPlaying = document.getElementById("property-model-animation-playing"); var elModelAnimationFPS = document.getElementById("property-model-animation-fps"); var elModelAnimationFrame = document.getElementById("property-model-animation-frame"); - var elTextSection = document.getElementById("text-section"); + var elTextSections = document.querySelectorAll(".text-section"); var elTextText = document.getElementById("property-text-text"); var elTextLineHeight = document.getElementById("property-text-line-height"); var elTextTextColorRed = document.getElementById("property-text-text-color-red"); @@ -198,11 +199,16 @@ elIgnoreForCollisions.checked = properties.ignoreForCollisions; elCollisionsWillMove.checked = properties.collisionsWillMove; elLifetime.value = properties.lifetime; + elScriptURL.value = properties.script; if (properties.type != "Box") { - elBoxSection.style.display = 'none'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'none'; + } } else { - elBoxSection.style.display = 'block'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'table-row'; + } elBoxColorRed.value = properties.color.red; elBoxColorGreen.value = properties.color.green; @@ -210,9 +216,14 @@ } if (properties.type != "Model") { - elModelSection.style.display = 'none'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'none'; + } } else { - elModelSection.style.display = 'block'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'table-row'; + } + elModelURL.value = properties.modelURL; elModelAnimationURL.value = properties.animationURL; elModelAnimationPlaying.checked = properties.animationIsPlaying; @@ -220,9 +231,13 @@ } if (properties.type != "Text") { - elTextSection.style.display = 'none'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'none'; + } } else { - elTextSection.style.display = 'block'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'table-row'; + } elTextText.value = properties.text; elTextLineHeight.value = properties.lineHeight; @@ -235,9 +250,13 @@ } if (properties.type != "Light") { - elLightSection.style.display = 'none'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'none'; + } } else { - elLightSection.style.display = 'block'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'table-row'; + } elLightDiffuseRed.value = properties.diffuseColor.red; elLightDiffuseGreen.value = properties.diffuseColor.green; @@ -307,6 +326,7 @@ elIgnoreForCollisions.addEventListener('change', createEmitCheckedPropertyUpdateFunction('ignoreForCollisions')); elCollisionsWillMove.addEventListener('change', createEmitCheckedPropertyUpdateFunction('collisionsWillMove')); elLifetime.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifetime')); + elScriptURL.addEventListener('change', createEmitTextPropertyUpdateFunction('script')); var boxColorChangeFunction = createEmitColorPropertyUpdateFunction( 'color', elBoxColorRed, elBoxColorGreen, elBoxColorBlue); @@ -437,7 +457,7 @@