').html(html).html();
- // fixme: this converts '"' to '"'
+ // note: this converts '"' to '"'
return Ox.element('
').html(html).html();
}
@@ -3952,7 +4002,7 @@ Ox.tokenize = (function() {
'global', 'ignoreCase', 'lastIndex', 'multiline', 'source',
// Window
'applicationCache',
- 'closed', 'content', 'crypto',
+ 'closed', 'console', 'content', 'crypto',
'defaultStatus', 'document',
'frameElement', 'frames',
'history',
@@ -3966,7 +4016,6 @@ Ox.tokenize = (function() {
'self', 'sessionStorage', 'status', 'statusbar',
'toolbar', 'top'
]
- // Window stuff? 'atob', 'btoa', 'console', 'document' ...
};
return function(source) {
@@ -4269,10 +4318,10 @@ Ox.extend = function() {
Ox.serialize Parses an object into query parameters
> Ox.serialize({a: 1, b: 2, c: 3})
'a=1&b=2&c=3'
- > Ox.serialize({a: 1, b: 2.3, c: [4, 5]})
- 'a=1&b=2.3&c=4,5'
+ > Ox.serialize({a: -1, b: 2.3, c: [4, 5]})
+ 'a=-1&b=2.3&c=4,5'
> Ox.serialize({string: 'foo', empty: {}, null: null, undefined: void 0})
- 'string=bar'
+ 'string=foo'
@*/
Ox.serialize = function(obj) {
var arr = [];
@@ -4288,8 +4337,8 @@ Ox.serialize = function(obj) {
Ox.unserialize Parses query parameters into an object
> Ox.unserialize('a=1&b=2&c=3')
{a: '1', b: '2', c: '3'}
- > Ox.unserialize('a=1&b=2.3&c=4,5', true)
- {a: 1, b: 2.3, c: [4, 5]}
+ > Ox.unserialize('a=-1&b=2.3&c=4,5', true)
+ {a: -1, b: 2.3, c: [4, 5]}
@*/
Ox.unserialize = function(str, toNumber) {
var obj = {};
@@ -4774,8 +4823,8 @@ Ox.truncate = function(str, len, pad, pos) {
Ox.words Splits a string into words, removing punctuation
(string) -> <[s]> Array of words
string Any string
- > Ox.words('Let\'s "walk" a tree-like key/value store--okay?')
- ["let's", "walk", "a", "tree-like", "key", "value", "store", "okay"]
+ > Ox.words('Let\'s "split" array-likes into key/value pairs--okay?')
+ ["let's", "split", "array-likes", "into", "key", "value", "pairs", "okay"]
@*/
Ox.words = function(str) {
var arr = str.toLowerCase().split(/\b/),
@@ -4783,12 +4832,11 @@ Ox.words = function(str) {
len = arr.length,
startsWithWord = /\w/.test(arr[0]);
arr.forEach(function(v, i) {
- // find single occurrences of "-" or "-"
- // that are not at the beginning or end of the string
- // and join the surrounding words with them
+ // find single occurrences of "-" or "'" that are not at the beginning
+ // or end of the string, and join the surrounding words with them
if (
- i > 0 && i < len - 1 &&
- v.length == 1 && chr.indexOf(v) > -1
+ i > 0 && i < len - 1
+ && v.length == 1 && chr.indexOf(v) > -1
) {
arr[i + 1] = arr[i - 1] + arr[i] + arr[i + 1];
arr[i - 1] = arr[i] = '';
@@ -4986,18 +5034,17 @@ Ox.isEqual = function(a, b) {
isEqual = true;
} else if (type == 'date') {
isEqual = a.getTime() == b.getTime();
- /* toString doesn't do it
- } else if (['element', 'function'].indexOf(type) > -1) {
+ } else if (type == 'element') {
+ isEqual = a.isEqualNode(b);
+ } else if (type == 'function') {
+ // fixme: this doesn't do it
isEqual = a.toString() == b.toString();
- */
} else if (type == 'regexp') {
- isEqual = a.global == b.global &&
- a.ignore == b.ignore &&
- a.multiline == b.multiline &&
- a.source == b.source;
+ isEqual = a.global == b.global && a.ignore == b.ignore
+ && a.multiline == b.multiline && a.source == b.source;
} else if (
- ['arguments', 'array', 'object'].indexOf(type) > -1 &&
- Ox.len(a) == Ox.len(b)
+ ['arguments', 'array', 'object'].indexOf(type) > -1
+ && Ox.len(a) == Ox.len(b)
) {
isEqual = true;
Ox.forEach(a, function(v, k) {
@@ -5018,7 +5065,7 @@ Ox.isFunction Tests if a value is a function
> Ox.isFunction(/ /)
false
@*/
-Ox.isFunction = function(val) { // is in jQuery
+Ox.isFunction = function(val) {
return typeof val == 'function' && !Ox.isRegExp(val);
};
@@ -5090,11 +5137,14 @@ Ox.isObject Tests if a value is a an object
false
> Ox.isObject(null)
false
+ > Ox.isObject(/ /)
+ false
@*/
Ox.isObject = function(val) {
return typeof val == 'object' && !Ox.isArguments(val)
- && !Ox.isArray(val) && !Ox.isDate(val) && !Ox.isNull(val);
+ && !Ox.isArray(val) && !Ox.isDate(val)
+ && !Ox.isNull(val) && !Ox.isRegExp(val);
};
/*@
diff --git a/tests/tests.js b/tests/tests.js
index 047cc8c3..b86b85be 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,4 +1,4 @@
-Ox.load('UI', function() {
+Ox.load({UI: {}, Geo: {}}, function() {
//Ox.UI.ready(function() {
@@ -23,7 +23,7 @@ Ox.load('UI', function() {
setBackground($tests, true);
- tests(['../build/Ox.js'/*, '../build/js/ox.data.js'*/]);
+ tests(['../build/Ox.js', '../build/Ox.Geo/Ox.Geo.js']);
function tests() {
var passed = 0, failed = 0,