Skip to content

Commit

Permalink
Merge pull request #560 from art0007i/master
Browse files Browse the repository at this point in the history
remove jquery from EmoteApp.html
  • Loading branch information
ksuprynowicz authored Aug 18, 2023
2 parents d62a40d + dc3f1fb commit fc7d12a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions scripts/system/html/EmoteApp.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
// EmoteApp.html
//
// Created by Brad Hefta-Gaub on 7 Jan 2018
Expand Down Expand Up @@ -110,7 +110,6 @@ <h4>Emote App</h4>
<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
Expand All @@ -122,17 +121,19 @@ <h4>Emote App</h4>
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>

0 comments on commit fc7d12a

Please sign in to comment.