This commit is contained in:
Pierre Ossman 2019-08-23 15:08:56 +02:00
commit 30ff15a35a
12 changed files with 4059 additions and 3324 deletions

View File

@ -4,7 +4,7 @@ cache:
directories:
- node_modules
node_js:
- 6
- lts/*
env:
matrix:
- TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10'

View File

@ -19,7 +19,7 @@
"vendor/pako"
],
"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",
"prepublish": "node ./utils/use_require.js --as commonjs --clean"
},
@ -40,36 +40,36 @@
},
"homepage": "https://github.com/novnc/noVNC",
"devDependencies": {
"babel-core": "^6.22.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-core": "*",
"babel-plugin-add-module-exports": "*",
"babel-plugin-import-redirect": "*",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-es2015-modules-amd": "^6.22.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
"babel-plugin-transform-es2015-modules-systemjs": "^6.22.0",
"babel-plugin-transform-es2015-modules-umd": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babelify": "^7.3.0",
"browserify": "^13.1.0",
"chai": "^3.5.0",
"commander": "^2.9.0",
"es-module-loader": "^2.1.0",
"eslint": "^4.16.0",
"fs-extra": "^1.0.0",
"babel-plugin-syntax-dynamic-import": "*",
"babel-plugin-transform-es2015-modules-amd": "*",
"babel-plugin-transform-es2015-modules-commonjs": "*",
"babel-plugin-transform-es2015-modules-systemjs": "*",
"babel-plugin-transform-es2015-modules-umd": "*",
"babel-preset-es2015": "*",
"babelify": "*",
"browserify": "*",
"chai": "*",
"commander": "*",
"es-module-loader": "*",
"eslint": "*",
"fs-extra": "*",
"jsdom": "*",
"karma": "^1.3.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.0",
"karma-sauce-launcher": "^1.0.0",
"karma-sinon-chai": "^2.0.0",
"mocha": "^3.1.2",
"karma": "*",
"karma-mocha": "*",
"karma-mocha-reporter": "*",
"karma-sauce-launcher": "*",
"karma-sinon-chai": "*",
"mocha": "*",
"node-getopt": "*",
"po2json": "*",
"requirejs": "^2.3.2",
"rollup": "^0.41.4",
"rollup-plugin-node-resolve": "^2.0.0",
"sinon": "^4.0.0",
"sinon-chai": "^2.8.0"
"requirejs": "*",
"rollup": "*",
"rollup-plugin-node-resolve": "*",
"sinon": "*",
"sinon-chai": "*"
},
"dependencies": {},
"keywords": [

5
po/.eslintrc Normal file
View File

@ -0,0 +1,5 @@
{
"env": {
"node": true,
},
}

View File

@ -22,17 +22,17 @@ const fs = require('fs');
const po2json = require("po2json");
const opt = getopt.create([
['h' , 'help' , 'display this help'],
['h', 'help', 'display this help'],
]).bindHelp().parseSystem();
if (opt.argv.length != 2) {
console.error("Incorrect number of arguments given");
process.exit(1);
console.error("Incorrect number of arguments given");
process.exit(1);
}
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;
const msgstr = data[msgid][1];
return " " + JSON.stringify(msgid) + ": " + JSON.stringify(msgstr);

View File

@ -10,8 +10,8 @@ const jsdom = require("jsdom");
const fs = require("fs");
const opt = getopt.create([
['o' , 'output=FILE' , 'write output to specified file'],
['h' , 'help' , 'display this help'],
['o', 'output=FILE', 'write output to specified file'],
['h', 'help', 'display this help'],
]).bindHelp().parseSystem();
const strings = {};
@ -22,7 +22,7 @@ function addString(str, location) {
}
if (strings[str] === undefined) {
strings[str] = {}
strings[str] = {};
}
strings[str][location] = null;
}
@ -74,7 +74,7 @@ function process(elem, locator, enabled) {
}
for (let i = 0; i < elem.childNodes.length; i++) {
node = elem.childNodes[i];
let node = elem.childNodes[i];
if (node.nodeType === node.ELEMENT_NODE) {
process(node, locator, 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 body = dom.window.document.body;
function locator(elem) {
let locator = (elem) => {
const offset = dom.nodeLocation(elem).startOffset;
const line = file.slice(0, offset).split("\n").length;
return fn + ":" + line;
}
};
process(body, locator, true);
}
let output = "";
for (str in strings) {
for (let str in strings) {
output += "#:";
for (location in strings[str]) {
output += " " + location;

View File

@ -437,7 +437,7 @@ describe('Key Event Handling', function () {
expect(kbd.onkeyevent.secondCall).to.have.been.calledWith(0x61, "KeyA", true);
// Check that the timer is properly dead
kbd.onkeyevent.reset();
kbd.onkeyevent.resetHistory();
this.clock.tick(100);
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);
// Check that the timer is properly dead
kbd.onkeyevent.reset();
kbd.onkeyevent.resetHistory();
this.clock.tick(100);
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);
// Check that the timer is properly dead
kbd.onkeyevent.reset();
kbd.onkeyevent.resetHistory();
this.clock.tick(100);
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);
// Check that the timer is properly dead
kbd.onkeyevent.reset();
kbd.onkeyevent.resetHistory();
this.clock.tick(100);
expect(kbd.onkeyevent).to.not.have.been.called;
});

View File

@ -271,7 +271,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
it('should move focus to canvas object', function () {
client._canvas.focus = sinon.spy();
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 () {
client._canvas.blur = sinon.spy();
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;
expect(spy.set).to.have.been.calledOnce;
expect(spy.set).to.have.been.calledWith(false);
spy.set.reset();
spy.set.resetHistory();
client.clipViewport = true;
expect(spy.set).to.have.been.calledOnce;
@ -438,7 +438,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
client._handleMouseButton(13, 9, 0x000);
expect(RFB.messages.pointerEvent).to.have.been.calledTwice;
RFB.messages.pointerEvent.reset();
RFB.messages.pointerEvent.resetHistory();
// Small movement
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.calledWith(-30, 0);
client._display.viewportChangePos.reset();
client._display.viewportChangePos.resetHistory();
// 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.calledWith(true);
spy.set.reset();
spy.set.resetHistory();
client.scaleViewport = true;
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.calledWith(sinon.match.object, 70, 80, 0, 0);
RFB.messages.setDesktopSize.reset();
RFB.messages.setDesktopSize.resetHistory();
// Second message should not trigger a resize
@ -2056,7 +2056,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
beforeEach(function () {
client.showDotCursor = true;
// Was called when we enabled dot cursor
client._cursor.change.reset();
client._cursor.change.resetHistory();
});
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

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,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';