disabled other menuitems
/ mirror_to_github (push) Successful in 20s Details
/ test (push) Successful in 5s Details

This commit is contained in:
Leon van Kammen 2024-09-06 08:30:24 +00:00
parent 98c3adb791
commit 658e113853
5 changed files with 79 additions and 84 deletions

View File

@ -37,7 +37,7 @@ if( typeof AFRAME != 'undefined '){
transparent: { type:'boolean', "default":false } // need good gpu
},
init: function(){
init: async function(){
this.el.object3D.visible = false
},
@ -107,21 +107,7 @@ if( typeof AFRAME != 'undefined '){
`
},
events:{
// combined AFRAME+DOM reactive events
click: function(e){ }, //
keydown: function(e){ },
// reactive events for this.data updates
myvalue: function(e){ this.el.dom.querySelector('b').innerText = this.data.myvalue },
ready: function( ){
this.el.dom.style.display = 'none'
},
launcher: async function(){
initTerminal: async function(){
if( this.instance ){
const el = document.querySelector('.isoterminal')
return console.warn('TODO: allow multiple terminals (see v86 examples)')
@ -186,6 +172,24 @@ if( typeof AFRAME != 'undefined '){
this.el.sceneEl.addEventListener('enter-ar', focus )
instance.object3D.quaternion.copy( AFRAME.scenes[0].camera.quaternion ) // face towards camera
},
events:{
// combined AFRAME+DOM reactive events
click: function(e){ }, //
keydown: function(e){ },
// reactive events for this.data updates
myvalue: function(e){ this.el.dom.querySelector('b').innerText = this.data.myvalue },
ready: function( ){
this.el.dom.style.display = 'none'
},
launcher: async function(){
this.initTerminal()
}
},
@ -244,20 +248,4 @@ if( typeof AFRAME != 'undefined '){
}
});
// reflect HTML changes to /dev/browser/html
AFRAME.registerSystem('isoterminal',{
init: function(){
this.components = []
// observe HTML changes in <a-scene>
observer = new MutationObserver( (a,b) => {
console.log("change")
})
observer.observe( this.sceneEl, {characterData: false, childList: true, attributes: false});
}
})
}

View File

@ -8,7 +8,7 @@ source /mnt/profile.xrsh
source /mnt/profile.sh
# source js functions
js "$(cat ~/.profile.js)" &>/dev/null &
./.profile.js
## forward not-found commands to javascript (via jsh)
command_not_found_handle(){

View File

@ -1,3 +1,5 @@
#!/bin/js
window.helloworld = function(){
alert("hello world")
return "hello world"

View File

@ -15,6 +15,8 @@ test -d /dev/browser || {
ln -s /mnt/profile.browser ~/.profile.browser
ln -s /mnt/profile.sh ~/.profile.sh
ln -s /mnt/motd ~/.motd
ln -s ~/.profile.js ~/index.js
chmod +x ~/.profile.js
}
setup_browser_dev(){

View File

@ -45,9 +45,12 @@ AFRAME.registerComponent('launcher', {
cols: { type:"number", "default": 5 }
},
dependencies:['dom'],
dependencies:{
dom: "com/dom.js"
},
init: async function () {
await AFRAME.utils.require(this.dependencies)
this.worldPosition = new THREE.Vector3()
await AFRAME.utils.require({
@ -377,7 +380,7 @@ AFRAME.registerSystem('launcher',{
updateLauncher: function(){
let launcher = document.querySelector('[launcher]')
if( launcher ) launcher.components['launcher'].render()
if( launcher ) launcher.components.launcher.render()
}
})