forked from 0x2620/pandora
add and use pandora.site.posters.ratio (fixes #1572)
This commit is contained in:
parent
e6117dfc61
commit
9e6fa2714e
10 changed files with 30 additions and 18 deletions
|
@ -664,6 +664,9 @@
|
|||
//{"title": "Movies with Video", "query": {"conditions": [{"key": "canplayvideo", "value": "true", "operator": "="}], "operator": "&"}},
|
||||
//{"title": "Movies with Clips", "query": {"conditions": [{"key": "canplayclips", "value": "true", "operator": "="}], "operator": "&"}}
|
||||
],
|
||||
"posters": {
|
||||
"ratio": 0.625
|
||||
},
|
||||
"rightsLevel": {"member": 4, "staff": 3, "admin": 2},
|
||||
"rightsLevels": [
|
||||
{"name": "Public", "color": [128, 255, 128]},
|
||||
|
|
|
@ -703,6 +703,9 @@
|
|||
{"title": "Black & White Films", "query": {"conditions": [{"key": "color", "value": "Black and White", "operator": "=="}], "operator": "&"}},
|
||||
{"title": "Silent Films", "query": {"conditions": [{"key": "language", "value": "None", "operator": "=="}, {"key": "sound", "value": "Silent", "operator": "=="}], "operator": "|"}}
|
||||
],
|
||||
"posters": {
|
||||
"ratio": 0.6875
|
||||
},
|
||||
"rightsLevel": {"member": 3, "student": 3, "staff": 3, "admin": 3},
|
||||
"rightsLevels": [
|
||||
{"name": "Public", "color": [128, 255, 128]},
|
||||
|
|
|
@ -585,6 +585,9 @@
|
|||
"personalLists": [
|
||||
{"title": "Favorites"}
|
||||
],
|
||||
"posters": {
|
||||
"ratio": 0.625
|
||||
},
|
||||
"rightsLevel": {"member": 2, "staff": 2, "admin": 2},
|
||||
"rightsLevels": [
|
||||
{"name": "Public", "color": [128, 255, 128]},
|
||||
|
|
|
@ -504,6 +504,9 @@
|
|||
"personalLists": [
|
||||
{"title": "Favorites"}
|
||||
],
|
||||
"posters": {
|
||||
"ratio": 0.625
|
||||
},
|
||||
"rightsLevel": {"member": 2, "staff": 2, "admin": 2},
|
||||
"rightsLevels": [
|
||||
{"name": "Public", "color": [128, 255, 128]},
|
||||
|
|
|
@ -66,14 +66,14 @@ pandora.ui.browser = function() {
|
|||
var that = Ox.IconList({
|
||||
borderRadius: pandora.user.ui.icons == 'posters' ? 0 : 8,
|
||||
centered: true,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? pandora.site.posters.ratio : 1,
|
||||
draggable: true,
|
||||
id: 'list',
|
||||
item: function(data, sort, size) {
|
||||
size = size || 64;
|
||||
var ui = pandora.user.ui,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1,
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
|
@ -158,7 +158,7 @@ pandora.ui.browser = function() {
|
|||
pandora_icons: function(data) {
|
||||
that.options({
|
||||
borderRadius: data.value == 'posters' ? 0 : 8,
|
||||
defaultRatio: data.value == 'posters' ? 5/8 : 1
|
||||
defaultRatio: data.value == 'posters' ? pandora.site.posters.ratio : 1
|
||||
}).reloadList();
|
||||
},
|
||||
pandora_item: function(data) {
|
||||
|
|
|
@ -16,7 +16,7 @@ pandora.ui.infoView = function(data) {
|
|||
WebkitUserSelect: 'text'
|
||||
},
|
||||
iconRatio = ui.icons == 'posters' ? (
|
||||
ui.showSitePosters ? 5/8 : data.posterRatio
|
||||
ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio
|
||||
) : 1,
|
||||
iconSize = ui.infoIconSize,
|
||||
iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio),
|
||||
|
@ -852,7 +852,7 @@ pandora.ui.infoView = function(data) {
|
|||
return image.selected;
|
||||
})[0];
|
||||
$list = Ox.IconList({
|
||||
defaultRatio: ui.icons == 'posters' || !data.stream ? 5/8 : data.stream.aspectratio,
|
||||
defaultRatio: ui.icons == 'posters' || !data.stream ? pandora.site.posters.ratio : data.stream.aspectratio,
|
||||
fixedRatio: ui.icons == 'posters' || !data.stream ? false : data.stream.aspectratio,
|
||||
item: function(data, sort, size) {
|
||||
var ratio = data.width / data.height;
|
||||
|
@ -1059,7 +1059,7 @@ pandora.ui.infoView = function(data) {
|
|||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
iconRatio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1;
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
|
||||
toggleIconSize();
|
||||
pandora.user.level == 'admin' && $list.replaceWith($list = renderList());
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ pandora.ui.infoView = function(data) {
|
|||
WebkitUserSelect: 'text'
|
||||
},
|
||||
iconRatio = ui.icons == 'posters' ? (
|
||||
ui.showSitePosters ? 5/8 : data.posterRatio
|
||||
ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio
|
||||
) : 1,
|
||||
iconSize = ui.infoIconSize,
|
||||
iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio),
|
||||
|
@ -1030,7 +1030,7 @@ pandora.ui.infoView = function(data) {
|
|||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
iconRatio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1;
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
|
||||
toggleIconSize();
|
||||
};
|
||||
|
||||
|
|
|
@ -641,7 +641,7 @@ pandora.ui.infoView = function(data) {
|
|||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
iconRatio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1;
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
|
||||
toggleIconSize();
|
||||
};
|
||||
|
||||
|
|
|
@ -690,7 +690,7 @@ pandora.ui.infoView = function(data) {
|
|||
$reflectionIcon.attr({src: src});
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
iconRatio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1;
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1;
|
||||
toggleIconSize();
|
||||
};
|
||||
|
||||
|
|
|
@ -121,13 +121,13 @@ pandora.ui.list = function() {
|
|||
} else if (view == 'grid') {
|
||||
that = Ox.IconList({
|
||||
borderRadius: pandora.user.ui.icons == 'posters' ? 0 : 16,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? pandora.site.posters.ratio : 1,
|
||||
draggable: true,
|
||||
id: 'list',
|
||||
item: function(data, sort, size) {
|
||||
var ui = pandora.user.ui,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1,
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
|
@ -178,14 +178,14 @@ pandora.ui.list = function() {
|
|||
} else if (view == 'clips') {
|
||||
that = Ox.InfoList({
|
||||
borderRadius: pandora.user.ui.icons == 'posters' ? 0 : 16,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? pandora.site.posters.ratio : 1,
|
||||
draggable: true,
|
||||
id: 'list',
|
||||
item: function(data, sort, size) {
|
||||
size = 128;
|
||||
var ui = pandora.user.ui,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1,
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
|
@ -261,7 +261,7 @@ pandora.ui.list = function() {
|
|||
} else if (view == 'timelines') {
|
||||
that = Ox.InfoList({
|
||||
borderRadius: pandora.user.ui.icons == 'posters' ? 0 : 16,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
|
||||
defaultRatio: pandora.user.ui.icons == 'posters' ? pandora.site.posters.ratio : 1,
|
||||
draggable: true,
|
||||
id: 'list',
|
||||
item: function(data, sort, size) {
|
||||
|
@ -270,7 +270,7 @@ pandora.ui.list = function() {
|
|||
isClipsQuery = !!clipsQuery.conditions.length,
|
||||
ui = pandora.user.ui,
|
||||
ratio = ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 5/8 : data.posterRatio) : 1,
|
||||
? (ui.showSitePosters ? pandora.site.posters.ratio : data.posterRatio) : 1,
|
||||
url = '/' + data.id + '/' + (
|
||||
ui.icons == 'posters'
|
||||
? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon'
|
||||
|
@ -467,7 +467,7 @@ pandora.ui.list = function() {
|
|||
) + (
|
||||
item.year ? ' ' + item.year : ''
|
||||
),
|
||||
ratio = ui.showSitePosters ? 5/8 : item.posterRatio,
|
||||
ratio = ui.showSitePosters ? pandora.site.posters.ratio : item.posterRatio,
|
||||
windowWidth = window.innerWidth * 0.8,
|
||||
windowHeight = window.innerHeight * 0.8,
|
||||
windowRatio = windowWidth / windowHeight,
|
||||
|
@ -606,7 +606,7 @@ pandora.ui.list = function() {
|
|||
} else {
|
||||
that.options({
|
||||
borderRadius: data.value == 'posters' ? 0 : 16,
|
||||
defaultRatio: data.value == 'posters' ? 5/8 : 1
|
||||
defaultRatio: data.value == 'posters' ? pandora.site.posters.ratio : 1
|
||||
});
|
||||
}
|
||||
that.reloadList(true);
|
||||
|
|
Loading…
Reference in a new issue