forked from 0x2620/pandora
merge
This commit is contained in:
commit
01dc04a9fb
18 changed files with 295 additions and 631 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
|
||||
Ox.FilesView = function(options, self) {
|
||||
pandora.ui.filesView = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = Ox.Element({}, self)
|
||||
|
|
@ -55,19 +55,11 @@ Ox.FilesView = function(options, self) {
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
id: 'folder',
|
||||
id: 'path',
|
||||
operator: '+',
|
||||
title: 'Folder',
|
||||
title: 'Path',
|
||||
visible: true,
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
id: 'name',
|
||||
operator: '+',
|
||||
title: 'Name',
|
||||
visible: true,
|
||||
width: 360
|
||||
width: 560
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
|
@ -147,7 +139,7 @@ Ox.FilesView = function(options, self) {
|
|||
}), callback);
|
||||
},
|
||||
scrollbarVisible: true,
|
||||
sort: [{key: 'name', operator: '+'}]
|
||||
sort: [{key: 'path', operator: '+'}]
|
||||
})
|
||||
.bindEvent({
|
||||
open: openFiles,
|
||||
|
|
@ -174,19 +166,11 @@ Ox.FilesView = function(options, self) {
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
id: 'folder',
|
||||
id: 'path',
|
||||
operator: '+',
|
||||
title: 'Folder',
|
||||
title: 'Path',
|
||||
visible: true,
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
id: 'name',
|
||||
operator: '+',
|
||||
title: 'Name',
|
||||
visible: true,
|
||||
width: 360
|
||||
width: 560
|
||||
},
|
||||
],
|
||||
columnsMovable: true,
|
||||
|
|
@ -352,11 +336,19 @@ Ox.FilesView = function(options, self) {
|
|||
});
|
||||
|
||||
function openFiles(data) {
|
||||
//Ox.print('........', JSON.stringify(self.$filesList.value(data.ids[0], 'instances')))
|
||||
data.ids.length == 1 && pandora.api.parsePath({
|
||||
path: self.$filesList.value(data.ids[0], 'path')
|
||||
}, function(result) {
|
||||
['title', 'director', 'year'].forEach(function(key) {
|
||||
if (result.data[key]) {
|
||||
self['$' + key + 'Input'].options({value: result.data[key]});
|
||||
}
|
||||
});
|
||||
updateForm();
|
||||
});
|
||||
}
|
||||
|
||||
function selectFiles(data) {
|
||||
//Ox.print('........', JSON.stringify(self.$filesList.value(data.ids[0], 'instances')))
|
||||
self.selected = data.ids;
|
||||
self.$instancesList.options({
|
||||
items: data.ids.length == 1
|
||||
|
|
@ -146,8 +146,8 @@ pandora.ui.infoView = function(data) {
|
|||
})
|
||||
.html(
|
||||
data.title + (
|
||||
data.original_title && data.original_title != data.title
|
||||
? ' ' + formatLight('(' + data.original_title + ')') : ''
|
||||
data.originalTitle && data.originalTitle != data.title
|
||||
? ' ' + formatLight('(' + data.originalTitle + ')') : ''
|
||||
)
|
||||
)
|
||||
.appendTo($text);
|
||||
|
|
@ -182,11 +182,10 @@ pandora.ui.infoView = function(data) {
|
|||
$div.html(html.join('; '));
|
||||
}
|
||||
|
||||
// fixme: should be camelCase!
|
||||
data.alternative_titles && $('<div>')
|
||||
data.alternativeTitles && $('<div>')
|
||||
.css(css)
|
||||
.html(
|
||||
formatKey('Alternative Titles') + data.alternative_titles.map(function(value) {
|
||||
formatKey('Alternative Titles') + data.alternativeTitles.map(function(value) {
|
||||
return value[0] + (value[1] ? ' '
|
||||
+ formatLight('(' + value[1] + ')') : '');
|
||||
}).join(', ')
|
||||
|
|
@ -225,9 +224,9 @@ pandora.ui.infoView = function(data) {
|
|||
.css(css)
|
||||
.appendTo($text);
|
||||
html = [];
|
||||
['genre', 'keyword'].forEach(function(key) {
|
||||
['genre', 'keywords'].forEach(function(key) {
|
||||
data[key] && html.push(
|
||||
formatKey(key == 'keyword' ? 'keywords' : key)
|
||||
formatKey(key)
|
||||
+ formatValue(data[key], key)
|
||||
);
|
||||
});
|
||||
|
|
@ -272,19 +271,19 @@ pandora.ui.infoView = function(data) {
|
|||
.appendTo($text);
|
||||
});
|
||||
|
||||
data.filming_locations && $('<div>')
|
||||
data.filmingLocations && $('<div>')
|
||||
.css(css)
|
||||
.html(
|
||||
formatKey('Filming Locations') + data.filming_locations.map(function(location) {
|
||||
formatKey('Filming Locations') + data.filmingLocations.map(function(location) {
|
||||
return '<a href="/map/@' + location + '">' + location + '</a>'
|
||||
}).join(', ')
|
||||
)
|
||||
.appendTo($text);
|
||||
|
||||
data.releasedate && $('<div>')
|
||||
data.releaseDate && $('<div>')
|
||||
.css(css)
|
||||
.html(
|
||||
formatKey('Release Date') + Ox.formatDate(data.releasedate, '%A, %B %e, %Y')
|
||||
formatKey('Release Date') + Ox.formatDate(data.releaseDate, '%A, %B %e, %Y')
|
||||
)
|
||||
.appendTo($text);
|
||||
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ pandora.ui.item = function() {
|
|||
|
||||
} else if (pandora.user.ui.itemView == 'files') {
|
||||
pandora.$ui.contentPanel.replaceElement(1,
|
||||
pandora.$ui.item = Ox.FilesView({
|
||||
pandora.$ui.item = pandora.ui.filesView({
|
||||
id: result.data.id
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"js/pandora/URL.js",
|
||||
"js/pandora/autovalidate.js",
|
||||
"js/pandora/utils.js",
|
||||
"js/pandora/ui/Ox.FilesView.js",
|
||||
"js/pandora/ui/filesView.js",
|
||||
"js/pandora/ui/account.js",
|
||||
"js/pandora/ui/appPanel.js",
|
||||
"js/pandora/ui/backButton.js",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue