forked from 0x2620/pandora
cleanup
This commit is contained in:
parent
bafad0a5c7
commit
6e4b902def
4 changed files with 165 additions and 65 deletions
|
@ -19,9 +19,15 @@ pandora.UI = (function() {
|
||||||
that.reset = function() {
|
that.reset = function() {
|
||||||
pandora.api.resetUI({}, function() {
|
pandora.api.resetUI({}, function() {
|
||||||
pandora.user.ui = pandora.site.user.ui;
|
pandora.user.ui = pandora.site.user.ui;
|
||||||
pandora.user.ui._list = pandora.getListState(pandora.user.ui.find);
|
pandora.user.ui._list = pandora.getListState(
|
||||||
pandora.user.ui._filterState = pandora.getFilterState(pandora.user.ui.find);
|
pandora.user.ui.find
|
||||||
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
|
);
|
||||||
|
pandora.user.ui._filterState = pandora.getFilterState(
|
||||||
|
pandora.user.ui.find
|
||||||
|
);
|
||||||
|
pandora.user.ui._findState = pandora.getFindState(
|
||||||
|
pandora.user.ui.find
|
||||||
|
);
|
||||||
Ox.Theme(pandora.user.ui.theme);
|
Ox.Theme(pandora.user.ui.theme);
|
||||||
pandora.$ui.appPanel.reload();
|
pandora.$ui.appPanel.reload();
|
||||||
});
|
});
|
||||||
|
@ -83,8 +89,10 @@ pandora.UI = (function() {
|
||||||
// if find has changed list
|
// if find has changed list
|
||||||
Ox.forEach(listSettings, function(listSetting, setting) {
|
Ox.forEach(listSettings, function(listSetting, setting) {
|
||||||
// then for each setting that corresponds to a list setting
|
// then for each setting that corresponds to a list setting
|
||||||
if (!pandora.user.ui.lists[list]
|
if (
|
||||||
|| Ox.isUndefined(pandora.user.ui.lists[list][listSetting])) {
|
!pandora.user.ui.lists[list]
|
||||||
|
|| Ox.isUndefined(pandora.user.ui.lists[list][listSetting])
|
||||||
|
) {
|
||||||
// either add the default setting
|
// either add the default setting
|
||||||
add[setting] = pandora.site.user.ui[setting];
|
add[setting] = pandora.site.user.ui[setting];
|
||||||
} else {
|
} else {
|
||||||
|
@ -107,7 +115,9 @@ pandora.UI = (function() {
|
||||||
// when switching to a clip view, clear list selection
|
// when switching to a clip view, clear list selection
|
||||||
// (but don't trigger an additional event)
|
// (but don't trigger an additional event)
|
||||||
add.listSelection = [];
|
add.listSelection = [];
|
||||||
} else if (['text', 'position'].indexOf(pandora.user.ui.listSort[0].key) > -1) {
|
} else if (['text', 'position'].indexOf(
|
||||||
|
pandora.user.ui.listSort[0].key
|
||||||
|
) > -1) {
|
||||||
// when switching to a non-clip view, with a sort key
|
// when switching to a non-clip view, with a sort key
|
||||||
// that only exists in clip view, reset sort to default
|
// that only exists in clip view, reset sort to default
|
||||||
args.listSort = pandora.site.user.ui.listSort;
|
args.listSort = pandora.site.user.ui.listSort;
|
||||||
|
@ -149,19 +159,26 @@ pandora.UI = (function() {
|
||||||
add['lists.' + that.encode(list) + '.selection'] = [args.item];
|
add['lists.' + that.encode(list) + '.selection'] = [args.item];
|
||||||
if (
|
if (
|
||||||
!args.itemView
|
!args.itemView
|
||||||
&& ['timeline', 'player', 'editor'].indexOf(pandora.user.ui.itemView) > -1
|
&& ['timeline', 'player', 'editor'].indexOf(
|
||||||
|
pandora.user.ui.itemView
|
||||||
|
) > -1
|
||||||
&& !pandora.user.ui.videoPoints[item]
|
&& !pandora.user.ui.videoPoints[item]
|
||||||
&& !args['videoPoints.' + item]
|
&& !args['videoPoints.' + item]
|
||||||
) {
|
) {
|
||||||
// if the item view doesn't change, remains a video view,
|
// if the item view doesn't change, remains a video view,
|
||||||
// video points don't exist yet, and won't be set,
|
// video points don't exist yet, and won't be set,
|
||||||
// add default video points
|
// add default video points
|
||||||
add['videoPoints.' + item] = {annotation: '', 'in': 0, out: 0, position: 0};
|
add['videoPoints.' + item] = {
|
||||||
|
annotation: '',
|
||||||
|
'in': 0,
|
||||||
|
out: 0,
|
||||||
|
position: 0
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (
|
if (args['videoPoints.' + item] && (
|
||||||
args['videoPoints.' + item]
|
!pandora.user.ui.item
|
||||||
&& (!pandora.user.ui.item || pandora.user.ui.itemView != 'editor')
|
|| pandora.user.ui.itemView != 'editor'
|
||||||
) {
|
)) {
|
||||||
pandora._dontSelectResult = true;
|
pandora._dontSelectResult = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +192,12 @@ pandora.UI = (function() {
|
||||||
) {
|
) {
|
||||||
// if video points don't exist yet, and won't be set,
|
// if video points don't exist yet, and won't be set,
|
||||||
// add default video points
|
// add default video points
|
||||||
add['videoPoints.' + item] = {annotation: '', 'in': 0, out: 0, position: 0};
|
add['videoPoints.' + item] = {
|
||||||
|
annotation: '',
|
||||||
|
'in': 0,
|
||||||
|
out: 0,
|
||||||
|
position: 0
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,10 +210,9 @@ pandora.UI = (function() {
|
||||||
Ox.forEach(editSettings, function(value, key) {
|
Ox.forEach(editSettings, function(value, key) {
|
||||||
var editsKey = 'edits.' + that.encode(args.edit) + '.' + key;
|
var editsKey = 'edits.' + that.encode(args.edit) + '.' + key;
|
||||||
add[editsKey] = editsKey in args ? args[editsKey]
|
add[editsKey] = editsKey in args ? args[editsKey]
|
||||||
: (
|
: (pandora.user.ui.edits[args.edit] && !Ox.isUndefined(
|
||||||
pandora.user.ui.edits[args.edit]
|
pandora.user.ui.edits[args.edit][key]
|
||||||
&& !Ox.isUndefined(pandora.user.ui.edits[args.edit][key])
|
)) ? pandora.user.ui.edits[args.edit][key]
|
||||||
) ? pandora.user.ui.edits[args.edit][key]
|
|
||||||
: value;
|
: value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -201,7 +222,9 @@ pandora.UI = (function() {
|
||||||
editSort: 'sort',
|
editSort: 'sort',
|
||||||
editView: 'view'
|
editView: 'view'
|
||||||
}, function(editSetting, setting) {
|
}, function(editSetting, setting) {
|
||||||
var key = 'edits.' + that.encode(args.edit || pandora.user.ui.edit) + '.' + editSetting;
|
var key = 'edits.' + that.encode(
|
||||||
|
args.edit || pandora.user.ui.edit
|
||||||
|
) + '.' + editSetting;
|
||||||
if (setting in args) {
|
if (setting in args) {
|
||||||
// add local edit setting
|
// add local edit setting
|
||||||
add[key] = args[setting];
|
add[key] = args[setting];
|
||||||
|
@ -220,10 +243,9 @@ pandora.UI = (function() {
|
||||||
textsSubKey = textsKey + '.' + key;
|
textsSubKey = textsKey + '.' + key;
|
||||||
return textsKey in args && key in args[textsKey] ? args[textsKey][key]
|
return textsKey in args && key in args[textsKey] ? args[textsKey][key]
|
||||||
: textsSubKey in args ? args[textSubKey]
|
: textsSubKey in args ? args[textSubKey]
|
||||||
: (
|
: (pandora.user.ui.texts[args.text] && !Ox.isUndefined(
|
||||||
pandora.user.ui.texts[args.text]
|
pandora.user.ui.texts[args.text][key]
|
||||||
&& !Ox.isUndefined(pandora.user.ui.texts[args.text][key])
|
)) ? pandora.user.ui.texts[args.text][key]
|
||||||
) ? pandora.user.ui.texts[args.text][key]
|
|
||||||
: value;
|
: value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,9 @@ pandora.URL = (function() {
|
||||||
if (pandora.user.ui.page) {
|
if (pandora.user.ui.page) {
|
||||||
|
|
||||||
state.page = pandora.user.ui.page;
|
state.page = pandora.user.ui.page;
|
||||||
if (Ox.contains(Object.keys(pandora.site.user.ui.part), state.page)) {
|
if (
|
||||||
|
Ox.contains(Object.keys(pandora.site.user.ui.part), state.page)
|
||||||
|
) {
|
||||||
state.part = pandora.user.ui.part[state.page];
|
state.part = pandora.user.ui.part[state.page];
|
||||||
if (
|
if (
|
||||||
state.page == 'documents'
|
state.page == 'documents'
|
||||||
|
@ -50,7 +52,9 @@ pandora.URL = (function() {
|
||||||
: '';
|
: '';
|
||||||
} else if (state.view == 'calendar') {
|
} else if (state.view == 'calendar') {
|
||||||
// ...
|
// ...
|
||||||
} 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 || [].concat(
|
state.span = videoPoints.annotation || [].concat(
|
||||||
videoPoints.position
|
videoPoints.position
|
||||||
|
@ -139,7 +143,9 @@ pandora.URL = (function() {
|
||||||
if (state.page) {
|
if (state.page) {
|
||||||
|
|
||||||
set.page = state.page;
|
set.page = state.page;
|
||||||
if (Ox.contains(Object.keys(pandora.site.user.ui.part), state.page) && state.part) {
|
if (Ox.contains(
|
||||||
|
Object.keys(pandora.site.user.ui.part), state.page
|
||||||
|
) && state.part) {
|
||||||
set['part.' + state.page] = state.part;
|
set['part.' + state.page] = state.part;
|
||||||
}
|
}
|
||||||
if (state.span) {
|
if (state.span) {
|
||||||
|
@ -153,7 +159,8 @@ pandora.URL = (function() {
|
||||||
set.page = '';
|
set.page = '';
|
||||||
|
|
||||||
if (state.type) {
|
if (state.type) {
|
||||||
set.section = state.type == pandora.site.itemsSection ? 'items' : state.type
|
set.section = state.type == pandora.site.itemsSection
|
||||||
|
? 'items' : state.type
|
||||||
set[set.section.slice(0, -1)] = state.item;
|
set[set.section.slice(0, -1)] = state.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +183,9 @@ pandora.URL = (function() {
|
||||||
position: state.span[0]
|
position: state.span[0]
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
set['videoPoints.' + state.item + '.annotation'] = state.span;
|
set[
|
||||||
|
'videoPoints.' + state.item + '.annotation'
|
||||||
|
] = state.span;
|
||||||
}
|
}
|
||||||
} else if (state.view == 'map') {
|
} else if (state.view == 'map') {
|
||||||
// fixme: this doesn't handle map coordinates
|
// fixme: this doesn't handle map coordinates
|
||||||
|
@ -189,7 +198,10 @@ pandora.URL = (function() {
|
||||||
}
|
}
|
||||||
} else if (state.view == 'calendar') {
|
} else if (state.view == 'calendar') {
|
||||||
// fixme: this is still very much unclear
|
// fixme: this is still very much unclear
|
||||||
if (state.span.length == 1 && /^\d/.test(state.span)) {
|
if (
|
||||||
|
state.span.length == 1
|
||||||
|
&& /^\d/.test(state.span)
|
||||||
|
) {
|
||||||
set.calendarFind = state.span[0];
|
set.calendarFind = state.span[0];
|
||||||
} else if (state.span.length == 2) {
|
} else if (state.span.length == 2) {
|
||||||
set.calendarFind = state.span[0];
|
set.calendarFind = state.span[0];
|
||||||
|
@ -474,7 +486,9 @@ pandora.URL = (function() {
|
||||||
callback = arguments[0];
|
callback = arguments[0];
|
||||||
url = null;
|
url = null;
|
||||||
if (document.location.pathname.slice(0, 4) == 'url=') {
|
if (document.location.pathname.slice(0, 4) == 'url=') {
|
||||||
document.location.href = Ox.decodeURI(document.location.pathname.slice(4));
|
document.location.href = Ox.decodeURI(
|
||||||
|
document.location.pathname.slice(4)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
self.URL.parse(function(state) {
|
self.URL.parse(function(state) {
|
||||||
// setState -> UI.set -> URL.update
|
// setState -> UI.set -> URL.update
|
||||||
|
@ -532,7 +546,9 @@ pandora.URL = (function() {
|
||||||
: ['item', 'itemView', 'itemSort'];
|
: ['item', 'itemView', 'itemSort'];
|
||||||
} else {
|
} else {
|
||||||
if (keys.some(function(key) {
|
if (keys.some(function(key) {
|
||||||
return Ox.contains(['itemSort', 'itemView', 'listSort', 'listView'], key);
|
return Ox.contains(
|
||||||
|
['itemSort', 'itemView', 'listSort', 'listView'], key
|
||||||
|
);
|
||||||
})) {
|
})) {
|
||||||
self.URL.options(getOptions());
|
self.URL.options(getOptions());
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ pandora.ui.licenseDialog = function() {
|
||||||
open: function() {
|
open: function() {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.enableButton('close');
|
that.enableButton('close');
|
||||||
}, 15000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1743,7 +1743,9 @@ pandora.getSpan = function(state, val, callback) {
|
||||||
} else {
|
} else {
|
||||||
isName = val[0] == '@';
|
isName = val[0] == '@';
|
||||||
isVideoView = pandora.isVideoView(state.view, state.item);
|
isVideoView = pandora.isVideoView(state.view, state.item);
|
||||||
canBeAnnotation = state.item && (!state.view || isVideoView) && !isName;
|
canBeAnnotation = state.item
|
||||||
|
&& (!state.view || isVideoView)
|
||||||
|
&& !isName;
|
||||||
canBeEvent = !state.view || state.view == 'calendar';
|
canBeEvent = !state.view || state.view == 'calendar';
|
||||||
canBePlace = !state.view || state.view == 'map';
|
canBePlace = !state.view || state.view == 'map';
|
||||||
val = isName ? val.slice(1) : val;
|
val = isName ? val.slice(1) : val;
|
||||||
|
@ -1828,7 +1830,8 @@ pandora.getSpan = function(state, val, callback) {
|
||||||
query: {
|
query: {
|
||||||
conditions: [{
|
conditions: [{
|
||||||
key: isName ? 'name' : 'id',
|
key: isName ? 'name' : 'id',
|
||||||
value: type != 'annotation' ? val : state.item + '/' + val,
|
value: type != 'annotation'
|
||||||
|
? val : state.item + '/' + val,
|
||||||
operator: '=='
|
operator: '=='
|
||||||
}],
|
}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
|
@ -1837,7 +1840,11 @@ pandora.getSpan = function(state, val, callback) {
|
||||||
range: [0, 1]
|
range: [0, 1]
|
||||||
}, state.item && type != 'annotation' ? {
|
}, state.item && type != 'annotation' ? {
|
||||||
itemQuery: {
|
itemQuery: {
|
||||||
conditions: [{key: 'id', value: state.item, operator: '=='}],
|
conditions: [{
|
||||||
|
key: 'id',
|
||||||
|
value: state.item,
|
||||||
|
operator: '=='
|
||||||
|
}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
}
|
}
|
||||||
} : {}), function(result) {
|
} : {}), function(result) {
|
||||||
|
@ -1941,12 +1948,14 @@ pandora.getVideoOptions = function(data) {
|
||||||
options.subtitlesLayer && data.layers[options.subtitlesLayer].length
|
options.subtitlesLayer && data.layers[options.subtitlesLayer].length
|
||||||
? data.layers[options.subtitlesLayer].map(function(subtitle, i) {
|
? data.layers[options.subtitlesLayer].map(function(subtitle, i) {
|
||||||
return {
|
return {
|
||||||
'in': i == 0 ? 0 : data.layers[options.subtitlesLayer][i - 1].out,
|
'in': i == 0 ? 0
|
||||||
|
: data.layers[options.subtitlesLayer][i - 1].out,
|
||||||
out: subtitle['in']
|
out: subtitle['in']
|
||||||
};
|
};
|
||||||
}).concat(
|
}).concat([{
|
||||||
[{'in': Ox.last(data.layers[options.subtitlesLayer]).out, out: data.duration}]
|
'in': Ox.last(data.layers[options.subtitlesLayer]).out,
|
||||||
).filter(function(censored) {
|
out: data.duration
|
||||||
|
}]).filter(function(censored) {
|
||||||
// don't include gaps shorter than one second
|
// don't include gaps shorter than one second
|
||||||
return censored.out - censored['in'] >= 1;
|
return censored.out - censored['in'] >= 1;
|
||||||
})
|
})
|
||||||
|
@ -1968,7 +1977,9 @@ pandora.getVideoOptions = function(data) {
|
||||||
index: i,
|
index: i,
|
||||||
track: Ox.getLanguageNameByCode(track),
|
track: Ox.getLanguageNameByCode(track),
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
src: pandora.getVideoURL(data.item || pandora.user.ui.item, resolution, i + 1, track)
|
src: pandora.getVideoURL(
|
||||||
|
data.item || pandora.user.ui.item, resolution, i + 1, track
|
||||||
|
)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1978,7 +1989,9 @@ pandora.getVideoOptions = function(data) {
|
||||||
duration: data.durations[i],
|
duration: data.durations[i],
|
||||||
index: i,
|
index: i,
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
src: pandora.getVideoURL(data.item || pandora.user.ui.item, resolution, i + 1)
|
src: pandora.getVideoURL(
|
||||||
|
data.item || pandora.user.ui.item, resolution, i + 1
|
||||||
|
)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2148,13 +2161,13 @@ pandora.openLicenseDialog = function() {
|
||||||
close: function() {
|
close: function() {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
!pandora.isLicensed() && pandora.openLicenseDialog();
|
!pandora.isLicensed() && pandora.openLicenseDialog();
|
||||||
}, 300000); // 5 minutes
|
}, 60000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
!pandora.isLicensed() && pandora.openLicenseDialog();
|
!pandora.isLicensed() && pandora.openLicenseDialog();
|
||||||
}, 60000); // 1 minute
|
}, 60000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2208,8 +2221,11 @@ pandora.reloadList = function() {
|
||||||
init: function(data) {
|
init: function(data) {
|
||||||
// fixme: this will not work for lists in the favorites folder
|
// fixme: this will not work for lists in the favorites folder
|
||||||
// (but then it's also unlikely they'll have to be reloaded)
|
// (but then it's also unlikely they'll have to be reloaded)
|
||||||
var folder = listData.status != 'featured' ? 'personal' : 'featured';
|
var folder = listData.status != 'featured'
|
||||||
pandora.$ui.folderList[folder].value(listData.id, 'items', data.items);
|
? 'personal' : 'featured';
|
||||||
|
pandora.$ui.folderList[folder].value(
|
||||||
|
listData.id, 'items', data.items
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.bindEventOnce({
|
.bindEventOnce({
|
||||||
|
@ -2231,7 +2247,11 @@ pandora.renameList = function(oldId, newId, newName, folder) {
|
||||||
// fixme: ugly
|
// fixme: ugly
|
||||||
// ... does this always coincide with triggerEvents = false, as below?
|
// ... does this always coincide with triggerEvents = false, as below?
|
||||||
pandora.replaceURL = true;
|
pandora.replaceURL = true;
|
||||||
pandora.UI.set('lists.' + pandora.UI.encode(newId), pandora.user.ui.lists[oldId], false);
|
pandora.UI.set(
|
||||||
|
'lists.' + pandora.UI.encode(newId),
|
||||||
|
pandora.user.ui.lists[oldId],
|
||||||
|
false
|
||||||
|
);
|
||||||
pandora.UI.set({
|
pandora.UI.set({
|
||||||
find: {
|
find: {
|
||||||
conditions: [{key: 'list', value: newId, operator: '=='}],
|
conditions: [{key: 'list', value: newId, operator: '=='}],
|
||||||
|
@ -2241,10 +2261,17 @@ pandora.renameList = function(oldId, newId, newName, folder) {
|
||||||
pandora.UI.set('lists.' + pandora.UI.encode(oldId), null, false);
|
pandora.UI.set('lists.' + pandora.UI.encode(oldId), null, false);
|
||||||
} else {
|
} else {
|
||||||
pandora.replaceURL = true;
|
pandora.replaceURL = true;
|
||||||
pandora.UI.set(pandora.user.ui.section + '.' + pandora.UI.encode(newId),
|
pandora.UI.set(
|
||||||
pandora.user.ui[pandora.user.ui.section][oldId], false);
|
pandora.user.ui.section + '.' + pandora.UI.encode(newId),
|
||||||
|
pandora.user.ui[pandora.user.ui.section][oldId],
|
||||||
|
false
|
||||||
|
);
|
||||||
pandora.UI.set(pandora.user.ui.section.slice(0, -1), newId);
|
pandora.UI.set(pandora.user.ui.section.slice(0, -1), newId);
|
||||||
pandora.UI.set(pandora.user.ui.section + '.' + pandora.UI.encode(oldId), null, false);
|
pandora.UI.set(
|
||||||
|
pandora.user.ui.section + '.' + pandora.UI.encode(oldId),
|
||||||
|
null,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2257,9 +2284,14 @@ pandora.resizeFilters = function(width) {
|
||||||
.size(0, pandora.user.ui.filterSizes[1])
|
.size(0, pandora.user.ui.filterSizes[1])
|
||||||
.size(2, pandora.user.ui.filterSizes[3]);
|
.size(2, pandora.user.ui.filterSizes[3]);
|
||||||
pandora.$ui.filters && pandora.$ui.filters.forEach(function($list, i) {
|
pandora.$ui.filters && pandora.$ui.filters.forEach(function($list, i) {
|
||||||
$list.resizeColumn('name', pandora.user.ui.filterSizes[i] - 44 - Ox.UI.SCROLLBAR_SIZE);
|
$list.resizeColumn(
|
||||||
|
'name',
|
||||||
|
pandora.user.ui.filterSizes[i] - 44 - Ox.UI.SCROLLBAR_SIZE
|
||||||
|
);
|
||||||
if (pandora.site.flags) {
|
if (pandora.site.flags) {
|
||||||
$list.find('.flagname').css({width: pandora.user.ui.filterSizes[i] - 68 - Ox.UI.SCROLLBAR_SIZE})
|
$list.find('.flagname').css({
|
||||||
|
width: pandora.user.ui.filterSizes[i] - 68 - Ox.UI.SCROLLBAR_SIZE
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -2277,9 +2309,14 @@ pandora.resizeFolders = function(section) {
|
||||||
) - 8);
|
) - 8);
|
||||||
Ox.forEach(pandora.$ui.folderList, function($list, id) {
|
Ox.forEach(pandora.$ui.folderList, function($list, id) {
|
||||||
var pos = Ox.getIndexById(pandora.site.sectionFolders[section], id);
|
var pos = Ox.getIndexById(pandora.site.sectionFolders[section], id);
|
||||||
pandora.$ui.folder[pos] && pandora.$ui.folder[pos].css({width: width + 'px'});
|
pandora.$ui.folder[pos] && pandora.$ui.folder[pos].css({
|
||||||
|
width: width + 'px'
|
||||||
|
});
|
||||||
$list.css({width: width + 'px'});
|
$list.css({width: width + 'px'});
|
||||||
if (pandora.site.sectionFolders[section][pos] && pandora.site.sectionFolders[section][pos].showBrowser) {
|
if (
|
||||||
|
pandora.site.sectionFolders[section][pos]
|
||||||
|
&& pandora.site.sectionFolders[section][pos].showBrowser
|
||||||
|
) {
|
||||||
pandora.$ui.findListsInput[id] && pandora.$ui.findListsInput[id].options({
|
pandora.$ui.findListsInput[id] && pandora.$ui.findListsInput[id].options({
|
||||||
width: width - 24
|
width: width - 24
|
||||||
});
|
});
|
||||||
|
@ -2288,7 +2325,10 @@ pandora.resizeFolders = function(section) {
|
||||||
} else {
|
} else {
|
||||||
$list.resizeColumn(id == 'favorite' ? 'id' : 'name', columnWidth);
|
$list.resizeColumn(id == 'favorite' ? 'id' : 'name', columnWidth);
|
||||||
}
|
}
|
||||||
if (pandora.$ui.folder[pos] && !pandora.user.ui.showFolder[section][id]) {
|
if (
|
||||||
|
pandora.$ui.folder[pos]
|
||||||
|
&& !pandora.user.ui.showFolder[section][id]
|
||||||
|
) {
|
||||||
pandora.$ui.folder[pos].updatePanel();
|
pandora.$ui.folder[pos].updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2305,14 +2345,18 @@ pandora.resizeWindow = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// FIXME: a lot of this throws errors on load
|
// FIXME: a lot of this throws errors on load
|
||||||
pandora.$ui.leftPanel && pandora.$ui.leftPanel.size(2, pandora.getInfoHeight(true));
|
pandora.$ui.leftPanel && pandora.$ui.leftPanel.size(
|
||||||
|
2, pandora.getInfoHeight(true)
|
||||||
|
);
|
||||||
pandora.resizeFolders();
|
pandora.resizeFolders();
|
||||||
if (pandora.user.ui.section == 'items') {
|
if (pandora.user.ui.section == 'items') {
|
||||||
if (!pandora.user.ui.item) {
|
if (!pandora.user.ui.item) {
|
||||||
pandora.resizeFilters(pandora.$ui.rightPanel.width());
|
pandora.resizeFilters(pandora.$ui.rightPanel.width());
|
||||||
if (pandora.user.ui.listView == 'clips') {
|
if (pandora.user.ui.listView == 'clips') {
|
||||||
var clipsItems = pandora.getClipsItems(),
|
var clipsItems = pandora.getClipsItems(),
|
||||||
previousClipsItems = pandora.getClipsItems(pandora.$ui.list.options('width'));
|
previousClipsItems = pandora.getClipsItems(
|
||||||
|
pandora.$ui.list.options('width')
|
||||||
|
);
|
||||||
pandora.$ui.list.options({
|
pandora.$ui.list.options({
|
||||||
width: window.innerWidth
|
width: window.innerWidth
|
||||||
- pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 1
|
- pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 1
|
||||||
|
@ -2345,19 +2389,22 @@ pandora.resizeWindow = function() {
|
||||||
pandora.$ui.timeline && pandora.$ui.timeline.options({
|
pandora.$ui.timeline && pandora.$ui.timeline.options({
|
||||||
// fixme: duplicated
|
// fixme: duplicated
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width()
|
||||||
|
- pandora.$ui.mainPanel.size(0) - 1
|
||||||
});
|
});
|
||||||
} else if (pandora.user.ui.itemView == 'player') {
|
} else if (pandora.user.ui.itemView == 'player') {
|
||||||
pandora.$ui.player && pandora.$ui.player.options({
|
pandora.$ui.player && pandora.$ui.player.options({
|
||||||
// fixme: duplicated
|
// fixme: duplicated
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width()
|
||||||
|
- pandora.$ui.mainPanel.size(0) - 1
|
||||||
});
|
});
|
||||||
} else if (pandora.user.ui.itemView == 'editor') {
|
} else if (pandora.user.ui.itemView == 'editor') {
|
||||||
pandora.$ui.editor && pandora.$ui.editor.options({
|
pandora.$ui.editor && pandora.$ui.editor.options({
|
||||||
// fixme: duplicated
|
// fixme: duplicated
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width()
|
||||||
|
- pandora.$ui.mainPanel.size(0) - 1
|
||||||
});
|
});
|
||||||
} else if (pandora.user.ui.itemView == 'map') {
|
} else if (pandora.user.ui.itemView == 'map') {
|
||||||
pandora.$ui.map.resizeMap();
|
pandora.$ui.map.resizeMap();
|
||||||
|
@ -2371,7 +2418,8 @@ pandora.resizeWindow = function() {
|
||||||
} else {
|
} else {
|
||||||
pandora.$ui.editPanel && pandora.$ui.editPanel.options({
|
pandora.$ui.editPanel && pandora.$ui.editPanel.options({
|
||||||
height: pandora.$ui.appPanel.size(1),
|
height: pandora.$ui.appPanel.size(1),
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width()
|
||||||
|
- pandora.$ui.mainPanel.size(0) - 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (pandora.user.ui.section == 'texts') {
|
} else if (pandora.user.ui.section == 'texts') {
|
||||||
|
@ -2385,7 +2433,11 @@ pandora.selectList = function() {
|
||||||
pandora.api.findLists({
|
pandora.api.findLists({
|
||||||
keys: ['status', 'user'],
|
keys: ['status', 'user'],
|
||||||
query: {
|
query: {
|
||||||
conditions: [{key: 'id', value: pandora.user.ui._list, operator: '=='}],
|
conditions: [{
|
||||||
|
key: 'id',
|
||||||
|
operator: '==',
|
||||||
|
value: pandora.user.ui._list
|
||||||
|
}],
|
||||||
operator: ''
|
operator: ''
|
||||||
},
|
},
|
||||||
range: [0, 1]
|
range: [0, 1]
|
||||||
|
@ -2394,11 +2446,15 @@ pandora.selectList = function() {
|
||||||
if (result.data.items.length) {
|
if (result.data.items.length) {
|
||||||
list = result.data.items[0];
|
list = result.data.items[0];
|
||||||
folder = list.status == 'featured' ? 'featured' : (
|
folder = list.status == 'featured' ? 'featured' : (
|
||||||
list.user == pandora.user.username ? 'personal' : 'favorite'
|
list.user == pandora.user.username
|
||||||
|
? 'personal' : 'favorite'
|
||||||
);
|
);
|
||||||
pandora.$ui.folderList[folder]
|
pandora.$ui.folderList[folder]
|
||||||
.options({selected: [pandora.user.ui._list]});
|
.options({selected: [pandora.user.ui._list]});
|
||||||
if (!pandora.hasDialogOrScreen() && !Ox.Focus.focusedElementIsInput()) {
|
if (
|
||||||
|
!pandora.hasDialogOrScreen()
|
||||||
|
&& !Ox.Focus.focusedElementIsInput()
|
||||||
|
) {
|
||||||
pandora.$ui.folderList[folder].gainFocus();
|
pandora.$ui.folderList[folder].gainFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2408,11 +2464,15 @@ pandora.selectList = function() {
|
||||||
var id = pandora.user.ui[pandora.user.ui.section.slice(0,-1)],
|
var id = pandora.user.ui[pandora.user.ui.section.slice(0,-1)],
|
||||||
section = Ox.toTitleCase(pandora.user.ui.section.slice(0, -1));
|
section = Ox.toTitleCase(pandora.user.ui.section.slice(0, -1));
|
||||||
if (id) {
|
if (id) {
|
||||||
pandora.api['get' + section]({id: id, keys: ['id', 'status', 'user']}, function(result) {
|
pandora.api['get' + section]({
|
||||||
|
id: id,
|
||||||
|
keys: ['id', 'status', 'user']
|
||||||
|
}, function(result) {
|
||||||
var folder;
|
var folder;
|
||||||
if (result.data.id) {
|
if (result.data.id) {
|
||||||
folder = result.data.status == 'featured' ? 'featured' : (
|
folder = result.data.status == 'featured' ? 'featured' : (
|
||||||
result.data.user == pandora.user.username ? 'personal' : 'favorite'
|
result.data.user == pandora.user.username
|
||||||
|
? 'personal' : 'favorite'
|
||||||
);
|
);
|
||||||
pandora.$ui.folderList[folder].options({selected: [id]});
|
pandora.$ui.folderList[folder].options({selected: [id]});
|
||||||
}
|
}
|
||||||
|
@ -2573,7 +2633,9 @@ pandora.wait = function(taskId, callback, timeout) {
|
||||||
var indices = Ox.indicesOf(conditions, function(condition) {
|
var indices = Ox.indicesOf(conditions, function(condition) {
|
||||||
return (
|
return (
|
||||||
condition.conditions
|
condition.conditions
|
||||||
? includeSubconditions && everyCondition(condition.conditions, key, operator)
|
? includeSubconditions && everyCondition(
|
||||||
|
condition.conditions, key, operator
|
||||||
|
)
|
||||||
: condition.key == key && condition.operator == operator
|
: condition.key == key && condition.operator == operator
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue