Permalink
Browse files

add browser examples without requirejs

  • Loading branch information...
1 parent cc74bf8 commit 7800785c7203bfb2d6a6fe0a9dabcb1ed4729182 @ben-lin ben-lin committed Jul 16, 2012
No changes.
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>thunder browsers example</title>
+ <meta name="description" content="An example of thunder on browsers" />
+ </head>
+ <body>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script>
+ <script src="js/libs/thunder.js" ></script>
+ <script src="js/models/index.js" ></script>
+ <script src="js/views/index.js" ></script>
+ <script src="js/boot.js" ></script>
+ </body>
+</html>
@@ -0,0 +1,3 @@
+var view = thunder.render( index, model );
+
+$( 'body' ).append( view );

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,9 @@
+var model = {
+ header1 : 'Header1',
+ header2 : 'Header2',
+ header3 : 'Header3',
+ header4 : 'Header4',
+ header5 : 'Header5',
+ header6 : 'Header6',
+ list : [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ]
+};
@@ -0,0 +1,11 @@
+<h1 class='header1'><?- it.header1 ?></h1>
+<h2 class='header2'><?- it.header2 ?></h2>
+<h3 class='header3'><?- it.header3 ?></h3>
+<h4 class='header4'><?- it.header4 ?></h4>
+<h5 class='header5'><?- it.header5 ?></h5>
+<h6 class='header6'><?- it.header6 ?></h6>
+<ul class='list'>
+ <? for( var i = 0, l = it.list.length; i <l; i++ ){ ?>
+ <li class='item'><?- it.list[ i ] ?></li>
+ <? } ?>
+</ul>
@@ -0,0 +1,11 @@
+var index = "<h1 class='header1'><?- it.header1 ?></h1>\n\
+<h2 class='header2'><?- it.header2 ?></h2>\n\
+<h3 class='header3'><?- it.header3 ?></h3>\n\
+<h4 class='header4'><?- it.header4 ?></h4>\n\
+<h5 class='header5'><?- it.header5 ?></h5>\n\
+<h6 class='header6'><?- it.header6 ?></h6>\n\
+<ul class='list'>\n\
+ <? for( var i = 0, l = it.list.length; i <l; i++ ){ ?>\n\
+ <li class='item'><?- it.list[ i ] ?></li>\n\
+ <? } ?>\n\
+</ul>";

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -4,5 +4,5 @@
*/
exports.index = function(req, res){
- res.render('index', { title: 'Express' })
+ res.render('index', { layout: false })
};
@@ -1,2 +1,17 @@
-<h1><%= title %></h1>
-<p>Welcome to <%= title %></p>
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>thunder browsers example with requirejs</title>
+ <meta name="description" content="An example of thunder on browsers with requirejs" />
+ </head>
+ <body>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script>
+ <script src="/js/libs/require.js" data-main="js/boot.js"></script>
+ <script>
+ requirejs.config({
+ baseUrl : '/js'
+ });
+ </script>
+ </body>
+</html>
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8" />
- <title>thunder browsers example</title>
- <meta name="description" content="thunder browsers example" />
- </head>
- <body>
- <script src="js/libs/jquery.js" ></script>
- <script src="js/libs/require.js" data-main="js/boot.js"></script>
- <script>
- requirejs.config({
- baseUrl : '/js'
- });
- </script>
- </body>
-</html>

0 comments on commit 7800785

Please sign in to comment.