').css(css).html(data.summary).appendTo($center);
}
@@ -398,7 +398,7 @@ pandora.ui.infoView = function(data) {
}
})
.appendTo($div);
- } else if(data.license) {
+ } else if (data.license) {
$div.html(
formatKey('License')
+ (data.license || []).join(', ')
@@ -547,12 +547,13 @@ pandora.ui.infoView = function(data) {
}
function formatValue(value, key) {
- if(key == 'date') {
+ if (key == 'date') {
return value ? Ox.formatDate(value,
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length]
) : '';
- } else if(key == 'duration') {
- return value < 60 ? Math.round(value) + ' sec' : Math.round(value / 60) + ' min';
+ } else if (key == 'duration') {
+ return value < 60 ? Math.round(value) + ' sec'
+ : Math.round(value / 60) + ' min';
}
return (Ox.isArray(value) ? value : [value]).map(function(value) {
return key ?
diff --git a/static/js/pandora/infoView.padma.js b/static/js/pandora/infoView.padma.js
index b09b7df7..64b0adeb 100644
--- a/static/js/pandora/infoView.padma.js
+++ b/static/js/pandora/infoView.padma.js
@@ -426,7 +426,7 @@ pandora.ui.infoView = function(data) {
.css(css)
)
.appendTo($center);
- } else if(data.summary) {
+ } else if (data.summary) {
$('
').css(css).html(data.summary).appendTo($center);
}
@@ -449,7 +449,7 @@ pandora.ui.infoView = function(data) {
}
})
.appendTo($div);
- } else if(data.license) {
+ } else if (data.license) {
$div.html(
formatKey('License')
+ (data.license || []).join(', ')
@@ -598,11 +598,11 @@ pandora.ui.infoView = function(data) {
}
function formatValue(value, key) {
- if(key == 'date') {
+ if (key == 'date') {
return value ? Ox.formatDate(value,
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length]
) : '';
- } else if(key == 'duration') {
+ } else if (key == 'duration') {
return value < 60 ? Math.round(value) + ' sec' : Math.round(value / 60) + ' min';
}
return (Ox.isArray(value) ? value : [value]).map(function(value) {
diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js
index b8fb84cd..8406cc95 100644
--- a/static/js/pandora/menu.js
+++ b/static/js/pandora/menu.js
@@ -332,7 +332,7 @@ pandora.ui.mainMenu = function() {
pandora.$ui.appPanel.reload();
});
} else if (data.id == 'debug') {
- if(pandora.localStorage('debug')) {
+ if (pandora.localStorage('debug')) {
pandora.localStorage['delete']('debug');
} else {
pandora.localStorage('debug', true);
diff --git a/static/js/pandora/news.js b/static/js/pandora/news.js
index 99ae7183..44882b05 100644
--- a/static/js/pandora/news.js
+++ b/static/js/pandora/news.js
@@ -18,7 +18,7 @@ pandora.ui.news = function(width, height) {
pandora.api.getNews({}, function(result) {
items = result.data.items;
- if(items.length) {
+ if (items.length) {
selected = items[0].id;
renderItem();
renderList();
diff --git a/static/js/pandora/onloadDialog.js b/static/js/pandora/onloadDialog.js
index 7f64e660..5c7fe71d 100644
--- a/static/js/pandora/onloadDialog.js
+++ b/static/js/pandora/onloadDialog.js
@@ -71,7 +71,7 @@ pandora.ui.onloadDialog = function() {
that.superClose = that.close;
that.close = function() {
var value = $text.value();
- if(value) {
+ if (value) {
localStorage['pandora.onload'] = value;
} else {
delete localStorage['pandora.onload'];
diff --git a/static/js/pandora/tests.js b/static/js/pandora/tests.js
index a932e97d..b839af1b 100644
--- a/static/js/pandora/tests.js
+++ b/static/js/pandora/tests.js
@@ -21,7 +21,7 @@ pandora.tests = function() {
test('set item', pandora.user.ui.item, item.id);
startPlayback();
function startPlayback() {
- if(pandora.$ui.player) {
+ if (pandora.$ui.player) {
pandora.$ui.player.options({paused: false});
setTimeout(function() {
pandora.$ui.player.options({paused: true});
diff --git a/static/js/pandora/upload.js b/static/js/pandora/upload.js
index 62598479..fe388340 100644
--- a/static/js/pandora/upload.js
+++ b/static/js/pandora/upload.js
@@ -88,9 +88,9 @@ pandora.ui.upload = function(oshash, file) {
chunk,
chunkOffset = chunkId * chunkSize;
- if(file.mozSlice) {
+ if (file.mozSlice) {
chunk = file.mozSlice(chunkOffset, chunkOffset+chunkSize, file.type);
- } else if(file.webkitSlice) {
+ } else if (file.webkitSlice) {
chunk = file.webkitSlice(chunkOffset, chunkOffset+chunkSize, file.type);
}
diff --git a/static/js/pandora/uploadDialog.js b/static/js/pandora/uploadDialog.js
index cfaed5c7..8efe32fc 100644
--- a/static/js/pandora/uploadDialog.js
+++ b/static/js/pandora/uploadDialog.js
@@ -3,7 +3,7 @@
pandora.ui.uploadDialog = function(data) {
var content = Ox.Element().css({margin: '16px'}),
- canceled = false,
+ cancelled = false,
file,
closeButton,
actionButton,
@@ -23,14 +23,14 @@ pandora.ui.uploadDialog = function(data) {
title: 'Select Video'
}).bindEvent({
click: function() {
- if(actionButton.options('title') == 'Select Video') {
- if(selectVideo()) {
+ if (actionButton.options('title') == 'Select Video') {
+ if (selectVideo()) {
actionButton.options('title', 'Upload');
}
- } else if(actionButton.options('title') == 'Close') {
+ } else if (actionButton.options('title') == 'Close') {
that.close();
- } else if(actionButton.options('title') == 'Cancel') {
- canceled = true;
+ } else if (actionButton.options('title') == 'Cancel') {
+ cancelled = true;
pandora.firefogg && pandora.firefogg.cancel();
pandora.$ui.upload && pandora.$ui.upload.abort();
actionButton.options('title', 'Select Video');
@@ -70,7 +70,7 @@ pandora.ui.uploadDialog = function(data) {
pandora._status = $status;
pandora._info = $info;
- if(typeof(Firefogg) == 'undefined') {
+ if (typeof(Firefogg) == 'undefined') {
/*
selectFile = $('')
.attr({
@@ -81,9 +81,9 @@ pandora.ui.uploadDialog = function(data) {
})
.on({
change: function(event) {
- if(this.files.length) {
+ if (this.files.length) {
file = this.files[0];
- if(file.type == 'video/webm') {
+ if (file.type == 'video/webm') {
$status.html('');
uploadButton.options({
disabled: false
@@ -122,7 +122,7 @@ pandora.ui.uploadDialog = function(data) {
denominator;
ratio = ratio.split(':');
numerator = ratio[0];
- if(ratio.length == 2) {
+ if (ratio.length == 2) {
denominator = ratio[1];
}
if (Math.abs(numerator/denominator - 4/3) < 0.03) {
@@ -166,8 +166,8 @@ pandora.ui.uploadDialog = function(data) {
function(result, file) {
result = JSON.parse(result);
if (result.progress != 1) {
- if(canceled) {
- $status.html('Encoding canceled.');
+ if (cancelled) {
+ $status.html('Encoding cancelled.');
} else {
$status.html('Encoding failed.');
}
@@ -209,7 +209,7 @@ pandora.ui.uploadDialog = function(data) {
dar,
options = {};
- if(format == 'webm') {
+ if (format == 'webm') {
options.videoCodec = 'vp8';
options.audioCodec = 'vorbis';
} else if (format == 'ogv') {
@@ -296,12 +296,14 @@ pandora.ui.uploadDialog = function(data) {
options.noUpscaling = true;
- if((!info.video.length || (info.video[0].codec == options.videoCodec
- && info.video[0].height <= options.height))
- && (!info.audio.length || info.audio[0].codec == options.audioCodec)) {
- options = {
- passthrough: true
- };
+ if (
+ (!info.video.length || (
+ info.video[0].codec == options.videoCodec
+ && info.video[0].height <= options.height
+ ))
+ && (!info.audio.length || info.audio[0].codec == options.audioCodec)
+ ) {
+ options = {passthrough: true};
}
return JSON.stringify(options);
}
@@ -310,14 +312,17 @@ pandora.ui.uploadDialog = function(data) {
var html = '';
html += '' + info.path + '';
html += '
';
- if(info.video && info.video.length>0) {
+ if (info.video && info.video.length > 0) {
var video = info.video[0];
html += video.width + 'x' + video.height + ' (' + video.codec + ')';
}
- if(info.video && info.video.length>0 && info.audio && info.audio.length>0) {
+ if (
+ info.video && info.video.length > 0
+ && info.audio && info.audio.length > 0
+ ) {
html += ' / ';
}
- if(info.audio && info.audio.length>0) {
+ if (info.audio && info.audio.length > 0) {
var audio= info.audio[0];
html += '' + {
1: 'mono',
@@ -335,10 +340,10 @@ pandora.ui.uploadDialog = function(data) {
}
function selectVideo() {
- canceled = false;
+ cancelled = false;
pandora.firefogg = new Firefogg();
pandora.firefogg.setFormat(pandora.site.video.formats[0]);
- if(pandora.firefogg.selectVideo()) {
+ if (pandora.firefogg.selectVideo()) {
var info = JSON.parse(pandora.firefogg.sourceInfo),
options = JSON.parse(getEncodingOptions(info)),
oshash = info.oshash,
@@ -350,7 +355,9 @@ pandora.ui.uploadDialog = function(data) {
},
keys: ['id', 'available']
}, function(result) {
- if(result.data.items.length === 0 || !result.data.items[0].available) {
+ if (
+ result.data.items.length === 0 || !result.data.items[0].available
+ ) {
$info.html(formatInfo(info));
$status.html(
options.passthrough