diff --git a/index.html b/index.html index f176156..5dc9a76 100644 --- a/index.html +++ b/index.html @@ -2425,6 +2425,29 @@ obj.rotateOnAxis(axis, val.angle) } } +AFRAME.registerComponent('refresh-text-content-from-wiki-page', { + schema: { + pagename: {type: 'string', default: 'FoT'}, + }, + init:function(){ + this.added = [] + let = forcedPagename = AFRAME.utils.getUrlParameter('roomname') + forcedPagename?this.pagename=forcedPagename:this.pagename=this.data.pagename + }, + tick: function(){ + let generatorName = this.attrName + fetch("https://fabien.benetou.fr/PIMVRdata/"+ this.pagename +"?action=source#" + Date.now()).then(res => res.text() ).then(res => { + res.split("\n").slice(0,maxItemsFromSources).map( (n,i) => { + found = this.added.find((str) => str === n) + if (typeof found === 'undefined'){ + this.added.push(n) + addNewNote( n, "-1 "+(1+i/10)+" -2.5", ".1 .1 .1", null, generatorName ) + } + }) + }) + } +}); +
@@ -2433,6 +2456,7 @@ obj.rotateOnAxis(axis, val.angle)