use latest hyperjson

pull/1/head
ansuz 9 years ago
parent 980ff8a0ca
commit a18c793f98

@ -4,16 +4,6 @@ define([], function () {
return Object.prototype.toString.call(A)==='[object Array]'; return Object.prototype.toString.call(A)==='[object Array]';
}; };
var parseStyle = function(el){
var style = el.style;
var output = {};
for (var i = 0; i < style.length; ++i) {
var item = style.item(i);
output[item] = style[item];
}
return output;
};
var callOnHyperJSON = function (hj, cb) { var callOnHyperJSON = function (hj, cb) {
var children; var children;
@ -23,9 +13,7 @@ define([], function () {
// if the child is an array, recurse // if the child is an array, recurse
return callOnHyperJSON(child, cb); return callOnHyperJSON(child, cb);
} else if (typeof (child) === 'string') { } else if (typeof (child) === 'string') {
// string nodes have leading and trailing quotes return child;
// don't strip them!
return child; //child.replace(/(^"|"$)/g,"");
} else { } else {
// the above branches should cover all methods // the above branches should cover all methods
// if we hit this, there is a problem // if we hit this, there is a problem
@ -39,16 +27,6 @@ define([], function () {
return cb(hj[0], hj[1], children); return cb(hj[0], hj[1], children);
}; };
var classify = function (token) {
return '.' + token.trim();
};
var isValidClass = function (x) {
if (x && /\S/.test(x)) {
return true;
}
};
var isTruthy = function (x) { var isTruthy = function (x) {
return x; return x;
}; };
@ -73,14 +51,9 @@ define([], function () {
for(;i < el.attributes.length; i++){ for(;i < el.attributes.length; i++){
var attr = el.attributes[i]; var attr = el.attributes[i];
if(attr.name && attr.value){ if(attr.name && attr.value){
if(attr.name === "style"){
attributes.style = parseStyle(el);
}
else{
attributes[attr.name] = attr.value; attributes[attr.name] = attr.value;
} }
} }
}
// this should never be longer than three elements // this should never be longer than three elements
var result = []; var result = [];

Loading…
Cancel
Save