From 5ee998b2633d7138eba263e4314eb77ecebcb0f7 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 14 Jul 2010 00:38:53 +0200 Subject: [PATCH] serialize/unserialize --- build/css/ox.ui.css | 9 +++++++-- build/css/ox.ui.modern.css | 4 ++-- build/js/ox.js | 21 +++++++++++++++++++-- build/js/ox.ui.js | 16 +++++++++++----- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index 5e0b838e..c6f7e2f9 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -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))); diff --git a/build/css/ox.ui.modern.css b/build/css/ox.ui.modern.css index 3620db38..eeed9681 100644 --- a/build/css/ox.ui.modern.css +++ b/build/css/ox.ui.modern.css @@ -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); diff --git a/build/js/ox.js b/build/js/ox.js index 338d70f6..9a51279a 100644 --- a/build/js/ox.js +++ b/build/js/ox.js @@ -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"; -}; +}; \ No newline at end of file diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 4d153155..3d6e5fee 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -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 */ -})(); +})(); \ No newline at end of file