diff --git a/static/main.js b/static/main.js
index b33f0bd..fc6a44d 100644
--- a/static/main.js
+++ b/static/main.js
@@ -61,6 +61,8 @@ ready(function() {
evt = evt || window.event;
if (evt.keyCode == 27) {
resetSearch();
+ } else if (evt.keyCode == 75 && evt.ctrlKey) {
+ ajaxRequest("/?killvideo=yes");
}
};
@@ -70,8 +72,13 @@ ready(function() {
all_a_s[i].addEventListener('keypress', async function (e) {
var key = e.keyCode;
var source = e.target;
- if (key === 13) {
- source.classList.add("sound-pressed")
+ // keylistener for enter or ctrl+enter (which is k10 on chrome)
+ if (key === 13 || (key === 10 && e.ctrlKey)) {
+ if(e.ctrlKey){
+ ajaxRequest("/?killvideo=yes");
+ await sleep(100);
+ }
+ source.classList.add("sound-pressed");
source.onclick();
await sleep(300);
source.classList.remove("sound-pressed");
@@ -105,11 +112,10 @@ function hideSections() {
});
}
-function ajaxRequest(filename){
+function ajaxRequest(url){
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
- var url = "play/" + filename;
ajaxRequest.open("GET", url, true);
ajaxRequest.send(null);
}catch (e){
diff --git a/templates/index.html b/templates/index.html
index 8378a11..03792ac 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -38,7 +38,7 @@