mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 23:02:24 +02:00
remove jquery from EmoteApp.html
this script is too trivial to use jquery
This commit is contained in:
parent
47ec27ff4d
commit
dc3f1fbd48
1 changed files with 12 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
|||
<!--
|
||||
<!--
|
||||
// EmoteApp.html
|
||||
//
|
||||
// Created by Brad Hefta-Gaub on 7 Jan 2018
|
||||
|
@ -110,7 +110,6 @@
|
|||
<input type="button" class="emote-button white" value="Love"></p>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script>
|
||||
function main() {
|
||||
// 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));
|
||||
|
||||
// Send an event when user click on each of the emote buttons
|
||||
$(".emote-button").click(function(){
|
||||
console.log(this.value + " button click");
|
||||
var clickEvent = {
|
||||
"type": "click",
|
||||
"data": this.value
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(clickEvent));
|
||||
document.querySelectorAll(".emote-button").forEach((btn)=>{
|
||||
btn.addEventListener("click", (e)=>{
|
||||
console.log(e.target.value + " button click");
|
||||
var clickEvent = {
|
||||
"type": "click",
|
||||
"data": e.target.value
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(clickEvent));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(main);
|
||||
document.addEventListener("DOMContentLoaded", main);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue