Files
Pinry/pinry/static/js/helpers.js
2013-02-27 04:34:44 +00:00

23 lines
502 B
JavaScript

/**
* Helpers for Pinry
* Descrip: A hodgepodge of useful things to help clean up Pinry's JavaScript.
* Authors: Pinry Contributors
* Updated: Feb 26th, 2013
* Require: jQuery
*/
function renderTemplate(templateId, context) {
var template = Handlebars.compile($(templateId).html());
return template(context);
}
function cleanTags(tags) {
if (typeof tags === 'string') {
tags = tags.split(',');
for (var i in tags) tags[i] = tags[i].trim();
}
return tags
}