Skip to content

Commit

Permalink
Get examples working.
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Jul 14, 2011
1 parent 94246ee commit f6c7c4a
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/Makefile
@@ -1,4 +1,4 @@
PERL5LIB=../lib
PERL5LIB = ../lib

all: js/ajax.js js/hello.js js/features.js

Expand Down
9 changes: 9 additions & 0 deletions examples/README
@@ -0,0 +1,9 @@
This is a directory of simple Jemplate examples.

It should be viewable from CPAN.

It should also run locally by running:

plackup

to start a server.
8 changes: 4 additions & 4 deletions examples/ajax/index.html
@@ -1,10 +1,10 @@
<html>
<head>
<title>Ajax Test</title>
<script src="../../share/Jemplate.js" type="text/javascript"></script>
<script src="../js/ajax.js" type="text/javascript"></script>
<title>Jemplate Ajax Example</title>
<script src="../js/JemplateRuntime.js" type="text/javascript"></script>
<script src="../js/ajax.js" type="text/javascript"></script>
</head>
<body onload="Jemplate.process('body.html', 'data.json', this.document.body)">
It didn't work...
Loading...
</body>
</html>
1 change: 1 addition & 0 deletions examples/app.psgi
13 changes: 6 additions & 7 deletions examples/features/index.html
@@ -1,17 +1,16 @@
<html>
<head>
<title>Features Test</title>
<script src="../../share/Jemplate.js" type="text/javascript"></script>
<script src="../js/features.js" type="text/javascript"></script>

<script type="text/javascript">
<title>Jemplate Features Test</title>
<script src="../js/JemplateRuntime.js" type="text/javascript"></script>
<script src="../js/features.js" type="text/javascript"></script>
<script type="text/javascript">
onload = function() {
Jemplate.process('body.html', null, '#body');
}
</script>
</script>

</head>
<body id="body">
It didn't work...
Loading...
</body>
</html>
12 changes: 6 additions & 6 deletions examples/hello/index.html
@@ -1,19 +1,19 @@
<html>
<head>
<title>Hello Test</title>
<script src="../../share/Jemplate.js" type="text/javascript"></script>
<script src="../js/hello.js" type="text/javascript"></script>
<title>Hello Jemplate Example</title>
<script src="../js/JemplateRuntime.js" type="text/javascript"></script>
<script src="../js/hello.js" type="text/javascript"></script>

<script type="text/javascript">
<script type="text/javascript">
onload = function() {
var body = document.getElementsByTagName('body')[0];
var data = { name: 'Ingy' };
body.innerHTML = Jemplate.process('hello.html', data);
}
</script>
</script>

</head>
<body>
It didn't work...
Loading...
</body>
</html>
1 change: 1 addition & 0 deletions examples/js/JemplateRuntime.js
2 changes: 1 addition & 1 deletion examples/js/ajax.js
Expand Up @@ -3,7 +3,7 @@
Template Toolkit. Any changes made to this file will be lost the next
time the templates are compiled.
Copyright 2006 - Ingy döt Net - All rights reserved.
Copyright 2006-2008 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
Expand Down
2 changes: 1 addition & 1 deletion examples/js/features.js
Expand Up @@ -3,7 +3,7 @@
Template Toolkit. Any changes made to this file will be lost the next
time the templates are compiled.
Copyright 2006 - Ingy döt Net - All rights reserved.
Copyright 2006-2008 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
Expand Down
2 changes: 1 addition & 1 deletion examples/js/hello.js
Expand Up @@ -3,7 +3,7 @@
Template Toolkit. Any changes made to this file will be lost the next
time the templates are compiled.
Copyright 2006 - Ingy döt Net - All rights reserved.
Copyright 2006-2008 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
Expand Down

0 comments on commit f6c7c4a

Please sign in to comment.