forked from 0x2620/pandora
wrap image urls in pandora.getMediaURL to add option to load image from another domain
This commit is contained in:
parent
7de2644eea
commit
522af49a73
22 changed files with 118 additions and 77 deletions
|
@ -57,6 +57,7 @@ def load_config():
|
|||
settings.DEFAULT_FROM_EMAIL = config['site']['email']['system']
|
||||
settings.SERVER_EMAIL = config['site']['email']['system']
|
||||
config['site']['videoprefix'] = settings.VIDEO_PREFIX
|
||||
config['site']['mediaprefix'] = settings.MEDIA_PREFIX
|
||||
config['site']['version'] = get_version()
|
||||
config['site']['dontValidateUser'] = not settings.AUTH_CHECK_USERNAME
|
||||
if not 'folderdepth' in config['site']:
|
||||
|
|
|
@ -195,6 +195,8 @@ USE_IMDB = False
|
|||
#if you set VIDEO_PREFIX make sure cookies work accros subsomains
|
||||
VIDEO_PREFIX=''
|
||||
#VIDEO_PREFIX = '//video{uid}.example.com'
|
||||
MEDIA_PREFIX=''
|
||||
#VIDEO_PREFIX = '//media.example.com'
|
||||
#SESSION_COOKIE_DOMAIN = '.example.com'
|
||||
|
||||
SESSION_COOKIE_AGE=60*24*60*60
|
||||
|
|
|
@ -78,10 +78,10 @@ pandora.ui.browser = function() {
|
|||
var ui = pandora.user.ui,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
url = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + '128.jpg?' + data.modified,
|
||||
) + '128.jpg?' + data.modified),
|
||||
format, info, sortKey = sort[0].key;
|
||||
if (['title', 'director', 'random'].indexOf(sortKey) > -1) {
|
||||
info = data['year'];
|
||||
|
|
|
@ -35,7 +35,9 @@ pandora.ui.clipList = function(videoRatio) {
|
|||
}).map(function(annotation) {
|
||||
return Ox.stripTags(annotation.value.replace(/\n/g, ' '));
|
||||
}).join('; ') : '';
|
||||
url = '/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg';
|
||||
url = pandora.getMediaURL(
|
||||
'/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg'
|
||||
);
|
||||
sortKey = sort[0].key;
|
||||
if (['text', 'position', 'duration', 'random'].indexOf(sortKey) > -1) {
|
||||
info = Ox.formatDuration(data['in']) + ' - '
|
||||
|
@ -204,7 +206,9 @@ pandora.ui.clipList = function(videoRatio) {
|
|||
censoredTooltip: pandora.site.cantPlay.text,
|
||||
height: height,
|
||||
paused: true,
|
||||
poster: '/' + item + '/' + height + 'p' + points[0] + '.jpg',
|
||||
poster: pandora.getMediaURL(
|
||||
'/' + item + '/' + height + 'p' + points[0] + '.jpg'
|
||||
),
|
||||
rewind: true,
|
||||
video: pandora.getClipVideos({
|
||||
item: item,
|
||||
|
|
|
@ -162,7 +162,7 @@ pandora.ui.documentDialog = function(options) {
|
|||
center: settings.center,
|
||||
height: dialogHeight,
|
||||
imageHeight: item.dimensions[1],
|
||||
imagePreviewURL: '/documents/' + item.id + '/256p.jpg',
|
||||
imagePreviewURL: pandora.getMediaURL('/documents/' + item.id + '/256p.jpg'),
|
||||
imageURL: '/documents/' + item.id + '/'
|
||||
+ item.name + '.' + item.extension,
|
||||
imageWidth: item.dimensions[0],
|
||||
|
|
|
@ -98,7 +98,7 @@ pandora.ui.editPanel = function() {
|
|||
fullscreen: false,
|
||||
getClipImageURL: function(id, width, height) {
|
||||
var clip = Ox.getObjectById(edit.clips, id);
|
||||
return '/' + clip.item + '/' + height + 'p' + clip['in'] + '.jpg';
|
||||
return pandora.getMediaURL('/' + clip.item + '/' + height + 'p' + clip['in'] + '.jpg');
|
||||
},
|
||||
getLargeTimelineURL: function(type, i, callback) {
|
||||
pandora.getLargeEditTimelineURL(edit, type, i, callback);
|
||||
|
@ -348,7 +348,7 @@ pandora.ui.editPanel = function() {
|
|||
item: function(data, sort, size) {
|
||||
size = size || 128;
|
||||
var ui = pandora.user.ui,
|
||||
url = '/edit/' + data.id + '/icon' + size + '.jpg?' + data.modified,
|
||||
url = pandora.getMediaURL('/edit/' + data.id + '/icon' + size + '.jpg?' + data.modified),
|
||||
info = Ox.formatDuration(data.duration);
|
||||
return {
|
||||
height: size,
|
||||
|
|
|
@ -29,13 +29,13 @@ pandora.ui.editor = function(data) {
|
|||
enableSubtitles: ui.videoSubtitles,
|
||||
find: ui.itemFind,
|
||||
getFrameURL: function(position) {
|
||||
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg?' + data.modified;
|
||||
return pandora.getMediaURL('/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg?' + data.modified);
|
||||
},
|
||||
getLargeTimelineURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg?' + data.modified;
|
||||
return pandora.getMediaURL('/' + ui.item + '/timeline' + type + '64p' + i + '.jpg?' + data.modified);
|
||||
},
|
||||
getSmallTimelineURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '16p' + i + '.jpg?' + data.modified;
|
||||
return pandora.getMediaURL('/' + ui.item + '/timeline' + type + '16p' + i + '.jpg?' + data.modified);
|
||||
},
|
||||
height: pandora.$ui.contentPanel.size(1),
|
||||
id: 'editor',
|
||||
|
@ -298,9 +298,9 @@ pandora.ui.editor = function(data) {
|
|||
function updateBrowser() {
|
||||
pandora.$ui.browser.find('img[src*="/' + ui.item + '/"]').each(function() {
|
||||
$(this).attr({
|
||||
src: '/' + ui.item + '/' + (
|
||||
src: pandora.getMediaURL('/' + ui.item + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '128.jpg?' + Ox.uid()
|
||||
) + '128.jpg?' + Ox.uid())
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ pandora.ui.embedInfo = function() {
|
|||
data = result.data;
|
||||
|
||||
$icon = Ox.$('<img>')
|
||||
.attr({src: '/' + item + '/poster512.jpg'})
|
||||
.attr({src: pandora.getMediaURL('/' + item + '/poster512.jpg')})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
top: margin + 'px',
|
||||
|
@ -39,7 +39,7 @@ pandora.ui.embedInfo = function() {
|
|||
.appendTo(that);
|
||||
|
||||
$reflectionIcon = Ox.$('<img>')
|
||||
.attr({src: '/' + item + '/poster512.jpg'})
|
||||
.attr({src: pandora.getMediaURL('/' + item + '/poster512.jpg')})
|
||||
.css({
|
||||
position: 'absolute'
|
||||
})
|
||||
|
|
|
@ -95,19 +95,19 @@ pandora.ui.embedPlayer = function() {
|
|||
paused: options.paused,
|
||||
playInToOut: options.playInToOut,
|
||||
position: options.position,
|
||||
poster: '/' + options.item + '/' + '96p' + (
|
||||
poster: pandora.getMediaURL('/' + options.item + '/' + '96p' + (
|
||||
options.position !== void 0 ? options.position
|
||||
: options['in'] !== void 0 ? options['in']
|
||||
: video.posterFrame
|
||||
) +'.jpg',
|
||||
) +'.jpg'),
|
||||
resolution: ui.videoResolution,
|
||||
scaleToFill: ui.videoScale == 'fill',
|
||||
subtitles: video.subtitles,
|
||||
timeline: options.playInToOut ? function(size, i) {
|
||||
return '/' + options.item
|
||||
return pandora.getMediaURL('/' + options.item
|
||||
+ '/timelineantialias'
|
||||
+ size + 'p' + i + '.jpg'
|
||||
} : '/' + options.item + '/' + 'timeline16p.png',
|
||||
+ size + 'p' + i + '.jpg');
|
||||
} : pandora.getMediaURL('/' + options.item + '/' + 'timeline16p.png'),
|
||||
/*
|
||||
timeline: options.playInToOut ? getSmallTimelineURL()
|
||||
: '/' + options.item + '/' + 'timeline16p.png',
|
||||
|
@ -173,7 +173,7 @@ pandora.ui.embedPlayer = function() {
|
|||
disabled: isFrame,
|
||||
duration: video.duration,
|
||||
getImageURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||
return pandora.getMediaURL('/' + ui.item + '/timeline' + type + '64p' + i + '.jpg');
|
||||
},
|
||||
position: options.position,
|
||||
showInToOut: options.playInToOut && options['in'] < options.out,
|
||||
|
|
|
@ -51,17 +51,21 @@ pandora.ui.embedTimeline = function() {
|
|||
duration: video.duration,
|
||||
followPlayer: ui.followPlayer,
|
||||
getFrameURL: function(position) {
|
||||
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg'
|
||||
);
|
||||
},
|
||||
getLargeTimelineURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + ui.item + '/timeline' + type + '64p' + i + '.jpg'
|
||||
);
|
||||
},
|
||||
height: sizes.innerHeight,
|
||||
muted: ui.videoMuted,
|
||||
paused: options.paused,
|
||||
position: options.position,
|
||||
resolution: Ox.min(pandora.site.video.resolutions),
|
||||
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
||||
smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'),
|
||||
subtitles: video.subtitles,
|
||||
timeline: ui.videoTimeline,
|
||||
timelines: pandora.site.timelines,
|
||||
|
|
|
@ -135,10 +135,10 @@ pandora.ui.infoView = function(data) {
|
|||
) : ''
|
||||
})
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -168,10 +168,10 @@ pandora.ui.infoView = function(data) {
|
|||
|
||||
$reflectionIcon = $('<img>')
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -1004,7 +1004,7 @@ pandora.ui.infoView = function(data) {
|
|||
var src;
|
||||
Ox.Request.clearCache();
|
||||
if (ui.icons == 'frames') {
|
||||
src = '/' + data.id + '/icon512.jpg?' + Ox.uid();
|
||||
src = pandora.getMediaURL('/' + data.id + '/icon512.jpg?' + Ox.uid());
|
||||
$icon.attr({src: src});
|
||||
$reflectionIcon.attr({src: src});
|
||||
if (pandora.$ui.videoPreview) {
|
||||
|
@ -1015,9 +1015,9 @@ pandora.ui.infoView = function(data) {
|
|||
}
|
||||
if (!ui.showSitePosters) {
|
||||
$browserImages.each(function() {
|
||||
$(this).attr({src: '/' + data.id + '/' + (
|
||||
$(this).attr({src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '128.jpg?' + Ox.uid()});
|
||||
) + '128.jpg?' + Ox.uid())});
|
||||
});
|
||||
}
|
||||
if (ui.listSort[0].key == 'modified') {
|
||||
|
@ -1135,10 +1135,10 @@ pandora.ui.infoView = function(data) {
|
|||
}
|
||||
|
||||
that.reload = function() {
|
||||
var src = src = '/' + data.id + '/' + (
|
||||
var src = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + '512.jpg?' + Ox.uid()
|
||||
) + '512.jpg?' + Ox.uid())
|
||||
$icon.attr({src: src});
|
||||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
|
|
|
@ -131,9 +131,9 @@ pandora.ui.infoView = function(data) {
|
|||
element: '<img>'
|
||||
})
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -163,10 +163,10 @@ pandora.ui.infoView = function(data) {
|
|||
|
||||
$reflectionIcon = $('<img>')
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -492,7 +492,7 @@ pandora.ui.infoView = function(data) {
|
|||
Ox.contains(['title', 'director', 'year'], key)
|
||||
&& ui.icons == 'posters'
|
||||
) {
|
||||
src = '/' + data.id + '/poster512.jpg?' + Ox.uid();
|
||||
src = pandora.getMediaURL('/' + data.id + '/poster512.jpg?' + Ox.uid());
|
||||
$icon.attr({src: src});
|
||||
$reflectionIcon.attr({src: src});
|
||||
}
|
||||
|
@ -1042,9 +1042,9 @@ pandora.ui.infoView = function(data) {
|
|||
}
|
||||
|
||||
that.reload = function() {
|
||||
var src = src = '/' + data.id + '/' + (
|
||||
var src = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '512.jpg?' + Ox.uid();
|
||||
) + '512.jpg?' + Ox.uid());
|
||||
$icon.attr({src: src});
|
||||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
|
|
|
@ -107,9 +107,9 @@ pandora.ui.infoView = function(data) {
|
|||
).title + ' View'
|
||||
})
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -141,9 +141,9 @@ pandora.ui.infoView = function(data) {
|
|||
|
||||
$reflectionIcon = $('<img>')
|
||||
.attr({
|
||||
src: '/' + data.id + '/' + (
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '512.jpg?' + data.modified
|
||||
) + '512.jpg?' + data.modified)
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -767,9 +767,9 @@ pandora.ui.infoView = function(data) {
|
|||
}
|
||||
|
||||
that.reload = function() {
|
||||
var src = src = '/' + data.id + '/' + (
|
||||
var src = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters' ? 'poster' : 'icon'
|
||||
) + '512.jpg?' + Ox.uid();
|
||||
) + '512.jpg?' + Ox.uid());
|
||||
$icon.attr({src: src});
|
||||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
|
|
|
@ -34,7 +34,9 @@ pandora.ui.itemClips = function(options) {
|
|||
: a.value > b.value ? 1
|
||||
: 0;
|
||||
}),
|
||||
url = '/' + self.options.id + '/' + self.height + 'p' + clip['in'] + '.jpg',
|
||||
url = pandora.getMediaURL(
|
||||
'/' + self.options.id + '/' + self.height + 'p' + clip['in'] + '.jpg'
|
||||
),
|
||||
$item = Ox.IconItem({
|
||||
find: pandora.user.ui.itemFind,
|
||||
imageHeight: self.height,
|
||||
|
@ -106,7 +108,9 @@ pandora.ui.itemClips = function(options) {
|
|||
'in': partsAndPoints.points[0],
|
||||
out: partsAndPoints.points[1],
|
||||
playInToOut: true,
|
||||
poster: '/' + self.options.id + '/' + self.height + 'p' + points[0] + '.jpg',
|
||||
poster: pandora.getMediaURL(
|
||||
'/' + self.options.id + '/' + self.height + 'p' + points[0] + '.jpg'
|
||||
),
|
||||
rewind: true,
|
||||
video: partsAndPoints.parts.map(function(i) {
|
||||
return pandora.getVideoURL(self.options.id, Ox.min(pandora.site.video.resolutions), i + 1);
|
||||
|
|
|
@ -44,7 +44,7 @@ pandora.ui.list = function() {
|
|||
//background: 'transparent'
|
||||
});
|
||||
}).attr({
|
||||
src: '/' + data.id + '/' + icon + '14.jpg?' + data.modified
|
||||
src: pandora.getMediaURL('/' + data.id + '/' + icon + '14.jpg?' + data.modified)
|
||||
});
|
||||
},
|
||||
id: 'posterRatio',
|
||||
|
@ -128,10 +128,10 @@ pandora.ui.list = function() {
|
|||
item: function(data, sort, size) {
|
||||
var ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
url = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + size + '.jpg?' + data.modified,
|
||||
) + size + '.jpg?' + data.modified),
|
||||
format, info, sortKey = sort[0].key;
|
||||
if (['title', 'director', 'random'].indexOf(sortKey) > -1) {
|
||||
info = data['year'];
|
||||
|
@ -185,10 +185,10 @@ pandora.ui.list = function() {
|
|||
size = 128;
|
||||
var ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
url = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + size + '.jpg?' + data.modified,
|
||||
) + size + '.jpg?' + data.modified),
|
||||
format, info, sortKey = sort[0].key;
|
||||
if (['title', 'director'].indexOf(sortKey) > -1) {
|
||||
info = data['year'];
|
||||
|
@ -270,10 +270,10 @@ pandora.ui.list = function() {
|
|||
isClipsQuery = !!clipsQuery.conditions.length,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
url = pandora.getMediaURL('/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
) + size + '.jpg?' + data.modified,
|
||||
) + size + '.jpg?' + data.modified),
|
||||
format, info, sortKey = sort[0].key;
|
||||
if (['title', 'director'].indexOf(sortKey) > -1) {
|
||||
info = data['year'];
|
||||
|
@ -323,7 +323,9 @@ pandora.ui.list = function() {
|
|||
duration: data.duration,
|
||||
find: isClipsQuery ? clipsQuery.conditions[0].value : '',
|
||||
getImageURL: function(type, i) {
|
||||
return '/' + data.id + '/timeline' + type + '16p' + i + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + data.id + '/timeline' + type + '16p' + i + '.jpg'
|
||||
);
|
||||
},
|
||||
position: ui.videoPoints[data.id]
|
||||
? ui.videoPoints[data.id].position : 0,
|
||||
|
|
|
@ -168,7 +168,7 @@ pandora.ui.listGeneralPanel = function(listData) {
|
|||
tooltip: Ox._('Doubleclick to edit icon')
|
||||
})
|
||||
.attr({
|
||||
src: '/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid()
|
||||
src: pandora.getMediaURL('/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid())
|
||||
})
|
||||
.css({
|
||||
position: 'absolute',
|
||||
|
@ -358,7 +358,7 @@ pandora.ui.listIconPanel = function(listData) {
|
|||
$iconPanel = Ox.Element(),
|
||||
|
||||
$icon = $('<img>')
|
||||
.attr({src: '/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid()})
|
||||
.attr({src: pandora.getMediaURL('/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid())})
|
||||
.css({position: 'absolute', borderRadius: '64px', margin: '16px'})
|
||||
.appendTo($iconPanel),
|
||||
|
||||
|
@ -435,7 +435,7 @@ pandora.ui.listIconPanel = function(listData) {
|
|||
id: data.id,
|
||||
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
|
||||
title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''),
|
||||
url: '/' + data.id + '/icon' + size + '.jpg?' + data.modified,
|
||||
url: pandora.getMediaURL('/' + data.id + '/icon' + size + '.jpg?' + data.modified),
|
||||
width: size
|
||||
};
|
||||
},
|
||||
|
@ -544,12 +544,20 @@ pandora.ui.listIconPanel = function(listData) {
|
|||
posterFrames: posterFrames
|
||||
}, function() {
|
||||
$icon.attr({
|
||||
src: '/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid()
|
||||
src: pandora.getMediaURL('/' + folderItem.toLowerCase()
|
||||
+ '/' + encodeURIComponent(listData.id) + '/icon256.jpg?' + Ox.uid()
|
||||
)
|
||||
});
|
||||
pandora.$ui.folderList[listData.folder].$element
|
||||
.find('img[src*="/' + encodeURIComponent(listData.id) + '/"]')
|
||||
.find('img[src*="'
|
||||
+ pandora.getMediaURL('/' + encodeURIComponent(listData.id))
|
||||
+ '/"]'
|
||||
)
|
||||
.attr({
|
||||
src: '/' + folderItem.toLowerCase() + '/' + encodeURIComponent(listData.id) + '/icon.jpg?' + Ox.uid()
|
||||
src: pandora.getMediaURL('/' + folderItem.toLowerCase()
|
||||
+ '/' + encodeURIComponent(listData.id)
|
||||
+ '/icon.jpg?' + Ox.uid()
|
||||
)
|
||||
});
|
||||
pandora.$ui.info.updateListInfo();
|
||||
});
|
||||
|
|
|
@ -27,7 +27,9 @@ pandora.ui.player = function(data) {
|
|||
enableSubtitles: ui.videoSubtitles,
|
||||
find: ui.itemFind,
|
||||
getLargeTimelineURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + ui.item + '/timeline' + type + '64p' + i + '.jpg'
|
||||
);
|
||||
},
|
||||
height: pandora.$ui.contentPanel.size(1),
|
||||
'in': ui.videoPoints[ui.item]['in'],
|
||||
|
@ -48,7 +50,7 @@ pandora.ui.player = function(data) {
|
|||
showLayers: Ox.clone(ui.showLayers),
|
||||
showUsers: pandora.site.annotations.showUsers,
|
||||
showTimeline: ui.showTimeline,
|
||||
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
||||
smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'),
|
||||
subtitles: data.subtitles,
|
||||
timeline: ui.videoTimeline,
|
||||
timelineTooltip: 'timeline <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>',
|
||||
|
|
|
@ -79,17 +79,17 @@ pandora.ui.previewDialog = function() {
|
|||
item.year ? ' ' + item.year : ''
|
||||
);
|
||||
$image = $('<img>')
|
||||
.attr({src: '/' + item.id + '/' + (
|
||||
.attr({src: pandora.getMediaURL('/' + item.id + '/' + (
|
||||
pandora.user.ui.showSitePosters ? 'siteposter' : 'poster'
|
||||
) + '128.jpg?' + item.modified})
|
||||
) + '128.jpg?' + item.modified)})
|
||||
.css({width: size.width + 'px', height: size.height + 'px'});
|
||||
$('<img>')
|
||||
.load(function() {
|
||||
$image.attr({src: $(this).attr('src')});
|
||||
})
|
||||
.attr({src: '/' + item.id + '/' + (
|
||||
.attr({src: pandora.getMediaURL('/' + item.id + '/' + (
|
||||
pandora.user.ui.showSitePosters ? 'siteposter' : 'poster'
|
||||
) + '1024.jpg?' + item.modified});
|
||||
) + '1024.jpg?' + item.modified)});
|
||||
that.options({
|
||||
content: $image,
|
||||
title: title,
|
||||
|
|
|
@ -352,7 +352,7 @@ pandora.ui.similarClipsDialog = function() {
|
|||
id: data.id,
|
||||
info: Ox.formatDuration(data['in'], 2) + '-' + Ox.formatDuration(data.out, 2),
|
||||
title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''),
|
||||
url: '/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg',
|
||||
url: pandora.getMediaURL('/' + data.id.split('/')[0] + '/' + height + 'p' + data['in'] + '.jpg'),
|
||||
width: width
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,10 +25,14 @@ pandora.ui.timeline = function(data) {
|
|||
duration: data.duration,
|
||||
followPlayer: ui.followPlayer,
|
||||
getFrameURL: function(position) {
|
||||
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg?' + data.modified
|
||||
);
|
||||
},
|
||||
getLargeTimelineURL: function(type, i) {
|
||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||
return pandora.getMediaURL(
|
||||
'/' + ui.item + '/timeline' + type + '64p' + i + '.jpg?' + data.modified
|
||||
);
|
||||
},
|
||||
height: pandora.$ui.contentPanel.size(1),
|
||||
itemName: pandora.site.itemName,
|
||||
|
@ -44,7 +48,9 @@ pandora.ui.timeline = function(data) {
|
|||
showAnnotationsMap: ui.showAnnotationsMap,
|
||||
showLayers: Ox.clone(ui.showLayers),
|
||||
showUsers: pandora.site.annotations.showUsers,
|
||||
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
||||
smallTimelineURL: pandora.getMediaURL(
|
||||
'/' + ui.item + '/timeline16p.jpg?' + data.modified
|
||||
),
|
||||
timeline: ui.videoTimeline,
|
||||
timelines: pandora.site.timelines,
|
||||
video: data.video,
|
||||
|
|
|
@ -1241,7 +1241,9 @@ pandora.getLargeClipTimelineURL = function(item, inPoint, outPoint, type, callba
|
|||
}
|
||||
})
|
||||
.attr({
|
||||
src: '/' + item + '/timeline' + type + '64p' + index + '.jpg'
|
||||
src: pandora.getMediaURL(
|
||||
'/' + item + '/timeline' + type + '64p' + index + '.jpg'
|
||||
)
|
||||
})[0];
|
||||
}, function() {
|
||||
callback(canvas.toDataURL());
|
||||
|
@ -1455,7 +1457,9 @@ pandora.getSmallClipTimelineURL = function(item, inPoint, outPoint, type, callba
|
|||
}
|
||||
})
|
||||
.attr({
|
||||
src: '/' + item + '/timeline' + type + '16p' + index + '.jpg'
|
||||
src: pandora.getMediaURL(
|
||||
'/' + item + '/timeline' + type + '16p' + index + '.jpg'
|
||||
)
|
||||
})[0];
|
||||
}, function() {
|
||||
callback(canvas.toDataURL());
|
||||
|
@ -1646,6 +1650,10 @@ pandora.getStatusText = function(data) {
|
|||
return parts.join(', ');
|
||||
};
|
||||
|
||||
pandora.getMediaURL = function(url) {
|
||||
return pandora.site.site.mediaprefix + url;
|
||||
};
|
||||
|
||||
pandora.getVideoURL = function(id, resolution, part) {
|
||||
var prefix = pandora.site.site.videoprefix
|
||||
.replace('{id}', id)
|
||||
|
|
|
@ -12,15 +12,15 @@ pandora.ui.videoPreview = function(data) {
|
|||
resolution = resolutions.length
|
||||
? Ox.min(resolutions)
|
||||
: Ox.max(pandora.site.video.resolutions);
|
||||
return '/' + data.id + '/' + resolution + 'p' + (
|
||||
return pandora.getMediaURL('/' + data.id + '/' + resolution + 'p' + (
|
||||
Ox.isUndefined(position) ? '' : position
|
||||
) + '.jpg';
|
||||
) + '.jpg');
|
||||
},
|
||||
frameRatio: data.frameRatio,
|
||||
height: data.height,
|
||||
position: data.position,
|
||||
scaleToFill: true,
|
||||
timeline: '/' + data.id + '/timeline16p.jpg',
|
||||
timeline: pandora.getMediaURL('/' + data.id + '/timeline16p.jpg'),
|
||||
videoTooltip: data.videoTooltip,
|
||||
width: data.width
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue