working example

webdav
Fabien Benetou 2 years ago
parent 200679915a
commit b96a58883c
  1. 20
      index.html

@ -16,8 +16,7 @@
<script src="https://naf.benetou.fr/easyrtc/easyrtc.js"></script>
<script src='dependencies/networked-aframe.min.js'></script>
<!-- still experimenting, see webdav.html
<script src='dependencies/webdav.js'></script> -->
<script src='dependencies/webdav.js'></script>
<!-- replacing with local copies as CDNs are like unpkg tend to be slow
<script type="module" src="https://unpkg.com/immers-client/dist/destination.bundle.js"></script>
@ -116,7 +115,7 @@ var generators = "line-link-entities link screenstack dynamic-view selectionboxo
+ "commands-from-external-json glossary timeline issues web-url background-via-url observableui hidableenvironmentfot fot"
// could be an array proper completed on each relevant component registration
var heightAdjustableClasses = ["commands-from-external-json"]
const webdavURL = "https://webdav.benetou.fr";
// could add a dedicated MakeyMakey mode with a fixed camera, e.g bird eye view, and an action based on some physical input that others, thanks to NAF, could see or even use.
// ?inputmode=makeymakey
@ -1346,6 +1345,19 @@ AFRAME.registerComponent('dynamic-view', {
},
});
AFRAME.registerComponent('webdav', {
init:function(){
// could become a parameter instead with optional credentials
const client = window.WebDAV.createClient(webdavURL);
let generatorName = this.attrName
async function getDirectory(path = "/"){
return await client.getDirectoryContents(path);
}
getDirectory().then( d => d.map( (c,i) => addNewNote( c.filename , "-1 "+(i/10+1)+" -1", undefined, undefined, generatorName) ) )
// null doesn't fallback to default parameter. Fine when truly optional but fails otherwise, so prefer undefined.
},
});
function toggleVisibilityEntitiesFromClass(classname){
let entities = Array.from( document.querySelectorAll("."+classname) )
if (entities.length == 0) return
@ -1530,7 +1542,7 @@ function switchSide(){
<div id="observablehq-viewof-offsetExample-ab4c1560"></div>
<div id="observablehq-result_as_html-ab4c1560"></div>
</div>
<a-scene cursor="rayOrigin: mouse" raycaster="objects: [html]; interval:100;" adjust-height-in-vr
<a-scene cursor="rayOrigin: mouse" raycaster="objects: [html]; interval:100;" adjust-height-in-vr webdav
toolbox disable-components-via-url enable-components-via-url commands-from-external-json >
<!-- screenstack dynamic-view selectionboxonpinches keyboard glossary timeline issues fot
networked-scene="serverURL: https://naf.benetou.fr/; adapter: easyrtc; audio: true;"

Loading…
Cancel
Save