Sha256: ec5f09047b6383ad08e3aea3a61ab3caadf7ecd939da9a3fdc94bb62b186c3c8

Contents?: true

Size: 738 Bytes

Versions: 6

Compression:

Stored size: 738 Bytes

Contents

rio.Tag = {
	build: function (tag, body, args) {
	    args = args || {};
		if (Object.isArray(body)) {
			for (var i=body.length; i--;) {
				var elt = body[i];
				body[i] = elt.html ? elt.html() : elt;
			}
		} else if (body && body.html) {
			body = body.html();
		}
		
	    var node = Builder.node(tag, args, body);

	    return $(node);
	},

	tags: [
		"span", 
		"div", 
		"table", 
		"thead", 
		"tbody", 
		"tr", 
		"td",
		"th", 
		"h1", 
		"h2", 
		"hr", 
		"br",
		"a", 
		"p", 
		"textarea",
		"label",
		"input",
		"button",
		"img",
		"option",
		"pre",
		"ul",
		"li",
		"iframe",
		"link",
		"script",
		"select"
	]
};
(function() {
	rio.Tag.tags.each(function(tag) {
		rio.Tag[tag] = rio.Tag.build.curry(tag);
	});
})();

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riojs-0.0.5 public/javascripts/lib/tag.js
riojs-0.0.4 public/javascripts/lib/tag.js
riojs-0.0.3 public/javascripts/lib/tag.js
riojs-0.0.2 public/javascripts/lib/tag.js
riojs-0.0.1 public/javascripts/lib/tag.js
riojs-0.0.0 public/javascripts/lib/tag.js