parent
2d028d9bc7
commit
11bc946797
@ -1,3 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4" />
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<excludedPredefinedLibrary name="HTML" />
|
||||
<excludedPredefinedLibrary name="HTML5 / EcmaScript 5" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'handlebars'
|
||||
], function (Handlebars) {
|
||||
Handlebars.registerHelper('times', function(n, block) {
|
||||
var accum = '';
|
||||
|
||||
for(var i = 0; i < n; ++i) {
|
||||
accum += block.fn(i);
|
||||
}
|
||||
|
||||
return accum;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('for', function(from, to, incr, block) {
|
||||
var accum = '';
|
||||
|
||||
for(var i = from; i < to; i += incr) {
|
||||
accum += block.fn(i);
|
||||
}
|
||||
|
||||
return accum;
|
||||
});
|
||||
});
|
Loading…
Reference in new issue