aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2021-01-24 13:12:58 +0300
committerRblSb <msrblsb@gmail.com>2021-01-24 13:12:58 +0300
commit35beab11cdccf09dc77917a795b033314e62a5b1 (patch)
tree23134d53f46ac678742f7fc4095b66dd68010617 /src/client/Buttons.hx
parent3444b413ab12783c85ce73df9931142fea11b749 (diff)
Video title input
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index cdc9780..538aaa0 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -8,6 +8,7 @@ import js.html.Element;
import client.Main.ge;
import js.Browser.window;
import js.Browser.document;
+using StringTools;
class Buttons {
@@ -150,10 +151,20 @@ class Buttons {
final showCustomEmbed = ge("#showcustomembed");
showCustomEmbed.onclick = e -> showPlayerGroup(showCustomEmbed);
+ final mediaUrl:InputElement = cast ge("#mediaurl");
+ mediaUrl.oninput = () -> {
+ final value = mediaUrl.value;
+ if (value != "" && main.isRawPlayerLink(value) && main.isSingleVideoLink(value)) {
+ ge("#mediatitleblock").style.display = "";
+ } else {
+ ge("#mediatitleblock").style.display = "none";
+ }
+ }
+ mediaUrl.onfocus = mediaUrl.oninput;
+
ge("#insert_template").onclick = e -> {
- final input:InputElement = cast ge("#mediaurl");
- input.value = main.getTemplateUrl();
- input.focus();
+ mediaUrl.value = main.getTemplateUrl();
+ mediaUrl.focus();
}
final showOptions = ge("#showoptions");
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage