use [].concat, not Ox.merge
This commit is contained in:
parent
fd5f0c3c4c
commit
ee160efa3d
24 changed files with 85 additions and 90 deletions
|
@ -103,15 +103,17 @@ Ox.load('UI', {
|
||||||
options.censored = canPlayVideo ? []
|
options.censored = canPlayVideo ? []
|
||||||
: canPlayClips ? (
|
: canPlayClips ? (
|
||||||
options.subtitles.length
|
options.subtitles.length
|
||||||
? Ox.merge(
|
? options.subtitles.map(function(subtitle, i) {
|
||||||
options.subtitles.map(function(subtitle, i) {
|
return {
|
||||||
return {
|
'in': i == 0 ? 0 : options.subtitles[i - 1].out,
|
||||||
'in': i == 0 ? 0 : options.subtitles[i - 1].out,
|
out: subtitle['in']
|
||||||
out: subtitle['in']
|
};
|
||||||
};
|
}).concat(
|
||||||
}),
|
|
||||||
[{'in': Ox.last(options.subtitles).out, out: data.duration}]
|
[{'in': Ox.last(options.subtitles).out, out: data.duration}]
|
||||||
)
|
).filter(function(censored) {
|
||||||
|
// don't include gaps shorter than one second
|
||||||
|
return censored.out - censored['in'] >= 1;
|
||||||
|
})
|
||||||
: Ox.range(0, data.duration - 5, 60).map(function(position) {
|
: Ox.range(0, data.duration - 5, 60).map(function(position) {
|
||||||
return {
|
return {
|
||||||
'in': position + 5,
|
'in': position + 5,
|
||||||
|
|
|
@ -311,7 +311,7 @@ appPanel
|
||||||
function loadBrowserMessage() {
|
function loadBrowserMessage() {
|
||||||
|
|
||||||
var isMSIE = $.browser.msie,
|
var isMSIE = $.browser.msie,
|
||||||
browsers = Ox.merge(
|
browsers = [].concat(
|
||||||
isMSIE ? [{name: 'Chrome Frame', url: 'http://google.com/chromeframe/'}] : [],
|
isMSIE ? [{name: 'Chrome Frame', url: 'http://google.com/chromeframe/'}] : [],
|
||||||
[
|
[
|
||||||
{name: 'Chrome', url: 'http://google.com/chrome/'},
|
{name: 'Chrome', url: 'http://google.com/chrome/'},
|
||||||
|
|
|
@ -39,7 +39,7 @@ pandora.URL = (function() {
|
||||||
// ...
|
// ...
|
||||||
} else if (['timeline', 'player', 'editor'].indexOf(state.view) > -1) {
|
} else if (['timeline', 'player', 'editor'].indexOf(state.view) > -1) {
|
||||||
var videoPoints = pandora.user.ui.videoPoints[state.item] || {};
|
var videoPoints = pandora.user.ui.videoPoints[state.item] || {};
|
||||||
state.span = videoPoints.annotation || Ox.merge(
|
state.span = videoPoints.annotation || [].concat(
|
||||||
videoPoints.position
|
videoPoints.position
|
||||||
? videoPoints.position
|
? videoPoints.position
|
||||||
: [],
|
: [],
|
||||||
|
@ -173,19 +173,17 @@ pandora.URL = (function() {
|
||||||
findKeys, sortKeys = {}, spanType = {}, views = {};
|
findKeys, sortKeys = {}, spanType = {}, views = {};
|
||||||
|
|
||||||
views[itemsSection] = {
|
views[itemsSection] = {
|
||||||
list: Ox.merge(
|
// listView is the default view
|
||||||
// listView is the default view
|
list: [pandora.user.ui.listView].concat(
|
||||||
[pandora.user.ui.listView],
|
|
||||||
pandora.site.listViews.filter(function(view) {
|
pandora.site.listViews.filter(function(view) {
|
||||||
return view.id == pandora.user.ui.listView
|
return view.id == pandora.user.ui.listView
|
||||||
}).map(function(view) {
|
}).map(function(view) {
|
||||||
return view.id;
|
return view.id;
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
item: Ox.merge(
|
// itemView is the default view,
|
||||||
// itemView is the default view,
|
// videoView is the default view if there is a duration
|
||||||
// videoView is the default view if there is a duration
|
item: [pandora.user.ui.itemView, pandora.user.ui.videoView].concat(
|
||||||
[pandora.user.ui.itemView, pandora.user.ui.videoView],
|
|
||||||
pandora.site.itemViews.filter(function(view) {
|
pandora.site.itemViews.filter(function(view) {
|
||||||
return [
|
return [
|
||||||
pandora.user.ui.itemView, pandora.user.ui.videoView
|
pandora.user.ui.itemView, pandora.user.ui.videoView
|
||||||
|
@ -198,7 +196,7 @@ pandora.URL = (function() {
|
||||||
|
|
||||||
sortKeys[itemsSection] = {list: {}, item: {}};
|
sortKeys[itemsSection] = {list: {}, item: {}};
|
||||||
views[itemsSection].list.forEach(function(view) {
|
views[itemsSection].list.forEach(function(view) {
|
||||||
sortKeys[itemsSection].list[view] = Ox.merge(
|
sortKeys[itemsSection].list[view] = [].concat(
|
||||||
// listSort[0].key is the default sort key
|
// listSort[0].key is the default sort key
|
||||||
Ox.getObjectById(pandora.site.sortKeys, pandora.user.ui.listSort[0].key)
|
Ox.getObjectById(pandora.site.sortKeys, pandora.user.ui.listSort[0].key)
|
||||||
|| pandora.isClipView(view)
|
|| pandora.isClipView(view)
|
||||||
|
@ -214,9 +212,13 @@ pandora.URL = (function() {
|
||||||
});
|
});
|
||||||
views[itemsSection].item.forEach(function(view) {
|
views[itemsSection].item.forEach(function(view) {
|
||||||
if (pandora.isClipView(view, true)) {
|
if (pandora.isClipView(view, true)) {
|
||||||
sortKeys[itemsSection].item[view] = Ox.merge(
|
// itemSort[0].key is the default sort key
|
||||||
// itemSort[0].key is the default sort key
|
sortKeys[itemsSection].item[view] = [
|
||||||
[Ox.getObjectById(pandora.site.clipKeys, pandora.user.ui.itemSort[0].key)],
|
Ox.getObjectById(
|
||||||
|
pandora.site.clipKeys,
|
||||||
|
pandora.user.ui.itemSort[0].key
|
||||||
|
)
|
||||||
|
].concat(
|
||||||
pandora.site.clipKeys.filter(function(key) {
|
pandora.site.clipKeys.filter(function(key) {
|
||||||
return key.id == pandora.user.ui.itemSort[0].key;
|
return key.id == pandora.user.ui.itemSort[0].key;
|
||||||
})
|
})
|
||||||
|
@ -238,13 +240,13 @@ pandora.URL = (function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
findKeys = Ox.merge([{id: 'list', type: 'string'}], pandora.site.itemKeys);
|
findKeys = [{id: 'list', type: 'string'}].concat(pandora.site.itemKeys);
|
||||||
|
|
||||||
self.URL = Ox.URL({
|
self.URL = Ox.URL({
|
||||||
findKeys: findKeys,
|
findKeys: findKeys,
|
||||||
getItem: pandora.getItemByIdOrTitle,
|
getItem: pandora.getItemByIdOrTitle,
|
||||||
getSpan: pandora.getMetadataByIdOrName,
|
getSpan: pandora.getMetadataByIdOrName,
|
||||||
pages: Ox.merge(
|
pages: [].concat(
|
||||||
['home', 'software', 'api', 'help', 'tv'],
|
['home', 'software', 'api', 'help', 'tv'],
|
||||||
pandora.site.sitePages.map(function(page) {
|
pandora.site.sitePages.map(function(page) {
|
||||||
return page.id;
|
return page.id;
|
||||||
|
|
|
@ -84,7 +84,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
buttons: Ox.merge(
|
buttons: [].concat(
|
||||||
buttons[action].map(function(type) {
|
buttons[action].map(function(type) {
|
||||||
return button(type);
|
return button(type);
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
pandora.ui.annotationDialog = function(layer) {
|
pandora.ui.annotationDialog = function(layer) {
|
||||||
var isEditor = pandora.user.ui.itemView == 'editor',
|
var isEditor = pandora.user.ui.itemView == 'editor',
|
||||||
$dialog = Ox.Dialog({
|
$dialog = Ox.Dialog({
|
||||||
buttons: Ox.merge(
|
buttons: [].concat(
|
||||||
isEditor ? [
|
isEditor ? [
|
||||||
Ox.Button({title: 'Sign Up...'}).bindEvent({
|
Ox.Button({title: 'Sign Up...'}).bindEvent({
|
||||||
click: function() {
|
click: function() {
|
||||||
|
|
|
@ -87,7 +87,7 @@ pandora.ui.browser = function() {
|
||||||
info = (
|
info = (
|
||||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||||
this, Ox.merge([data[sortKey]], format.args || [])
|
this, [data[sortKey]].concat(format.args || [])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info = data[sortKey];
|
info = data[sortKey];
|
||||||
|
|
|
@ -46,7 +46,7 @@ pandora.ui.clipList = function(videoRatio) {
|
||||||
info = (
|
info = (
|
||||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||||
this, Ox.merge([data[sortKey]], format.args || [])
|
this, [data[sortKey]].concat(format.args || [])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info = data[sortKey];
|
info = data[sortKey];
|
||||||
|
@ -98,8 +98,7 @@ pandora.ui.clipList = function(videoRatio) {
|
||||||
query: query
|
query: query
|
||||||
}, data), callback);
|
}, data), callback);
|
||||||
},
|
},
|
||||||
keys: Ox.merge(
|
keys = ['annotations', 'id', 'in', 'out'].concat(
|
||||||
['annotations', 'id', 'in', 'out'],
|
|
||||||
!ui.item ? ['videoRatio'] : []
|
!ui.item ? ['videoRatio'] : []
|
||||||
),
|
),
|
||||||
max: 1,
|
max: 1,
|
||||||
|
|
|
@ -15,20 +15,20 @@ pandora.ui.filterForm = function(list) {
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
that.append(
|
that.append(
|
||||||
that.$filter = Ox.Filter({
|
that.$filter = Ox.Filter({
|
||||||
findKeys: Ox.merge(pandora.site.itemKeys.map(function(itemKey) {
|
findKeys: pandora.site.itemKeys.map(function(itemKey) {
|
||||||
var key = Ox.clone(itemKey);
|
var key = Ox.clone(itemKey);
|
||||||
key.type = key.type == 'layer'
|
key.type = key.type == 'layer'
|
||||||
? Ox.getObjectById(pandora.site.layers, key.id).type
|
? Ox.getObjectById(pandora.site.layers, key.id).type
|
||||||
: key.type;
|
: key.type;
|
||||||
return key;
|
return key;
|
||||||
}), {
|
}).concat([{
|
||||||
id: 'list',
|
id: 'list',
|
||||||
title: 'List',
|
title: 'List',
|
||||||
type: 'list',
|
type: 'list',
|
||||||
values: result.data.items.map(function(item) {
|
values: result.data.items.map(function(item) {
|
||||||
return item.id;
|
return item.id;
|
||||||
})
|
})
|
||||||
}),
|
}]),
|
||||||
list: list ? null : {
|
list: list ? null : {
|
||||||
sort: pandora.user.ui.listSort,
|
sort: pandora.user.ui.listSort,
|
||||||
view: pandora.user.ui.listView
|
view: pandora.user.ui.listView
|
||||||
|
|
|
@ -5,9 +5,9 @@ pandora.ui.findElement = function() {
|
||||||
findKey = pandora.user.ui._findState.key,
|
findKey = pandora.user.ui._findState.key,
|
||||||
findValue = pandora.user.ui._findState.value,
|
findValue = pandora.user.ui._findState.value,
|
||||||
hasPressedClear = false,
|
hasPressedClear = false,
|
||||||
previousFindKey = findKey;
|
previousFindKey = findKey,
|
||||||
var that = Ox.FormElementGroup({
|
that = Ox.FormElementGroup({
|
||||||
elements: Ox.merge(pandora.user.ui._list ? [
|
elements: [].concat(pandora.user.ui._list ? [
|
||||||
pandora.$ui.findListSelect = Ox.Select({
|
pandora.$ui.findListSelect = Ox.Select({
|
||||||
items: [
|
items: [
|
||||||
{id: 'all', title: 'Find: All ' + pandora.site.itemName.plural},
|
{id: 'all', title: 'Find: All ' + pandora.site.itemName.plural},
|
||||||
|
@ -27,7 +27,7 @@ pandora.ui.findElement = function() {
|
||||||
] : [], [
|
] : [], [
|
||||||
pandora.$ui.findSelect = Ox.Select({
|
pandora.$ui.findSelect = Ox.Select({
|
||||||
id: 'select',
|
id: 'select',
|
||||||
items: Ox.merge(
|
items: [].concat(
|
||||||
pandora.site.findKeys.filter(function(key, i) {
|
pandora.site.findKeys.filter(function(key, i) {
|
||||||
return !key.capability
|
return !key.capability
|
||||||
|| pandora.site.capabilities[key.capability][pandora.user.level];
|
|| pandora.site.capabilities[key.capability][pandora.user.level];
|
||||||
|
@ -93,7 +93,7 @@ pandora.ui.findElement = function() {
|
||||||
var findInList = pandora.user.ui._list
|
var findInList = pandora.user.ui._list
|
||||||
&& pandora.$ui.findListSelect.value() == 'list',
|
&& pandora.$ui.findListSelect.value() == 'list',
|
||||||
key = pandora.$ui.findSelect.value(),
|
key = pandora.$ui.findSelect.value(),
|
||||||
conditions = Ox.merge(
|
conditions = [].concat(
|
||||||
findInList ? [{
|
findInList ? [{
|
||||||
key: 'list',
|
key: 'list',
|
||||||
value: pandora.user.ui._list,
|
value: pandora.user.ui._list,
|
||||||
|
|
|
@ -37,7 +37,7 @@ pandora.ui.homePage = function() {
|
||||||
// fixme: duplicated
|
// fixme: duplicated
|
||||||
$select = Ox.Select({
|
$select = Ox.Select({
|
||||||
id: 'select',
|
id: 'select',
|
||||||
items: Ox.merge(pandora.site.findKeys.map(function(key) {
|
items: [].concat(pandora.site.findKeys.map(function(key) {
|
||||||
return {
|
return {
|
||||||
id: key.id,
|
id: key.id,
|
||||||
title: 'Find: ' + key.title
|
title: 'Find: ' + key.title
|
||||||
|
|
|
@ -598,7 +598,7 @@ pandora.ui.infoView = function(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCapabilities(rightsLevel) {
|
function renderCapabilities(rightsLevel) {
|
||||||
var capabilities = Ox.merge(
|
var capabilities = [].concat(
|
||||||
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
||||||
[
|
[
|
||||||
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
||||||
|
|
|
@ -571,7 +571,7 @@ pandora.ui.infoView = function(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCapabilities(rightsLevel) {
|
function renderCapabilities(rightsLevel) {
|
||||||
var capabilities = Ox.merge(
|
var capabilities = [].concat(
|
||||||
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
||||||
[
|
[
|
||||||
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
||||||
|
|
|
@ -571,7 +571,7 @@ pandora.ui.infoView = function(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCapabilities(rightsLevel) {
|
function renderCapabilities(rightsLevel) {
|
||||||
var capabilities = Ox.merge(
|
var capabilities = [].concat(
|
||||||
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
canEdit ? [{name: 'canSeeItem', symbol: 'Find'}] : [],
|
||||||
[
|
[
|
||||||
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
{name: 'canPlayClips', symbol: 'PlayInToOut'},
|
||||||
|
|
|
@ -8,7 +8,7 @@ pandora.ui.list = function() {
|
||||||
|
|
||||||
if (view == 'list') {
|
if (view == 'list') {
|
||||||
that = Ox.TextList({
|
that = Ox.TextList({
|
||||||
columns: Ox.merge([{
|
columns: [].concat([{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
defaultWidth: 16,
|
defaultWidth: 16,
|
||||||
format: function(value, data) {
|
format: function(value, data) {
|
||||||
|
@ -139,7 +139,7 @@ pandora.ui.list = function() {
|
||||||
info = (
|
info = (
|
||||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||||
this, Ox.merge([data[sortKey]], format.args || [])
|
this, [data[sortKey]].concat(format.args || [])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info = data[sortKey];
|
info = data[sortKey];
|
||||||
|
@ -192,7 +192,7 @@ pandora.ui.list = function() {
|
||||||
info = (
|
info = (
|
||||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||||
this, Ox.merge([data[sortKey]], format.args || [])
|
this, [data[sortKey]].concat(format.args || [])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info = data[sortKey];
|
info = data[sortKey];
|
||||||
|
@ -272,7 +272,7 @@ pandora.ui.list = function() {
|
||||||
info = (
|
info = (
|
||||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||||
this, Ox.merge([data[sortKey]], format.args || [])
|
this, [data[sortKey]].concat(format.args || [])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info = data[sortKey];
|
info = data[sortKey];
|
||||||
|
@ -525,15 +525,15 @@ pandora.ui.list = function() {
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
query = {
|
query = {
|
||||||
conditions: Ox.merge([
|
conditions: [pandora.user.ui.find].concat(
|
||||||
pandora.user.ui.find
|
data.rest.map(function(id) {
|
||||||
], data.rest.map(function(id) {
|
return {
|
||||||
return {
|
key: 'id',
|
||||||
key: 'id',
|
value: id,
|
||||||
value: id,
|
operator: '!='
|
||||||
operator: '!='
|
};
|
||||||
};
|
})
|
||||||
})),
|
),
|
||||||
operator: '&'
|
operator: '&'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ pandora.ui.listDialog = function(section) {
|
||||||
section = section || 'general';
|
section = section || 'general';
|
||||||
var width = getWidth(section);
|
var width = getWidth(section);
|
||||||
var listData = pandora.getListData(),
|
var listData = pandora.getListData(),
|
||||||
tabs = Ox.merge([
|
tabs = [].concat([
|
||||||
{id: 'general', title: 'General'},
|
{id: 'general', title: 'General'},
|
||||||
{id: 'icon', title: 'Icon'}
|
{id: 'icon', title: 'Icon'}
|
||||||
], listData.type == 'smart'
|
], listData.type == 'smart'
|
||||||
|
@ -494,8 +494,7 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
items: function(data, callback) {
|
items: function(data, callback) {
|
||||||
pandora.api.find(Ox.extend(data, {
|
pandora.api.find(Ox.extend(data, {
|
||||||
query: {
|
query: {
|
||||||
conditions: Ox.merge(
|
conditions: [{key: 'list', value: listData.id, operator: '=='}].concat(
|
||||||
[{key: 'list', value: listData.id, operator: '=='}],
|
|
||||||
value !== '' ? [{key: key, value: value, operator: '='}] : []
|
value !== '' ? [{key: key, value: value, operator: '='}] : []
|
||||||
),
|
),
|
||||||
operator: '&'
|
operator: '&'
|
||||||
|
|
|
@ -232,7 +232,7 @@ pandora.ui.logsDialog = function() {
|
||||||
|
|
||||||
function updateList(key, value) {
|
function updateList(key, value) {
|
||||||
var query = {
|
var query = {
|
||||||
conditions: Ox.merge(
|
conditions: [].concat(
|
||||||
key != 'url' ? [{key: 'user', value: value, operator: '='}] : [],
|
key != 'url' ? [{key: 'user', value: value, operator: '='}] : [],
|
||||||
key != 'user' ? [{key: 'url', value: value, operator: '='}] : []
|
key != 'user' ? [{key: 'url', value: value, operator: '='}] : []
|
||||||
),
|
),
|
||||||
|
|
|
@ -12,9 +12,9 @@ pandora.ui.mainMenu = function() {
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
id: 'mainMenu',
|
id: 'mainMenu',
|
||||||
menus: Ox.merge(
|
menus: [].concat(
|
||||||
[
|
[
|
||||||
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: Ox.merge(
|
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [].concat(
|
||||||
[
|
[
|
||||||
{ id: 'home', title: 'Home' },
|
{ id: 'home', title: 'Home' },
|
||||||
{}
|
{}
|
||||||
|
@ -58,7 +58,7 @@ pandora.ui.mainMenu = function() {
|
||||||
}, view);
|
}, view);
|
||||||
}) },
|
}) },
|
||||||
]},
|
]},
|
||||||
{ id: 'icons', title: 'Icons', items: Ox.merge([
|
{ id: 'icons', title: 'Icons', items: [].concat([
|
||||||
{ group: 'viewicons', min: 1, max: 1, items: ['posters', 'frames'].map(function(icons) {
|
{ group: 'viewicons', min: 1, max: 1, items: ['posters', 'frames'].map(function(icons) {
|
||||||
return {id: icons, title: Ox.toTitleCase(icons), checked: ui.icons == icons};
|
return {id: icons, title: Ox.toTitleCase(icons), checked: ui.icons == icons};
|
||||||
}) }
|
}) }
|
||||||
|
@ -255,7 +255,7 @@ pandora.ui.mainMenu = function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
click: function(data) {
|
click: function(data) {
|
||||||
if (Ox.merge(
|
if ([].concat(
|
||||||
['home', 'software'],
|
['home', 'software'],
|
||||||
pandora.site.sitePages.map(function(page) {
|
pandora.site.sitePages.map(function(page) {
|
||||||
return page.id;
|
return page.id;
|
||||||
|
@ -552,7 +552,7 @@ pandora.ui.mainMenu = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getListMenu(lists) {
|
function getListMenu(lists) {
|
||||||
return { id: 'listMenu', title: 'List', items: Ox.merge(
|
return { id: 'listMenu', title: 'List', items: [].concat(
|
||||||
{ id: 'allitems', title: 'All ' + pandora.site.itemName.plural, checked: !ui.item && !ui._list, keyboard: 'shift control w' },
|
{ id: 'allitems', title: 'All ' + pandora.site.itemName.plural, checked: !ui.item && !ui._list, keyboard: 'shift control w' },
|
||||||
['personal', 'favorite', 'featured'].map(function(folder) {
|
['personal', 'favorite', 'featured'].map(function(folder) {
|
||||||
return {
|
return {
|
||||||
|
@ -600,7 +600,7 @@ pandora.ui.mainMenu = function() {
|
||||||
}) : [];
|
}) : [];
|
||||||
return { id: 'sortMenu', title: 'Sort', items: [
|
return { id: 'sortMenu', title: 'Sort', items: [
|
||||||
{ id: 'sortitems', title: 'Sort ' + (isClipView || ui.item ? 'Clips' : pandora.site.itemName.plural) + ' by', items: [
|
{ id: 'sortitems', title: 'Sort ' + (isClipView || ui.item ? 'Clips' : pandora.site.itemName.plural) + ' by', items: [
|
||||||
{ group: 'listsort', min: 1, max: 1, items: Ox.merge(
|
{ group: 'listsort', min: 1, max: 1, items: [].concat(
|
||||||
items,
|
items,
|
||||||
pandora.site.sortKeys.filter(function(key) {
|
pandora.site.sortKeys.filter(function(key) {
|
||||||
return Ox.getIndexById(items, key.id) == -1 && (
|
return Ox.getIndexById(items, key.id) == -1 && (
|
||||||
|
|
|
@ -7,10 +7,7 @@ pandora.ui.siteDialog = function(section) {
|
||||||
var dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
|
var dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
|
||||||
dialogWidth = Math.round(window.innerWidth * 0.75),
|
dialogWidth = Math.round(window.innerWidth * 0.75),
|
||||||
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
||||||
tabs = Ox.merge(
|
tabs = pandora.site.sitePages.concat([{id: 'software', title: 'Software'}]);
|
||||||
Ox.clone(pandora.site.sitePages, true),
|
|
||||||
[{id: 'software', title: 'Software'}]
|
|
||||||
);
|
|
||||||
Ox.getObjectById(tabs, section).selected = true;
|
Ox.getObjectById(tabs, section).selected = true;
|
||||||
var $tabPanel = Ox.TabPanel({
|
var $tabPanel = Ox.TabPanel({
|
||||||
content: function(id) {
|
content: function(id) {
|
||||||
|
@ -70,7 +67,7 @@ pandora.ui.siteDialog = function(section) {
|
||||||
.css({width: '128px', height: '128px', marginBottom: '8px'})
|
.css({width: '128px', height: '128px', marginBottom: '8px'})
|
||||||
.appendTo($right);
|
.appendTo($right);
|
||||||
risk = ['Unknown', 'Severe', 'High', 'Significant', 'General', 'Low'];
|
risk = ['Unknown', 'Severe', 'High', 'Significant', 'General', 'Low'];
|
||||||
Ox.merge(
|
[].concat(
|
||||||
['Unknown'],
|
['Unknown'],
|
||||||
pandora.site.rightsLevels.map(function(rightsLevel) {
|
pandora.site.rightsLevels.map(function(rightsLevel) {
|
||||||
return rightsLevel.name;
|
return rightsLevel.name;
|
||||||
|
|
|
@ -7,7 +7,7 @@ pandora.ui.sortMenu = function() {
|
||||||
// FIXME: unused
|
// FIXME: unused
|
||||||
|
|
||||||
var that = Ox.MenuButton({
|
var that = Ox.MenuButton({
|
||||||
items: Ox.merge(
|
items: [].concat(
|
||||||
pandora.site.clipKeys.map(function(key) {
|
pandora.site.clipKeys.map(function(key) {
|
||||||
return Ox.extend(Ox.clone(key), {
|
return Ox.extend(Ox.clone(key), {
|
||||||
checked: key.id == pandora.user.ui.itemSort[0].key,
|
checked: key.id == pandora.user.ui.itemSort[0].key,
|
||||||
|
|
|
@ -13,7 +13,7 @@ pandora.ui.sortSelect = function(isNavigationView) {
|
||||||
sortKey = !pandora.user.ui.item ? 'listSort' : 'itemSort',
|
sortKey = !pandora.user.ui.item ? 'listSort' : 'itemSort',
|
||||||
that;
|
that;
|
||||||
if (!pandora.user.ui.item) {
|
if (!pandora.user.ui.item) {
|
||||||
items = Ox.merge(
|
items = [].concat(
|
||||||
items,
|
items,
|
||||||
pandora.site.sortKeys.filter(function(key) {
|
pandora.site.sortKeys.filter(function(key) {
|
||||||
return Ox.getIndexById(items, key.id) == -1 && (
|
return Ox.getIndexById(items, key.id) == -1 && (
|
||||||
|
|
|
@ -26,7 +26,7 @@ pandora.ui.statisticsDialog = function() {
|
||||||
},
|
},
|
||||||
dialogHeight = Math.round((window.innerHeight - 48) * 0.9),
|
dialogHeight = Math.round((window.innerHeight - 48) * 0.9),
|
||||||
dialogWidth = Math.round(window.innerWidth * 0.9),
|
dialogWidth = Math.round(window.innerWidth * 0.9),
|
||||||
names = Ox.merge(Object.keys(colors.system), Object.keys(colors.browser)),
|
names = Object.keys(colors.system).concat(Object.keys(colors.browser)),
|
||||||
tabs = [
|
tabs = [
|
||||||
{id: 'seen', title: 'First Seen & Last Seen', selected: true},
|
{id: 'seen', title: 'First Seen & Last Seen', selected: true},
|
||||||
{id: 'locations', title: 'Locations'},
|
{id: 'locations', title: 'Locations'},
|
||||||
|
|
|
@ -16,12 +16,9 @@ pandora.ui.usersDialog = function() {
|
||||||
'Android', 'BSD', 'iOS', 'Linux',
|
'Android', 'BSD', 'iOS', 'Linux',
|
||||||
'Mac OS X', 'Unix', 'Windows'
|
'Mac OS X', 'Unix', 'Windows'
|
||||||
],
|
],
|
||||||
userLevels = Ox.merge(
|
userLevels = pandora.site.userLevels.map(function(userLevel) {
|
||||||
pandora.site.userLevels.map(function(userLevel) {
|
return Ox.toTitleCase(userLevel);
|
||||||
return Ox.toTitleCase(userLevel);
|
}).concat(['Robot']),
|
||||||
}),
|
|
||||||
['Robot']
|
|
||||||
),
|
|
||||||
|
|
||||||
$reloadButton = Ox.Button({
|
$reloadButton = Ox.Button({
|
||||||
title: 'redo',
|
title: 'redo',
|
||||||
|
@ -968,11 +965,11 @@ pandora.ui.usersDialog = function() {
|
||||||
value = $findInput.value(),
|
value = $findInput.value(),
|
||||||
query = {
|
query = {
|
||||||
conditions: value
|
conditions: value
|
||||||
? Ox.merge(
|
? [].concat(
|
||||||
key != 'email' ? [{key: 'username', value: value, operator: '='}] : [],
|
key != 'email' ? [{key: 'username', value: value, operator: '='}] : [],
|
||||||
key != 'username' ? [{key: 'email', value: value, operator: '='}] : []
|
key != 'username' ? [{key: 'email', value: value, operator: '='}] : []
|
||||||
)
|
)
|
||||||
: Ox.merge(
|
: [].concat(
|
||||||
!guests ? [{key: 'level', value: 'guest', operator: '!='}] : [],
|
!guests ? [{key: 'level', value: 'guest', operator: '!='}] : [],
|
||||||
!robots ? [{key: 'level', value: 'robot', operator: '!='}] : []
|
!robots ? [{key: 'level', value: 'robot', operator: '!='}] : []
|
||||||
),
|
),
|
||||||
|
|
|
@ -770,7 +770,7 @@ pandora.getMetadataByIdOrName = function(item, view, str, callback) {
|
||||||
};
|
};
|
||||||
|
|
||||||
pandora.getPageTitle = function(stateOrURL) {
|
pandora.getPageTitle = function(stateOrURL) {
|
||||||
var pages = Ox.merge([
|
var pages = [
|
||||||
{id: '', title: ''},
|
{id: '', title: ''},
|
||||||
{id: 'help', title: 'Help'},
|
{id: 'help', title: 'Help'},
|
||||||
{id: 'home', title: ''},
|
{id: 'home', title: ''},
|
||||||
|
@ -780,7 +780,7 @@ pandora.getPageTitle = function(stateOrURL) {
|
||||||
{id: 'signup', title: 'Sign Up'},
|
{id: 'signup', title: 'Sign Up'},
|
||||||
{id: 'software', title: 'Software'},
|
{id: 'software', title: 'Software'},
|
||||||
{id: 'tv', title: 'TV'}
|
{id: 'tv', title: 'TV'}
|
||||||
], pandora.site.sitePages),
|
].concat(pandora.site.sitePages),
|
||||||
page = Ox.getObjectById(
|
page = Ox.getObjectById(
|
||||||
pages,
|
pages,
|
||||||
Ox.isObject(stateOrURL) ? stateOrURL.page : stateOrURL.substr(1)
|
Ox.isObject(stateOrURL) ? stateOrURL.page : stateOrURL.substr(1)
|
||||||
|
@ -830,13 +830,12 @@ pandora.getVideoOptions = function(data) {
|
||||||
options.censored = canPlayVideo ? []
|
options.censored = canPlayVideo ? []
|
||||||
: canPlayClips ? (
|
: canPlayClips ? (
|
||||||
options.subtitles.length
|
options.subtitles.length
|
||||||
? Ox.merge(
|
? options.subtitles.map(function(subtitle, i) {
|
||||||
options.subtitles.map(function(subtitle, i) {
|
return {
|
||||||
return {
|
'in': i == 0 ? 0 : options.subtitles[i - 1].out,
|
||||||
'in': i == 0 ? 0 : options.subtitles[i - 1].out,
|
out: subtitle['in']
|
||||||
out: subtitle['in']
|
};
|
||||||
};
|
}).concat(
|
||||||
}),
|
|
||||||
[{'in': Ox.last(options.subtitles).out, out: data.duration}]
|
[{'in': Ox.last(options.subtitles).out, out: data.duration}]
|
||||||
).filter(function(censored) {
|
).filter(function(censored) {
|
||||||
// don't include gaps shorter than one second
|
// don't include gaps shorter than one second
|
||||||
|
|
|
@ -16,7 +16,7 @@ pandora.ui.viewSelect = function() {
|
||||||
viewKey == 'itemView'
|
viewKey == 'itemView'
|
||||||
&& pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level]
|
&& pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level]
|
||||||
) {
|
) {
|
||||||
Ox.merge(items, [
|
items = items.concat([
|
||||||
{},
|
{},
|
||||||
{id: 'data', title: 'View Data'},
|
{id: 'data', title: 'View Data'},
|
||||||
{id: 'files', title: 'View Files'}
|
{id: 'files', title: 'View Files'}
|
||||||
|
|
Loading…
Reference in a new issue