summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolly Ross <sross@redhat.com>2016-09-14 13:45:08 -0400
committerSolly Ross <sross@redhat.com>2016-09-14 14:15:19 -0400
commitebcf44d55a9487e91357a6f09fa06f177fb6fa47 (patch)
tree87def292fbe281f81adbb453dd5a1c217c79eb7e
parente192e6710cbedd1926a99c6db750912a613a8c4d (diff)
downloadnovnc-refactor/modularized.tar.gz
Move input-related files into core/inputrefactor/modularized
This commit moves all the input-related files from `core/` to `core/input/`, and renames a couple as relevant (input.js --> input/devices.js, keyboard.js --> input/util.js).
-rw-r--r--LICENSE.txt6
-rw-r--r--app/ui.js8
-rw-r--r--core/input/devices.js (renamed from core/input.js)4
-rw-r--r--core/input/keysym.js (renamed from core/keysym.js)0
-rw-r--r--core/input/keysymdef.js (renamed from core/keysymdef.js)0
-rw-r--r--core/input/util.js (renamed from core/keyboard.js)0
-rw-r--r--core/input/xtscancodes.js (renamed from core/xtscancodes.js)0
-rw-r--r--core/rfb.js6
-rw-r--r--karma.conf.js10
-rw-r--r--tests/input.html10
-rw-r--r--tests/test.helper.js2
-rw-r--r--tests/test.keyboard.js2
-rw-r--r--tests/test.rfb.js2
-rw-r--r--tests/vnc_perf.html6
-rw-r--r--tests/vnc_playback.html6
-rwxr-xr-xutils/use_require.js3
-rw-r--r--vnc_auto.html6
17 files changed, 36 insertions, 35 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
index 41b45bb..7b5de59 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -8,8 +8,8 @@ is not limited to):
core/base64.js
core/des.js
core/display.js
- core/input.js
- core/keysym.js
+ core/input/devices.js
+ core/input/keysym.js
core/logo.js
core/playback.js
core/rfb.js
@@ -17,7 +17,7 @@ is not limited to):
core/util.js
core/websock.js
app/webutil.js
- core/xtscancodes.js
+ core/input/xtscancodes.js
The HTML, CSS, font and images files that included with the noVNC
source distibution (or repository) are not considered part of the
diff --git a/app/ui.js b/app/ui.js
index cb0cc9e..78d397d 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -12,7 +12,7 @@
/* [module]
* import Util from "../core/util";
- * import KeyTable from "../core/keysym";
+ * import KeyTable from "../core/input/keysym";
* import RFB from "../core/rfb";
* import Display from "../core/display";
* import WebUtil from "./webutil";
@@ -26,9 +26,9 @@ var UI;
/* [begin skip-as-module] */
// Load supporting scripts
WebUtil.load_scripts(
- {'core': ["base64.js", "websock.js", "des.js", "keysymdef.js",
- "xtscancodes.js", "keyboard.js", "input.js", "display.js",
- "inflator.js", "rfb.js", "keysym.js"]});
+ {'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] */
diff --git a/core/input.js b/core/input/devices.js
index e1fff1c..d283fc4 100644
--- a/core/input.js
+++ b/core/input/devices.js
@@ -9,8 +9,8 @@
/*global window, Util */
/* [module]
- * import Util from "./util";
- * import KeyboardUtil from "./keyboard";
+ * import Util from "../util";
+ * import KeyboardUtil from "./util";
*/
/* [module] export */ var Keyboard;
diff --git a/core/keysym.js b/core/input/keysym.js
index 5983c38..5983c38 100644
--- a/core/keysym.js
+++ b/core/input/keysym.js
diff --git a/core/keysymdef.js b/core/input/keysymdef.js
index f45d9d9..f45d9d9 100644
--- a/core/keysymdef.js
+++ b/core/input/keysymdef.js
diff --git a/core/keyboard.js b/core/input/util.js
index efdcced..efdcced 100644
--- a/core/keyboard.js
+++ b/core/input/util.js
diff --git a/core/xtscancodes.js b/core/input/xtscancodes.js
index 89d824c..89d824c 100644
--- a/core/xtscancodes.js
+++ b/core/input/xtscancodes.js
diff --git a/core/rfb.js b/core/rfb.js
index 0ae96bd..135d3a7 100644
--- a/core/rfb.js
+++ b/core/rfb.js
@@ -13,12 +13,12 @@
/* [module]
* import Util from "./util";
* import Display from "./display";
- * import { Keyboard, Mouse } from "./input"
+ * import { Keyboard, Mouse } from "./input/devices"
* import Websock from "./websock"
* import Base64 from "./base64";
* import DES from "./des";
- * import KeyTable from "./keysym";
- * import XtScancode from "./xtscancodes";
+ * import KeyTable from "./input/keysym";
+ * import XtScancode from "./input/xtscancodes";
* import Inflator from "./inflator.mod";
*/
/*jslint white: false, browser: true */
diff --git a/karma.conf.js b/karma.conf.js
index f14dc42..5f3c20b 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -113,11 +113,11 @@ module.exports = function(config) {
'core/util.js', // load first to avoid issues, since methods are called immediately
//'../core/*.js',
'core/base64.js',
- 'core/keysym.js',
- 'core/keysymdef.js',
- 'core/xtscancodes.js',
- 'core/keyboard.js',
- 'core/input.js',
+ 'core/input/keysym.js',
+ 'core/input/keysymdef.js',
+ 'core/input/xtscancodes.js',
+ 'core/input/util.js',
+ 'core/input/devices.js',
'core/websock.js',
'core/rfb.js',
'core/des.js',
diff --git a/tests/input.html b/tests/input.html
index a513645..a261924 100644
--- a/tests/input.html
+++ b/tests/input.html
@@ -26,11 +26,11 @@
<script src="../core/util.js"></script>
<script src="../app/webutil.js"></script>
<script src="../core/base64.js"></script>
- <script src="../core/keysym.js"></script>
- <script src="../core/keysymdef.js"></script>
- <script src="../core/xtscancodes.js"></script>
- <script src="../core/keyboard.js"></script>
- <script src="../core/input.js"></script>
+ <script src="../core/input/keysym.js"></script>
+ <script src="../core/input/keysymdef.js"></script>
+ <script src="../core/input/xtscancodes.js"></script>
+ <script src="../core/input/util.js"></script>
+ <script src="../core/input/devices.js"></script>
<script src="../core/display.js"></script>
<script>
var msg_cnt = 0, iterations,
diff --git a/tests/test.helper.js b/tests/test.helper.js
index 16afcf4..4982535 100644
--- a/tests/test.helper.js
+++ b/tests/test.helper.js
@@ -1,4 +1,4 @@
-// requires local modules: keysym, keysymdef, keyboard
+// requires local modules: input/keysym, input/keysymdef, input/util
var assert = chai.assert;
var expect = chai.expect;
diff --git a/tests/test.keyboard.js b/tests/test.keyboard.js
index ad9c033..0019be9 100644
--- a/tests/test.keyboard.js
+++ b/tests/test.keyboard.js
@@ -1,4 +1,4 @@
-// requires local modules: input, keyboard, keysymdef, keysym
+// requires local modules: input/devices, input/util, input/keysymdef, input/keysym
var assert = chai.assert;
var expect = chai.expect;
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index 86d6378..3d856fa 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -1,4 +1,4 @@
-// requires local modules: util, websock, rfb, keyboard, keysym, keysymdef, input, inflator, des, display
+// requires local modules: util, websock, rfb, input/util, input/keysym, input/keysymdef, input/devices, inflator, des, display
// requires test modules: fake.websocket, assertions
/* jshint expr: true */
var assert = chai.assert;
diff --git a/tests/vnc_perf.html b/tests/vnc_perf.html
index 021bc4e..098575b 100644
--- a/tests/vnc_perf.html
+++ b/tests/vnc_perf.html
@@ -50,9 +50,9 @@
// Load supporting scripts
WebUtil.load_scripts({
- 'core': ["base64.js", "websock.js", "des.js", "keysym.js",
- "keysymdef.js", "xtscancodes.js", "keyboard.js",
- "input.js", "display.js", "rfb.js", "inflator.js"],
+ 'core': ["base64.js", "websock.js", "des.js", "input/keysym.js",
+ "input/keysymdef.js", "input/xtscancodes.js", "input/util.js",
+ "input/devices.js", "display.js", "rfb.js", "inflator.js"],
'tests': ["playback.js"],
'recordings': [fname]});
} else {
diff --git a/tests/vnc_playback.html b/tests/vnc_playback.html
index 611c371..b8f9eb1 100644
--- a/tests/vnc_playback.html
+++ b/tests/vnc_playback.html
@@ -60,9 +60,9 @@
message("Loading " + fname);
// Load supporting scripts
WebUtil.load_scripts({
- 'core': ["base64.js", "websock.js", "des.js", "keysym.js",
- "keysymdef.js", "xtscancodes.js", "keyboard.js",
- "input.js", "display.js", "rfb.js", "inflator.js"],
+ 'core': ["base64.js", "websock.js", "des.js", "input/keysym.js",
+ "input/keysymdef.js", "input/xtscancodes.js", "input/util.js",
+ "input/devices.js", "display.js", "rfb.js", "inflator.js"],
'tests': ["playback.js"],
'recordings': [fname]});
diff --git a/utils/use_require.js b/utils/use_require.js
index 0c16db2..e48c9e7 100755
--- a/utils/use_require.js
+++ b/utils/use_require.js
@@ -96,7 +96,8 @@ var make_lib_files = function (use_require) {
var b = make_browserify(rfb_file, {});
b.on('transform', function (tr, file) {
if (tr._is_make_module) {
- var new_path = path.join(lib_dir_base, path.basename(file));
+ var new_path = path.join(lib_dir_base, path.relative(core_path, file));
+ fse.ensureDir(path.dirname(new_path));
console.log("Writing " + new_path)
var fileStream = fs.createWriteStream(new_path);
diff --git a/vnc_auto.html b/vnc_auto.html
index 2bb9013..a3c5dc9 100644
--- a/vnc_auto.html
+++ b/vnc_auto.html
@@ -79,9 +79,9 @@
// Load supporting scripts
WebUtil.load_scripts({
- 'core': ["base64.js", "websock.js", "des.js", "keysymdef.js",
- "xtscancodes.js", "keyboard.js", "input.js", "display.js",
- "inflator.js", "rfb.js", "keysym.js"],
+ '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"],
'app': ["webutil.js"]});
var rfb;