|
|
@ -1,8 +1,8 @@ |
|
|
|
!function () { |
|
|
|
!function () { |
|
|
|
var patch = BI.Snabbdom.init([BI.Snabbdom.attributesModule, BI.Snabbdom.classModule, BI.Snabbdom.datasetModule, BI.Snabbdom.propsModule, BI.Snabbdom.styleModule, BI.Snabbdom.eventListenersModule]); |
|
|
|
var patch = BI.Snabbdom.init([BI.Snabbdom.attributesModule, BI.Snabbdom.classModule, BI.Snabbdom.datasetModule, BI.Snabbdom.propsModule, BI.Snabbdom.styleModule, BI.Snabbdom.eventListenersModule]); |
|
|
|
BI.Element2Snabbdom = function (parentNode) { |
|
|
|
BI.Element2Vnode = function (parentNode) { |
|
|
|
if (parentNode.nodeType === 3) { |
|
|
|
if (parentNode.nodeType === 3) { |
|
|
|
return parentNode.textContent; |
|
|
|
return BI.Snabbdom.vnode(undefined, undefined, undefined, parentNode.textContent, parentNode); |
|
|
|
} |
|
|
|
} |
|
|
|
var data = BI.jQuery._data(parentNode); |
|
|
|
var data = BI.jQuery._data(parentNode); |
|
|
|
var on = {}; |
|
|
|
var on = {}; |
|
|
@ -14,26 +14,31 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
var style = parentNode.getAttribute("style"); |
|
|
|
var attrs = {}; |
|
|
|
|
|
|
|
var elmAttrs = parentNode.attributes; |
|
|
|
|
|
|
|
var elmChildren = parentNode.childNodes; |
|
|
|
var key = parentNode.getAttribute("key"); |
|
|
|
var key = parentNode.getAttribute("key"); |
|
|
|
// var claz = parentNode.getAttribute("class");
|
|
|
|
for (i = 0, n = elmAttrs.length; i < n; i++) { |
|
|
|
var vnode = BI.Snabbdom.h(parentNode.nodeName, { |
|
|
|
var name = elmAttrs[i].nodeName; |
|
|
|
|
|
|
|
if (name !== "id" && name !== "class") { |
|
|
|
|
|
|
|
attrs[name] = elmAttrs[i].nodeValue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var vnode = BI.Snabbdom.vnode(parentNode.nodeName, { |
|
|
|
class: BI.makeObject(parentNode.classList), |
|
|
|
class: BI.makeObject(parentNode.classList), |
|
|
|
props: { |
|
|
|
attrs: attrs, |
|
|
|
style: style |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
key: key, |
|
|
|
key: key, |
|
|
|
on: on, |
|
|
|
on: on, |
|
|
|
hook: { |
|
|
|
hook: { |
|
|
|
create: function () { |
|
|
|
create: function () { |
|
|
|
BI.each(parentNode._Widgets, function (i, w) { |
|
|
|
BI.each(BI.Widget._renderEngine.createElement(parentNode).data("_Widgets"), function (i, w) { |
|
|
|
w.element = BI.Widget._renderEngine.createElement(vnode.elm); |
|
|
|
w.element = BI.Widget._renderEngine.createElement(vnode.elm); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, BI.map(parentNode.childNodes, function (i, childNode) { |
|
|
|
}, BI.map(elmChildren, function (i, childNode) { |
|
|
|
return BI.Element2Snabbdom(childNode); |
|
|
|
return BI.Element2Vnode(childNode); |
|
|
|
})); |
|
|
|
}), undefined, parentNode); |
|
|
|
return vnode; |
|
|
|
return vnode; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|