main: work in progress [might break]
This commit is contained in:
parent
c6ce294e69
commit
35ff5dc710
|
@ -151,6 +151,7 @@ if( typeof AFRAME != 'undefined '){
|
||||||
animation:fade 1000ms infinite;
|
animation:fade 1000ms infinite;
|
||||||
-webkit-animation:fade 1000ms infinite;
|
-webkit-animation:fade 1000ms infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -39,14 +39,16 @@ ISOTerminal.addEventListener('emulator-started', function(){
|
||||||
})
|
})
|
||||||
|
|
||||||
window.addEventListener('error', function(event) {
|
window.addEventListener('error', function(event) {
|
||||||
|
if( event.filename ){
|
||||||
console.error(event.filename+":"+event.lineno+":"+event.colno)
|
console.error(event.filename+":"+event.lineno+":"+event.colno)
|
||||||
console.error(event.message);
|
console.error(event.message);
|
||||||
console.error(event.error);
|
console.error(event.error);
|
||||||
|
}else console.error(event)
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('unhandledrejection', function(event) {
|
window.addEventListener('unhandledrejection', function(event) {
|
||||||
console.error('Unhandled promise rejection:')
|
console.error('Unhandled promise rejection:')
|
||||||
console.error(event.reason);
|
console.error(event);
|
||||||
});
|
});
|
||||||
|
|
||||||
// enable/disable logging file (echo 1 > mnt/console.tty)
|
// enable/disable logging file (echo 1 > mnt/console.tty)
|
||||||
|
|
|
@ -30,36 +30,36 @@ ISOTerminal.prototype.xtermInit = function(){
|
||||||
|
|
||||||
// xterm relies on requestAnimationFrame (which does not called in immersive mode)
|
// xterm relies on requestAnimationFrame (which does not called in immersive mode)
|
||||||
let _window = term._core._coreBrowserService._window
|
let _window = term._core._coreBrowserService._window
|
||||||
if( !_window.requestAnimationFrameAFRAME ){ // patch the planet!
|
if( !_window._XRSH_proxied ){ // patch the planet!
|
||||||
|
|
||||||
// _window.requestAnimationFrameAFRAME = function(cb){
|
//_window.requestAnimationFrameAFRAME = function(cb){
|
||||||
// if( term.tid != null ) clearTimeout(term.tid)
|
// if( term.tid != null ) clearTimeout(term.tid)
|
||||||
// term.tid = setTimeout( function(){
|
// term.tid = setTimeout( function(){
|
||||||
// console.log("render")
|
// console.log("render")
|
||||||
// cb()
|
// cb()
|
||||||
// term.tid = null
|
// term.tid = null
|
||||||
// },100)
|
// },100)
|
||||||
// }
|
//}
|
||||||
_window.requestAnimationFrameAFRAME =
|
const requestAnimationFrameAFRAME = AFRAME.utils.throttleLeadingAndTrailing(
|
||||||
AFRAME.utils.throttleLeadingAndTrailing( function(cb){
|
function(cb){ cb() },150
|
||||||
cb()
|
)
|
||||||
},150 )
|
|
||||||
|
|
||||||
// we proxy the _window object of xterm, and reroute
|
// we proxy the _window object of xterm, and reroute
|
||||||
// requestAnimationFrame to requestAnimationFrameAFRAME
|
// requestAnimationFrame to requestAnimationFrameAFRAME
|
||||||
_window = new Proxy(_window,{
|
_window_new = new Proxy(_window,{
|
||||||
get(me,k){
|
get(me,k){
|
||||||
|
if( k == '_XRSH_proxied' ) return true
|
||||||
if( k == 'requestAnimationFrame' ){
|
if( k == 'requestAnimationFrame' ){
|
||||||
return me.requestAnimationFrameAFRAME
|
return requestAnimationFrameAFRAME.bind(me)
|
||||||
}
|
}
|
||||||
return me[k]
|
return typeof me[k] == 'function' ? me[k].bind(me) : me[k]
|
||||||
},
|
},
|
||||||
set(me,k,v){
|
set(me,k,v){
|
||||||
me[k] = v
|
me[k] = v
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
term._core._coreBrowserService._window = _window
|
term._core._coreBrowserService._window = _window_new
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue