Skip to content

Instantly share code, notes, and snippets.

@Buildstarted
Created January 15, 2013 07:11
Show Gist options
  • Select an option

  • Save Buildstarted/4536821 to your computer and use it in GitHub Desktop.

Select an option

Save Buildstarted/4536821 to your computer and use it in GitHub Desktop.
(function ($, undefined) {
var parrot = {
parse: function(params) {
var defaults = { host: [], model: null, source: "" };
$.extend(defaults, params);
var parser = new Parser();
var view = new ParrotDocumentView(parser.parse(params.source));
return view.render(params.host, params.model);
}
};
$.fn.parrot = function(model, host) {
var template = $(this).html();
return parrot.parse({
host: host ? host : [],
model: model,
source: template
});
};
window.parrot = parrot;
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment