mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
There were some notable bug fixes between those versions. We are still far behind the current version (1.3.0). For the node stuff, I used npm update. Then for static/third/handlebars/handlebars.runtime.js, I copied the node version then added back the copyright. (imported from commit 59bcd2c52540ff88bba2f90cced809cfcb8cd92b)
19 lines
665 B
JavaScript
19 lines
665 B
JavaScript
var Handlebars = require('./lib/handlebars');
|
|
|
|
Handlebars.registerHelper('test_helper', function() { return 'found it!' });
|
|
Handlebars.registerPartial('global_test', '{{another_dude}}');
|
|
|
|
//var template = Handlebars.compile('{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}');
|
|
var template = Handlebars.precompile("Dudes: {{#if foo}} {{#if nested}} {{> shared/dude}} {{/if}} {{> global_test}} {{/if}}");
|
|
console.log(template);
|
|
|
|
return;
|
|
|
|
console.log(
|
|
template({cruel: "cruel", name:"Jeepers", another_dude:"Creepers"}, {
|
|
helpers: {world: function() { return "world!"; }},
|
|
partials: {'shared/dude':"{{name}}"}
|
|
}));
|
|
|
|
console.log(template);
|