aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/JsApi.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/JsApi.hx')
-rw-r--r--src/client/JsApi.hx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client/JsApi.hx b/src/client/JsApi.hx
index 66d0516..b0938f8 100644
--- a/src/client/JsApi.hx
+++ b/src/client/JsApi.hx
@@ -48,7 +48,7 @@ class JsApi {
@:expose
public static function addScriptToHead(url:String, ?onLoaded:()->Void):Void {
- var script = document.createScriptElement();
+ final script = document.createScriptElement();
script.type = "text/javascript";
script.onload = onLoaded;
script.src = url;
@@ -88,6 +88,18 @@ class JsApi {
player.changeVideoSrc(src);
}
+ /** Returns current page hostname (domain without protocol) **/
+ @:expose
+ static function getLocalIp():String {
+ return main.host;
+ }
+
+ /** Returns server global ip. **/
+ @:expose
+ static function getGlobalIp():String {
+ return main.globalIp;
+ }
+
@:expose
public static function once(type:WsEventType, func:OnceEventFunc):Void {
onceListeners.push({type: type, func: func});
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage