-
diff --git a/examples/landmark-demo/.meteor/.gitignore b/examples/other/template-demo/.meteor/.gitignore
similarity index 100%
rename from examples/landmark-demo/.meteor/.gitignore
rename to examples/other/template-demo/.meteor/.gitignore
diff --git a/examples/landmark-demo/.meteor/packages b/examples/other/template-demo/.meteor/packages
similarity index 100%
rename from examples/landmark-demo/.meteor/packages
rename to examples/other/template-demo/.meteor/packages
diff --git a/examples/landmark-demo/client/d3.v2.js b/examples/other/template-demo/client/d3.v2.js
similarity index 100%
rename from examples/landmark-demo/client/d3.v2.js
rename to examples/other/template-demo/client/d3.v2.js
diff --git a/examples/other/template-demo/client/template-demo.css b/examples/other/template-demo/client/template-demo.css
new file mode 100644
index 0000000000..4506e4bebb
--- /dev/null
+++ b/examples/other/template-demo/client/template-demo.css
@@ -0,0 +1,44 @@
+body {
+ font-family: 'Helvetica Neue', Helvetica, Arial, san-serif;
+ width: 600px;
+ margin: auto;
+ padding: 25px 50px;
+ border: 5px dashed #ccc;
+ border-style: none dashed;
+}
+
+h2 {
+ margin-top: 50px;
+ text-decoration: underline;
+}
+
+.clearboth {
+ clear: both;
+}
+
+@-webkit-keyframes spinForward {
+ from {-webkit-transform: rotate(0deg);}
+ to {-webkit-transform: rotate(360deg);}
+}
+
+@-webkit-keyframes spinBackward {
+ from {-webkit-transform: rotate(360deg);}
+ to {-webkit-transform: rotate(0deg);}
+}
+
+.spinner {
+ width: 100px;
+ border: 2px solid black;
+ font-weight: bold;
+ text-align: center;
+ background: white;
+}
+
+.circles {
+ float: left;
+ padding-right: 20px;
+}
+
+.circles svg {
+ border: 2px solid #333;
+}
\ No newline at end of file
diff --git a/examples/other/template-demo/client/template-demo.html b/examples/other/template-demo/client/template-demo.html
new file mode 100644
index 0000000000..fe3b4d73f1
--- /dev/null
+++ b/examples/other/template-demo/client/template-demo.html
@@ -0,0 +1,182 @@
+
+ Advanced Template Demo
+
+
+
+ {{> page}}
+
+
+
+
Advanced Template Demo
+
+ This demo shows off the advanced features of Meteor's optional
+ Spark-based templating system, including constant regions, node
+ preservation, per-template state, and template lifecycle
+ callbacks.
+
+ Elements can be preserved, meaning that they will not be
+ disturbed even as their attributes, children, or siblings
+ change. In this example, when you press the X++ button, the CSS
+ animation continues uninterrupted.
+
+
+
+X={{x}}
+
+ X={{x}}
+
+
+
+ Spin Forward
+
+ X={{x}}
+
+
+
+
Constant regions
+
+
+
+
+ Remove map 1
+
+ Remove map 2
+
+
+
+
+ Parts of a template can be marked as constant, meaning
+ that Meteor will leave the entire region alone (even as its
+ siblings change.) This is great for embedding non-Meteor
+ widgets. Try scrolling the two Google Maps embeds below. When you
+ press X++, the maps stay where they are.
+
+
+
+ Try using the checkboxes to remove either or both of the
+ maps. When you remove a map, Spark tracks the identity of
+ the constant regions so that it knows which DOM nodes to keep and
+ which DOM nodes to throw away. In the case of the Handlebars
+ package, the identity is based on the actual template call stack
+ that rendered the constant region.
+
+ You can get a create callback when a template is
+ initially rendered; a render when a template is placed on
+ the screen and when any part of the template is redrawn; and
+ a destroy callback when a template is taken across the
+ screen. All of these callbacks receive a common template state
+ object in 'this' which allows you to attach data to each
+ particular instance of a template.
+
+
+
+ In this case, create is used to create a new JavaScript
+ timer that updates the text of a <span> element every
+ second. render is used to find the <span> when it
+ appears on the screen, and update the pointer when the
+ <span> is redraw (say, when you press Y++ — since it
+ is not marked to be preserved.) destroy is used to cancel
+ the timer when the template goes off the screen.
+
+
+
+ The template state is used to hold the current time count and a
+ reference to the <span> object to update. That's why there
+ can be multiple copies of the same template, each with a different
+ value for the counter.
+
+ Meteor fits naturally with the popular d3.js data visualization
+ library by Michael Bostock. Just set up d3 from your
+ template's render callback. With Meteor, you can pass
+ data directly out of a Mongo query into d3, and your d3
+ visualization will update in realtime, with no extra code! Try
+ opening this page in two browser windows.
+