minor changes in OxJS

This commit is contained in:
rolux 2012-01-06 17:27:54 +05:30
parent 66934d22a9
commit f76ee0cf36
6 changed files with 16 additions and 6 deletions

View file

@ -449,8 +449,10 @@ Ox.Map = function(options, self) {
delete window.googleCallback; delete window.googleCallback;
initMap(); initMap();
}; };
$.getScript(document.location.protocol $.getScript(
+ '//maps.google.com/maps/api/js?callback=googleCallback&sensor=false'); document.location.protocol
+ '//maps.google.com/maps/api/js?callback=googleCallback&sensor=false'
);
} else { } else {
(function interval() { (function interval() {
window.google ? initMap() : setTimeout(interval, 100); window.google ? initMap() : setTimeout(interval, 100);

View file

@ -149,7 +149,7 @@ Ox.SmallVideoTimelineImage = function(options, self) {
Ox.loop(left, right, function(x) { Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) { Ox.loop(top, bottom, function(y) {
var alpha = self.options.type == 'player' ? 128 var alpha = self.options.type == 'player' ? 128
: (y == top || y == bottom - 1) ? 255 : 64, : (y == top || y == bottom - 1) ? 255 : 255,
color = Ox.Theme[self.theme].timeline[ color = Ox.Theme[self.theme].timeline[
self.options.editing ? 'editing' self.options.editing ? 'editing'
: self.options.selected ? 'selected' : 'default' : self.options.selected ? 'selected' : 'default'

View file

@ -4,7 +4,7 @@
"color": 0.25 "color": 0.25
}, },
"timeline": { "timeline": {
"default": [0, 0, 0], "default": [128, 128, 128],
"editing": [0, 0, 128], "editing": [0, 0, 128],
"result": [128, 128, 0], "result": [128, 128, 0],
"selected": [0, 128, 0] "selected": [0, 128, 0]

View file

@ -5,7 +5,6 @@ Ox.compact <f> Returns an array w/o <code>undefined</code> values
> Ox.compact([null,,1,,2,,3]) > Ox.compact([null,,1,,2,,3])
[1, 2, 3] [1, 2, 3]
@*/ @*/
Ox.compact = function(arr) { Ox.compact = function(arr) {
return arr.filter(function(val) { return arr.filter(function(val) {
return !Ox.isNull(val) && !Ox.isUndefined(val); return !Ox.isNull(val) && !Ox.isUndefined(val);

View file

@ -19,6 +19,10 @@
/*@ /*@
Ox.crossesDateline <f> Returns true if a given line crosses the dateline Ox.crossesDateline <f> Returns true if a given line crosses the dateline
> Ox.crossesDateline({lat: 0, lng: -90}, {lat: 0, lng: 90})
false
> Ox.crossesDateline({lat: 0, lng: 90}, {lat: 0, lng: -90})
true
@*/ @*/
Ox.crossesDateline = function(pointA, pointB) { Ox.crossesDateline = function(pointA, pointB) {
return pointA.lng > pointB.lng; return pointA.lng > pointB.lng;
@ -53,6 +57,8 @@
Ox.getBearing <f> Returns the bearing from one point to another Ox.getBearing <f> Returns the bearing from one point to another
> Ox.getBearing({lat: -45, lng: 0}, {lat: 45, lng: 0}) > Ox.getBearing({lat: -45, lng: 0}, {lat: 45, lng: 0})
0 0
> Ox.getBearing({lat: 0, lng: -90}, {lat: 0, lng: 90})
90
@*/ @*/
Ox.getBearing = function(pointA, pointB) { Ox.getBearing = function(pointA, pointB) {
var pointA = rad(pointA), var pointA = rad(pointA),
@ -209,6 +215,8 @@
/*@ /*@
Ox.isPolar <f> Returns true if a given point is outside the bounds of a mercator projection Ox.isPolar <f> Returns true if a given point is outside the bounds of a mercator projection
> Ox.isPolar({lat: 90, lng: 0})
true
@*/ @*/
Ox.isPolar = function(point) { Ox.isPolar = function(point) {
return point.lat < Ox.MIN_LATITUDE || point.lat > Ox.MAX_LATITUDE; return point.lat < Ox.MIN_LATITUDE || point.lat > Ox.MAX_LATITUDE;

View file

@ -4,6 +4,7 @@
Ox.parseEmailAddresses <f> Takes HTML and turns e-mail addresses into links Ox.parseEmailAddresses <f> Takes HTML and turns e-mail addresses into links
@*/ @*/
// fixme: no tests // fixme: no tests
// fixme: shouldn't this be formatEmailAddresses?
Ox.parseEmailAddresses = function(html) { Ox.parseEmailAddresses = function(html) {
return html.replace( return html.replace(
/\b([0-9A-Z\.\+\-_]+@(?:[0-9A-Z\-]+\.)+[A-Z]{2,6})\b/gi, /\b([0-9A-Z\.\+\-_]+@(?:[0-9A-Z\-]+\.)+[A-Z]{2,6})\b/gi,
@ -144,8 +145,8 @@ Ox.parseURL = (function() {
/*@ /*@
Ox.parseURLs <f> Takes HTML and turns URLs into links Ox.parseURLs <f> Takes HTML and turns URLs into links
@*/ @*/
// fixme: is parseURLs the right name?
// fixme: no tests // fixme: no tests
// fixme: shouldn't this be formatURLs?
Ox.parseURLs = function(html) { Ox.parseURLs = function(html) {
return html.replace( return html.replace(
/\b((https?:\/\/|www\.).+?)([\.,:;!\?\)\]]*?(\s|$))/gi, /\b((https?:\/\/|www\.).+?)([\.,:;!\?\)\]]*?(\s|$))/gi,