]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Uncomment ES6 module syntax
authorSolly Ross <sross@redhat.com>
Sat, 4 Feb 2017 04:17:44 +0000 (23:17 -0500)
committerSolly Ross <sross@redhat.com>
Sun, 26 Feb 2017 21:30:37 +0000 (16:30 -0500)
This removes the special comment part of the ES6 module syntax,
opting to enable ES6 module syntax by default.

It also appends `.js` to all import paths to better support in-browser
loading.

13 files changed:
app/ui.js
app/webutil.js
core/base64.js
core/des.js
core/display.js
core/input/devices.js
core/input/keysym.js
core/input/keysymdef.js
core/input/util.js
core/input/xtscancodes.js
core/rfb.js
core/util.js
core/websock.js

index 56bd9f74c4a7776e290f757bd49ff69469b1cd1d..8009c3825fcdea20305597b7bdcb14f1a0097f11 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
 /* jslint white: false, browser: true */
 /* global window, document.getElementById, Util, WebUtil, RFB, Display */
 
-/* [module]
- * import Util from "../core/util";
- * import KeyTable from "../core/input/keysym";
- * import keysyms from "../core/input/keysymdef";
- * import RFB from "../core/rfb";
- * import Display from "../core/display";
- * import WebUtil from "./webutil";
- */
+import Util from "../core/util.js";
+import KeyTable from "../core/input/keysym.js";
+import keysyms from "../core/input/keysymdef.js";
+import RFB from "../core/rfb.js";
+import Display from "../core/display.js";
+import WebUtil from "./webutil.js";
 
 var UI;
 
@@ -73,16 +71,6 @@ var UI;
             {'app': ["locale/" + Util.Localisation.language + ".js"]});
     }
 
-    /* [begin skip-as-module] */
-    // Load supporting scripts
-    WebUtil.load_scripts(
-        {'core': ["base64.js", "websock.js", "des.js", "input/keysymdef.js",
-                  "input/xtscancodes.js", "input/util.js", "input/devices.js",
-                  "display.js", "inflator.js", "rfb.js", "input/keysym.js"]});
-
-    window.onscriptsload = function () { UI.load(); };
-    /* [end skip-as-module] */
-
     var _ = Util.Localisation.get;
 
     UI = {
@@ -1755,7 +1743,7 @@ var UI;
  */
     };
 
-    /* [module] UI.load(); */
+    UI.load();
 })();
 
-/* [module] export default UI; */
+export default UI;
index e6e6afb70842af9118bf2c97e5f3f510546edf32..6afd015fd8613ca9a32b5d659b53a208e436c056 100644 (file)
@@ -10,9 +10,7 @@
 /*jslint bitwise: false, white: false, browser: true, devel: true */
 /*global Util, window, document */
 
-/* [module]
- * import Util from "../core/util";
- */
+import Util from "../core/util.js";
 
 // Globals defined here
 var WebUtil = {};
@@ -308,4 +306,4 @@ WebUtil.load_scripts = function (files_by_dir) {
     }
 };
 
-/* [module] export default WebUtil; */
+export default WebUtil;
index 2b4f948f4a3c9db9d506769d433fc6efaae560bf..3b9ebe540a717e8753af78c6b77a8d1f9255b8da 100644 (file)
@@ -112,4 +112,4 @@ var Base64 = {
     }
 }; /* End of Base64 namespace */
 
-/* [module] export default Base64; */
+export default Base64;
index c9a4753a199d309b045037ffa5aa8937524cf009..62684936db5e5a66efe36963b9b74babf3856932 100644 (file)
@@ -77,7 +77,7 @@
 
 /* jslint white: false */
 
-/* [module] export default */ function DES(passwd) {
+export default function DES(passwd) {
     "use strict";
 
     // Tables, permutations, S-boxes, etc.
index f7c437b4e934f6bf58a54e2cbdc0c16900a99894..a1dac7a4358883104aa8687d841550fecbd5fc66 100644 (file)
 /*jslint browser: true, white: false */
 /*global Util, Base64, changeCursor */
 
-/* [module]
- * import Util from "./util";
- * import Base64 from "./base64";
- */
+import Util from "./util.js";
+import Base64 from "./base64.js";
+
 
-/* [module] export default */ function Display(defaults) {
+export default function Display(defaults) {
     this._drawCtx = null;
     this._c_forceCanvas = false;
 
index 2e41122eb7caa6357bef36d731212a0455a0e734..74317ca8a692335745180db51274869010b53004 100644 (file)
@@ -8,12 +8,11 @@
 /*jslint browser: true, white: false */
 /*global window, Util */
 
-/* [module]
- * import Util from "../util";
- * import KeyboardUtil from "./util";
- */
+import Util from "../util.js";
+import KeyboardUtil from "./util.js";
+
 
-/* [module] export */ var Keyboard;
+export var Keyboard;
 
 (function () {
     "use strict";
     ]);
 })();
 
-/* [module] export */ var Mouse;
+export var Mouse;
 
 (function () {
     Mouse = function (defaults) {
index 5983c38afe3fde2f8c04b1b8634fbcc19de3b6e2..15cc1bc749b0d0407123d1824aff9f07091cd746 100644 (file)
@@ -379,4 +379,4 @@ var KeyTable = {
     XK_ydiaeresis:                  0x00ff, /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
 };
 
-/* [module] export default KeyTable; */
+export default KeyTable;
index c4d0ace91a4114fae8859f2189bf99fb704a6948..e618c167de38254d6fe384f73d180d1d0c7495eb 100644 (file)
@@ -21,4 +21,4 @@ var keysyms = (function(){
     };
 })();
 
-/* [module] export default keysyms */
+export default keysyms
index 52b31283f9a0d728fbcfa3e5e264a5e7fef0cb89..f34a9abfee284a1129c54813bb16ec189917a541 100644 (file)
@@ -1,7 +1,6 @@
-/* [module]
- * import KeyTable from "./keysym";
- * import keysyms from "./keysymdef";
- */
+import KeyTable from "./keysym.js";
+import keysyms from "./keysymdef.js";
+
 
 var KeyboardUtil = {};
 
@@ -676,4 +675,4 @@ KeyboardUtil.EscapeModifiers = function(next) {
     };
 };
 
-/* [module] export default KeyboardUtil; */
+export default KeyboardUtil;
index 542bcf739e1a1295f9f09bb8d5d1605aa8e2ee0d..611a80bef9dbeba2c977d2e0b80717daac0c3293 100644 (file)
@@ -148,4 +148,4 @@ var XtScancode = {
     "MediaSelect": 0xE06D,
 };
 
-/* [module] export default XtScancode */
+export default XtScancode
index baf5f3cef42834c78657d0dcdf6133bce82831c9..caf96cfd38170eb0228e6a8037c732d9603155bf 100644 (file)
  * (c) 2012 Michael Tinglof, Joe Balaz, Les Piech (Mercuri.ca)
  */
 
-/* [module]
- * import Util from "./util";
- * import Display from "./display";
- * import { Keyboard, Mouse } from "./input/devices"
- * import Websock from "./websock"
- * import Base64 from "./base64";
- * import DES from "./des";
- * import KeyTable from "./input/keysym";
- * import XtScancode from "./input/xtscancodes";
- * import Inflator from "./inflator.mod";
- */
+import Util from "./util.js";
+import Display from "./display.js";
+import { Keyboard, Mouse } from "./input/devices.js";
+import Websock from "./websock.js";
+import Base64 from "./base64.js";
+import DES from "./des.js";
+import KeyTable from "./input/keysym.js";
+import XtScancode from "./input/xtscancodes.js";
+import Inflator from "./inflator.mod.js";
+
 /*jslint white: false, browser: true */
 /*global window, Util, Display, Keyboard, Mouse, Websock, Websock_native, Base64, DES, KeyTable, Inflator, XtScancode */
 
-/* [module] export default */ function RFB(defaults) {
+export default function RFB(defaults) {
     "use strict";
     if (!defaults) {
         defaults = {};
index 550ef9168b5b151f9a75c12015a791cb11154fa9..9f048914ddf65e2cafd9e807b2d13caa4c95d7fe 100644 (file)
@@ -618,4 +618,4 @@ Util.releaseCapture = function () {
     }
 };
 
-/* [module] export default Util; */
+export default Util;
index 51d9b6250ebc5d3a7632b994bb45cf0c00edd058..7cb04667aeedce9d2202ed5f6b86eb3390f1ab5b 100644 (file)
  * read binary data off of the receive queue.
  */
 
-/* [module]
- * import Util from "./util";
- */
+import Util from "./util.js";
+
 
 /*jslint browser: true, bitwise: true */
 /*global Util*/
 
-/* [module] export default */ function Websock() {
+export default function Websock() {
     "use strict";
 
     this._websocket = null;  // WebSocket object