catlab-remote-client 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>pool host</title>
6
+ </head>
7
+ <body>
8
+ <!--
9
+ Iframe worker host bootstrap (spec §3). Loads the same files the dedicated
10
+ worker importScripts, in the same order, through the same worker-env.js
11
+ environment shim, then boots on the 'webcontrol' bundle exactly as the
12
+ Worker does. WorkerPolyfills guards every stub with a typeof check, so it
13
+ is inert here (a real document/window/localStorage already exist).
14
+ -->
15
+ <script src="vendor/requirejs/require.js"></script>
16
+ <script src="scripts/WorkerPolyfills.js"></script>
17
+ <script src="scripts/worker-env.js"></script>
18
+ <script>
19
+ (function () {
20
+ var post = function (m) { window.parent.postMessage(m, '*'); };
21
+ // vendor is resolved by RequireJS RELATIVE TO baseUrl, so from
22
+ // scripts/ the vendor tree next to it is '../vendor/' — 'vendor/'
23
+ // would ask for dist/scripts/vendor/... and 404 (Ruling P2-15).
24
+ window.__catlabWorkerEnv.configureRequire(requirejs, { baseUrl: 'scripts/', vendor: '../vendor/' });
25
+ window.__catlabWorkerEnv.installJqueryStub(define);
26
+ window.__catlabWorkerEnv.onRequireError(requirejs, post);
27
+ window.__catlabWorkerEnv.boot(require, post);
28
+ })();
29
+ </script>
30
+ </body>
31
+ </html>
@@ -4,7 +4,7 @@
4
4
  * Only stubs what the catlab-remote-client library actually needs at
5
5
  * module-definition time:
6
6
  * - window/self: socket.io-client, backbone, screenfull reference window
7
- * - document: backbone needs createElement, KeyboardUser registers keydown/keyup
7
+ * - document: backbone needs createElement
8
8
  * - localStorage/sessionStorage: Storage.js wraps localStorage
9
9
  * - alert/confirm: Portal default start handler uses alert()
10
10
  * - navigator: socket.io-client reads navigator.userAgent
@@ -115,7 +115,7 @@
115
115
  };
116
116
  }
117
117
 
118
- // ---------- document stub (with real event dispatch for KeyboardUser) ----------
118
+ // ---------- document stub (with real listener/dispatch bookkeeping) ----------
119
119
 
120
120
  if (typeof document === 'undefined') {
121
121
  var _docListeners = {};
@@ -212,6 +212,8 @@
212
212
  }
213
213
  if (typeof requestAnimationFrame === 'undefined') {
214
214
  scope.requestAnimationFrame = function (cb) { return setTimeout(cb, 1000 / 60); };
215
+ }
216
+ if (typeof cancelAnimationFrame === 'undefined') {
215
217
  scope.cancelAnimationFrame = function (id) { clearTimeout(id); };
216
218
  }
217
219