summaryrefslogtreecommitdiff
path: root/node_modules/mustache/wrappers/jquery
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/mustache/wrappers/jquery')
-rw-r--r--node_modules/mustache/wrappers/jquery/mustache.js.post13
-rw-r--r--node_modules/mustache/wrappers/jquery/mustache.js.pre9
2 files changed, 22 insertions, 0 deletions
diff --git a/node_modules/mustache/wrappers/jquery/mustache.js.post b/node_modules/mustache/wrappers/jquery/mustache.js.post
new file mode 100644
index 0000000..3209e91
--- /dev/null
+++ b/node_modules/mustache/wrappers/jquery/mustache.js.post
@@ -0,0 +1,13 @@
+ $.mustache = function (template, view, partials) {
+ return Mustache.render(template, view, partials);
+ };
+
+ $.fn.mustache = function (view, partials) {
+ return $(this).map(function (i, elm) {
+ var template = $.trim($(elm).html());
+ var output = $.mustache(template, view, partials);
+ return $(output).get();
+ });
+ };
+
+})(jQuery);
diff --git a/node_modules/mustache/wrappers/jquery/mustache.js.pre b/node_modules/mustache/wrappers/jquery/mustache.js.pre
new file mode 100644
index 0000000..b4d8af5
--- /dev/null
+++ b/node_modules/mustache/wrappers/jquery/mustache.js.pre
@@ -0,0 +1,9 @@
+/*
+Shameless port of a shameless port
+@defunkt => @janl => @aq
+
+See http://github.com/defunkt/mustache for more info.
+*/
+
+;(function($) {
+