temporary fix for video skipping bug (#716); add third parameter (index) to forEach callback; add Geo colors
This commit is contained in:
parent
8c67bf9462
commit
17aca54e7a
5 changed files with 57 additions and 50 deletions
|
@ -24,9 +24,9 @@ Ox.load('UI', function() {
|
||||||
|
|
||||||
$main = Ox.Element()
|
$main = Ox.Element()
|
||||||
.append(
|
.append(
|
||||||
Ox.Label({
|
Ox.FileButton({
|
||||||
textAlign: 'center',
|
maxFiles: 1,
|
||||||
title: 'File Button',
|
title: 'Select File...',
|
||||||
width: 128
|
width: 128
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
|
@ -37,20 +37,7 @@ Ox.load('UI', function() {
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
Ox.FileButton({
|
Ox.FileButton({
|
||||||
maxFiles: 1,
|
title: 'Select Files...',
|
||||||
title: 'Select File...',
|
|
||||||
width: 128
|
|
||||||
})
|
|
||||||
.css({
|
|
||||||
position: 'absolute',
|
|
||||||
left: '160px',
|
|
||||||
top: '16px'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.append(
|
|
||||||
Ox.Label({
|
|
||||||
textAlign: 'center',
|
|
||||||
title: 'File Input',
|
|
||||||
width: 128
|
width: 128
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
|
@ -66,8 +53,8 @@ Ox.load('UI', function() {
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: '160px',
|
left: '16px',
|
||||||
top: '48px'
|
top: '80px'
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
|
@ -76,8 +63,8 @@ Ox.load('UI', function() {
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: '160px',
|
left: '16px',
|
||||||
top: '80px'
|
top: '112px'
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,5 @@
|
||||||
Ox.load({UI: {}, Geo: {}}, function() {
|
Ox.load({UI: {}, Geo: {}}, function() {
|
||||||
|
|
||||||
var markerColor = {
|
|
||||||
'Northern America': [64, 64, 255],
|
|
||||||
'Central America': [0, 0, 255],
|
|
||||||
'Caribbean': [0, 0, 128],
|
|
||||||
'Southern America': [0, 255, 0],
|
|
||||||
'Northern Europe': [255, 255, 192],
|
|
||||||
'Western Europe': [255, 255, 0],
|
|
||||||
'Eastern Europe': [255, 128, 0],
|
|
||||||
'Southern Europe': [128, 128, 0],
|
|
||||||
'Northern Africa': [128, 128, 128],
|
|
||||||
'Western Africa': [64, 64, 128],
|
|
||||||
'Middle Africa': [64, 64, 64],
|
|
||||||
'Eastern Africa': [128, 64, 64],
|
|
||||||
'Southern Africa': [64, 128, 64],
|
|
||||||
'Western Asia': [255, 128, 128],
|
|
||||||
'Central Asia': [255, 0, 0],
|
|
||||||
'Eastern Asia': [128, 0, 0],
|
|
||||||
'Southern Asia': [255, 0, 255],
|
|
||||||
'South-Eastern Asia': [128, 0, 128],
|
|
||||||
'Australia and New Zealand': [0, 128, 128],
|
|
||||||
'Micronesia': [192, 255, 255],
|
|
||||||
'Melanesia': [0, 255, 255],
|
|
||||||
'Polynesia': [128, 128, 255],
|
|
||||||
'Antarctica': [192, 192, 192]
|
|
||||||
},
|
|
||||||
|
|
||||||
$listmap = new Ox.ListMap({
|
$listmap = new Ox.ListMap({
|
||||||
height: window.innerHeight,
|
height: window.innerHeight,
|
||||||
places: Ox.COUNTRIES.map(function(place) {
|
places: Ox.COUNTRIES.map(function(place) {
|
||||||
|
@ -37,7 +11,7 @@ Ox.load({UI: {}, Geo: {}}, function() {
|
||||||
flag: place.code,
|
flag: place.code,
|
||||||
geoname: place.name,
|
geoname: place.name,
|
||||||
id: place.code,
|
id: place.code,
|
||||||
markerColor: markerColor[place.region] || [128,128,128],
|
markerColor: Ox.getGeoColor(place.region),
|
||||||
name: place.name,
|
name: place.name,
|
||||||
type: 'country',
|
type: 'country',
|
||||||
lat: place.lat,
|
lat: place.lat,
|
||||||
|
|
|
@ -76,6 +76,45 @@ Ox.load.Geo = function(options, callback) {
|
||||||
@*/
|
@*/
|
||||||
|
|
||||||
Ox.COUNTRIES = data;
|
Ox.COUNTRIES = data;
|
||||||
|
var colors = {
|
||||||
|
|
||||||
|
'North America': [0, 0, 255],
|
||||||
|
'Northern America': [0, 0, 255],
|
||||||
|
|
||||||
|
'South America': [0, 255, 0],
|
||||||
|
'Southern America': [0, 255, 0],
|
||||||
|
'Caribbean': [192, 255, 192],
|
||||||
|
'Central America': [0, 128, 0],
|
||||||
|
|
||||||
|
'Europe': [255, 255, 0],
|
||||||
|
'Western Europe': [255, 255, 0],
|
||||||
|
'Northern Europe': [255, 255, 192],
|
||||||
|
'Southern Europe': [128, 128, 0],
|
||||||
|
'Eastern Europe': [255, 192, 0],
|
||||||
|
|
||||||
|
'Africa': [255, 0, 255],
|
||||||
|
'Northern Africa': [255, 0, 255],
|
||||||
|
'Southern Africa': [255, 128, 255],
|
||||||
|
'Middle Africa': [128, 0, 128],
|
||||||
|
'Western Africa': [128, 0, 255],
|
||||||
|
'Eastern Africa': [255, 0, 128],
|
||||||
|
|
||||||
|
'Asia': [255, 0, 0],
|
||||||
|
'Eastern Asia': [255, 0, 0],
|
||||||
|
'South-Eastern Asia': [255, 128, 128],
|
||||||
|
'Southern Asia': [128, 0, 0],
|
||||||
|
'Western Asia': [255, 128, 0],
|
||||||
|
'Central Asia': [128, 64, 0],
|
||||||
|
|
||||||
|
'Oceania': [0, 255, 255],
|
||||||
|
'Australia and New Zealand': [0, 255, 255],
|
||||||
|
'Micronesia': [192, 255, 255],
|
||||||
|
'Melanesia': [0, 128, 128],
|
||||||
|
'Polynesia': [128, 128, 255],
|
||||||
|
|
||||||
|
'Antarctica': [128, 128, 128]
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
//@ Functions ----------------------------------------------------------
|
//@ Functions ----------------------------------------------------------
|
||||||
|
|
||||||
|
@ -176,6 +215,10 @@ Ox.load.Geo = function(options, callback) {
|
||||||
return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png';
|
return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Ox.getGeoColor = function(str) {
|
||||||
|
return colors[str] || [128, 128, 128];
|
||||||
|
};
|
||||||
|
|
||||||
callback(true);
|
callback(true);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1721,9 +1721,12 @@ Ox.VideoPlayer = function(options, self) {
|
||||||
that.triggerEvent('playing', {
|
that.triggerEvent('playing', {
|
||||||
position: self.options.position
|
position: self.options.position
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
temporarily disabled
|
||||||
minute != previousMinute && that.triggerEvent('position', {
|
minute != previousMinute && that.triggerEvent('position', {
|
||||||
position: minute * 60
|
position: minute * 60
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function playInToOut() {
|
function playInToOut() {
|
||||||
|
|
|
@ -169,7 +169,7 @@ Ox.forEach <f> forEach loop
|
||||||
"012abcfoo"
|
"012abcfoo"
|
||||||
@*/
|
@*/
|
||||||
Ox.forEach = function(col, fn, includePrototype) {
|
Ox.forEach = function(col, fn, includePrototype) {
|
||||||
var isObject = Ox.isObject(col), key;
|
var ind = 0, isObject = Ox.isObject(col), key;
|
||||||
// Safari will not loop through an arguments array
|
// Safari will not loop through an arguments array
|
||||||
col = Ox.isArguments(col) ? Ox.makeArray(col) : col;
|
col = Ox.isArguments(col) ? Ox.makeArray(col) : col;
|
||||||
for (key in col) {
|
for (key in col) {
|
||||||
|
@ -177,7 +177,7 @@ Ox.forEach = function(col, fn, includePrototype) {
|
||||||
// fixme: fn.call(context, obj[key], key, obj) may be more standard...
|
// fixme: fn.call(context, obj[key], key, obj) may be more standard...
|
||||||
if ((
|
if ((
|
||||||
includePrototype || Object.hasOwnProperty.call(col, key)
|
includePrototype || Object.hasOwnProperty.call(col, key)
|
||||||
) && fn(col[key], key) === false) {
|
) && fn(col[key], key, ind++) === false) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue