feat: sync mixly root files and common folder

This commit is contained in:
yczpf2019
2026-01-24 16:12:04 +08:00
parent 93e17c00ae
commit c8c5fcf726
2920 changed files with 186461 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
goog.loadJs('web', () => {
goog.require('Mixly.Debug');
goog.require('Mixly.Config');
goog.require('Mixly.StatusBarsManager');
goog.require('Mixly.Socket');
goog.require('Mixly.WebCompiler.ArduShell');
goog.provide('Mixly.WebCompiler.Loader');
const {
Debug,
Config,
StatusBarsManager,
Socket,
WebCompiler
} = Mixly;
const {
Loader,
ArduShell
} = WebCompiler;
const { SOFTWARE } = Config;
Loader.init = function () {
let url = '';
if (SOFTWARE.webCompiler?.url) {
const info = new window.URL(SOFTWARE.webCompiler.url);
if (window.location.protocol === 'http:') {
info.protocol = 'ws:';
}
if (info.hostname === 'default') {
info.hostname = window.location.hostname;
}
url = info.origin;
} else {
url = `wss://${window.location.host}`;
}
const mixlySocket = new Socket(`${url}/compile`, {
path: '/mixly-socket/',
reconnection: true,
reconnectionDelayMax: 10000,
transports: ['websocket'],
protocols: ['my-protocol-v1']
});
const socket = mixlySocket.getSocket();
socket.on('connect', () => {});
socket.on('disconnect', () => {});
ArduShell.init(mixlySocket);
}
});