cortex-handlebars-compiler
Advanced tools
Comparing version 1.4.5 to 1.4.6
29
index.js
@@ -100,5 +100,23 @@ 'use strict'; | ||
this.register('timestamp', this._timestamp_handler, this); | ||
this.register('combo', this._combo_handler, this); | ||
this.register('timestr', this._timestr_handler, this); | ||
} | ||
Compiler.prototype._combo_handler = function(title, options){ | ||
var self = this; | ||
var mods = title.split(","); | ||
var base = "/concat/"; | ||
var paths = []; | ||
mods.forEach(function(mod){ | ||
var path = self._mod_file_path(mod, options); | ||
paths.push(path); | ||
}); | ||
var final_path = base + paths.map(function(path){ | ||
return path.replace(/\//g,"~"); | ||
}).join(","); | ||
return self._resolve_path(final_path); | ||
}; | ||
Compiler.prototype._timestamp_handler = function(){ | ||
@@ -204,3 +222,3 @@ return +new Date; | ||
*/ | ||
Compiler.prototype._modfile_handler = function(title, options) { | ||
Compiler.prototype._mod_file_path = function(title) { | ||
var versions = this.versions; | ||
@@ -228,6 +246,11 @@ var obj = pkg(title); | ||
path = node_path.join(base , name, version, path).replace(/\\/g,'/'); | ||
return this._resolve_path(path); | ||
return node_path.join(base , name, version, path).replace(/\\/g,'/'); | ||
}; | ||
Compiler.prototype._modfile_handler = function(title, options){ | ||
var path = this._mod_file_path(title); | ||
return this._resolve_path(path); | ||
} | ||
Compiler.prototype._facade_handler = function(title, options) { | ||
@@ -234,0 +257,0 @@ var output = ''; |
{ | ||
"name": "cortex-handlebars-compiler", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "Handlebar helpers for cortex template.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
23873
607
23