use base 10 in parseInt, use Math.floor for numbers

This commit is contained in:
rolux 2012-06-13 10:28:21 +02:00
commit 8bc8c57373
19 changed files with 44 additions and 45 deletions

View file

@ -1338,9 +1338,9 @@ Ox.VideoPlayer = function(options, self) {
};
} else if (element == 'subtitle') {
css = {
bottom: (parseInt(self.height / 16) + !!self.controlsBottomAreVisible * 16) + 'px',
bottom: (Math.floor(self.height / 16) + !!self.controlsBottomAreVisible * 16) + 'px',
width: self.width + 'px',
fontSize: parseInt(self.height / 20) + 'px',
fontSize: Math.floor(self.height / 20) + 'px',
WebkitTextStroke: (self.height / 1000) + 'px rgb(0, 0, 0)'
};
} else if (element == 'spaceBottom' || element == 'timeline') {
@ -1543,8 +1543,8 @@ Ox.VideoPlayer = function(options, self) {
width = Math.round(width);
height = Math.round(height);
return {
left: parseInt((playerWidth - width) / 2),
top: parseInt((playerHeight - height) / 2),
left: Math.floor((playerWidth - width) / 2),
top: Math.floor((playerHeight - height) / 2),
width: width,
height: height
};
@ -1823,7 +1823,7 @@ Ox.VideoPlayer = function(options, self) {
} else if (title == 'Subtitles') {
toggleSubtitles();
} else {
resolution = parseInt(title);
resolution = parseInt(title, 10);
if (resolution != self.options.resolution) {
self.options.resolution = resolution;
setResolution();
@ -1837,7 +1837,7 @@ Ox.VideoPlayer = function(options, self) {
&& self.options.enableSubtitles
) || (
Ox.last(title) == 'p'
&& parseInt(title) == self.options.resolution
&& parseInt(title, 10) == self.options.resolution
);
$(children[1]).attr({
src: Ox.UI.getImageURL(