fixed minify problem with new library #7107

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458
2025-06-20 15:31:38 +01:00
parent 6467947904
commit e47626a688
22 changed files with 52 additions and 46 deletions

View File

@@ -1 +1 @@
var CreateKvmDataChannel=function(e,t,n){var o={},l=(((o.m=t).parent=o).webchannel=e,o.State=0,o.protocol=t.protocol,o.onStateChanged=null,o.onControlMsg=null,o.debugmode=0,o.keepalive=n,o.rtcKeepAlive=null,o.Start=function(){1==o.debugmode&&console.log("start"),o.xxStateChange(3),o.webchannel.onmessage=o.xxOnMessage,o.rtcKeepAlive=setInterval(o.xxSendRtcKeepAlive,3e4)},new FileReader),i=!1,s=[];return l.readAsBinaryString?l.onload=function(e){o.xxOnSocketData(e.target.result),0==s.length?i=!1:l.readAsBinaryString(new Blob([s.shift()]))}:l.readAsArrayBuffer&&(l.onloadend=function(e){o.xxOnSocketData(e.target.result),0==s.length?i=!1:l.readAsArrayBuffer(s.shift())}),o.xxOnMessage=function(e){if("string"==typeof e.data)null!=o.onControlMsg&&o.onControlMsg(e.data);else if("object"==typeof e.data)if(1==i)s.push(e.data);else if(l.readAsBinaryString)i=!0,l.readAsBinaryString(new Blob([e.data]));else if(f.readAsArrayBuffer)i=!0,l.readAsArrayBuffer(e.data);else{for(var t="",n=new Uint8Array(e.data),a=n.byteLength,r=0;r<a;r++)t+=String.fromCharCode(n[r]);o.xxOnSocketData(t)}else o.xxOnSocketData(e.data)},o.xxOnSocketData=function(e){if(e){if("object"==typeof e){for(var t="",n=new Uint8Array(e),a=n.byteLength,r=0;r<a;r++)t+=String.fromCharCode(n[r]);e=t}else if("string"!=typeof e)return;return o.m.ProcessData(e)}},o.sendCtrlMsg=function(e){"string"==typeof e&&(o.webchannel.send(e),null!=o.keepalive)&&o.keepalive.sendKeepAlive()},o.send=function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);e=t}o.webchannel.send(e)},o.xxStateChange=function(e){o.State!=e&&(o.State=e,o.m.xxStateChange(o.State),null!=o.onStateChanged)&&o.onStateChanged(o,o.State)},o.Stop=function(){1==o.debugmode&&console.log("stop"),null!=o.rtcKeepAlive&&(clearInterval(o.rtcKeepAlive),o.rtcKeepAlive=null),o.xxStateChange(0)},o.xxSendRtcKeepAlive=function(){o.sendCtrlMsg(JSON.stringify({action:"ping"}))},o}
var CreateKvmDataChannel=function(e,t,n){var a={};a.m=t,t.parent=a,a.webchannel=e,a.State=0,a.protocol=t.protocol,a.onStateChanged=null,a.onControlMsg=null,a.debugmode=0,a.keepalive=n,a.rtcKeepAlive=null,a.Start=function(){1==a.debugmode&&console.log("start"),a.xxStateChange(3),a.webchannel.onmessage=a.xxOnMessage,a.rtcKeepAlive=setInterval(a.xxSendRtcKeepAlive,3e4)};var r=new FileReader,o=!1,l=[];return r.readAsBinaryString?r.onload=function(e){a.xxOnSocketData(e.target.result),0==l.length?o=!1:r.readAsBinaryString(new Blob([l.shift()]))}:r.readAsArrayBuffer&&(r.onloadend=function(e){a.xxOnSocketData(e.target.result),0==l.length?o=!1:r.readAsArrayBuffer(l.shift())}),a.xxOnMessage=function(e){if("string"!=typeof e.data)if("object"==typeof e.data){if(1==o)return void l.push(e.data);if(r.readAsBinaryString)o=!0,r.readAsBinaryString(new Blob([e.data]));else if(f.readAsArrayBuffer)o=!0,r.readAsArrayBuffer(e.data);else{for(var t="",n=new Uint8Array(e.data),i=n.byteLength,s=0;s<i;s++)t+=String.fromCharCode(n[s]);a.xxOnSocketData(t)}}else a.xxOnSocketData(e.data);else null!=a.onControlMsg&&a.onControlMsg(e.data)},a.xxOnSocketData=function(e){if(e){if("object"==typeof e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t+=String.fromCharCode(n[o]);e=t}else if("string"!=typeof e)return;return a.m.ProcessData(e)}},a.sendCtrlMsg=function(e){"string"==typeof e&&(a.webchannel.send(e),null!=a.keepalive&&a.keepalive.sendKeepAlive())},a.send=function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);e=t}a.webchannel.send(e)},a.xxStateChange=function(e){a.State!=e&&(a.State=e,a.m.xxStateChange(a.State),null!=a.onStateChanged&&a.onStateChanged(a,a.State))},a.Stop=function(){1==a.debugmode&&console.log("stop"),null!=a.rtcKeepAlive&&(clearInterval(a.rtcKeepAlive),a.rtcKeepAlive=null),a.xxStateChange(0)},a.xxSendRtcKeepAlive=function(){a.sendCtrlMsg(JSON.stringify({action:"ping"}))},a}