matching room as wiki pages to be able to write from submit.html and read from index.html

assymetric-collaboration
Fabien Benetou 2 years ago
parent de42d9be55
commit 65d15d3266
  1. 24
      index.html
  2. 8
      submit.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 )
}
})
})
}
});
</script>
<div id="observablehq-key">
<div id="observablehq-viewof-offsetExample-ab4c1560"></div>
@ -2433,6 +2456,7 @@ obj.rotateOnAxis(axis, val.angle)
<button id=mainbutton style="z-index: 1; position: absolute; width:50%; margin: auto; text-align:center; top:45%; left:30%; height:30%;" onclick="startExperience()">Start the experience (hand tracking recommended)</button>
<a-scene cursor="rayOrigin: mouse" raycaster="objects: [html]; interval:100;" adjust-height-in-vr
refresh-text-content-from-wiki-page="pagename:TestingPairCollaboration"
toolbox disable-components-via-url enable-components-via-url NOcommands-from-external-json keyboard >
<!-- screenstack dynamic-view selectionboxonpinches glossary timeline issues fot
networked-scene="serverURL: https://naf.benetou.fr/; adapter: easyrtc; audio: true;"

@ -35,7 +35,13 @@ function replaceWithThisText(element){
document.querySelector("textarea").value = element.innerText
}
const url = 'https://fabien.benetou.fr/PIMVRdata/FoT?action='
let pagename
const queryString = window.location.search
const urlParams = new URLSearchParams(queryString)
let = forcedPagename = urlParams.get('roomname')
forcedPagename?pagename=forcedPagename:pagename='FoT'
const url = 'https://fabien.benetou.fr/PIMVRdata/'+pagename+'?action='
function sendtovr(cabin){
text = document.querySelector("textarea").value
document.querySelector("textarea").value = ''

Loading…
Cancel
Save