forked from server/soundboard
Revert "fix merge... hopefully"
This reverts commit d42d0046c6deb3cb8ff18eb1cfb6ff798b20b65c.
This commit is contained in:
parent
d42d0046c6
commit
743807a3ac
@ -36,7 +36,11 @@ def index(sound=None, text=None, video=None):
|
|||||||
pitch = request.form.get("pitch", default="")
|
pitch = request.form.get("pitch", default="")
|
||||||
pitch = pitch if pitch.strip() != "" else "50"
|
pitch = pitch if pitch.strip() != "" else "50"
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
subprocess.Popen(["espeak", "-v", voice, "-s", speed, "-p", pitch, text.encode('utf-8')], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
=======
|
||||||
subprocess.Popen(["espeak", "-v", voice, "-s", speed, "-p", pitch, text.encode("utf-8")], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
subprocess.Popen(["espeak", "-v", voice, "-s", speed, "-p", pitch, text.encode("utf-8")], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
>>>>>>> f570309d9cc64b761aa2354da885be9cdf8d1b42
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
||||||
video = request.args.get("video")
|
video = request.args.get("video")
|
||||||
|
|||||||
@ -139,3 +139,28 @@ div #reset:hover {
|
|||||||
#local-mode-button .local {
|
#local-mode-button .local {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sound a:active {
|
||||||
|
background-color: #ff4136;
|
||||||
|
box-shadow: inset 5px 5px 5px rgba(0, 0, 0, 0.6);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sound-pressed {
|
||||||
|
background-color: #ff4136 !important;
|
||||||
|
box-shadow: inset 5px 5px 5px rgba(0, 0, 0, 0.6) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unselectable {
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#local-mode-button .local {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
var localModeEnabled = false;
|
var localModeEnabled = false;
|
||||||
|
|
||||||
|
// References to howler objects
|
||||||
|
/* jshint esversion: 6 */
|
||||||
|
|
||||||
|
var localModeEnabled = false;
|
||||||
|
|
||||||
// References to howler objects
|
// References to howler objects
|
||||||
var howlerSounds = [];
|
var howlerSounds = [];
|
||||||
|
|
||||||
@ -124,6 +129,69 @@ function playStream() {
|
|||||||
ajaxRequest("/?video="+encodeURI(streamUrl));
|
ajaxRequest("/?video="+encodeURI(streamUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Adds all necessary KeyListeners to document
|
||||||
|
*/
|
||||||
|
function addKeyListeners() {
|
||||||
|
// keyboard listener for global key strokes/inputs
|
||||||
|
document.onkeydown = function(evt) {
|
||||||
|
evt = evt || window.event;
|
||||||
|
if (evt.keyCode == 27) {
|
||||||
|
// esc key
|
||||||
|
resetSearch();
|
||||||
|
} else if ((evt.keyCode == 75 || evt.keyCode == 67) && evt.ctrlKey) {
|
||||||
|
// ctrl+k and ctrl+c key binding
|
||||||
|
killAllAudio();
|
||||||
|
} else if (evt.keyCode == 88 && evt.ctrlKey){
|
||||||
|
// ctrl+x key binding
|
||||||
|
toggleLocalMode();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// keyboard listener for playing sounds using enter key
|
||||||
|
var buttons = document.querySelectorAll(".sound");
|
||||||
|
|
||||||
|
buttons.forEach(function(item) {
|
||||||
|
item.firstChild.addEventListener('keypress', async function (e) {
|
||||||
|
var key = e.keyCode;
|
||||||
|
var source = e.target;
|
||||||
|
// keylistener for enter or ctrl+enter (which is k10 on chrome)
|
||||||
|
if (key === 13 || (key === 10 && e.ctrlKey)) {
|
||||||
|
if(e.ctrlKey){
|
||||||
|
killAllAudio();
|
||||||
|
await sleep(100);
|
||||||
|
}
|
||||||
|
source.classList.add("sound-pressed");
|
||||||
|
source.onclick();
|
||||||
|
await sleep(300);
|
||||||
|
source.classList.remove("sound-pressed");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function resetSearch() {
|
||||||
|
var searchfield = document.querySelector("#search");
|
||||||
|
var buttons = document.querySelectorAll(".sound");
|
||||||
|
|
||||||
|
buttons.forEach(function(item) {
|
||||||
|
item.style.display = "inline-block";
|
||||||
|
});
|
||||||
|
|
||||||
|
searchfield.value = "";
|
||||||
|
searchfield.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reads the stream url from input with id #streaming-url and forwards it to the server using AJAX.
|
||||||
|
*/
|
||||||
|
function playStream() {
|
||||||
|
var streamUrl = document.querySelector("#streaming-url").value;
|
||||||
|
ajaxRequest("/?video="+encodeURI(streamUrl));
|
||||||
|
}
|
||||||
|
|
||||||
function hideSections() {
|
function hideSections() {
|
||||||
var sections = document.querySelectorAll("section");
|
var sections = document.querySelectorAll("section");
|
||||||
|
|
||||||
@ -205,6 +273,8 @@ function killAllAudio() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reads the stream url from input with id #streaming-url and forwards it to the server using AJAX.
|
* Reads the stream url from input with id #streaming-url and forwards it to the server using AJAX.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user