Compare commits

...

2 commits

Author SHA1 Message Date
j
435d22a656 play edit on home page 2023-08-04 19:03:44 +02:00
j
5eeafec9d2 for translations 2023-08-04 19:03:28 +02:00
2 changed files with 68 additions and 4 deletions

View file

@ -26,7 +26,8 @@ pandora.ui.home = function() {
width: '560px', width: '560px',
margin: '0 auto 0 auto' margin: '0 auto 0 auto'
}) })
.appendTo(that), .appendTo(that);
/*
$reflectionImage = $('<img>') $reflectionImage = $('<img>')
.attr({src: '/static/png/logo.png'}) .attr({src: '/static/png/logo.png'})
@ -58,8 +59,9 @@ pandora.ui.home = function() {
margin: '0 auto 0 auto', margin: '0 auto 0 auto',
}) })
.appendTo($box), .appendTo($box),
*/
$logo = Ox.Element({ var $logo = Ox.Element({
element: '<img>', element: '<img>',
tooltip: function() { tooltip: function() {
return Ox._('Enter {0}', [pandora.site.site.name]); return Ox._('Enter {0}', [pandora.site.site.name]);
@ -263,6 +265,68 @@ pandora.ui.home = function() {
} }
$aboutButton.appendTo($footer); $aboutButton.appendTo($footer);
function getVideos(clips, resolution) {
var videos = [];
clips.filter(function(clip) {
return clip.duration;
}).map(function(clip) {
videos = videos.concat(pandora.getClipVideos(clip, resolution));
});
console.log(videos)
return videos;
}
function loadEdit() {
pandora.api.getEdit({
id: "mamafih:homepage",
}, response => {
var edit = response.data
pandora.api.sortClips({
edit: edit.id,
sort: [{
key: 'random',
operator: '+'
}]
}, result => {
console.log('!!', result)
edit.clips.forEach(function(clip) {
clip.sort = result.data.clips.indexOf(clip.id);
});
edit.clips = Ox.sortBy(edit.clips, 'sort');
var player = window.player = Ox.VideoElement({
items: getVideos(Ox.clone(edit.clips), pandora.user.ui.videoResolution),
autoplay: true,
muted: true,
loop: true,
}).css({
position: 'fixed',
top: 0,
bottom: 0,
left: 0,
right: 0,
width: '100%',
height: '100%'
})
player.find('video').css({
width: '100%',
height: '100%',
'object-fit': 'cover',
})
player.prependTo(pandora.$ui.home)
player.bindEvent('loadedmetadata', () => {
console.log('now play')
player.play()
setTimeout(() => {
player.play()
}, 1000)
})
})
})
}
loadEdit()
function showFeatures() { function showFeatures() {
pandora.api.getHomeItems({active: true}, function(result) { pandora.api.getHomeItems({active: true}, function(result) {
var items = result.data.items.filter(pandora.isCompleteHomeItem), var items = result.data.items.filter(pandora.isCompleteHomeItem),

View file

@ -294,7 +294,7 @@ pandora.ui.infoView = function(data, isMixed) {
.append( .append(
Ox.EditableContent({ Ox.EditableContent({
editable: canEdit, editable: canEdit,
placeholder: formatLight(Ox._(isMixed ? 'Mixed title' : 'No title')), placeholder: formatLight(Ox._(isMixed ? 'Mixed Titles' : 'No title')),
tooltip: canEdit ? pandora.getEditTooltip() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
value: data.title || '' value: data.title || ''
}) })
@ -494,7 +494,7 @@ pandora.ui.infoView = function(data, isMixed) {
.append( .append(
Ox.EditableContent({ Ox.EditableContent({
height: 128, height: 128,
placeholder: formatLight(Ox._(isMixed ? 'Mixed notes' : 'No notes')), placeholder: formatLight(Ox._(isMixed ? 'Mixed Notes' : 'No notes')),
tooltip: pandora.getEditTooltip(), tooltip: pandora.getEditTooltip(),
type: 'textarea', type: 'textarea',
value: data.notes || '', value: data.notes || '',