Merge branch 'upgrade' of https://github.com/CendioOssman/noVNC
This commit is contained in:
commit
30ff15a35a
|
@ -4,7 +4,7 @@ cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
node_js:
|
node_js:
|
||||||
- 6
|
- lts/*
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10'
|
- TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10'
|
||||||
|
|
54
package.json
54
package.json
|
@ -19,7 +19,7 @@
|
||||||
"vendor/pako"
|
"vendor/pako"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint app core po tests utils",
|
"lint": "eslint app core po/po2js po/xgettext-html tests utils",
|
||||||
"test": "karma start karma.conf.js",
|
"test": "karma start karma.conf.js",
|
||||||
"prepublish": "node ./utils/use_require.js --as commonjs --clean"
|
"prepublish": "node ./utils/use_require.js --as commonjs --clean"
|
||||||
},
|
},
|
||||||
|
@ -40,36 +40,36 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/novnc/noVNC",
|
"homepage": "https://github.com/novnc/noVNC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.22.1",
|
"babel-core": "*",
|
||||||
"babel-plugin-add-module-exports": "^0.2.1",
|
"babel-plugin-add-module-exports": "*",
|
||||||
"babel-plugin-import-redirect": "*",
|
"babel-plugin-import-redirect": "*",
|
||||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
"babel-plugin-syntax-dynamic-import": "*",
|
||||||
"babel-plugin-transform-es2015-modules-amd": "^6.22.0",
|
"babel-plugin-transform-es2015-modules-amd": "*",
|
||||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
|
"babel-plugin-transform-es2015-modules-commonjs": "*",
|
||||||
"babel-plugin-transform-es2015-modules-systemjs": "^6.22.0",
|
"babel-plugin-transform-es2015-modules-systemjs": "*",
|
||||||
"babel-plugin-transform-es2015-modules-umd": "^6.22.0",
|
"babel-plugin-transform-es2015-modules-umd": "*",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "*",
|
||||||
"babelify": "^7.3.0",
|
"babelify": "*",
|
||||||
"browserify": "^13.1.0",
|
"browserify": "*",
|
||||||
"chai": "^3.5.0",
|
"chai": "*",
|
||||||
"commander": "^2.9.0",
|
"commander": "*",
|
||||||
"es-module-loader": "^2.1.0",
|
"es-module-loader": "*",
|
||||||
"eslint": "^4.16.0",
|
"eslint": "*",
|
||||||
"fs-extra": "^1.0.0",
|
"fs-extra": "*",
|
||||||
"jsdom": "*",
|
"jsdom": "*",
|
||||||
"karma": "^1.3.0",
|
"karma": "*",
|
||||||
"karma-mocha": "^1.3.0",
|
"karma-mocha": "*",
|
||||||
"karma-mocha-reporter": "^2.2.0",
|
"karma-mocha-reporter": "*",
|
||||||
"karma-sauce-launcher": "^1.0.0",
|
"karma-sauce-launcher": "*",
|
||||||
"karma-sinon-chai": "^2.0.0",
|
"karma-sinon-chai": "*",
|
||||||
"mocha": "^3.1.2",
|
"mocha": "*",
|
||||||
"node-getopt": "*",
|
"node-getopt": "*",
|
||||||
"po2json": "*",
|
"po2json": "*",
|
||||||
"requirejs": "^2.3.2",
|
"requirejs": "*",
|
||||||
"rollup": "^0.41.4",
|
"rollup": "*",
|
||||||
"rollup-plugin-node-resolve": "^2.0.0",
|
"rollup-plugin-node-resolve": "*",
|
||||||
"sinon": "^4.0.0",
|
"sinon": "*",
|
||||||
"sinon-chai": "^2.8.0"
|
"sinon-chai": "*"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
},
|
||||||
|
}
|
8
po/po2js
8
po/po2js
|
@ -22,17 +22,17 @@ const fs = require('fs');
|
||||||
const po2json = require("po2json");
|
const po2json = require("po2json");
|
||||||
|
|
||||||
const opt = getopt.create([
|
const opt = getopt.create([
|
||||||
['h' , 'help' , 'display this help'],
|
['h', 'help', 'display this help'],
|
||||||
]).bindHelp().parseSystem();
|
]).bindHelp().parseSystem();
|
||||||
|
|
||||||
if (opt.argv.length != 2) {
|
if (opt.argv.length != 2) {
|
||||||
console.error("Incorrect number of arguments given");
|
console.error("Incorrect number of arguments given");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = po2json.parseFileSync(opt.argv[0]);
|
const data = po2json.parseFileSync(opt.argv[0]);
|
||||||
|
|
||||||
const bodyPart = Object.keys(data).filter((msgid) => msgid !== "").map((msgid) => {
|
const bodyPart = Object.keys(data).filter(msgid => msgid !== "").map((msgid) => {
|
||||||
if (msgid === "") return;
|
if (msgid === "") return;
|
||||||
const msgstr = data[msgid][1];
|
const msgstr = data[msgid][1];
|
||||||
return " " + JSON.stringify(msgid) + ": " + JSON.stringify(msgstr);
|
return " " + JSON.stringify(msgid) + ": " + JSON.stringify(msgstr);
|
||||||
|
|
|
@ -10,8 +10,8 @@ const jsdom = require("jsdom");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const opt = getopt.create([
|
const opt = getopt.create([
|
||||||
['o' , 'output=FILE' , 'write output to specified file'],
|
['o', 'output=FILE', 'write output to specified file'],
|
||||||
['h' , 'help' , 'display this help'],
|
['h', 'help', 'display this help'],
|
||||||
]).bindHelp().parseSystem();
|
]).bindHelp().parseSystem();
|
||||||
|
|
||||||
const strings = {};
|
const strings = {};
|
||||||
|
@ -22,7 +22,7 @@ function addString(str, location) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strings[str] === undefined) {
|
if (strings[str] === undefined) {
|
||||||
strings[str] = {}
|
strings[str] = {};
|
||||||
}
|
}
|
||||||
strings[str][location] = null;
|
strings[str][location] = null;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ function process(elem, locator, enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < elem.childNodes.length; i++) {
|
for (let i = 0; i < elem.childNodes.length; i++) {
|
||||||
node = elem.childNodes[i];
|
let node = elem.childNodes[i];
|
||||||
if (node.nodeType === node.ELEMENT_NODE) {
|
if (node.nodeType === node.ELEMENT_NODE) {
|
||||||
process(node, locator, enabled);
|
process(node, locator, enabled);
|
||||||
} else if (node.nodeType === node.TEXT_NODE && enabled) {
|
} else if (node.nodeType === node.TEXT_NODE && enabled) {
|
||||||
|
@ -89,18 +89,18 @@ for (let i = 0; i < opt.argv.length; i++) {
|
||||||
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
|
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
|
||||||
const body = dom.window.document.body;
|
const body = dom.window.document.body;
|
||||||
|
|
||||||
function locator(elem) {
|
let locator = (elem) => {
|
||||||
const offset = dom.nodeLocation(elem).startOffset;
|
const offset = dom.nodeLocation(elem).startOffset;
|
||||||
const line = file.slice(0, offset).split("\n").length;
|
const line = file.slice(0, offset).split("\n").length;
|
||||||
return fn + ":" + line;
|
return fn + ":" + line;
|
||||||
}
|
};
|
||||||
|
|
||||||
process(body, locator, true);
|
process(body, locator, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
for (str in strings) {
|
for (let str in strings) {
|
||||||
output += "#:";
|
output += "#:";
|
||||||
for (location in strings[str]) {
|
for (location in strings[str]) {
|
||||||
output += " " + location;
|
output += " " + location;
|
||||||
|
|
|
@ -437,7 +437,7 @@ describe('Key Event Handling', function () {
|
||||||
expect(kbd.onkeyevent.secondCall).to.have.been.calledWith(0x61, "KeyA", true);
|
expect(kbd.onkeyevent.secondCall).to.have.been.calledWith(0x61, "KeyA", true);
|
||||||
|
|
||||||
// Check that the timer is properly dead
|
// Check that the timer is properly dead
|
||||||
kbd.onkeyevent.reset();
|
kbd.onkeyevent.resetHistory();
|
||||||
this.clock.tick(100);
|
this.clock.tick(100);
|
||||||
expect(kbd.onkeyevent).to.not.have.been.called;
|
expect(kbd.onkeyevent).to.not.have.been.called;
|
||||||
});
|
});
|
||||||
|
@ -455,7 +455,7 @@ describe('Key Event Handling', function () {
|
||||||
expect(kbd.onkeyevent.thirdCall).to.have.been.calledWith(0x61, "KeyA", false);
|
expect(kbd.onkeyevent.thirdCall).to.have.been.calledWith(0x61, "KeyA", false);
|
||||||
|
|
||||||
// Check that the timer is properly dead
|
// Check that the timer is properly dead
|
||||||
kbd.onkeyevent.reset();
|
kbd.onkeyevent.resetHistory();
|
||||||
this.clock.tick(100);
|
this.clock.tick(100);
|
||||||
expect(kbd.onkeyevent).to.not.have.been.called;
|
expect(kbd.onkeyevent).to.not.have.been.called;
|
||||||
});
|
});
|
||||||
|
@ -470,7 +470,7 @@ describe('Key Event Handling', function () {
|
||||||
expect(kbd.onkeyevent).to.have.been.calledWith(0xfe03, 'AltRight', true);
|
expect(kbd.onkeyevent).to.have.been.calledWith(0xfe03, 'AltRight', true);
|
||||||
|
|
||||||
// Check that the timer is properly dead
|
// Check that the timer is properly dead
|
||||||
kbd.onkeyevent.reset();
|
kbd.onkeyevent.resetHistory();
|
||||||
this.clock.tick(100);
|
this.clock.tick(100);
|
||||||
expect(kbd.onkeyevent).to.not.have.been.called;
|
expect(kbd.onkeyevent).to.not.have.been.called;
|
||||||
});
|
});
|
||||||
|
@ -486,7 +486,7 @@ describe('Key Event Handling', function () {
|
||||||
expect(kbd.onkeyevent.secondCall).to.have.been.calledWith(0xffea, "AltRight", true);
|
expect(kbd.onkeyevent.secondCall).to.have.been.calledWith(0xffea, "AltRight", true);
|
||||||
|
|
||||||
// Check that the timer is properly dead
|
// Check that the timer is properly dead
|
||||||
kbd.onkeyevent.reset();
|
kbd.onkeyevent.resetHistory();
|
||||||
this.clock.tick(100);
|
this.clock.tick(100);
|
||||||
expect(kbd.onkeyevent).to.not.have.been.called;
|
expect(kbd.onkeyevent).to.not.have.been.called;
|
||||||
});
|
});
|
||||||
|
|
|
@ -271,7 +271,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
it('should move focus to canvas object', function () {
|
it('should move focus to canvas object', function () {
|
||||||
client._canvas.focus = sinon.spy();
|
client._canvas.focus = sinon.spy();
|
||||||
client.focus();
|
client.focus();
|
||||||
expect(client._canvas.focus).to.have.been.called.once;
|
expect(client._canvas.focus).to.have.been.calledOnce;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
it('should remove focus from canvas object', function () {
|
it('should remove focus from canvas object', function () {
|
||||||
client._canvas.blur = sinon.spy();
|
client._canvas.blur = sinon.spy();
|
||||||
client.blur();
|
client.blur();
|
||||||
expect(client._canvas.blur).to.have.been.called.once;
|
expect(client._canvas.blur).to.have.been.calledOnce;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
client.clipViewport = false;
|
client.clipViewport = false;
|
||||||
expect(spy.set).to.have.been.calledOnce;
|
expect(spy.set).to.have.been.calledOnce;
|
||||||
expect(spy.set).to.have.been.calledWith(false);
|
expect(spy.set).to.have.been.calledWith(false);
|
||||||
spy.set.reset();
|
spy.set.resetHistory();
|
||||||
|
|
||||||
client.clipViewport = true;
|
client.clipViewport = true;
|
||||||
expect(spy.set).to.have.been.calledOnce;
|
expect(spy.set).to.have.been.calledOnce;
|
||||||
|
@ -438,7 +438,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
client._handleMouseButton(13, 9, 0x000);
|
client._handleMouseButton(13, 9, 0x000);
|
||||||
expect(RFB.messages.pointerEvent).to.have.been.calledTwice;
|
expect(RFB.messages.pointerEvent).to.have.been.calledTwice;
|
||||||
|
|
||||||
RFB.messages.pointerEvent.reset();
|
RFB.messages.pointerEvent.resetHistory();
|
||||||
|
|
||||||
// Small movement
|
// Small movement
|
||||||
client._handleMouseButton(13, 9, 0x001);
|
client._handleMouseButton(13, 9, 0x001);
|
||||||
|
@ -472,7 +472,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
expect(client._display.viewportChangePos).to.have.been.calledOnce;
|
expect(client._display.viewportChangePos).to.have.been.calledOnce;
|
||||||
expect(client._display.viewportChangePos).to.have.been.calledWith(-30, 0);
|
expect(client._display.viewportChangePos).to.have.been.calledWith(-30, 0);
|
||||||
|
|
||||||
client._display.viewportChangePos.reset();
|
client._display.viewportChangePos.resetHistory();
|
||||||
|
|
||||||
// Now a small movement should move right away
|
// Now a small movement should move right away
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
expect(spy.set).to.have.been.calledOnce;
|
expect(spy.set).to.have.been.calledOnce;
|
||||||
expect(spy.set).to.have.been.calledWith(true);
|
expect(spy.set).to.have.been.calledWith(true);
|
||||||
|
|
||||||
spy.set.reset();
|
spy.set.resetHistory();
|
||||||
|
|
||||||
client.scaleViewport = true;
|
client.scaleViewport = true;
|
||||||
expect(spy.set).to.have.been.calledOnce;
|
expect(spy.set).to.have.been.calledOnce;
|
||||||
|
@ -633,7 +633,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
expect(RFB.messages.setDesktopSize).to.have.been.calledOnce;
|
expect(RFB.messages.setDesktopSize).to.have.been.calledOnce;
|
||||||
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(sinon.match.object, 70, 80, 0, 0);
|
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(sinon.match.object, 70, 80, 0, 0);
|
||||||
|
|
||||||
RFB.messages.setDesktopSize.reset();
|
RFB.messages.setDesktopSize.resetHistory();
|
||||||
|
|
||||||
// Second message should not trigger a resize
|
// Second message should not trigger a resize
|
||||||
|
|
||||||
|
@ -2056,7 +2056,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
client.showDotCursor = true;
|
client.showDotCursor = true;
|
||||||
// Was called when we enabled dot cursor
|
// Was called when we enabled dot cursor
|
||||||
client._cursor.change.reset();
|
client._cursor.change.resetHistory();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show a standard cursor', function () {
|
it('should show a standard cursor', function () {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,16 +1,15 @@
|
||||||
import nodeResolve from 'rollup-plugin-node-resolve';
|
import nodeResolve from 'rollup-plugin-node-resolve';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
entry: 'src/browser-es-module-loader.js',
|
input: 'src/browser-es-module-loader.js',
|
||||||
dest: 'dist/browser-es-module-loader.js',
|
output: {
|
||||||
format: 'umd',
|
file: 'dist/browser-es-module-loader.js',
|
||||||
moduleName: 'BrowserESModuleLoader',
|
format: 'umd',
|
||||||
sourceMap: true,
|
name: 'BrowserESModuleLoader',
|
||||||
|
sourcemap: true,
|
||||||
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
nodeResolve(),
|
nodeResolve(),
|
||||||
],
|
],
|
||||||
|
|
||||||
// skip rollup warnings (specifically the eval warning)
|
|
||||||
onwarn: function() {}
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import RegisterLoader from 'es-module-loader/core/register-loader.js';
|
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 { baseURI, global, isBrowser } from 'es-module-loader/core/common.js';
|
||||||
import { resolveIfNotPlain } from 'es-module-loader/core/resolve.js';
|
import { resolveIfNotPlain } from 'es-module-loader/core/resolve.js';
|
||||||
|
|
Loading…
Reference in New Issue