mirror of
https://github.com/overte-org/overte.git
synced 2025-07-14 09:16:37 +02:00
Merge pull request #560 from art0007i/master
remove jquery from EmoteApp.html
This commit is contained in:
commit
fc7d12a61e
1 changed files with 12 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
<!--
|
<!--
|
||||||
// EmoteApp.html
|
// EmoteApp.html
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 7 Jan 2018
|
// Created by Brad Hefta-Gaub on 7 Jan 2018
|
||||||
|
@ -110,7 +110,6 @@
|
||||||
<input type="button" class="emote-button white" value="Love"></p>
|
<input type="button" class="emote-button white" value="Love"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
function main() {
|
function main() {
|
||||||
// Send an event to emote.js when the page loads and is ready to get things rolling
|
// Send an event to emote.js when the page loads and is ready to get things rolling
|
||||||
|
@ -122,17 +121,19 @@
|
||||||
EventBridge.emitWebEvent(JSON.stringify(readyEvent));
|
EventBridge.emitWebEvent(JSON.stringify(readyEvent));
|
||||||
|
|
||||||
// Send an event when user click on each of the emote buttons
|
// Send an event when user click on each of the emote buttons
|
||||||
$(".emote-button").click(function(){
|
document.querySelectorAll(".emote-button").forEach((btn)=>{
|
||||||
console.log(this.value + " button click");
|
btn.addEventListener("click", (e)=>{
|
||||||
var clickEvent = {
|
console.log(e.target.value + " button click");
|
||||||
"type": "click",
|
var clickEvent = {
|
||||||
"data": this.value
|
"type": "click",
|
||||||
};
|
"data": e.target.value
|
||||||
EventBridge.emitWebEvent(JSON.stringify(clickEvent));
|
};
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify(clickEvent));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(main);
|
document.addEventListener("DOMContentLoaded", main);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue