make advanced find work; put more logic into the url controller
This commit is contained in:
parent
62a952b8b0
commit
4f34613d80
7 changed files with 125 additions and 75 deletions
|
|
@ -17,6 +17,10 @@ pandora.ui.filter = function(list) {
|
|||
title: 'List',
|
||||
type: 'list'
|
||||
}),
|
||||
list: list ? null : {
|
||||
sort: pandora.user.ui.lists[pandora.user.ui.list].sort,
|
||||
view: pandora.user.ui.lists[pandora.user.ui.list].listView
|
||||
},
|
||||
query: list ? list.query : pandora.user.ui.query,
|
||||
sortKeys: pandora.site.sortKeys,
|
||||
viewKeys: pandora.site.listViews
|
||||
|
|
@ -30,14 +34,12 @@ pandora.ui.filter = function(list) {
|
|||
query: data.query
|
||||
}, function(result) {
|
||||
Ox.Request.clearCache(list.id);
|
||||
//Ox.Request.clearCache();
|
||||
pandora.$ui.groups.forEach(function($group) {
|
||||
$group.reloadList();
|
||||
});
|
||||
pandora.$ui.list
|
||||
.bindEventOnce({
|
||||
init: function(data) {
|
||||
Ox.print('NUMBER OF ITEMS:', data.items);
|
||||
pandora.$ui.folderList[
|
||||
pandora.getListData().folder
|
||||
].value(list.id, 'items', data.items);
|
||||
|
|
@ -45,6 +47,10 @@ pandora.ui.filter = function(list) {
|
|||
})
|
||||
.reloadList();
|
||||
});
|
||||
} else {
|
||||
pandora.user.ui.query = data.query;
|
||||
pandora.URL.update();
|
||||
//reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -189,7 +189,49 @@ pandora.ui.listIconPanel = function(list) {
|
|||
size: 288
|
||||
},
|
||||
{
|
||||
element: $list
|
||||
element: Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: Ox.Bar({size: 24}).append(
|
||||
Ox.FormElementGroup({
|
||||
elements: [
|
||||
pandora.$ui.findIconItemSelect = Ox.Select({
|
||||
items: pandora.site.findKeys,
|
||||
overlap: 'right',
|
||||
type: 'image'
|
||||
})
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
|
||||
}
|
||||
}),
|
||||
pandora.$ui.findIconItemInput = Ox.Input({
|
||||
changeOnKeypress: true,
|
||||
clear: true,
|
||||
placeholder: 'Find: Foo',
|
||||
width: 120
|
||||
})
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
|
||||
}
|
||||
})
|
||||
],
|
||||
})
|
||||
.css({
|
||||
float: 'right',
|
||||
margin: '4px',
|
||||
align: 'right'
|
||||
})
|
||||
),
|
||||
size: 24
|
||||
},
|
||||
{
|
||||
element: $list
|
||||
}
|
||||
],
|
||||
orientation: 'vertical'
|
||||
})
|
||||
},
|
||||
{
|
||||
element: $preview,
|
||||
|
|
|
|||
|
|
@ -194,17 +194,11 @@ pandora.ui.mainMenu = function() {
|
|||
groups[position].sort[0].key = key;
|
||||
pandora.UI.set({groups: groups});
|
||||
} else if (data.id == 'sortmovies') {
|
||||
var key = value,
|
||||
operator = pandora.getSortOperator(key);
|
||||
pandora.$ui.mainMenu.checkItem('sortMenu_ordermovies_' + (operator == '+' ? 'ascending' : 'descending'));
|
||||
pandora.$ui.sortSelect.options({value: key});
|
||||
pandora.$ui.list.options({
|
||||
sort: [{key: key, operator: operator}]
|
||||
});
|
||||
pandora.UI.set('lists|' + pandora.user.ui.list + '|sort', [{key: key, operator: operator}]);
|
||||
//pandora.user.ui.lists[pandora.user.ui.list].sort[0] = {key: key, operator: operator};
|
||||
pandora.URL.push(pandora.Query.toString());
|
||||
|
||||
pandora.UI.set(
|
||||
'lists|' + pandora.user.ui.list + '|sort',
|
||||
[{key: value, operator: ''}]
|
||||
);
|
||||
pandora.URL.update();
|
||||
} else if (data.id == 'viewicons') {
|
||||
var $list;
|
||||
pandora.UI.set({icons: value});
|
||||
|
|
@ -221,19 +215,11 @@ pandora.ui.mainMenu = function() {
|
|||
defaultRatio: value == 'posters' ? 5/8 : 1
|
||||
}).reloadList(true);
|
||||
} else if (data.id == 'viewmovies') {
|
||||
var isClipView = pandora.isClipView(value),
|
||||
wasClipView = pandora.isClipView(pandora.user.ui.lists[pandora.user.ui.list].listView);
|
||||
pandora.UI.set(['lists', pandora.user.ui.list, 'listView'].join('|'), value);
|
||||
if (isClipView != wasClipView) {
|
||||
pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu());
|
||||
pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect());
|
||||
}
|
||||
pandora.$ui.viewSelect.options({value: value});
|
||||
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.list = pandora.ui.list());
|
||||
pandora.URL.push('/' + value + '/' + document.location.search);
|
||||
} else if (['personallists', 'favoritelists', 'featuredlists'].indexOf(data.id) > -1) {
|
||||
pandora.UI.set('lists|' + pandora.user.ui.list + '|listView', value);
|
||||
pandora.URL.update();
|
||||
} else if (['personallists', 'favoritelists', 'featuredlists'].indexOf(value) > -1) {
|
||||
pandora.URL.set(
|
||||
data.checked[0] ? '?find=list:' + data.checked[0].id.substr(8) : ''
|
||||
data.checked[0] ? '?find=list:' + value.substr(8) : ''
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,15 +27,14 @@ pandora.ui.sortSelect = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
var key = data.selected[0].id,
|
||||
operator = pandora.getSortOperator(key);
|
||||
pandora.$ui.mainMenu.checkItem('sortMenu_sortmovies_' + key);
|
||||
pandora.$ui.mainMenu.checkItem('sortMenu_ordermovies_' + (operator == '+' ? 'ascending' : 'descending'));
|
||||
pandora.$ui.list.options({
|
||||
sort: [{key: key, operator: operator}]
|
||||
});
|
||||
pandora.UI.set('lists|' + pandora.user.ui.list + '|sort', [{key: key, operator: operator}]);
|
||||
pandora.URL.push(pandora.Query.toString());
|
||||
//var query = Ox.unserialize(document.location.search);
|
||||
//query.sort = data.selected.id;
|
||||
//pandora.URL.set('/' + pandora.user.ui.lists[pandora.user.ui.list].listView + '/?' + Ox.serialize(query));
|
||||
pandora.UI.set(
|
||||
'lists|' + pandora.user.ui.list + '|sort',
|
||||
[{key: data.selected[0].id, operator: ''}]
|
||||
);
|
||||
pandora.URL.update();
|
||||
}
|
||||
});
|
||||
return that;
|
||||
|
|
|
|||
|
|
@ -21,21 +21,12 @@ pandora.ui.viewSelect = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
change: !pandora.user.ui.item ? function(data) {
|
||||
var view = data.selected[0].id,
|
||||
isClipView = pandora.isClipView(view),
|
||||
wasClipView = pandora.isClipView();
|
||||
pandora.UI.set('lists|' + pandora.user.ui.list + '|listView', view);
|
||||
pandora.$ui.mainMenu.checkItem('viewMenu_movies_' + view);
|
||||
if (isClipView != wasClipView) {
|
||||
pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu());
|
||||
pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect());
|
||||
}
|
||||
pandora.URL.set(view + '/' + document.location.search);
|
||||
// pandora.URL.set('/' + view + '/' + document.location.search);
|
||||
pandora.UI.set('lists|' + pandora.user.ui.list + '|listView', data.selected[0].id);
|
||||
pandora.URL.update();
|
||||
//pandora.URL.set('/' + data.selected[0].id + '/' + document.location.search);
|
||||
} : function(data) {
|
||||
var view = data.selected[0].id;
|
||||
//pandora.UI.set({itemView: id});
|
||||
pandora.URL.set(pandora.user.ui.item + '/' + view);
|
||||
pandora.UI.set({itemView: data.selected[0].id});
|
||||
pandora.URL.update();
|
||||
// pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.item = pandora.ui.item());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue