fix bugs with images in text lists

This commit is contained in:
rolux 2011-11-03 12:58:22 +00:00
parent a1d9a08e36
commit 9c55c93fc1
8 changed files with 36 additions and 47 deletions

View file

@ -557,7 +557,7 @@
"system": "0xdb@0xdb.org" "system": "0xdb@0xdb.org"
}, },
"id": "oxdb", "id": "oxdb",
"name": "0xDb", "name": "0xDB",
"url": "0xdb.org", "url": "0xdb.org",
"videoprefix": "" "videoprefix": ""
}, },

View file

@ -31,9 +31,7 @@ pandora.ui.folderBrowserList = function(id) {
}, },
*/ */
id: 'id', id: 'id',
title: $('<img>').attr({ titleImage: 'icon',
src: Ox.UI.getImageURL('symbolIcon')
}),
unique: true, unique: true,
visible: true, visible: true,
width: 16 width: 16
@ -79,10 +77,7 @@ pandora.ui.folderBrowserList = function(id) {
}, },
id: 'type', id: 'type',
operator: '+', operator: '+',
title: $('<img>') titleImage: 'edit',
.attr({
src: Ox.UI.getImageURL('symbolEdit')
}),
tooltip: function(data) { tooltip: function(data) {
return data.type == 'smart' return data.type == 'smart'
? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query') ? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query')
@ -111,12 +106,7 @@ pandora.ui.folderBrowserList = function(id) {
}, },
id: id == 'favorite' ? 'subscribed' : 'status', id: id == 'favorite' ? 'subscribed' : 'status',
operator: '+', operator: '+',
title: $('<img>') titleImage: id == 'favorite' ? 'like' : 'star',
.attr({
src: Ox.UI.getImageURL(
'symbol' + (id == 'favorite' ? 'Like' : 'Star')
)
}),
tooltip: function(data) { tooltip: function(data) {
var checked = id == 'favorite' ? data.subscribed : data.status == 'featured'; var checked = id == 'favorite' ? data.subscribed : data.status == 'featured';
return (checked ? 'Remove from' : 'Add to') return (checked ? 'Remove from' : 'Add to')

View file

@ -36,9 +36,8 @@ pandora.ui.folders = function() {
{ id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list }, { id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list },
{ id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list } { id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list }
], ],
max: 0,
min: 0,
selectable: false, selectable: false,
title: 'set', // FIXME: why does this work in VideoEditor, but not here?
tooltip: 'Manage Personal Lists', tooltip: 'Manage Personal Lists',
type: 'image' type: 'image'
}) })

View file

@ -11,7 +11,7 @@ pandora.ui.group = function(id) {
align: 'left', align: 'left',
id: 'name', id: 'name',
format: function(value) { format: function(value) {
return ['country', 'language'].indexOf(id) > -1 return ['country', 'language'].indexOf(id) > -1 && pandora.user.ui.showFlags
? $('<div>') ? $('<div>')
.append( .append(
$('<img>') $('<img>')
@ -28,6 +28,7 @@ pandora.ui.group = function(id) {
) )
.append( .append(
$('<div>') $('<div>')
.addClass('flagname')
.css({ .css({
float: 'left', float: 'left',
width: pandora.user.ui.groupsSizes[i] - 64 - Ox.UI.SCROLLBAR_SIZE, width: pandora.user.ui.groupsSizes[i] - 64 - Ox.UI.SCROLLBAR_SIZE,

View file

@ -56,25 +56,8 @@ pandora.ui.list = function() {
}, },
id: 'posterRatio', id: 'posterRatio',
resizable: false, resizable: false,
///* title: 'Icon',
title: '<img src="' + Ox.UI.getImageURL( titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon',
pandora.user.ui.icons == 'posters'
? 'symbolSetPoster' : 'symbolIcon'
) + '" style="width: 12px; height: 12px; margin: 0 0 0 -2px">',
//*/
/*
title: $('<img>').attr({
src: Ox.UI.getImageURL(
pandora.user.ui.icons == 'posters'
? 'symbolSetPoster' : 'symbolIcon'
)
})
.css({
width: '12px',
height: '12px',
margin: '0 0 0 -2px'
}),
*/
visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1, visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1,
width: 16 width: 16
}], Ox.map(pandora.site.sortKeys, function(key) { }], Ox.map(pandora.site.sortKeys, function(key) {
@ -550,11 +533,25 @@ pandora.ui.list = function() {
if (['list', 'grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) { if (['list', 'grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) {
that.bindEvent({ that.bindEvent({
pandora_icons: function(data) { pandora_icons: function(data) {
var src, previousSrc;
// fixme: doesn't update title icon, passes useless options // fixme: doesn't update title icon, passes useless options
hasIcons() && that.options({ if (hasIcons()) {
if (pandora.user.ui.listView == 'list') {
src = Ox.UI.getImageURL(
data.value == 'posters' ? 'symbolSetPoster' : 'symbolIcon'
);
previousSrc = Ox.UI.getImageURL(
data.previousValue == 'posters' ? 'symbolSetPoster' : 'symbolIcon'
)
that.$element.find('img[src="' + previousSrc + '"]').attr({src: src});
} else {
that.options({
borderRadius: data.value == 'posters' ? 0 : 16, borderRadius: data.value == 'posters' ? 0 : 16,
defaultRatio: data.value == 'posters' ? 5/8 : 1 defaultRatio: data.value == 'posters' ? 5/8 : 1
}).reloadList(true); });
}
that.reloadList(true);
}
}, },
pandora_showsiteposter: function() { pandora_showsiteposter: function() {
// fixme: should be disabled if ui.icons != 'posters' // fixme: should be disabled if ui.icons != 'posters'

View file

@ -107,8 +107,8 @@ pandora.ui.logsDialog = function() {
init: function(data) { init: function(data) {
numberOfLogs = data.items; numberOfLogs = data.items;
$status.html( $status.html(
Ox.formatNumber(numberOfLogs) Ox.formatNumber(numberOfLogs) + ' '
+ ' log ' + (numberOfLogs == 1 ? 'entry' : 'entries') + (numberOfLogs == 1 ? 'entry' : 'entries')
); );
}, },
'delete': function(data) { 'delete': function(data) {
@ -189,8 +189,8 @@ pandora.ui.logsDialog = function() {
.css({ .css({
position: 'absolute', position: 'absolute',
top: '4px', top: '4px',
left: '4px', left: '128px',
right: '256px', right: '128px',
bottom: '4px', bottom: '4px',
paddingTop: '2px', paddingTop: '2px',
fontSize: '9px', fontSize: '9px',

View file

@ -41,7 +41,6 @@ pandora.ui.mainPanel = function() {
} }
}, },
pandora_item: function(data) { pandora_item: function(data) {
Ox.print('PANDORA_ITEM', data.value, data.previousValue)
if (!data.value || !data.previousValue) { if (!data.value || !data.previousValue) {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
} }

View file

@ -752,8 +752,11 @@ pandora.resizeGroups = function(width) {
pandora.$ui.groupsInnerPanel pandora.$ui.groupsInnerPanel
.size(0, pandora.user.ui.groupsSizes[1]) .size(0, pandora.user.ui.groupsSizes[1])
.size(2, pandora.user.ui.groupsSizes[3]); .size(2, pandora.user.ui.groupsSizes[3]);
pandora.$ui.groups.forEach(function(list, i) { pandora.$ui.groups.forEach(function($list, i) {
list.resizeColumn('name', pandora.user.ui.groupsSizes[i] - 40 - Ox.UI.SCROLLBAR_SIZE); $list.resizeColumn('name', pandora.user.ui.groupsSizes[i] - 40 - Ox.UI.SCROLLBAR_SIZE);
if (pandora.user.ui.showFlags) {
$list.find('.flagname').css({width: pandora.user.ui.groupsSizes[i] - 64 - Ox.UI.SCROLLBAR_SIZE})
}
}); });
}; };