remove clearIconCache and clearListIconCache, append modified to more icon/poster urls, localize more strings
This commit is contained in:
parent
b1d326c6dd
commit
d215c0fad0
9 changed files with 26 additions and 47 deletions
|
@ -344,7 +344,7 @@ pandora.ui.accountSignoutDialog = function() {
|
||||||
.append(
|
.append(
|
||||||
$('<div>')
|
$('<div>')
|
||||||
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
|
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
|
||||||
.html('Are you sure you want to sign out?')
|
.html(Ox._('Are you sure you want to sign out?'))
|
||||||
),
|
),
|
||||||
fixedSize: true,
|
fixedSize: true,
|
||||||
height: 128,
|
height: 128,
|
||||||
|
|
|
@ -113,15 +113,15 @@ pandora.ui.apiDialog = function() {
|
||||||
|
|
||||||
function getIndex() {
|
function getIndex() {
|
||||||
var $index = Ox.Element()
|
var $index = Ox.Element()
|
||||||
.html(
|
.html(Ox._(
|
||||||
'<h1><b>API Documentation</b></h1>\n'
|
'<h1><b>API Documentation</b></h1>\n'
|
||||||
+ '<p><b>' + pandora.site.site.name + '</b> uses a JSON API'
|
+ '<p><b>{0}</b> uses a JSON API'
|
||||||
+ ' to communicate between the browser and the server.'
|
+ ' to communicate between the browser and the server.'
|
||||||
+ ' This API is 100% public, which means that there is'
|
+ ' This API is 100% public, which means that there is'
|
||||||
+ ' virtually no limit to what you can do with the site,'
|
+ ' virtually no limit to what you can do with the site,'
|
||||||
+ ' or build on top of it — from writing simple scripts'
|
+ ' or build on top of it — from writing simple scripts'
|
||||||
+ ' to read or write specific information to including'
|
+ ' to read or write specific information to including'
|
||||||
+ ' data from <b>' + pandora.site.site.name + '</b>'
|
+ ' data from <b>{0}</b>'
|
||||||
+ ' (not just videos, but also metadata, annotations, lists,'
|
+ ' (not just videos, but also metadata, annotations, lists,'
|
||||||
+ ' or a custom search interface) in your own website.</p>\n'
|
+ ' or a custom search interface) in your own website.</p>\n'
|
||||||
+ '<p>If you are using the API in JavaScript, you may want to'
|
+ '<p>If you are using the API in JavaScript, you may want to'
|
||||||
|
@ -137,7 +137,7 @@ pandora.ui.apiDialog = function() {
|
||||||
+ ' start with "X" (sorted by duration, then title, both'
|
+ ' start with "X" (sorted by duration, then title, both'
|
||||||
+ ' in ascending order), it will return their duration,'
|
+ ' in ascending order), it will return their duration,'
|
||||||
+ ' id and title properties.'
|
+ ' id and title properties.'
|
||||||
)
|
[pandora.site.site.name]))
|
||||||
.append(
|
.append(
|
||||||
Ox.SyntaxHighlighter({
|
Ox.SyntaxHighlighter({
|
||||||
source: "pandora.api.find({\n"
|
source: "pandora.api.find({\n"
|
||||||
|
|
|
@ -17,7 +17,7 @@ pandora.ui.folderList = function(id) {
|
||||||
},
|
},
|
||||||
format: function(value, data) {
|
format: function(value, data) {
|
||||||
return $('<img>').attr({
|
return $('<img>').attr({
|
||||||
src: '/' + folderItem.toLowerCase() + '/' + data.id + '/icon.jpg'
|
src: '/' + folderItem.toLowerCase() + '/' + data.id + '/icon.jpg?' + data.modified
|
||||||
}).css({
|
}).css({
|
||||||
width: '14px',
|
width: '14px',
|
||||||
height: '14px',
|
height: '14px',
|
||||||
|
@ -253,7 +253,7 @@ pandora.ui.folderList = function(id) {
|
||||||
that = Ox.TableList({
|
that = Ox.TableList({
|
||||||
columns: columns,
|
columns: columns,
|
||||||
items: items,
|
items: items,
|
||||||
keys: ui.section == 'items' ? ['query'] : ['rightslevel'],
|
keys: ['modified'].concat(ui.section == 'items' ? ['query'] : ['rightslevel']),
|
||||||
max: 1,
|
max: 1,
|
||||||
min: 0,
|
min: 0,
|
||||||
pageLength: 1000,
|
pageLength: 1000,
|
||||||
|
|
|
@ -76,7 +76,7 @@ pandora.ui.info = function() {
|
||||||
that.append(pandora.$ui.listInfo = pandora.ui.listInfo());
|
that.append(pandora.$ui.listInfo = pandora.ui.listInfo());
|
||||||
previousView == 'video' && resizeInfo();
|
previousView == 'video' && resizeInfo();
|
||||||
} else if (view == 'poster') {
|
} else if (view == 'poster') {
|
||||||
pandora.api.get({id: id, keys: ['director', 'posterRatio', 'title']}, function(result) {
|
pandora.api.get({id: id, keys: ['director', 'modified', 'posterRatio', 'title']}, function(result) {
|
||||||
var ratio = result.data.posterRatio,
|
var ratio = result.data.posterRatio,
|
||||||
height = pandora.getInfoHeight(true);
|
height = pandora.getInfoHeight(true);
|
||||||
emptyInfo();
|
emptyInfo();
|
||||||
|
@ -299,7 +299,7 @@ pandora.ui.listInfo = function() {
|
||||||
that.append(
|
that.append(
|
||||||
$('<div>')
|
$('<div>')
|
||||||
.css({paddingTop: '16px'})
|
.css({paddingTop: '16px'})
|
||||||
.html(folderItem + ' not found')
|
.html(Ox._('{0} not found', [Ox._(folderItem)]))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -308,8 +308,8 @@ pandora.ui.listInfo = function() {
|
||||||
$('<div>')
|
$('<div>')
|
||||||
.css({fontWeight: 'bold'})
|
.css({fontWeight: 'bold'})
|
||||||
.html(ui.section == 'items'
|
.html(ui.section == 'items'
|
||||||
? 'All ' + pandora.site.itemName.plural
|
? Ox._('All {0}', [Ox._(pandora.site.itemName.plural)])
|
||||||
: pandora.site.site.name + ' ' + folderItems
|
: Ox._('{} ' + folderItems, [pandora.site.site.name])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ pandora.ui.listInfo = function() {
|
||||||
|
|
||||||
pandora.ui.posterInfo = function(data) {
|
pandora.ui.posterInfo = function(data) {
|
||||||
var $poster = $('<img>')
|
var $poster = $('<img>')
|
||||||
.attr({src: '/' + data.id + '/poster512.jpg'})
|
.attr({src: '/' + data.id + '/poster512.jpg' + data.modified})
|
||||||
.css(getPosterCSS()),
|
.css(getPosterCSS()),
|
||||||
$text = $('<div>')
|
$text = $('<div>')
|
||||||
.css({
|
.css({
|
||||||
|
|
|
@ -863,7 +863,6 @@ pandora.ui.infoView = function(data) {
|
||||||
position: selectedImage.index
|
position: selectedImage.index
|
||||||
}), function() {
|
}), function() {
|
||||||
var src;
|
var src;
|
||||||
pandora.clearIconCache(data.id);
|
|
||||||
Ox.Request.clearCache();
|
Ox.Request.clearCache();
|
||||||
if (ui.icons == 'frames') {
|
if (ui.icons == 'frames') {
|
||||||
src = '/' + data.id + '/icon512.jpg?' + Ox.uid();
|
src = '/' + data.id + '/icon512.jpg?' + Ox.uid();
|
||||||
|
|
|
@ -487,7 +487,6 @@ pandora.ui.infoView = function(data) {
|
||||||
pandora.updateItemContext();
|
pandora.updateItemContext();
|
||||||
pandora.$ui.browser.value(result.data.id, key, result.data[key]);
|
pandora.$ui.browser.value(result.data.id, key, result.data[key]);
|
||||||
if (Ox.contains(['title', 'director', 'year'], key)) {
|
if (Ox.contains(['title', 'director', 'year'], key)) {
|
||||||
pandora.clearIconCache(data.id);
|
|
||||||
if (ui.icons == 'posters') {
|
if (ui.icons == 'posters') {
|
||||||
pandora.$ui.browser.find('img[src*="/' + data.id + '/"]').each(function() {
|
pandora.$ui.browser.find('img[src*="/' + data.id + '/"]').each(function() {
|
||||||
$(this).attr({
|
$(this).attr({
|
||||||
|
|
|
@ -23,10 +23,10 @@ pandora.ui.siteDialog = function(section) {
|
||||||
pandora.$ui.news = pandora.ui.news(dialogWidth, dialogHeight).appendTo($content);
|
pandora.$ui.news = pandora.ui.news(dialogWidth, dialogHeight).appendTo($content);
|
||||||
} else if (id == 'software') {
|
} else if (id == 'software') {
|
||||||
Ox.Element()
|
Ox.Element()
|
||||||
.html(
|
.html(Ox._(
|
||||||
'<h1><b>pan.do/ra</b></h1>'
|
'<h1><b>pan.do/ra</b></h1>'
|
||||||
+ '<sub>open media archive</sub>'
|
+ '<sub>open media archive</sub>'
|
||||||
+ '<p><b>' + pandora.site.site.name + '</b> is based on <b>pan.do/ra</b>, '
|
+ '<p><b>{0}</b> is based on <b>pan.do/ra</b>, '
|
||||||
+ 'a free, open source platform for media archives.</p>'
|
+ 'a free, open source platform for media archives.</p>'
|
||||||
+ '<b>pan.do/ra</b> includes <b>OxJS</b>, '
|
+ '<b>pan.do/ra</b> includes <b>OxJS</b>, '
|
||||||
+ 'a new JavaScript library for web applications.</p>'
|
+ 'a new JavaScript library for web applications.</p>'
|
||||||
|
@ -35,12 +35,13 @@ pandora.ui.siteDialog = function(section) {
|
||||||
+ 'and <a href="https://oxjs.org">oxjs.org</a>.</p>'
|
+ 'and <a href="https://oxjs.org">oxjs.org</a>.</p>'
|
||||||
+ (
|
+ (
|
||||||
canSeeVersion
|
canSeeVersion
|
||||||
? '<sub><b>' + pandora.site.site.name
|
? '<sub><b>{0}'
|
||||||
+ '</b> is running <b>pan.do/ra</b> revision '
|
+ '</b> is running <b>pan.do/ra</b> revision '
|
||||||
+ pandora.site.site.version + '.</sub>'
|
+ '{1}.</sub>'
|
||||||
: ''
|
: ''
|
||||||
)
|
),
|
||||||
)
|
[pandora.site.site.name, pandora.site.site.version]
|
||||||
|
))
|
||||||
.appendTo($content);
|
.appendTo($content);
|
||||||
pandora.createLinks($content);
|
pandora.createLinks($content);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -318,9 +318,9 @@ pandora.ui.statisticsDialog = function() {
|
||||||
key: key == 'topdays' ? 'value' : 'key',
|
key: key == 'topdays' ? 'value' : 'key',
|
||||||
operator: isDate || isDay ? '-' : '+'
|
operator: isDate || isDay ? '-' : '+'
|
||||||
},
|
},
|
||||||
title: key == 'lastdays' ? 'Last 30 Days'
|
title: key == 'lastdays' ? Ox._('Last 30 Days')
|
||||||
: key == 'topdays' ? 'Top 30 Days'
|
: key == 'topdays' ? Ox._('Top 30 Days')
|
||||||
: Ox.toTitleCase(key) + 's',
|
: Ox._(Ox.toTitleCase(key) + 's'),
|
||||||
width: chartWidth
|
width: chartWidth
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
|
@ -480,9 +480,9 @@ pandora.ui.statisticsDialog = function() {
|
||||||
sort: version == ''
|
sort: version == ''
|
||||||
? {key: 'value', operator: '-'}
|
? {key: 'value', operator: '-'}
|
||||||
: {key: 'key', operator: '+'},
|
: {key: 'key', operator: '+'},
|
||||||
title: key == 'system'
|
title: Ox._(key == 'system'
|
||||||
? (version == '' ? 'Platforms' : 'Platform Versions')
|
? (version == '' ? 'Platforms' : 'Platform Versions')
|
||||||
: (version == '' ? 'Browsers' : 'Browser Versions'),
|
: (version == '' ? 'Browsers' : 'Browser Versions')),
|
||||||
width: chartWidth
|
width: chartWidth
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
|
@ -557,8 +557,8 @@ pandora.ui.statisticsDialog = function() {
|
||||||
? {key: 'value', operator: '-'}
|
? {key: 'value', operator: '-'}
|
||||||
: {key: 'key', operator: '+'},
|
: {key: 'key', operator: '+'},
|
||||||
title: version == ''
|
title: version == ''
|
||||||
? 'Platforms & Browsers'
|
? Ox._('Platforms & Browsers')
|
||||||
: 'Platform & Browser Versions',
|
: Ox._('Platform & Browser Versions'),
|
||||||
width: chartWidth
|
width: chartWidth
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
|
|
|
@ -222,26 +222,6 @@ pandora.changeFolderItemStatus = function(id, status, callback) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pandora.clearIconCache = function(item) {
|
|
||||||
['poster', 'icon'].forEach(function(icon) {
|
|
||||||
['', 64, 128, 512].forEach(function(size) {
|
|
||||||
var url = '/' + item + '/' + icon + size + '.jpg',
|
|
||||||
xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('POST', url);
|
|
||||||
xhr.send();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
pandora.clearListIconCache = function(list) {
|
|
||||||
['', 256].forEach(function(size) {
|
|
||||||
var url = '/list/' + list + '/icon' + size + '.jpg',
|
|
||||||
xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('POST', url);
|
|
||||||
xhr.send();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
pandora.clickLink = function(e) {
|
pandora.clickLink = function(e) {
|
||||||
var match = e.target.id.match(/^embed(\d+)$/)
|
var match = e.target.id.match(/^embed(\d+)$/)
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|
Loading…
Reference in a new issue