Skip to content

Commit

Permalink
use latest aframe master
Browse files Browse the repository at this point in the history
remove deprecated url() syntax since we're using new aframe master

fix more deprecated url(...) usage

remove deprecated url() syntax since we're using new aframe master

replace deprecated getComputedAttribute

use https://aframe.io/releases/0.4.0/aframe.min.js

bump build.js
  • Loading branch information
machenmusik committed Dec 18, 2016
1 parent 6ee464e commit 5c5fe58
Show file tree
Hide file tree
Showing 7 changed files with 4,562 additions and 4,546 deletions.
8,705 changes: 4,359 additions & 4,346 deletions build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/look-controls-alt.js
Expand Up @@ -82,7 +82,7 @@ AFRAME.registerComponent('look-controls-alt', {
var deltaHMDPosition = new THREE.Vector3();
return function () {
var el = this.el;
var currentPosition = el.getComputedAttribute('position');
var currentPosition = el.getAttribute('position');
var currentHMDPosition;
var previousHMDPosition = this.previousHMDPosition;
var sceneEl = this.el.sceneEl;
Expand Down
2 changes: 1 addition & 1 deletion src/components/orbit-controls.js
Expand Up @@ -47,7 +47,7 @@ AFRAME.registerComponent('orbit-controls', {
var renderer = this.el.sceneEl.renderer;
var camera = this.el.getObject3D('camera');
var controls = this.controls = new THREE.OrbitControls(camera, renderer.domElement);
var position = this.el.getComputedAttribute('position');
var position = this.el.getAttribute('position');
controls.target.setX(-position.x);
controls.target.setZ(-position.z);
controls.enableDamping = true;
Expand Down
4 changes: 2 additions & 2 deletions src/components/paint-controls.js
Expand Up @@ -9,9 +9,9 @@ AFRAME.registerComponent('paint-controls', {
init: function () {
var el = this.el;
var self = this;
var highLightTextureUrl = 'url(https://cdn.aframe.io/a-painter/images/controller-pressed.png)';
var highLightTextureUrl = 'https://cdn.aframe.io/a-painter/images/controller-pressed.png';
el.sceneEl.systems.material.loadTexture(highLightTextureUrl, {src: highLightTextureUrl}, createTexture);
el.setAttribute('json-model', {src: 'url(https://cdn.aframe.io/a-painter/models/controller.json)'});
el.setAttribute('json-model', {src: 'https://cdn.aframe.io/a-painter/models/controller.json'});
this.onButtonChanged = this.onButtonChanged.bind(this);
this.onButtonDown = function (evt) { self.onButtonEvent(evt.detail.id, 'down'); };
this.onButtonUp = function (evt) { self.onButtonEvent(evt.detail.id, 'up'); };
Expand Down
15 changes: 7 additions & 8 deletions src/components/ui.js
Expand Up @@ -197,7 +197,7 @@ AFRAME.registerComponent('ui', {
},

copyBrush: function () {
var brush = this.el.getComputedAttribute('brush');
var brush = this.el.getAttribute('brush');
this.handEl.setAttribute('brush', 'brush', brush.brush);
this.handEl.setAttribute('brush', 'color', brush.color);
this.handEl.setAttribute('brush', 'size', brush.size);
Expand Down Expand Up @@ -482,7 +482,7 @@ AFRAME.registerComponent('ui', {
this.objects.messageError.visible = false;
this.objects.messageError.material = this.messagesMaterial;

var messagesImageUrl = 'url(https://cdn.aframe.io/a-painter/images/messages.png)';
var messagesImageUrl = 'https://cdn.aframe.io/a-painter/images/messages.png';

this.el.sceneEl.systems.material.loadTexture(messagesImageUrl, {src: messagesImageUrl}, function (texture) {
var material = self.messagesMaterial;
Expand Down Expand Up @@ -524,8 +524,8 @@ AFRAME.registerComponent('ui', {
this.initColorHistory();
this.initBrushesMenu();
this.setCursorTransparency();
this.updateColorUI(this.el.getComputedAttribute('brush').color);
this.updateSizeSlider(this.el.getComputedAttribute('brush').size);
this.updateColorUI(this.el.getAttribute('brush').color);
this.updateSizeSlider(this.el.getAttribute('brush').size);
},

initBrushesMenu: function () {
Expand Down Expand Up @@ -589,7 +589,6 @@ AFRAME.registerComponent('ui', {
function loadBrush (name, id, thumbnailUrl) {
var brushName = !name ? undefined : (name.charAt(0).toUpperCase() + name.slice(1)).toLowerCase();
if (thumbnailUrl && !brushesMaterials[brushName]) {
thumbnailUrl = 'url(' + thumbnailUrl + ')';
self.el.sceneEl.systems.material.loadTexture(thumbnailUrl, {src: thumbnailUrl}, onLoadThumbnail);
return;
}
Expand Down Expand Up @@ -733,7 +732,7 @@ AFRAME.registerComponent('ui', {
syncUI: function () {
var brush;
if (!this.handEl || !this.objects) { return; }
brush = this.handEl.getComputedAttribute('brush');
brush = this.handEl.getAttribute('brush');
this.updateSizeSlider(brush.size);
this.updateColorUI(brush.color);
this.updateColorHistory();
Expand All @@ -754,7 +753,7 @@ AFRAME.registerComponent('ui', {
},

updateColorHistory: function () {
var color = this.handEl && this.handEl.getComputedAttribute('brush').color;
var color = this.handEl && this.handEl.getAttribute('brush').color;
var colorStack = this.colorStack;
if (!color) { color = this.el.components.brush.schema.color.default; }
this.objects.currentColor.material.color.set(color);
Expand Down Expand Up @@ -818,7 +817,7 @@ AFRAME.registerComponent('ui', {
var color;
var colorStack = this.colorStack;
if (!this.colorHasChanged) { return; }
color = this.handEl.getComputedAttribute('brush').color;
color = this.handEl.getAttribute('brush').color;
this.colorHasChanged = false;
if (colorStack.length === 7) { colorStack.shift(); }
colorStack.push(color);
Expand Down
4 changes: 2 additions & 2 deletions src/systems/ui.js
Expand Up @@ -6,8 +6,8 @@ AFRAME.registerSystem('ui', {

initTextures: function () {
var self = this;
var hoverTextureUrl = 'url(https://cdn.aframe.io/a-painter/images/ui-hover.png)';
var pressedTextureUrl = 'url(https://cdn.aframe.io/a-painter/images/ui-pressed.png)';
var hoverTextureUrl = 'https://cdn.aframe.io/a-painter/images/ui-hover.png';
var pressedTextureUrl = 'https://cdn.aframe.io/a-painter/images/ui-pressed.png';
this.sceneEl.systems.material.loadTexture(hoverTextureUrl, {src: hoverTextureUrl}, onLoadedHoverTexture);
this.sceneEl.systems.material.loadTexture(pressedTextureUrl, {src: pressedTextureUrl}, onLoadedPressedTexture);
function onLoadedHoverTexture (texture) {
Expand Down
376 changes: 190 additions & 186 deletions vendor/aframe.min.js

Large diffs are not rendered by default.

0 comments on commit 5c5fe58

Please sign in to comment.