1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

update novnc 1.1.0 ->1.2.0

This commit is contained in:
catborise 2020-08-11 15:05:09 +03:00
parent bb935b3713
commit 43f1461e29
53 changed files with 109904 additions and 56529 deletions

View file

@ -6,8 +6,8 @@ It's based heavily on
https://github.com/ModuleLoader/browser-es-module-loader, but uses
WebWorkers to compile the modules in the background.
To generate, run `rollup -c` in this directory, and then run `browserify
src/babel-worker.js > dist/babel-worker.js`.
To generate, run `npx rollup -c` in this directory, and then run
`./genworker.js`.
LICENSE
-------

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,13 @@
#!/usr/bin/env node
var fs = require("fs");
var browserify = require("browserify");
browserify("src/babel-worker.js")
.transform("babelify", {
presets: [ [ "@babel/preset-env", { targets: "ie >= 11" } ] ],
global: true,
ignore: [ "../../node_modules/core-js" ]
})
.bundle()
.pipe(fs.createWriteStream("dist/babel-worker.js"));

View file

@ -1,16 +1,15 @@
import nodeResolve from 'rollup-plugin-node-resolve';
export default {
entry: 'src/browser-es-module-loader.js',
dest: 'dist/browser-es-module-loader.js',
format: 'umd',
moduleName: 'BrowserESModuleLoader',
sourceMap: true,
input: 'src/browser-es-module-loader.js',
output: {
file: 'dist/browser-es-module-loader.js',
format: 'umd',
name: 'BrowserESModuleLoader',
sourcemap: true,
},
plugins: [
nodeResolve(),
],
// skip rollup warnings (specifically the eval warning)
onwarn: function() {}
};

View file

@ -1,12 +1,10 @@
/*import { transform as babelTransform } from 'babel-core';
import babelTransformDynamicImport from 'babel-plugin-syntax-dynamic-import';
import babelTransformES2015ModulesSystemJS from 'babel-plugin-transform-es2015-modules-systemjs';*/
// Polyfills needed for Babel to function
require("core-js");
// sadly, due to how rollup works, we can't use es6 imports here
var babelTransform = require('babel-core').transform;
var babelTransformDynamicImport = require('babel-plugin-syntax-dynamic-import');
var babelTransformES2015ModulesSystemJS = require('babel-plugin-transform-es2015-modules-systemjs');
var babelPresetES2015 = require('babel-preset-es2015');
var babelTransform = require('@babel/core').transform;
var babelTransformDynamicImport = require('@babel/plugin-syntax-dynamic-import');
var babelTransformModulesSystemJS = require('@babel/plugin-transform-modules-systemjs');
var babelPresetEnv = require('@babel/preset-env');
self.onmessage = function (evt) {
// transform source with Babel
@ -17,8 +15,8 @@ self.onmessage = function (evt) {
moduleIds: false,
sourceMaps: 'inline',
babelrc: false,
plugins: [babelTransformDynamicImport, babelTransformES2015ModulesSystemJS],
presets: [babelPresetES2015],
plugins: [babelTransformDynamicImport, babelTransformModulesSystemJS],
presets: [ [ babelPresetEnv, { targets: 'ie >= 11' } ] ],
});
self.postMessage({key: evt.data.key, code: output.code, source: evt.data.source});

View file

@ -1,5 +1,4 @@
import RegisterLoader from 'es-module-loader/core/register-loader.js';
import { InternalModuleNamespace as ModuleNamespace } from 'es-module-loader/core/loader-polyfill.js';
import { baseURI, global, isBrowser } from 'es-module-loader/core/common.js';
import { resolveIfNotPlain } from 'es-module-loader/core/resolve.js';
@ -35,7 +34,7 @@ if (typeof document != 'undefined' && document.getElementsByTagName) {
// throw so it still shows up in the console
throw err;
};
}
var ready = function() {
document.removeEventListener('DOMContentLoaded', ready, false );
@ -63,7 +62,7 @@ if (typeof document != 'undefined' && document.getElementsByTagName) {
}
}
}
};
}
// simple DOM ready
if (document.readyState !== 'loading')
@ -105,10 +104,10 @@ function xhrFetch(url, resolve, reject) {
var xhr = new XMLHttpRequest();
var load = function(source) {
resolve(xhr.responseText);
};
}
var error = function() {
reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url));
};
}
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
@ -235,7 +234,7 @@ BrowserESModuleLoader.prototype[RegisterLoader.instantiate] = function(key, proc
return new Promise(function(resolve, reject) {
// anonymous module
if (anonSources[key]) {
resolve(anonSources[key]);
resolve(anonSources[key])
anonSources[key] = undefined;
}
// otherwise we fetch

View file

@ -4,7 +4,7 @@ export function shrinkBuf (buf, size) {
if (buf.subarray) { return buf.subarray(0, size); }
buf.length = size;
return buf;
}
};
export function arraySet (dest, src, src_offs, len, dest_offs) {

View file

@ -9,51 +9,51 @@ import msg from "./messages.js";
/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
//var Z_TREES = 6;
export const Z_NO_FLUSH = 0;
export const Z_PARTIAL_FLUSH = 1;
//export const Z_SYNC_FLUSH = 2;
export const Z_FULL_FLUSH = 3;
export const Z_FINISH = 4;
export const Z_BLOCK = 5;
//export const Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
//var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
//var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
export const Z_OK = 0;
export const Z_STREAM_END = 1;
//export const Z_NEED_DICT = 2;
//export const Z_ERRNO = -1;
export const Z_STREAM_ERROR = -2;
export const Z_DATA_ERROR = -3;
//export const Z_MEM_ERROR = -4;
export const Z_BUF_ERROR = -5;
//export const Z_VERSION_ERROR = -6;
/* compression levels */
//var Z_NO_COMPRESSION = 0;
//var Z_BEST_SPEED = 1;
//var Z_BEST_COMPRESSION = 9;
var Z_DEFAULT_COMPRESSION = -1;
//export const Z_NO_COMPRESSION = 0;
//export const Z_BEST_SPEED = 1;
//export const Z_BEST_COMPRESSION = 9;
export const Z_DEFAULT_COMPRESSION = -1;
var Z_FILTERED = 1;
var Z_HUFFMAN_ONLY = 2;
var Z_RLE = 3;
var Z_FIXED = 4;
var Z_DEFAULT_STRATEGY = 0;
export const Z_FILTERED = 1;
export const Z_HUFFMAN_ONLY = 2;
export const Z_RLE = 3;
export const Z_FIXED = 4;
export const Z_DEFAULT_STRATEGY = 0;
/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY = 0;
//var Z_TEXT = 1;
//var Z_ASCII = 1; // = Z_TEXT
var Z_UNKNOWN = 2;
//export const Z_BINARY = 0;
//export const Z_TEXT = 1;
//export const Z_ASCII = 1; // = Z_TEXT
export const Z_UNKNOWN = 2;
/* The deflate compression method */
var Z_DEFLATED = 8;
export const Z_DEFLATED = 8;
/*============================================================================*/

View file

@ -277,7 +277,7 @@ export default function inflate_fast(strm, start) {
}
else if ((op & 64) === 0) { /* 2nd level distance code */
here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue;
continue dodist;
}
else {
strm.msg = 'invalid distance code';
@ -290,7 +290,7 @@ export default function inflate_fast(strm, start) {
}
else if ((op & 64) === 0) { /* 2nd level length code */
here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue;
continue dolen;
}
else if (op & 32) { /* end-of-block */
//Tracevv((stderr, "inflate: end of block\n"));
@ -320,5 +320,5 @@ export default function inflate_fast(strm, start) {
strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
state.hold = hold;
state.bits = bits;
return;
};

View file

@ -13,30 +13,30 @@ var DISTS = 2;
/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
//var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
var Z_TREES = 6;
//export const Z_NO_FLUSH = 0;
//export const Z_PARTIAL_FLUSH = 1;
//export const Z_SYNC_FLUSH = 2;
//export const Z_FULL_FLUSH = 3;
export const Z_FINISH = 4;
export const Z_BLOCK = 5;
export const Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
export const Z_OK = 0;
export const Z_STREAM_END = 1;
export const Z_NEED_DICT = 2;
//export const Z_ERRNO = -1;
export const Z_STREAM_ERROR = -2;
export const Z_DATA_ERROR = -3;
export const Z_MEM_ERROR = -4;
export const Z_BUF_ERROR = -5;
//export const Z_VERSION_ERROR = -6;
/* The deflate compression method */
var Z_DEFLATED = 8;
export const Z_DEFLATED = 8;
/* STATES ====================================================================*/

File diff suppressed because one or more lines are too long