pandora/static/js/pandora/ui/menu.js

567 lines
34 KiB
JavaScript
Raw Normal View History

2011-07-29 18:37:11 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-05-25 19:42:45 +00:00
pandora.ui.mainMenu = function() {
2011-06-06 15:48:11 +00:00
var isGuest = pandora.user.level == 'guest',
ui = pandora.user.ui,
2011-06-19 17:49:25 +00:00
that = Ox.MainMenu({
2011-05-25 19:42:45 +00:00
extras: [
$('<div>').html('beta').css({marginRight: '8px', color: 'rgb(128, 128, 128)'}),
2011-06-19 17:49:25 +00:00
pandora.$ui.loadingIcon = Ox.LoadingIcon({
2011-05-25 19:42:45 +00:00
size: 'medium'
})
],
id: 'mainMenu',
menus: [
2011-06-06 15:48:11 +00:00
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [
2011-05-25 19:42:45 +00:00
{ id: 'home', title: 'Home' },
{},
2011-06-06 15:48:11 +00:00
{ id: 'about', title: 'About ' + pandora.site.site.name },
{ id: 'news', title: pandora.site.site.name + ' News' },
2011-05-25 19:42:45 +00:00
{ id: 'tour', title: 'Take a Tour' },
{ id: 'faq', title: 'Frequently Asked Questions' },
{ id: 'terms', title: 'Terms of Service' },
2011-08-16 17:03:14 +00:00
{ id: 'contact', title: 'Contact ' + pandora.site.site.name },
2011-05-25 19:42:45 +00:00
{},
2011-08-16 17:03:14 +00:00
{ id: 'software', title: 'Software' }
2011-05-25 19:42:45 +00:00
] },
{ id: 'userMenu', title: 'User', items: [
2011-06-06 15:48:11 +00:00
{ id: 'username', title: 'User: ' + (isGuest ? 'not logged in' : pandora.user.username), disabled: true },
2011-05-25 19:42:45 +00:00
{},
{ id: 'preferences', title: 'Preferences...', disabled: isGuest, keyboard: 'control ,' },
2011-08-16 17:03:14 +00:00
{ id: 'archives', title: 'Archives...', disabled: isGuest },
2011-05-25 19:42:45 +00:00
{},
{ id: 'signup', title: 'Sign Up...', disabled: !isGuest },
isGuest ? { id: 'signin', title: 'Sign In...' }
: { id: 'signout', title: 'Sign Out...'}
2011-05-25 19:42:45 +00:00
] },
2011-09-18 01:52:43 +00:00
pandora.getListMenu(),
2011-05-25 19:42:45 +00:00
{ id: 'editMenu', title: 'Edit', items: [
{ id: 'undo', title: 'Undo', disabled: true, keyboard: 'control z' },
{ id: 'redo', title: 'Redo', disabled: true, keyboard: 'shift control z' },
{},
{ id: 'cut', title: 'Cut', disabled: true, keyboard: 'control x' },
{ id: 'copy', title: 'Copy', disabled: true, keyboard: 'control c' },
{ id: 'paste', title: 'Paste', disabled: true, keyboard: 'control v' },
{ id: 'delete', title: 'Delete', disabled: true, keyboard: 'delete' },
{},
{ id: 'selectall', title: 'Select All', disabled: true, keyboard: 'control a' },
{ id: 'selectnone', title: 'Select None', disabled: true, keyboard: 'shift control a' },
{ id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' }
] },
{ id: 'viewMenu', title: 'View', items: [
2011-06-06 15:48:11 +00:00
{ id: 'movies', title: 'View ' + pandora.site.itemName.plural, items: [
{ group: 'viewmovies', min: 1, max: 1, items: pandora.site.listViews.map(function(view) {
return Ox.extend({
checked: ui.listView == view.id,
2011-05-25 19:42:45 +00:00
}, view);
}) },
]},
{ id: 'icons', title: 'Icons', items: [
2011-08-06 18:00:15 +00:00
{ group: 'viewicons', min: 1, max: 1, items: ['posters', 'frames'].map(function(icons) {
return {id: icons, title: Ox.toTitleCase(icons), checked: ui.icons == icons};
2011-08-21 08:17:10 +00:00
}) },
{},
{ id: 'showsiteposter', title: 'Always Show ' + pandora.site.site.name + ' Poster', checked: ui.showSitePoster }
2011-05-25 19:42:45 +00:00
] },
2011-09-04 22:06:14 +00:00
{ id: 'columns', title: 'Columns', items: [
{ id: 'loadcolumns', title: 'Load Layout...' },
{ id: 'savecolumns', title: 'Save Layout...' },
2011-09-04 21:15:53 +00:00
{},
2011-09-18 00:31:41 +00:00
{ id: 'resetcolumns', title: 'Reset Layout' }
2011-09-04 21:15:53 +00:00
]},
2011-05-25 19:42:45 +00:00
{},
2011-08-19 06:40:19 +00:00
{ id: 'openmovie', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], items: [
{ group: 'itemview', min: 1, max: 1, items: pandora.site.itemViews.map(function(view) {
return Ox.extend({
checked: ui.itemView == view.id,
2011-05-25 19:42:45 +00:00
}, view);
}) },
]},
2011-08-19 06:40:19 +00:00
{ id: 'openvideo', title: 'Open Video Links', items: [
{ group: 'videoview', min: 1, max: 1, items: ['player', 'editor'].map(function(view) {
return {id: view, title: Ox.toTitleCase(view), checked: ui.videoView == view};
2011-08-19 06:40:19 +00:00
}) }
] },
2011-05-25 19:42:45 +00:00
{},
2011-09-17 23:24:53 +00:00
{ id: 'groups', title: 'Groups', items: [
{ group: 'groups', min: 5, max: 5, items: pandora.site.groups.map(function(group) {
return Ox.extend({
checked: Ox.getPositionById(ui.groups, group.id) > -1
2011-09-17 23:24:53 +00:00
}, group);
2011-09-18 00:31:41 +00:00
}) },
{},
{ id: 'resetgroups', title: 'Reset Groups' }
2011-09-17 23:24:53 +00:00
] },
{},
2011-05-25 19:42:45 +00:00
{ id: 'lists', title: 'Hide Lists', keyboard: 'shift l' },
{ id: 'info', title: 'Hide Info', keyboard: 'shift i' },
{ id: 'groups', title: 'Hide Groups', keyboard: 'shift g' },
2011-09-09 12:09:05 +00:00
{ id: 'movies', title: 'Hide ' + pandora.site.itemName.plural, disabled: true, keyboard: 'shift m' },
{},
{ id: 'theme', title: 'Theme', items: [
{ group: 'settheme', min: 1, max: 1, items: [
{ id: 'classic', title: 'Classic', checked: ui.theme == 'classic'},
{ id: 'modern', title: 'Modern', checked: ui.theme == 'modern' }
2011-09-09 12:09:05 +00:00
]}
] }
2011-05-25 19:42:45 +00:00
]},
pandora.getSortMenu(),
2011-05-25 19:42:45 +00:00
{ id: 'findMenu', title: 'Find', items: [
{ id: 'find', title: 'Find', items: [
2011-08-18 07:54:46 +00:00
{ group: 'find', min: 1, max: 1, items: pandora.site.findKeys.map(function(key, i) {
var index = ui._findState.index;
return Ox.extend({
checked: index > -1 && ui.find.conditions[index].key
? ui.find.conditions[index].key == key.id
: key.id == 'all'
2011-08-18 07:54:46 +00:00
}, key);
2011-05-25 19:42:45 +00:00
}) }
] },
{ id: 'advancedfind', title: 'Advanced Find...', keyboard: 'shift control f' }
] },
{ id: 'dataMenu', title: 'Data', items: [
{ id: 'titles', title: 'Manage Titles...' },
{ id: 'names', title: 'Manage Names...' },
{},
{ id: 'places', title: 'Manage Places...' },
{ id: 'events', title: 'Manage Events...' },
{},
{ id: 'users', title: 'Manage Users...' },
{ id: 'lists', title: 'Manage Lists...' },
{},
{ id: 'news', title: 'Manage News...' },
{ id: 'tour', title: 'Manage Tour...' }
2011-05-25 19:42:45 +00:00
] },
{ id: 'helpMenu', title: 'Help', items: [
2011-06-06 15:48:11 +00:00
{ id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' }
2011-05-25 19:42:45 +00:00
] },
{ id: 'debugMenu', title: 'Debug', items: [
{ id: 'query', title: 'Show pandora.Query' },
2011-08-11 17:28:44 +00:00
{ id: 'resetui', title: 'Reset UI Settings'},
2011-09-17 23:24:53 +00:00
{ id: 'clearcache', title: 'Clear cache'},
{ id: 'nestedone', title: 'Some Nesting', items: [
{ id: 'nestedtwo', title: 'Some More Nesting', items: [
{ id: 'nestedthree', title: 'Even More Nesting' }
] }
] }
2011-05-25 19:42:45 +00:00
] }
]
})
.bindEvent({
2011-09-17 17:40:15 +00:00
change: function(data) {
2011-09-18 01:52:43 +00:00
var value = data.checked[0] ? data.checked[0].id : null;
2011-05-25 19:42:45 +00:00
if (data.id == 'find') {
2011-09-17 07:07:59 +00:00
pandora.$ui.findSelect.options({value: value});
} else if (data.id == 'itemview') {
pandora.UI.set({itemView: value});
2011-09-17 23:24:53 +00:00
} else if (Ox.startsWith(data.id, 'ordergroup')) {
var groups = Ox.clone(pandora.user.ui.groups),
id = data.id.replace('ordergroup', ''),
position = Ox.getPositionById(groups, id),
key = groups[position].sort[0].key,
operator = value == 'ascending' ? '+' : '-';
pandora.$ui.groups[position].options({
sort: [{key: key, operator: operator}]
});
groups[position].sort[0].operator = operator;
pandora.UI.set({groups: groups});
2011-05-25 19:42:45 +00:00
} else if (data.id == 'ordermovies') {
var key = pandora.user.ui.listSort[0].key,
2011-08-18 07:54:46 +00:00
operator = value == 'ascending' ? '+' : '-';
pandora.UI.set({listSort: [{key: key, operator: operator}]});
2011-09-09 12:09:05 +00:00
} else if (data.id == 'settheme') {
Ox.Theme(value);
pandora.UI.set('theme', value);
} else if (data.id == 'showsiteposter') {
pandora.UI.set('showSitePoster', data.checked)
2011-09-17 23:24:53 +00:00
} else if (Ox.startsWith(data.id, 'sortgroup')) {
var groups = Ox.clone(ui.groups),
2011-09-17 23:24:53 +00:00
id = data.id.replace('sortgroup', ''),
position = Ox.getPositionById(groups, id),
type = Ox.getObjectById(pandora.site.groups, id).type,
2011-09-17 23:24:53 +00:00
key = value,
operator = key == 'name' && type == 'string' ? '+' : '-';
pandora.$ui.mainMenu.checkItem('sortMenu_ordergroups_ordergroup' + id + '_' + (operator == '+' ? 'ascending' : 'descending'))
2011-09-17 23:24:53 +00:00
pandora.$ui.groups[position].options({
sort: [{key: key, operator: operator}]
});
groups[position].sort[0].key = key;
pandora.UI.set({groups: groups});
2011-05-25 19:42:45 +00:00
} else if (data.id == 'sortmovies') {
pandora.UI.set({listSort: [{key: value, operator: ''}]});
2011-08-07 18:30:14 +00:00
} else if (data.id == 'viewicons') {
2011-08-07 20:25:33 +00:00
pandora.UI.set({icons: value});
2011-05-25 19:42:45 +00:00
} else if (data.id == 'viewmovies') {
pandora.UI.set('listView', value);
} else if (['personallists', 'favoritelists', 'featuredlists'].indexOf(value) > -1) {
pandora.UI.set({list: value.substr(8)});
2011-05-25 19:42:45 +00:00
}
},
2011-09-17 17:40:15 +00:00
click: function(data) {
if ([
'home', 'about', 'news', 'tour', 'faq', 'tos', 'contact', 'software',
'signup', 'signin', 'signout', 'preferences', 'help'
].indexOf(data.id) > -1) {
pandora.URL.push('/' + data.id);
2011-08-04 14:49:16 +00:00
} else if (data.id == 'stills') {
var id = pandora.user.ui.item || pandora.user.ui.listItem;
pandora.$ui.postersDialog = pandora.ui.framesDialog(id).open();
2011-06-06 12:23:59 +00:00
} else if (data.id == 'posters') {
2011-08-01 16:55:18 +00:00
var id = pandora.user.ui.item || pandora.user.ui.listItem;
pandora.$ui.postersDialog = pandora.ui.postersDialog(id).open();
2011-05-25 19:42:45 +00:00
} else if (data.id == 'places') {
2011-06-06 15:48:11 +00:00
pandora.$ui.placesDialog = pandora.ui.placesDialog().open();
2011-05-25 19:42:45 +00:00
/*
2011-06-19 17:49:25 +00:00
var $manage = Ox.SplitPanel({
2011-05-25 19:42:45 +00:00
elements: [
{
collapsible: true,
2011-06-19 17:49:25 +00:00
element: Ox.SplitPanel({
2011-05-25 19:42:45 +00:00
elements: [
{
2011-06-19 17:49:25 +00:00
element: Ox.Toolbar({
2011-05-25 19:42:45 +00:00
orientation: 'horizontal',
size: 44
}).append(
2011-06-19 17:49:25 +00:00
pandora.$ui.findPlacesElement = Ox.FormElementGroup({
2011-05-25 19:42:45 +00:00
elements: [
2011-06-19 17:49:25 +00:00
pandora.$ui.findPlacesSelect = Ox.Select({
2011-05-25 19:42:45 +00:00
id: 'findPlacesSelect',
items: [
{ id: 'name', title: 'Find: Name' },
{ id: 'region', title: 'Find: Region' },
{ id: 'user', title: 'Find: User' }
],
overlap: 'right',
type: 'image'
})
.bindEvent({
2011-09-17 17:40:15 +00:00
change: function(data) {
2011-06-06 15:48:11 +00:00
pandora.$ui.findPlacesSelect.loseFocus();
pandora.$ui.findPlacesInput.options({
2011-05-25 19:42:45 +00:00
placeholder: data.selected[0].title
});
}
}),
2011-06-19 17:49:25 +00:00
pandora.$ui.findPlacesInput = Ox.Input({
2011-05-25 19:42:45 +00:00
clear: true,
id: 'findPlacesInput',
placeholder: 'Find: Name',
width: 234
})
],
id: 'findPlacesElement'
})
.css({
float: 'left',
margin: '4px'
})
).append(
2011-06-19 17:49:25 +00:00
pandora.$ui.sortPlacesSelect = Ox.Select({
2011-05-25 19:42:45 +00:00
id: 'sortPlacesSelect',
items: [
{ id: 'name', title: 'Sort by Name', checked: true },
{ id: 'region', title: 'Sort by Region' },
{ id: 'size', title: 'Sort by Size' },
{ id: 'latitude', title: 'Sort by Latitude' },
{ id: 'longitude', title: 'Sort by Longitude' },
{ id: 'clips', title: 'Sort by Number of Clips' },
{ id: 'user', title: 'Sort by User' },
{ id: 'datecreated', title: 'Sort by Date Added' },
{ id: 'datemodified', title: 'Sort by Date Modified' }
],
width: 246
})
.css({
float: 'left',
margin: '0 4px 4px 4px'
})
),
size: 44
},
{
2011-06-19 17:49:25 +00:00
element: Ox.Element('div')
2011-05-25 19:42:45 +00:00
},
{
2011-06-19 17:49:25 +00:00
element: Ox.Toolbar({
2011-05-25 19:42:45 +00:00
orientation: 'horizontal',
size: 16
}),
size: 16
}
],
orientation: 'vertical'
}),
size: 256
},
{
2011-06-19 17:49:25 +00:00
element: Ox.SplitPanel({
2011-05-25 19:42:45 +00:00
elements: [
{
2011-06-19 17:49:25 +00:00
element: Ox.Toolbar({
2011-05-25 19:42:45 +00:00
orientation: 'horizontal',
size: 24
}).append(
2011-06-19 17:49:25 +00:00
pandora.$ui.labelsButton = Ox.Button({
2011-05-25 19:42:45 +00:00
id: 'labelsButton',
title: [
{id: 'show', title: 'Show Labels'},
{id: 'hide', title: 'Hide Labels'}
],
width: 96
})
.css({
float: 'left',
margin: '4px'
})
).append(
2011-06-19 17:49:25 +00:00
pandora.$ui.findMapInput = Ox.Input({
2011-05-25 19:42:45 +00:00
clear: true,
id: 'findMapInput',
placeholder: 'Find on Map',
width: 192
})
.css({
float: 'right',
margin: '4px'
})
.bindEvent({
2011-09-17 17:40:15 +00:00
submit: function(data) {
2011-06-06 15:48:11 +00:00
pandora.$ui.map.find(data.value, function(location) {
2011-05-25 19:42:45 +00:00
2011-06-06 15:48:11 +00:00
pandora.$ui.placeNameInput.options({
2011-05-25 19:42:45 +00:00
disabled: false,
value: location.name
});
2011-06-06 15:48:11 +00:00
pandora.$ui.placeAliasesInput.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
2011-06-06 15:48:11 +00:00
pandora.$ui.placeGeonameLabel.options({
2011-05-25 19:42:45 +00:00
disabled: false,
title: location.names.join(', ')
});
2011-06-06 15:48:11 +00:00
pandora.$ui.removePlaceButton.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
2011-06-06 15:48:11 +00:00
pandora.$ui.addPlaceButton.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
});
}
})
),
size: 24
},
{
2011-06-19 17:49:25 +00:00
element: pandora.$ui.map = Ox.Map({
2011-05-25 19:42:45 +00:00
places: ['Boston', 'Brussels', 'Barcelona', 'Berlin', 'Beirut', 'Bombay', 'Bangalore', 'Beijing']
})
.css({
left: 0,
top: 0,
right: 0,
bottom: 0
})
.bindEvent({
select: function(event, location) {
2011-06-06 15:48:11 +00:00
pandora.$ui.placeNameInput.options({
2011-05-25 19:42:45 +00:00
disabled: false,
value: location.name
});
2011-06-06 15:48:11 +00:00
pandora.$ui.placeAliasesInput.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
2011-06-06 15:48:11 +00:00
pandora.$ui.placeGeonameLabel.options({
2011-05-25 19:42:45 +00:00
disabled: false,
title: location.names.join(', ')
});
2011-06-06 15:48:11 +00:00
pandora.$ui.removePlaceButton.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
2011-06-06 15:48:11 +00:00
pandora.$ui.addPlaceButton.options({
2011-05-25 19:42:45 +00:00
disabled: false
});
}
})
},
{
2011-06-19 17:49:25 +00:00
element: pandora.$ui.bottomBar = Ox.Toolbar({
2011-05-25 19:42:45 +00:00
orientation: 'horizontal',
size: 24
})
.append(
2011-06-19 17:49:25 +00:00
pandora.$ui.placeNameInput = Ox.Input({
2011-05-25 19:42:45 +00:00
disabled: true,
id: 'placeName',
placeholder: 'Name',
width: 128
})
.css({
float: 'left',
margin: '4px 0 0 4px'
})
)
.append(
2011-06-19 17:49:25 +00:00
pandora.$ui.placeAliasesInput = Ox.Input({
2011-05-25 19:42:45 +00:00
disabled: true,
id: 'aliases',
placeholder: 'Aliases',
width: 128
})
.css({
float: 'left',
margin: '4px 0 0 4px'
})
)
.append(
2011-06-19 17:49:25 +00:00
pandora.$ui.placeGeonameLabel = Ox.Label({
2011-05-25 19:42:45 +00:00
disabled: true,
id: 'placeGeoname',
title: 'Geoname',
2011-06-06 15:48:11 +00:00
width: parseInt(pandora.$ui.document.width() * 0.8) - 256 - 256 - 32 - 24
2011-05-25 19:42:45 +00:00
})
.css({
float: 'left',
margin: '4px 0 0 4px'
})
)
.append(
2011-06-19 17:49:25 +00:00
pandora.$ui.addPlaceButton = Ox.Button({
2011-05-25 19:42:45 +00:00
disabled: true,
id: 'addPlaceButton',
title: 'add',
type: 'image'
})
.css({
float: 'right',
margin: '4px 4px 0 0'
})
)
.append(
2011-06-19 17:49:25 +00:00
pandora.$ui.removePlaceButton = Ox.Button({
2011-05-25 19:42:45 +00:00
disabled: true,
id: 'removePlaceButton',
title: 'remove',
type: 'image'
})
.css({
float: 'right',
margin: '4px 4px 0 0'
})
),
size: 24
}
],
orientation: 'vertical'
})
}
],
orientation: 'horizontal'
}).css({
top: '24px',
bottom: '24px',
}),
2011-06-19 17:49:25 +00:00
$dialog = Ox.Dialog({
2011-05-25 19:42:45 +00:00
buttons: [
{
click: function() {
$dialog.close();
},
id: 'close',
title: 'Close',
value: 'Close'
}
],
2011-06-06 15:48:11 +00:00
height: parseInt(pandora.$ui.document.height() * 0.8),
2011-05-25 19:42:45 +00:00
id: 'places',
minHeight: 400,
minWidth: 600,
padding: 0,
title: 'Manage Places',
2011-06-06 15:48:11 +00:00
width: parseInt(pandora.$ui.document.width() * 0.8)
2011-05-25 19:42:45 +00:00
}).css({
overflow: 'hidden'
}).append($manage).open();
*/
} else if (data.id == 'events') {
pandora.$ui.eventsDialog = pandora.ui.eventsDialog().open();
} else if (data.id == 'users') {
pandora.$ui.eventsDialog = pandora.ui.usersDialog().open();
} else if (data.id == 'lists') {
pandora.$ui.eventsDialog = pandora.ui.listsDialog().open();
2011-05-25 19:42:45 +00:00
} else if (data.id == 'query') {
2011-06-19 17:49:25 +00:00
var $dialog = Ox.Dialog({
2011-05-25 19:42:45 +00:00
buttons: [
2011-06-19 17:49:25 +00:00
Ox.Button({
2011-05-25 19:42:45 +00:00
id: 'close',
title: 'Close'
}).bindEvent({
click: function() {
$dialog.close();
}
})
],
2011-06-19 17:49:25 +00:00
content: Ox.Element()
2011-08-17 11:39:55 +00:00
.css({padding: '16px'})
2011-05-25 19:42:45 +00:00
.html([
'Query: ' + JSON.stringify(pandora.Query.toObject()),
2011-06-06 15:48:11 +00:00
'findQuery: ' + JSON.stringify(pandora.user.ui.findQuery),
'listQuery: ' + JSON.stringify(pandora.user.ui.listQuery)
2011-05-25 19:42:45 +00:00
].join('<br/><br/>')),
2011-08-17 11:39:55 +00:00
height: 192,
2011-05-25 19:42:45 +00:00
keys: {enter: 'close', escape: 'close'},
2011-08-17 11:39:55 +00:00
title: 'Query',
width: 384
2011-05-25 19:42:45 +00:00
}).open();
2011-09-18 00:31:41 +00:00
} else if (data.id == 'resetgroups') {
pandora.UI.set({
groups: pandora.site.user.ui.groups
});
pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
2011-05-25 19:42:45 +00:00
} else if (data.id == 'resetui') {
pandora.api.resetUI({}, function() {
2011-06-06 15:48:11 +00:00
pandora.$ui.appPanel.reload();
2011-05-25 19:42:45 +00:00
});
2011-08-11 17:28:44 +00:00
} else if (data.id == 'clearcache') {
Ox.Request.clearCache();
2011-05-25 19:42:45 +00:00
}
}
});
2011-09-18 01:52:43 +00:00
// fixme: the sidebar makes the same requests.
// is it ok to make them twice, or should the sidebar trigger the menu replace?
var counter = 0,
lists = {},
queries = {
// fixme: duplicated
personal: {conditions: [
{key: 'user', value: pandora.user.username, operator: '='},
{key: 'status', value: 'featured', operator: '!'}
], operator: '&'},
favorite: {conditions: [
{key: 'subscribed', value: true, operator: '='},
{key: 'status', value: 'featured', operator: '!'},
], operator: '&'},
featured: {conditions: [
{key: 'status', value: 'featured', operator: '='}
], operator: '&'}
};
Ox.forEach(queries, function(query, folder) {
pandora.api.findLists({
query: query,
keys: ['id', 'name', 'user']
}, function(result) {
lists[folder] = result.data.items;
if (++counter == 3) {
Ox.print('--------------------------------------------', lists)
pandora.$ui.mainMenu.replaceMenu('listMenu', pandora.getListMenu(lists));
}
});
});
2011-05-25 19:42:45 +00:00
return that;
};