这是indexloc提供的服务,不要输入任何密码
Skip to content

Add better VDOM support, use different template syntax. #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ Basic Example
<body>
<a-scene networked-scene>
<a-assets>
<template id="avatar-template">
<naf-template id="avatar-template">
<a-sphere></a-sphere>
</template>
</naf-template>
</a-assets>
<a-entity id="player" networked="template:#avatar-template;attachTemplateToLocal:false;" camera wasd-controls look-controls>
</a-entity>
Expand Down Expand Up @@ -163,11 +163,11 @@ Completely removing `a-scene` from your page will also handle cleanly disconnect

```html
<a-assets>
<template id="my-template">
<naf-template id="my-template">
<a-entity>
<a-sphere color="#f00"></a-sphere>
</a-entity>
</template>
</naf-template>
<a-assets>

<!-- Attach local template by default -->
Expand Down
6 changes: 3 additions & 3 deletions dist/networked-aframe.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/networked-aframe.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/RELEASE_NOTES.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ The release of version 0.6 brings a major change in how templates work, among a

#### Migration Guide

1. Templates are defined in a `<template>` tag rather than `<script type="text/html">`. Change all your templates to use the `<template>` tag.
1. Templates are defined in a `<naf-template>` tag rather than `<script type="text/html">`. Change all your templates to use the `<naf-template>` tag.

2. Templates must not have more than one root element. Eg,

This is good:

```html
<template>
<naf-template>
<a-entity class="parent">
<a-entity class="child"></a-entity>
</a-entity>
Expand All @@ -34,7 +34,7 @@ This is bad:


```html
<template>
<naf-template>
<a-entity class="brother"></a-entity>
<a-entity class="sister"></a-entity>
</template>
Expand All @@ -45,7 +45,7 @@ This is bad:
Eg,

```html
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity gltf-model="#avatar-model">
<a-text position="0 1 0" value="Avatar Name"></a-text>
</a-entity>
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-local.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Templates are added in A-Frame's `<a-assets>` tag. Let's add the assets tag with

```html
<a-assets>
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#5985ff"
Expand Down
4 changes: 2 additions & 2 deletions examples/360.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
">
<a-assets>
<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#ffffff"
Expand Down Expand Up @@ -90,4 +90,4 @@
});
</script>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions examples/a-saturday-night/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
debug: true;
">
<a-assets>
<template id="player-template">
<naf-template id="player-template">
<a-entity></a-entity>
</template>

<template id="head-template">
<naf-template id="head-template">
<a-entity class="heads" show-child="0">
<a-entity class="head" gltf-model="#avatar1-head-obj"></a-entity>
<a-entity class="head" gltf-model="#avatar2-head-obj"></a-entity>
Expand All @@ -46,7 +46,7 @@
</a-entity>
</template>

<template id="left-hand-template">
<naf-template id="left-hand-template">
<a-entity class="hands" show-child="0">
<a-entity class="hand" gltf-model="#avatar1-hand-left-obj"></a-entity>
<a-entity class="hand" gltf-model="#avatar2-hand-left-obj"></a-entity>
Expand All @@ -55,7 +55,7 @@
</a-entity>
</template>

<template id="right-hand-template">
<naf-template id="right-hand-template">
<a-entity class="hands" show-child="0">
<a-entity class="hand" gltf-model="#avatar1-hand-right-obj"></a-entity>
<a-entity class="hand" gltf-model="#avatar2-hand-right-obj"></a-entity>
Expand Down Expand Up @@ -155,4 +155,4 @@

<script src="js/naf-schemas.js"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion examples/basic-audio.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar" networked-audio-source>
<a-sphere class="head"
color="#ffffff"
Expand Down
4 changes: 2 additions & 2 deletions examples/basic-events.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
scale="0.45 0.5 0.4"
Expand Down Expand Up @@ -148,4 +148,4 @@
}
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion examples/basic.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#ffffff"
Expand Down
6 changes: 3 additions & 3 deletions examples/child-entities.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
scale="0.45 0.5 0.4"
></a-sphere>
</a-entity>
</template>

<template id="face-template">
<naf-template id="face-template">
<a-entity class="face"
position="0 0.05 0"
>
Expand Down Expand Up @@ -64,7 +64,7 @@
</a-entity>
</template>

<template id="simple">
<naf-template id="simple">
<a-sphere></a-sphere>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/disconnect.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#5985ff"
Expand Down Expand Up @@ -140,4 +140,4 @@
}
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion examples/google-blocks.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity obj-model="obj: #raccoon-obj; mtl: #raccoon-mtl" scale="5 5 5"></a-entity>
</template>

Expand Down
6 changes: 3 additions & 3 deletions examples/ownership-transfer.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
scale="0.45 0.5 0.4"
Expand Down Expand Up @@ -81,7 +81,7 @@
</a-entity>
</template>

<template id="cube-template">
<naf-template id="cube-template">
<a-entity>
<a-box class="cube" toggle-ownership color="#F00"></a-box>
</a-entity>
Expand Down Expand Up @@ -180,4 +180,4 @@
}
</script>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions examples/shooter-ar.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
scale="0.45 0.5 0.4"
Expand Down Expand Up @@ -81,7 +81,7 @@
</template>

<!-- Bullet -->
<template id="bullet-template">
<naf-template id="bullet-template">
<a-sphere class="bullet"
scale="0.1 0.1 0.1"
color="#fff"
Expand Down Expand Up @@ -121,4 +121,4 @@
});
</script>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions examples/shooter.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
scale="0.45 0.5 0.4"
Expand Down Expand Up @@ -75,7 +75,7 @@
</template>

<!-- Bullet -->
<template id="bullet-template">
<naf-template id="bullet-template">
<a-sphere class="bullet"
scale="0.1 0.1 0.1"
color="#fff"
Expand Down Expand Up @@ -144,4 +144,4 @@
});
</script>
</body>
</html>
</html>
8 changes: 4 additions & 4 deletions examples/tracked-controllers.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<!-- Templates -->

<!-- Player -->
<template id="player-template">
<naf-template id="player-template">
<a-entity></a-entity>
</template>

<!-- Head -->
<template id="head-template">
<naf-template id="head-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#ffffff"
Expand Down Expand Up @@ -68,7 +68,7 @@
</template>

<!-- Hand -->
<template id="hand-template">
<naf-template id="hand-template">
<a-entity>
<a-box scale="0.1 0.1 0.1"></a-box>
</a-entity>
Expand Down Expand Up @@ -155,4 +155,4 @@
}
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion examples/webrtc.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- Templates -->

<!-- Avatar -->
<template id="avatar-template">
<naf-template id="avatar-template">
<a-entity class="avatar">
<a-sphere class="head"
color="#ffffff"
Expand Down
Loading