diff options
| author | RblSb <msrblsb@gmail.com> | 2020-03-04 20:56:03 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-03-04 20:56:03 +0300 |
| commit | 81071b59445d702d14a80241f409fc282d509f1f (patch) | |
| tree | 6e6bdcb0860801338bb4cd033558c1c0aea28a05 | |
| parent | 6e28381de77265f8b6a24cdd9c583d1d27d8d7b2 (diff) | |
Template url
| -rw-r--r-- | default-config.json | 1 | ||||
| -rw-r--r-- | res/client.js | 9 | ||||
| -rw-r--r-- | src/Types.hx | 1 | ||||
| -rw-r--r-- | src/client/Buttons.hx | 6 | ||||
| -rw-r--r-- | src/client/Main.hx | 4 |
5 files changed, 21 insertions, 0 deletions
diff --git a/default-config.json b/default-config.json index 4635f38..f569962 100644 --- a/default-config.json +++ b/default-config.json @@ -5,6 +5,7 @@ "serverChatHistory": 50, "totalVideoLimit": 0, "userVideoLimit": 0, + "templateUrl": "https://youtube.com/watch?v=iY1QHpp6iEE", "leaderRequest": "everyone", "emotes": [ {"name": ":adorable:", "image": "https://i.imgur.com/5GxNwDY.png"}, diff --git a/res/client.js b/res/client.js index d603436..a500324 100644 --- a/res/client.js +++ b/res/client.js @@ -528,6 +528,12 @@ client_Buttons.init = function(main) { client_Buttons.showPlayerGroup(showCustomEmbed); return; }; + window.document.querySelector("#insert_template").onclick = function(e14) { + var input = window.document.querySelector("#mediaurl"); + input.value = main.getTemplateUrl(); + input.focus(); + return; + }; window.onresize = client_Buttons.onVideoResize; client_Buttons.initSplit(); }; @@ -1364,6 +1370,9 @@ client_Main.prototype = { this.onTimeGet = new haxe_Timer(s * 1000); this.onTimeGet.run = $bind(this,this.requestTime); } + ,getTemplateUrl: function() { + return this.config.templateUrl; + } ,escapeRegExp: function(regex) { var _this_r = new RegExp("([.*+?^${}()|[\\]\\\\])","g".split("u").join("")); return regex.replace(_this_r,"\\$1"); diff --git a/src/Types.hx b/src/Types.hx index e5b467a..06c85ea 100644 --- a/src/Types.hx +++ b/src/Types.hx @@ -14,6 +14,7 @@ typedef Config = { serverChatHistory:Int, totalVideoLimit:Int, userVideoLimit:Int, + templateUrl:String, leaderRequest:String, emotes:Array<Emote>, filters:Array<Filter>, diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index 318ba9a..e5c36a0 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -137,6 +137,12 @@ class Buttons { final showCustomEmbed = ge("#showcustomembed"); showCustomEmbed.onclick = e -> showPlayerGroup(showCustomEmbed); + ge("#insert_template").onclick = e -> { + final input:InputElement = cast ge("#mediaurl"); + input.value = main.getTemplateUrl(); + input.focus(); + } + window.onresize = onVideoResize; initSplit(); } diff --git a/src/client/Main.hx b/src/client/Main.hx index b2f51ca..8ec1704 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -646,6 +646,10 @@ class Main { onTimeGet.run = requestTime; } + public function getTemplateUrl():String { + return config.templateUrl; + } + function escapeRegExp(regex:String):String { return ~/([.*+?^${}()|[\]\\])/g.replace(regex, "\\$1"); } |
