don't redeclare vars; fix semicolons
This commit is contained in:
parent
9f2dc33124
commit
4fbfc139b4
3 changed files with 16 additions and 16 deletions
|
@ -155,7 +155,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
ret = data;
|
ret = data;
|
||||||
} else if (arguments.length == 1 && Ox.isString(arguments[0])) {
|
} else if (arguments.length == 1 && Ox.isString(arguments[0])) {
|
||||||
ret = data[arguments[0]]
|
ret = data[arguments[0]];
|
||||||
} else {
|
} else {
|
||||||
Ox.forEach(Ox.makeObject(arguments), function(value, key) {
|
Ox.forEach(Ox.makeObject(arguments), function(value, key) {
|
||||||
data[key] = value;
|
data[key] = value;
|
||||||
|
@ -249,7 +249,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
nextAll: function() {
|
nextAll: function() {
|
||||||
var sibling = this[0], siblings = [];
|
var sibling = this[0], siblings = [];
|
||||||
while (true) {
|
while (true) {
|
||||||
var sibling = sibling.nextSibling;
|
sibling = sibling.nextSibling;
|
||||||
if (!sibling) {
|
if (!sibling) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
parents: function() {
|
parents: function() {
|
||||||
var parent = this[0], parents = [];
|
var parent = this[0], parents = [];
|
||||||
while (true) {
|
while (true) {
|
||||||
var parent = parent.parentNode;
|
parent = parent.parentNode;
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -367,7 +367,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
prevAll: function() {
|
prevAll: function() {
|
||||||
var sibling = this[0], siblings = [];
|
var sibling = this[0], siblings = [];
|
||||||
while (true) {
|
while (true) {
|
||||||
var sibling = sibling.previousSibling;
|
sibling = sibling.previousSibling;
|
||||||
if (!sibling) {
|
if (!sibling) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ Ox.once = function(fn) {
|
||||||
return function() {
|
return function() {
|
||||||
if (!once) {
|
if (!once) {
|
||||||
once = true;
|
once = true;
|
||||||
fn.apply(null, args);
|
fn.apply(null, arguments);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -140,8 +140,8 @@ Ox.queue <f> Queue of asynchronous function calls with cached results
|
||||||
maxThreads <n|10> Number of parallel function calls
|
maxThreads <n|10> Number of parallel function calls
|
||||||
@*/
|
@*/
|
||||||
Ox.queue = function(fn, maxThreads) {
|
Ox.queue = function(fn, maxThreads) {
|
||||||
var maxThreads = maxThreads || 10,
|
maxThreads = maxThreads || 10;
|
||||||
processing = [],
|
var processing = [],
|
||||||
queued = [],
|
queued = [],
|
||||||
ret = Ox.cache(function() {
|
ret = Ox.cache(function() {
|
||||||
var args = Ox.slice(arguments);
|
var args = Ox.slice(arguments);
|
||||||
|
@ -214,7 +214,7 @@ Ox.throttle = function(fn, ms) {
|
||||||
}
|
}
|
||||||
timeout = null;
|
timeout = null;
|
||||||
}, ms);
|
}, ms);
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
90
|
90
|
||||||
@*/
|
@*/
|
||||||
Ox.getBearing = function(pointA, pointB) {
|
Ox.getBearing = function(pointA, pointB) {
|
||||||
var pointA = rad(pointA),
|
pointA = rad(pointA);
|
||||||
pointB = rad(pointB),
|
pointB = rad(pointB);
|
||||||
x = Math.cos(pointA.lat) * Math.sin(pointB.lat)
|
var x = Math.cos(pointA.lat) * Math.sin(pointB.lat)
|
||||||
- Math.sin(pointA.lat) * Math.cos(pointB.lat)
|
- Math.sin(pointA.lat) * Math.cos(pointB.lat)
|
||||||
* Math.cos(pointB.lng - pointA.lng),
|
* Math.cos(pointB.lng - pointA.lng),
|
||||||
y = Math.sin(pointB.lng - pointA.lng)
|
y = Math.sin(pointB.lng - pointA.lng)
|
||||||
|
@ -107,9 +107,9 @@
|
||||||
{lat: 0, lng: 0}
|
{lat: 0, lng: 0}
|
||||||
@*/
|
@*/
|
||||||
Ox.getCenter = function(pointA, pointB) {
|
Ox.getCenter = function(pointA, pointB) {
|
||||||
var pointA = rad(pointA),
|
pointA = rad(pointA);
|
||||||
pointB = rad(pointB),
|
pointB = rad(pointB);
|
||||||
x = Math.cos(pointB.lat)
|
var x = Math.cos(pointB.lat)
|
||||||
* Math.cos(pointB.lng - pointA.lng),
|
* Math.cos(pointB.lng - pointA.lng),
|
||||||
y = Math.cos(pointB.lat)
|
y = Math.cos(pointB.lat)
|
||||||
* Math.sin(pointB.lng - pointA.lng),
|
* Math.sin(pointB.lng - pointA.lng),
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
Ox.EARTH_CIRCUMFERENCE
|
Ox.EARTH_CIRCUMFERENCE
|
||||||
@*/
|
@*/
|
||||||
Ox.getDistance = function(pointA, pointB) {
|
Ox.getDistance = function(pointA, pointB) {
|
||||||
var pointA = rad(pointA),
|
pointA = rad(pointA);
|
||||||
pointB = rad(pointB);
|
pointB = rad(pointB);
|
||||||
return Math.acos(
|
return Math.acos(
|
||||||
Math.sin(pointA.lat) * Math.sin(pointB.lat)
|
Math.sin(pointA.lat) * Math.sin(pointB.lat)
|
||||||
|
|
Loading…
Reference in a new issue