diff options
| author | RblSb <msrblsb@gmail.com> | 2023-04-18 06:00:10 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2023-04-23 12:29:24 +0300 |
| commit | b25ebe9ce888b516c6478be2592052a7916a736f (patch) | |
| tree | 4c6944ff349330eb1f5ccf77810b07e5eb32196f /res | |
| parent | b57aca347d4076f995e8849c5cc47c41e9cfd6c2 (diff) | |
Update to Haxe 4.3
Diffstat (limited to 'res')
| -rw-r--r-- | res/client.js | 127 |
1 files changed, 63 insertions, 64 deletions
diff --git a/res/client.js b/res/client.js index 32780ac..29774b5 100644 --- a/res/client.js +++ b/res/client.js @@ -1,3 +1,4 @@ +// Generated by Haxe 4.3.0 (function ($hx_exports, $global) { "use strict"; $hx_exports["client"] = $hx_exports["client"] || {}; $hx_exports["client"]["JsApi"] = $hx_exports["client"]["JsApi"] || {}; @@ -189,10 +190,6 @@ Lambda.find = function(it,f) { } return null; }; -var haxe_ds_StringMap = function() { - this.h = Object.create(null); -}; -haxe_ds_StringMap.__name__ = true; var Lang = function() { }; Lang.__name__ = true; Lang.request = function(path,callback) { @@ -278,26 +275,6 @@ Reflect.fields = function(o) { } return a; }; -Reflect.isFunction = function(f) { - if(typeof(f) == "function") { - return !(f.__name__ || f.__ename__); - } else { - return false; - } -}; -Reflect.compareMethods = function(f1,f2) { - if(f1 == f2) { - return true; - } - if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) { - return false; - } - if(f1.scope == f2.scope && f1.method == f2.method) { - return f1.method != null; - } else { - return false; - } -}; Reflect.copy = function(o) { if(o == null) { return null; @@ -318,24 +295,11 @@ Std.string = function(s) { return js_Boot.__string_rec(s,""); }; Std.parseInt = function(x) { - if(x != null) { - var _g = 0; - var _g1 = x.length; - while(_g < _g1) { - var i = _g++; - var c = x.charCodeAt(i); - if(c <= 8 || c >= 14 && c != 32 && c != 45) { - var nc = x.charCodeAt(i + 1); - var v = parseInt(x,nc == 120 || nc == 88 ? 16 : 10); - if(isNaN(v)) { - return null; - } else { - return v; - } - } - } + var v = parseInt(x); + if(isNaN(v)) { + return null; } - return null; + return v; }; var StringTools = function() { }; StringTools.__name__ = true; @@ -447,13 +411,10 @@ StringTools.replace = function(s,sub,by) { }; StringTools.hex = function(n,digits) { var s = ""; - while(true) { + do { s = "0123456789ABCDEF".charAt(n & 15) + s; n >>>= 4; - if(!(n > 0)) { - break; - } - } + } while(n > 0); if(digits != null) { while(s.length < digits) s = "0" + s; } @@ -552,7 +513,8 @@ client_Buttons.init = function(main) { if(list.children.length == 0) { return; } - if(smilesBtn.classList.toggle("active")) { + var isActive = smilesBtn.classList.toggle("active"); + if(isActive) { wrap.style.display = "block"; var tmp = client_Buttons.outerHeight(list); wrap.style.height = tmp + "px"; @@ -606,7 +568,8 @@ client_Buttons.init = function(main) { if(isHidden) { icon.setAttribute("name","chevron-down"); style.display = "block"; - var tmp = client_Buttons.outerHeight(wrap.firstElementChild); + var list = wrap.firstElementChild; + var tmp = client_Buttons.outerHeight(list); wrap.style.height = tmp + "px"; wrap.style.marginBottom = "1rem"; } else { @@ -623,7 +586,8 @@ client_Buttons.init = function(main) { userlistToggle.onclick(); } else { var wrap = window.document.querySelector("#userlist-wrap"); - var tmp = client_Buttons.outerHeight(wrap.firstElementChild); + var list = wrap.firstElementChild; + var tmp = client_Buttons.outerHeight(list); wrap.style.height = tmp + "px"; } haxe_Timer.delay(function() { @@ -772,13 +736,15 @@ client_Buttons.toggleGroup = function(el) { el.classList.toggle("collapsed"); var id = el.dataset.target; var target = window.document.querySelector(id); - if(target.classList.toggle("collapse")) { + var isClosed = target.classList.toggle("collapse"); + if(isClosed) { target.style.height = "0"; } else { + var list = target.firstElementChild; if(target.style.height == "") { target.style.height = "0"; } - var tmp = client_Buttons.outerHeight(target.firstElementChild); + var tmp = client_Buttons.outerHeight(list); target.style.height = tmp + "px"; } return el.classList.toggle("active"); @@ -864,7 +830,8 @@ client_Buttons.initHotkeys = function(main,player) { if(!client_Buttons.settings.hotkeysEnabled) { return; } - if(client_Buttons.isElementEditable(e.target)) { + var target = e.target; + if(client_Buttons.isElementEditable(target)) { return; } var key = e.keyCode; @@ -966,7 +933,8 @@ client_Buttons.initChatInput = function(main) { } }; if(client_Utils.isIOS() && window.visualViewport != null) { - window.visualViewport.addEventListener("resize",function(e) { + var viewport = window.visualViewport; + viewport.addEventListener("resize",function(e) { var tmp = "" + Std.string(window.innerHeight); return window.document.querySelector("#chat").style.height = tmp + "px"; }); @@ -1020,7 +988,8 @@ client_InputWithHistory.pushIfNotLast = function(arr,item) { }; client_InputWithHistory.prototype = { onKeyDown: function(e) { - switch(e.keyCode) { + var key = e.keyCode; + switch(key) { case 13: var value = this.element.value; if(value.length == 0) { @@ -1470,7 +1439,9 @@ client_Main.prototype = { var _gthis = this; var protocol = $global.location.protocol; if(StringTools.startsWith(url,"/")) { - url = "" + protocol + "//" + $global.location.hostname + ":" + $global.location.port + url; + var host = $global.location.hostname; + var port = $global.location.port; + url = "" + protocol + "//" + host + ":" + port + url; } if(!StringTools.startsWith(url,"http")) { url = "" + protocol + "//" + url; @@ -2318,7 +2289,8 @@ client_Player.prototype = { } ,toggleItemType: function(pos) { this.videoList.toggleItemType(pos); - this.setItemElementType(this.videoItemsEl.children[pos],this.videoList.items[pos].isTemp); + var el = this.videoItemsEl.children[pos]; + this.setItemElementType(el,this.videoList.items[pos].isTemp); } ,setPlayer: function(newPlayer) { if(this.player != newPlayer) { @@ -2761,7 +2733,8 @@ client_Settings.read = function() { if(!client_Settings.isSupported) { return client_Settings.defaults; } - return client_Settings.checkData(JSON.parse(client_Settings.storage.getItem("data"))); + var data = JSON.parse(client_Settings.storage.getItem("data")); + return client_Settings.checkData(data); }; client_Settings.checkData = function(data) { if(client_Settings.defaults == null) { @@ -3292,12 +3265,11 @@ client_players_RawSubs.parseAss = function(video,url) { } var result = new Array(list1.length); var _g3 = 0; - var _g11 = list1.length; - while(_g3 < _g11) { + var _g4 = list1.length; + while(_g3 < _g4) { var i1 = _g3++; result[i1] = StringTools.trim(list1[i1]); } - list1 = result; var text = result[ids_h["Text"]]; if(drawingMode.match(text)) { text = ""; @@ -3353,7 +3325,8 @@ client_players_RawSubs.onParsed = function(video,name,dataUrl) { trackEl.srclang = "en"; trackEl.src = dataUrl; video.appendChild(trackEl); - trackEl.track.mode = "showing"; + var track = trackEl.track; + track.mode = "showing"; }; var client_players_Youtube = function(main,player) { this.matchSeconds = new EReg("([0-9]+)S",""); @@ -4000,6 +3973,10 @@ haxe_crypto_Sha256.prototype = { return str.toLowerCase(); } }; +var haxe_ds_StringMap = function() { + this.h = Object.create(null); +}; +haxe_ds_StringMap.__name__ = true; var haxe_http_HttpBase = function(url) { this.url = url; this.headers = []; @@ -4017,7 +3994,7 @@ haxe_http_HttpBase.prototype = { ,onStatus: function(status) { } ,hasOnData: function() { - return !Reflect.compareMethods($bind(this,this.onData),this.emptyOnData); + return $bind(this,this.onData) != this.emptyOnData; } ,success: function(data) { this.responseBytes = data; @@ -4046,6 +4023,7 @@ haxe_http_HttpJs.prototype = $extend(haxe_http_HttpBase.prototype,{ var _gthis = this; this.responseAsString = null; this.responseBytes = null; + this.responseHeaders = null; var r = this.req = js_Browser.createXMLHttpRequest(); var onreadystatechange = function(_) { if(r.readyState != 4) { @@ -4071,6 +4049,27 @@ haxe_http_HttpJs.prototype = $extend(haxe_http_HttpBase.prototype,{ } if(s != null && s >= 200 && s < 400) { _gthis.req = null; + var headers = r.getAllResponseHeaders().split("\r\n"); + var _g = []; + var _g1 = 0; + var _g2 = headers; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(v != "") { + _g.push(v); + } + } + headers = _g; + _gthis.responseHeaders = new haxe_ds_StringMap(); + var _g = 0; + while(_g < headers.length) { + var a = headers[_g++].split(": "); + var hname = a.shift(); + var hval = a.length == 1 ? a[0] : a.join(": "); + hval = StringTools.ltrim(StringTools.rtrim(hval)); + _gthis.responseHeaders.h[hname] = hval; + } _gthis.success(haxe_io_Bytes.ofData(r.response)); } else if(s == null || s == 0 && r.response == null) { _gthis.req = null; @@ -4118,9 +4117,9 @@ haxe_http_HttpJs.prototype = $extend(haxe_http_HttpBase.prototype,{ uri = (uri == null ? "null" : Std.string(uri)) + "&"; } var s = p.name; - var value = (uri == null ? "null" : Std.string(uri)) + encodeURIComponent(s) + "="; + var uri1 = (uri == null ? "null" : Std.string(uri)) + encodeURIComponent(s) + "="; var s1 = p.value; - uri = value + encodeURIComponent(s1); + uri = uri1 + encodeURIComponent(s1); } } try { |
