Sha256: 2a6d008aba6aee69b7ca0f46658c9e4cfeeff401346cb08021c342b6595b825c
Contents?: true
Size: 1.37 KB
Versions: 31
Compression:
Stored size: 1.37 KB
Contents
(function($) { $.fn.microjungle = function(template) { var d = document; // they just doing their job. function monkeys(what, who) { var l = what.length; for (var i = 0; i < l; i++) { var j = what[i]; if (j) { if (typeof j == 'string') { who.html(who.html() + j); } else { if (typeof j[0] == 'string') { var el = $('<' + j.shift() + '>'), attrs = {}.toString.call(j[0]) === '[object Object]' && j.shift(), k; if (attrs) { for(k in attrs) { attrs[k] && el.attr(k, attrs[k]); } } who.append(monkeys(j, el)); } else if (j.nodeType === 11) { who.append(j); } else { monkeys(j, who); } } } } return who; }; return this.each(function() { $(this).append(monkeys(template, $(d.createDocumentFragment()))); }); }; })(Zepto);
Version data entries
31 entries across 31 versions & 1 rubygems