serialize/unserialize

This commit is contained in:
rolux 2010-07-14 00:38:53 +02:00
parent 5a655b3e20
commit 5ee998b263
4 changed files with 39 additions and 11 deletions

View file

@ -472,8 +472,10 @@ Layers
.OxLayer {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgb(0, 0, 0);
opacity: 0;
overflow: hidden;
@ -677,6 +679,9 @@ Menus
padding-top: 2px;
font-size: 9px;
}
.OxMainMenu > .OxTitle:first-child {
font-weight: bold;
}
.OxMainMenu > .OxTitle.OxSelected {
background: rgb(48, 48, 48);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgb(80, 80, 80)), color-stop(1, rgb(48, 48, 48)));

View file

@ -120,10 +120,10 @@ Lists
background: rgb(18, 18, 18);
}
.OxThemeModern .OxTextList .OxItem.OxSelected:nth-child(odd) {
background: rgb(30, 30, 30);
background: rgb(46, 46, 46);
}
.OxThemeModern .OxTextList .OxItem.OxSelected:nth-child(even) {
background: rgb(34, 34, 34);
background: rgb(50, 50, 50);
}
.OxThemeModern .OxTextList .OxFocus .OxItem.OxSelected:nth-child(odd) {
background: rgb(62, 62, 62);

View file

@ -96,7 +96,7 @@ Ox.user = function() {
outerHeight: outerHeight,
outerWidth: outerWidth
}
}
};
/*
================================================================================
@ -330,6 +330,14 @@ Ox.range = function(start, stop, step) {
return range;
};
Ox.serialize = function(obj) {
var arr = [];
Ox.each(obj, function(k, v) {
arr.push(k + "=" + v);
});
return arr.join("&");
};
Ox.shuffle = function(arr) {
/*
>>> Ox.shuffle([1, 2, 3]).length
@ -368,6 +376,15 @@ Ox.sum = function(obj) {
return sum;
};
Ox.unserialize = function(str) {
var arr, obj = {};
Ox.each(str.split("&"), function(i, v) {
arr = v.split("=");
obj[arr[0]] = arr[1];
});
return obj;
};
Ox.values = function(obj) {
/*
>>> Ox.values({"a": 1, "b": 2, "c": 3}).join(",")
@ -1708,4 +1725,4 @@ Ox.isUndefined = function(val) {
true
*/
return typeof val == "undefined";
};
};

View file

@ -3747,11 +3747,15 @@ requires
};
that.disableItem = function(id) {
that.getItem(id).options({
disabled: true
});
};
that.enableItem = function(id) {
that.getItem(id).options({
disabled: false
});
};
that.getItem = function(id) {
@ -3785,7 +3789,9 @@ requires
};
that.uncheckItem = function(id) {
that.getItem(id).options({
checked: false
});
};
return that;
@ -4475,7 +4481,7 @@ requires
}
that.$status.html(value ? oxui.symbols.check : "")
} else if (key == "disabled") {
that.toggleClass("disabled"); // fixme: this will only work if onChange is only invoked on actual change
that.toggleClass("OxDisabled"); // fixme: this will only work if onChange is only invoked on actual change
} else if (key == "title") {
}
@ -4790,4 +4796,4 @@ requires
*/
})();
})();