remove clearIconCache and clearListIconCache, append modified to more icon/poster urls, localize more strings

This commit is contained in:
j 2013-05-10 14:18:14 +00:00
parent b1d326c6dd
commit d215c0fad0
9 changed files with 26 additions and 47 deletions

View file

@ -344,7 +344,7 @@ pandora.ui.accountSignoutDialog = function() {
.append(
$('<div>')
.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,
height: 128,

View file

@ -113,15 +113,15 @@ pandora.ui.apiDialog = function() {
function getIndex() {
var $index = Ox.Element()
.html(
.html(Ox._(
'<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.'
+ ' This API is 100% public, which means that there is'
+ ' virtually no limit to what you can do with the site,'
+ ' or build on top of it &mdash; from writing simple scripts'
+ ' 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,'
+ ' or a custom search interface) in your own website.</p>\n'
+ '<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'
+ ' in ascending order), it will return their duration,'
+ ' id and title properties.'
)
[pandora.site.site.name]))
.append(
Ox.SyntaxHighlighter({
source: "pandora.api.find({\n"

View file

@ -17,7 +17,7 @@ pandora.ui.folderList = function(id) {
},
format: function(value, data) {
return $('<img>').attr({
src: '/' + folderItem.toLowerCase() + '/' + data.id + '/icon.jpg'
src: '/' + folderItem.toLowerCase() + '/' + data.id + '/icon.jpg?' + data.modified
}).css({
width: '14px',
height: '14px',
@ -253,7 +253,7 @@ pandora.ui.folderList = function(id) {
that = Ox.TableList({
columns: columns,
items: items,
keys: ui.section == 'items' ? ['query'] : ['rightslevel'],
keys: ['modified'].concat(ui.section == 'items' ? ['query'] : ['rightslevel']),
max: 1,
min: 0,
pageLength: 1000,

View file

@ -76,7 +76,7 @@ pandora.ui.info = function() {
that.append(pandora.$ui.listInfo = pandora.ui.listInfo());
previousView == 'video' && resizeInfo();
} 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,
height = pandora.getInfoHeight(true);
emptyInfo();
@ -299,7 +299,7 @@ pandora.ui.listInfo = function() {
that.append(
$('<div>')
.css({paddingTop: '16px'})
.html(folderItem + ' not found')
.html(Ox._('{0} not found', [Ox._(folderItem)]))
);
}
});
@ -308,8 +308,8 @@ pandora.ui.listInfo = function() {
$('<div>')
.css({fontWeight: 'bold'})
.html(ui.section == 'items'
? 'All ' + pandora.site.itemName.plural
: pandora.site.site.name + ' ' + folderItems
? Ox._('All {0}', [Ox._(pandora.site.itemName.plural)])
: Ox._('{} ' + folderItems, [pandora.site.site.name])
)
);
}
@ -351,7 +351,7 @@ pandora.ui.listInfo = function() {
pandora.ui.posterInfo = function(data) {
var $poster = $('<img>')
.attr({src: '/' + data.id + '/poster512.jpg'})
.attr({src: '/' + data.id + '/poster512.jpg' + data.modified})
.css(getPosterCSS()),
$text = $('<div>')
.css({

View file

@ -863,7 +863,6 @@ pandora.ui.infoView = function(data) {
position: selectedImage.index
}), function() {
var src;
pandora.clearIconCache(data.id);
Ox.Request.clearCache();
if (ui.icons == 'frames') {
src = '/' + data.id + '/icon512.jpg?' + Ox.uid();

View file

@ -487,7 +487,6 @@ pandora.ui.infoView = function(data) {
pandora.updateItemContext();
pandora.$ui.browser.value(result.data.id, key, result.data[key]);
if (Ox.contains(['title', 'director', 'year'], key)) {
pandora.clearIconCache(data.id);
if (ui.icons == 'posters') {
pandora.$ui.browser.find('img[src*="/' + data.id + '/"]').each(function() {
$(this).attr({

View file

@ -23,10 +23,10 @@ pandora.ui.siteDialog = function(section) {
pandora.$ui.news = pandora.ui.news(dialogWidth, dialogHeight).appendTo($content);
} else if (id == 'software') {
Ox.Element()
.html(
.html(Ox._(
'<h1><b>pan.do/ra</b></h1>'
+ '<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>'
+ '<b>pan.do/ra</b> includes <b>OxJS</b>, '
+ '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>'
+ (
canSeeVersion
? '<sub><b>' + pandora.site.site.name
? '<sub><b>{0}'
+ '</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);
pandora.createLinks($content);
} else {

View file

@ -318,9 +318,9 @@ pandora.ui.statisticsDialog = function() {
key: key == 'topdays' ? 'value' : 'key',
operator: isDate || isDay ? '-' : '+'
},
title: key == 'lastdays' ? 'Last 30 Days'
: key == 'topdays' ? 'Top 30 Days'
: Ox.toTitleCase(key) + 's',
title: key == 'lastdays' ? Ox._('Last 30 Days')
: key == 'topdays' ? Ox._('Top 30 Days')
: Ox._(Ox.toTitleCase(key) + 's'),
width: chartWidth
})
.css({
@ -480,9 +480,9 @@ pandora.ui.statisticsDialog = function() {
sort: version == ''
? {key: 'value', operator: '-'}
: {key: 'key', operator: '+'},
title: key == 'system'
title: Ox._(key == 'system'
? (version == '' ? 'Platforms' : 'Platform Versions')
: (version == '' ? 'Browsers' : 'Browser Versions'),
: (version == '' ? 'Browsers' : 'Browser Versions')),
width: chartWidth
})
.css({
@ -557,8 +557,8 @@ pandora.ui.statisticsDialog = function() {
? {key: 'value', operator: '-'}
: {key: 'key', operator: '+'},
title: version == ''
? 'Platforms & Browsers'
: 'Platform & Browser Versions',
? Ox._('Platforms & Browsers')
: Ox._('Platform & Browser Versions'),
width: chartWidth
})
.css({

View file

@ -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) {
var match = e.target.id.match(/^embed(\d+)$/)
if (match) {