Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyabel committed Oct 3, 2017
1 parent d67463d commit e83d220
Show file tree
Hide file tree
Showing 11 changed files with 15,272 additions and 1,472 deletions.
2,524 changes: 1,411 additions & 1,113 deletions dist/aframe-master.js

Large diffs are not rendered by default.

70 changes: 33 additions & 37 deletions dist/aframe-master.js.map

Large diffs are not rendered by default.

530 changes: 265 additions & 265 deletions dist/aframe-master.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/aframe-master.min.js.map

Large diffs are not rendered by default.

13,513 changes: 13,513 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require('./vive-controls');
require('./wasd-controls');

require('./scene/auto-enter-vr');
require('./scene/canvas');
require('./scene/debug');
require('./scene/embedded');
require('./scene/inspector');
Expand Down
43 changes: 0 additions & 43 deletions src/components/scene/canvas.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/components/scene/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ module.exports.Component = registerComponent('screenshot', {
*/
setCapture: function (projection) {
var el = this.el;
var renderer = el.renderer;
var size;
var camera;
var cubeCamera;
Expand All @@ -148,7 +147,7 @@ module.exports.Component = registerComponent('screenshot', {
this.quad.visible = false;
// Use scene camera.
camera = el.camera;
size = renderer.getSize();
size = {width: this.data.width, height: this.data.height};
} else {
// Use ortho camera.
camera = this.camera;
Expand Down
5 changes: 4 additions & 1 deletion src/components/scene/vr-mode-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ function createEnterVRButton (enterVRHandler) {
wrapper.setAttribute(constants.AFRAME_INJECTED, '');
vrButton = document.createElement('button');
vrButton.className = ENTER_VR_BTN_CLASS;
vrButton.setAttribute('title', 'Enter VR mode with a headset or fullscreen mode on a desktop. Visit https://webvr.rocks or https://webvr.info for more information.');
vrButton.setAttribute(constants.AFRAME_INJECTED, '');

// Insert elements.
wrapper.appendChild(vrButton);
vrButton.addEventListener('click', enterVRHandler);
vrButton.addEventListener('click', function (evt) {
enterVRHandler();
});
return wrapper;
}

Expand Down
51 changes: 43 additions & 8 deletions src/core/scene/a-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ module.exports = registerElement('a-scene', {
prototype: Object.create(AEntity.prototype, {
defaultComponents: {
value: {
'canvas': '',
'inspector': '',
'keyboard-shortcuts': '',
'screenshot': '',
Expand Down Expand Up @@ -67,10 +66,9 @@ module.exports = registerElement('a-scene', {
this.hasLoaded = false;
this.isPlaying = false;
this.originalHTML = this.innerHTML;
this.addEventListener('render-target-loaded', function () {
this.setupRenderer();
this.resize();
});
setupCanvas(this);
this.setupRenderer();
this.resize();
this.addFullScreenStyles();
initPostMessageAPI(this);
},
Expand Down Expand Up @@ -341,12 +339,12 @@ module.exports = registerElement('a-scene', {

setupRenderer: {
value: function () {
var canvas = this.canvas;
// Set at startup. To enable/disable antialias
// at runttime we would have to recreate the whole context
var antialias = this.getAttribute('antialias') === 'true';
var renderer = this.renderer = new THREE.WebGLRenderer({
canvas: canvas,
var renderer;
renderer = this.renderer = new THREE.WebGLRenderer({
canvas: this.canvas,
antialias: antialias || window.hasNativeWebVRImplementation,
alpha: true
});
Expand Down Expand Up @@ -519,3 +517,40 @@ function exitFullscreen () {
document.webkitExitFullscreen();
}
}

function setupCanvas (sceneEl) {
var canvasEl;

canvasEl = document.createElement('canvas');
canvasEl.classList.add('a-canvas');
// Mark canvas as provided/injected by A-Frame.
canvasEl.dataset.aframeCanvas = true;
sceneEl.appendChild(canvasEl);

document.addEventListener('fullscreenchange', onFullScreenChange);
document.addEventListener('mozfullscreenchange', onFullScreenChange);
document.addEventListener('webkitfullscreenchange', onFullScreenChange);

// Prevent overscroll on mobile.
canvasEl.addEventListener('touchmove', function (event) {
event.preventDefault();
});

// Set canvas on scene.
sceneEl.canvas = canvasEl;
sceneEl.emit('render-target-loaded', {target: canvasEl});
// For unknown reasons a synchronous resize does not work on desktop when
// entering/exiting fullscreen.
setTimeout(bind(sceneEl.resize, sceneEl), 0);

function onFullScreenChange () {
var fullscreenEl =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement;
// No fullscren element === exit fullscreen
if (!fullscreenEl) { sceneEl.exitVR(); }
document.activeElement.blur();
document.body.focus();
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require('./core/a-mixin');
require('./extras/components/');
require('./extras/primitives/');

console.log('A-Frame Version: 0.5.0 (Date 10-02-2017, Commit #bf8b8f9)');
console.log('A-Frame Version: 0.5.0 (Date 03-10-2017, Commit #d67463d)');
console.log('three Version:', pkg.dependencies['three']);
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);

Expand Down

0 comments on commit e83d220

Please sign in to comment.