diff --git a/lib/plugins/sammy.haml.js b/lib/plugins/sammy.haml.js index 87039f90..d594ab86 100644 --- a/lib/plugins/sammy.haml.js +++ b/lib/plugins/sammy.haml.js @@ -27,7 +27,7 @@ // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin // this.use(Sammy.Haml); // @@ -38,7 +38,10 @@ // // render the template and pass it through haml // this.partial('mytemplate.haml'); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to `#/hello/AQ` in the browser, Sammy will render this to the `body`: diff --git a/lib/plugins/sammy.handlebars.js b/lib/plugins/sammy.handlebars.js index 5609ec70..30c6501c 100644 --- a/lib/plugins/sammy.handlebars.js +++ b/lib/plugins/sammy.handlebars.js @@ -20,13 +20,13 @@ // // The template (mytemplate.hb): // - //

\{\{title\}\}

+ //

{{title}}

// // Hey, {{name}}! Welcome to Handlebars! // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias handlebars() to hb() // this.use('Handlebars', 'hb'); // @@ -37,7 +37,10 @@ // // render the template and pass it through handlebars // this.partial('mytemplate.hb'); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to #/hello/AQ in the browser, Sammy will render this to the body: @@ -60,27 +63,28 @@ // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias handlebars() to hb() // this.use('Handlebars', 'hb'); // - // this.get('#/hello/:name/to/:friend', function() { - // var context = this; - // + // this.get('#/hello/:name/to/:friend', function(context) { // // fetch handlebars-partial first - // $.get('mypartial.hb', function(response){ - // context.partials = response; - // - // // set local vars - // context.name = this.params.name; - // context.hello_friend = {name: this.params.friend}; - // - // // render the template and pass it through handlebars - // context.partial('mytemplate.hb'); - // }); + // this.load('mypartial.hb') + // .then(function(partial) { + // // set local vars + // context.partials = {hello_friend: partial}; + // context.name = context.params.name; + // context.friend = context.params.friend; + // + // // render the template and pass it through handlebars + // context.partial('mytemplate.hb'); + // }); // }); - // // }); + // + // $(function() { + // app.run() + // }); // // If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the body: // diff --git a/lib/plugins/sammy.hogan.js b/lib/plugins/sammy.hogan.js index c1eb46e3..ed79ddcf 100644 --- a/lib/plugins/sammy.hogan.js +++ b/lib/plugins/sammy.hogan.js @@ -22,13 +22,13 @@ // // The template (mytemplate.hg): // - //

\{\{title\}\}

+ //

{{title}}

// // Hey, {{name}}! Welcome to Mustache! // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias hogan() to hg() // this.use('Hogan', 'hg'); // @@ -39,7 +39,10 @@ // // render the template and pass it through hogan // this.partial('mytemplate.hg'); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to #/hello/AQ in the browser, Sammy will render this to the body: @@ -62,26 +65,27 @@ // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias hogan() to hg() // this.use('Hogan', 'hg'); // - // this.get('#/hello/:name/to/:friend', function() { - // var context = this; - // + // this.get('#/hello/:name/to/:friend', function(context) { // // fetch hogan-partial first - // $.get('mypartial.hg', function(response){ - // context.partials = response; - // - // // set local vars - // context.name = this.params.name; - // context.hello_friend = {name: this.params.friend}; - // - // // render the template and pass it through hogan - // context.partial('mytemplate.hg'); - // }); + // this.load('mypartial.hg') + // .then(function(partial) { + // // set local vars + // context.partials = {hello_friend: partial}; + // context.name = context.params.name; + // context.friend = context.params.friend; + // + // // render the template and pass it through hogan + // context.partial('mytemplate.hg'); + // }); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the body: diff --git a/lib/plugins/sammy.mustache.js b/lib/plugins/sammy.mustache.js index e9102b22..422846f0 100644 --- a/lib/plugins/sammy.mustache.js +++ b/lib/plugins/sammy.mustache.js @@ -22,13 +22,13 @@ // // The template (mytemplate.ms): // - //

\{\{title\}\}

+ //

{{title}}

// // Hey, {{name}}! Welcome to Mustache! // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias mustache() to ms() // this.use('Mustache', 'ms'); // @@ -39,7 +39,10 @@ // // render the template and pass it through mustache // this.partial('mytemplate.ms'); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to #/hello/AQ in the browser, Sammy will render this to the body: @@ -62,26 +65,27 @@ // // The app: // - // var $.app = $.sammy(function() { + // var app = $.sammy(function() { // // include the plugin and alias mustache() to ms() // this.use('Mustache', 'ms'); // - // this.get('#/hello/:name/to/:friend', function() { - // var context = this; - // + // this.get('#/hello/:name/to/:friend', function(context) { // // fetch mustache-partial first - // $.get('mypartial.ms', function(response){ - // context.partials = response; - // - // // set local vars - // context.name = this.params.name; - // context.hello_friend = {name: this.params.friend}; - // - // // render the template and pass it through mustache - // context.partial('mytemplate.ms'); - // }); + // this.load('mypartial.ms') + // .then(function(partial) { + // // set local vars + // context.partials = {hello_friend: partial}; + // context.name = context.params.name; + // context.friend = context.params.friend; + // + // // render the template and pass it through mustache + // context.partial('mytemplate.ms'); + // }); // }); + // }); // + // $(function() { + // app.run() // }); // // If I go to #/hello/AQ/to/dP in the browser, Sammy will render this to the body: