/*! HTML - v0.12.1 - 2014-10-22
* http://nbubna.github.io/HTML/
* Copyright (c) 2014 ESHA Research; Licensed MIT, GPL */
(function(window, document, Observer) {
"use strict";
var _ = {
version: "0.12.1",
slice: Array.prototype.slice,
list: function(list, force) {
if (list.length === 1){ return _.node(list[0], force); }
if (force || !list.each) {
if (!list.slice){ list = _.slice.call(list); }
_.methods(list);
if (list.length){ _.children(list[0], list); }// proxy dot-traversal into first element
}
return list;
},
node: function(node, force) {
if (force || !node.each) {
_.methods(node);
_.children(node);
}
return node;
},
methods: function(o) {
for (var method in _.fn) {
_.define(o, method, _.fn[method]);
}
},
children: function(node, list) {
var children = node._children = {};
for (var i=0, m=node.childNodes.length; i