Skip to content

Commit

Permalink
forgot helpers file
Browse files Browse the repository at this point in the history
  • Loading branch information
ProCynic committed Jun 24, 2013
1 parent e176236 commit a89bd64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions views/handlebars-helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports.register = function(Handlebars) {
Handlebars.registerHelper('filepicker', function(url, width, height){
if (typeof url !== 'string') return null;
var result = url.replace('www', 'cdn');

if (result.indexOf('convert') === -1)
result += "/convert?cache=true&fit=crop"

result += "&w=" + (width || 100);
result += "&h=" + (height || 100);

return result;
});
};

0 comments on commit a89bd64

Please sign in to comment.