add compiling of client code to es5
This commit is contained in:
parent
79dd88fd67
commit
7bd1935723
8 changed files with 4181 additions and 13 deletions
2
public/static/js/lib/bootstrap.js
vendored
Normal file
2
public/static/js/lib/bootstrap.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
new traceur.WebPageTranscoder(document.location.href).run();
|
4148
public/static/js/lib/traceur-runtime.js
Normal file
4148
public/static/js/lib/traceur-runtime.js
Normal file
File diff suppressed because it is too large
Load diff
8
public/static/js/lib/traceur.js
Normal file
8
public/static/js/lib/traceur.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
var $__util_45_imports_46_js__,
|
||||
$__compiler_45_imports_46_js__,
|
||||
$__loader_47_loader_45_imports_46_js__;
|
||||
var $__util_45_imports_46_js__ = ($__util_45_imports_46_js__ = require("./util-imports.js"), $__util_45_imports_46_js__ && $__util_45_imports_46_js__.__esModule && $__util_45_imports_46_js__ || {default: $__util_45_imports_46_js__});
|
||||
var $__compiler_45_imports_46_js__ = ($__compiler_45_imports_46_js__ = require("./compiler-imports.js"), $__compiler_45_imports_46_js__ && $__compiler_45_imports_46_js__.__esModule && $__compiler_45_imports_46_js__ || {default: $__compiler_45_imports_46_js__});
|
||||
var $__loader_47_loader_45_imports_46_js__ = ($__loader_47_loader_45_imports_46_js__ = require("./loader/loader-imports.js"), $__loader_47_loader_45_imports_46_js__ && $__loader_47_loader_45_imports_46_js__.__esModule && $__loader_47_loader_45_imports_46_js__ || {default: $__loader_47_loader_45_imports_46_js__});
|
||||
$traceurRuntime.exportStar(Object.defineProperties(module.exports, {__esModule: {value: true}}), $__util_45_imports_46_js__, $__compiler_45_imports_46_js__, $__loader_47_loader_45_imports_46_js__);
|
|
@ -33,25 +33,25 @@ class Input {
|
|||
document.addEventListener('contextmenu', e => e.preventDefault());
|
||||
}
|
||||
|
||||
mouseMove() {
|
||||
mouseMove(event) {
|
||||
if (this.locked) return;
|
||||
var rect = game.renderer.canvas.getBoundingClientRect();
|
||||
this.mouse.x = event.clientX - rect.left;
|
||||
this.mouse.y = event.clientY - rect.top;
|
||||
};
|
||||
|
||||
mouseDown() {
|
||||
mouseDown(event) {
|
||||
if (this.locked) return;
|
||||
this.mouse.pressed[event.which] = true;
|
||||
this.mouse.held[event.which] = true;
|
||||
};
|
||||
|
||||
mouseUp() {
|
||||
mouseUp(event) {
|
||||
if (this.locked) return;
|
||||
this.mouse.held[event.which] = false;
|
||||
}
|
||||
|
||||
keyDown() {
|
||||
keyDown(event) {
|
||||
if (this.locked) {
|
||||
if (event.key == 'Esc' || event.key == 'Enter') {
|
||||
this.keys.pressed[event.key] = true;
|
||||
|
@ -63,18 +63,18 @@ class Input {
|
|||
this.keys.held[event.key] = true;
|
||||
}
|
||||
|
||||
keyUp() {
|
||||
keyUp(event) {
|
||||
if (this.locked) return;
|
||||
this.keys.held[event.key] = false;
|
||||
}
|
||||
|
||||
mouseAnyPressed() {
|
||||
mouseAnyPressed(event) {
|
||||
if (this.locked) return;
|
||||
var p = this.mouse.pressed;
|
||||
return p[1] || p[2] || p[3];
|
||||
}
|
||||
|
||||
clear() {
|
||||
clear(event) {
|
||||
for (var i in this.keys.pressed) this.keys.pressed[i] = false;
|
||||
for (var i in this.mouse.pressed) this.mouse.pressed[i] = false;
|
||||
};
|
||||
|
|
|
@ -3,6 +3,7 @@ extends layout.jade
|
|||
block head
|
||||
title
|
||||
| Wingbase
|
||||
script(src='js/lib/traceur-runtime.js')
|
||||
script(src='js/lib/dexie.min.js')
|
||||
script(src='js/lib/domeventslevel3.shim.min.js')
|
||||
script(src='socket.io/socket.io.js')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue