update to new UI/URL handling

This commit is contained in:
rolux 2011-09-26 18:46:31 +02:00
parent 41134b5eb1
commit a09813bc28
19 changed files with 73 additions and 79 deletions

View file

@ -191,13 +191,13 @@ Ox.load({
function unloadWindow() { function unloadWindow() {
// fixme: ajax request has to have async set to false for this to work // fixme: ajax request has to have async set to false for this to work
pandora.user.ui.section == 'items' && pandora.user.ui.section == 'items'
['player', 'timeline'].indexOf(pandora.user.ui.itemView) > -1 && && pandora.user.ui.item
pandora.user.ui.item && && ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1
pandora.UI.set( && pandora.UI.set(
'videoPosition|' + pandora.user.ui.item, 'videoPosition.' + pandora.user.ui.item,
pandora.$ui[ pandora.$ui[
pandora.user.ui.itemView == 'player' ? 'player' : 'editor' pandora.user.ui.itemView == 'video' ? 'player' : 'editor'
].options('position') ].options('position')
); );
} }

View file

@ -1,15 +1,19 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript // vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.UI = (function() { pandora.UI = (function() {
// fixme: "|" as separator doesn't buy us much, use "."
var self = {}, that = {}; var self = {}, that = {};
self.previousUI = {}; self.previousUI = {};
// sets pandora.user.ui.key to val that.bind = function() {
// key foo|bar|baz sets pandora.user.ui.foo.bar.baz Ox.Event.bind.apply(null, arguments);
// (we have to use '|' as a separator since list names may contain '.') };
// val null removes a key that.encode = function(val) {
return val.replace(/\./g, '\\.');
};
that.getPrevious = function(key) { that.getPrevious = function(key) {
return !key ? self.previousUI : self.previousUI[key]; return !key ? self.previousUI : self.previousUI[key];
}; };
// sets pandora.user.ui.key to val
// key foo.bar.baz sets pandora.user.ui.foo.bar.baz
// val null removes a key
that.set = function(/*{key: val} or key, val*/) { that.set = function(/*{key: val} or key, val*/) {
var obj = Ox.makeObject(arguments), var obj = Ox.makeObject(arguments),
set = {}; set = {};
@ -18,25 +22,25 @@ pandora.UI = (function() {
var listSettings = pandora.site.listSettings var listSettings = pandora.site.listSettings
if (key == 'list' && !pandora.user.ui.lists[val]) { if (key == 'list' && !pandora.user.ui.lists[val]) {
// add default list settings // add default list settings
obj['lists|' + val] = {}; obj['lists.' + that.encode(val)] = {};
Ox.forEach(listSettings, function(listSetting, setting) { Ox.forEach(listSettings, function(listSetting, setting) {
obj['lists|' + val][listSetting] = pandora.site.user.ui[setting]; obj['lists.' + that.encode(val)][listSetting] = pandora.site.user.ui[setting];
}); });
} else if (Object.keys(listSettings).indexOf(key) > -1) { } else if (Object.keys(listSettings).indexOf(key) > -1) {
// add list setting // add list setting
obj['lists|' + pandora.user.ui.list + '|' + listSettings[key]] = val; obj['lists.' + that.encode(pandora.user.ui.list) + '.' + listSettings[key]] = val;
} else if ( } else if (
key == 'itemView' key == 'itemView'
&& ['video', 'timeline'].indexOf(val) > -1 && ['video', 'timeline'].indexOf(val) > -1
&& !pandora.user.ui.videoPoints[pandora.user.ui.item] && !pandora.user.ui.videoPoints[pandora.user.ui.item]
) { ) {
// add default videoPoints // add default videoPoints
obj['videoPoints|' + pandora.user.ui.item] = {'in': 0, out: 0, position: 0}; obj['videoPoints.' + pandora.user.ui.item] = {'in': 0, out: 0, position: 0};
} }
}); });
Ox.forEach(obj, function(val, key) { Ox.forEach(obj, function(val, key) {
var i = 0, var i = 0,
keys = key.split('|'), keys = key.split('.'),
ui = pandora.user.ui; ui = pandora.user.ui;
while (i < keys.length - 1) { while (i < keys.length - 1) {
ui = ui[keys[i]]; ui = ui[keys[i]];
@ -48,7 +52,9 @@ pandora.UI = (function() {
} else { } else {
ui[keys[i]] = val; ui[keys[i]] = val;
} }
set[key] = val; // set[key] = val;
// fixme: remove later
set[key.replace(/\./g, '|')] = val;
} }
}); });
if (Ox.len(set)) { if (Ox.len(set)) {

View file

@ -200,19 +200,16 @@ pandora.URL = (function() {
} }
function getState() { function getState() {
if (!pandora.user.ui.lists[pandora.user.ui.list]) {
pandora.user.ui.lists[pandora.user.ui.list] = pandora.site.user.ui.lists[''];
}
return { return {
type: pandora.user.ui.section == 'items' type: pandora.user.ui.section == 'items'
? pandora.site.itemsSection ? pandora.site.itemsSection
: pandora.user.ui.section, : pandora.user.ui.section,
item: pandora.user.ui.item, item: pandora.user.ui.item,
view: !pandora.user.ui.item view: !pandora.user.ui.item
? pandora.user.ui.lists[pandora.user.ui.list].view ? pandora.user.ui.listView
: pandora.user.ui.itemView, : pandora.user.ui.itemView,
sort: !pandora.user.ui.item sort: !pandora.user.ui.item
? pandora.user.ui.lists[pandora.user.ui.list].sort ? pandora.user.ui.listSort
: pandora.isClipView(pandora.user.ui.itemView) : pandora.isClipView(pandora.user.ui.itemView)
? pandora.user.ui.itemSort : [], ? pandora.user.ui.itemSort : [],
find: !pandora.user.ui.item find: !pandora.user.ui.item
@ -298,17 +295,10 @@ pandora.URL = (function() {
list: getListsState(state.find) list: getListsState(state.find)
}); });
if (!pandora.user.ui.lists[pandora.user.ui.list]) {
pandora.UI.set(
'lists|' + pandora.user.ui.list,
pandora.site.user.ui.lists['']
);
}
if (state.view) { if (state.view) {
pandora.UI.set( pandora.UI.set(
!pandora.user.ui.item !pandora.user.ui.item
? 'lists|' + pandora.user.ui.list + '|view' ? 'lists.' + pandora.user.ui.list + '.view'
: 'itemView', : 'itemView',
state.view state.view
); );
@ -320,13 +310,13 @@ pandora.URL = (function() {
if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) { if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) {
if (state.span) { if (state.span) {
pandora.UI.set('videoPoints|' + pandora.user.ui.item, { pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
position: state.span[0], position: state.span[0],
'in': state.span[1] || 0, 'in': state.span[1] || 0,
out: state.span[2] || 0 out: state.span[2] || 0
}); });
} else if (!pandora.user.ui.videoPoints[pandora.user.ui.item]) { } else if (!pandora.user.ui.videoPoints[pandora.user.ui.item]) {
pandora.UI.set('videoPoints|' + pandora.user.ui.item, { pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
position: 0, position: 0,
'in': 0, 'in': 0,
out: 0 out: 0
@ -336,7 +326,7 @@ pandora.URL = (function() {
state.sort && pandora.UI.set( state.sort && pandora.UI.set(
!pandora.user.ui.item !pandora.user.ui.item
? 'lists|' + pandora.user.ui.list + '|sort' ? 'lists.' + pandora.user.ui.list + '.sort'
: 'itemSort', : 'itemSort',
state.sort state.sort
); );
@ -365,7 +355,7 @@ pandora.URL = (function() {
pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu()); pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu());
pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect()); pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect());
if (isClipView && !wasClipView) { if (isClipView && !wasClipView) {
pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', []); pandora.UI.set('lists.' + pandora.user.ui.list + '.selected', []);
} }
} }
} }
@ -409,7 +399,7 @@ pandora.URL = (function() {
previousUI.itemView == 'video' ? 'player' : 'editor' previousUI.itemView == 'video' ? 'player' : 'editor'
]; ];
$item && pandora.UI.set( $item && pandora.UI.set(
'videoPoints|' + previousUI.item + '|position', 'videoPoints.' + previousUI.item + '.position',
$item.options('position') $item.options('position')
); );
} }
@ -442,7 +432,7 @@ pandora.URL = (function() {
pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu()); pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu());
pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect()); pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect());
if (isClipView && !wasClipView) { if (isClipView && !wasClipView) {
pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', []); pandora.UI.set('lists.' + pandora.user.ui.list + '.selected', []);
} }
} }
} }
@ -480,7 +470,7 @@ pandora.URL = (function() {
previousUI.itemView == 'video' ? 'player' : 'editor' previousUI.itemView == 'video' ? 'player' : 'editor'
]; ];
$item && pandora.UI.set( $item && pandora.UI.set(
'videoPoints|' + previousUI.item + '|position', 'videoPoints.' + previousUI.item + '.position',
$item.options('position') $item.options('position')
); );
} }

View file

@ -569,6 +569,7 @@ pandora.signout = function(data) {
}; };
pandora.reloadGroups = function(i) { pandora.reloadGroups = function(i) {
// fixme: no longer needed
var query = pandora.user.ui.query, var query = pandora.user.ui.query,
view = pandora.user.ui.lists[pandora.user.ui.list].listView; view = pandora.user.ui.lists[pandora.user.ui.list].listView;
if (view == 'clip') { if (view == 'clip') {
@ -688,10 +689,6 @@ pandora.resizeFolders = function() {
}); });
}; };
pandora.saveVideoPosition = function() {
//alert(JSON.stringify(['videoPosition|' + old.user.ui.item, pandora.$ui[old.user.ui.itemView == 'player' ? 'player' : 'editor'].options('position')]));
};
pandora.selectList = function() { pandora.selectList = function() {
if (pandora.user.ui.list) { if (pandora.user.ui.list) {
pandora.api.findLists({ pandora.api.findLists({

View file

@ -94,7 +94,7 @@ pandora.ui.browser = function() {
} }
}); });
pandora.enableDragAndDrop(that, false); pandora.enableDragAndDrop(that, false);
Ox.Event.bind({ pandora.UI.bind({
icons: function(value) { icons: function(value) {
that.options({ that.options({
borderRadius: value == 'posters' ? 0 : 8, borderRadius: value == 'posters' ? 0 : 8,

View file

@ -28,7 +28,7 @@ pandora.ui.contentPanel = function() {
], ],
orientation: 'vertical' orientation: 'vertical'
}); });
Ox.Event.bind({ pandora.UI.bind({
listView: function() { listView: function() {
that.replaceElement(1, pandora.$ui.list = pandora.ui.list()); that.replaceElement(1, pandora.$ui.list = pandora.ui.list());
}, },

View file

@ -18,8 +18,8 @@ pandora.ui.filter = function(list) {
type: 'list' type: 'list'
}), }),
list: list ? null : { list: list ? null : {
sort: pandora.user.ui.lists[pandora.user.ui.list].sort, sort: pandora.user.ui.listSort,
view: pandora.user.ui.lists[pandora.user.ui.list].listView view: pandora.user.ui.listView
}, },
query: list ? list.query : pandora.user.ui.query, query: list ? list.query : pandora.user.ui.query,
sortKeys: pandora.site.sortKeys, sortKeys: pandora.site.sortKeys,
@ -49,7 +49,7 @@ pandora.ui.filter = function(list) {
}); });
} else { } else {
pandora.UI.set('query', data.query); pandora.UI.set({find: data.query});
pandora.URL.push(); pandora.URL.push();
//reload(); //reload();
} }

View file

@ -49,7 +49,7 @@ pandora.ui.folders = function() {
type: data.id == 'new' ? 'static' : 'smart' type: data.id == 'new' ? 'static' : 'smart'
}, function(result) { }, function(result) {
var id = result.data.id; var id = result.data.id;
pandora.UI.set(['lists', id].join('|'), pandora.site.user.ui.lists['']); // fixme: necessary? pandora.UI.set('lists.' + id, pandora.site.user.ui.lists['']); // fixme: necessary?
pandora.URL.set('?find=list:' + id) pandora.URL.set('?find=list:' + id)
Ox.Request.clearCache(); // fixme: remove Ox.Request.clearCache(); // fixme: remove
$list.reloadList().bindEventOnce({ $list.reloadList().bindEventOnce({
@ -220,7 +220,7 @@ pandora.ui.folders = function() {
}, },
toggle: function(data) { toggle: function(data) {
data.collapsed && pandora.$ui.folderList[folder.id].loseFocus(); data.collapsed && pandora.$ui.folderList[folder.id].loseFocus();
pandora.UI.set('showFolder|items|' + folder.id, !data.collapsed); pandora.UI.set('showFolder.items.' + folder.id, !data.collapsed);
pandora.resizeFolders(); pandora.resizeFolders();
} }
}); });

View file

@ -263,7 +263,7 @@ pandora.ui.folderList = function(id) {
type: event.keys == '' ? 'static' : 'smart' type: event.keys == '' ? 'static' : 'smart'
}, function(result) { }, function(result) {
var id = result.data.id; var id = result.data.id;
pandora.UI.set(['lists', id].join('|'), pandora.site.user.ui.lists['']); // fixme: necessary? pandora.UI.set('lists.' + id, pandora.site.user.ui.lists['']); // fixme: necessary?
pandora.URL.set('?find=list:' + id) pandora.URL.set('?find=list:' + id)
Ox.Request.clearCache(); // fixme: remove Ox.Request.clearCache(); // fixme: remove
that.reloadList().bindEventOnce({ that.reloadList().bindEventOnce({
@ -321,7 +321,7 @@ pandora.ui.folderList = function(id) {
pandora.api.removeList({ pandora.api.removeList({
id: data.ids[0] id: data.ids[0]
}, function(result) { }, function(result) {
pandora.UI.set(['lists', data.ids[0]].join('|'), null); pandora.UI.set('lists.' + data.ids[0], null);
Ox.Request.clearCache(); // fixme: remove Ox.Request.clearCache(); // fixme: remove
that.reloadList(); that.reloadList();
}); });

View file

@ -518,7 +518,7 @@ pandora.ui.infoView = function(data) {
$data.css({height: height + 'px'}); $data.css({height: height + 'px'});
}; };
Ox.Event.bind({ pandora.UI.bind({
icons: that.reload, icons: that.reload,
showSitePoster: that.reload showSitePoster: that.reload
}); });

View file

@ -146,7 +146,7 @@ pandora.ui.item = function() {
'in': pandora.$ui.clips.value(id, 'in'), 'in': pandora.$ui.clips.value(id, 'in'),
out: pandora.$ui.clips.value(id, 'out') out: pandora.$ui.clips.value(id, 'out')
}; };
pandora.UI.set('videoPoints|' + pandora.user.ui.item, Ox.extend(points, { pandora.UI.set('videoPoints.' + pandora.user.ui.item, Ox.extend(points, {
position: points['in'] position: points['in']
})); }));
pandora.UI.set({ pandora.UI.set({
@ -212,7 +212,7 @@ pandora.ui.item = function() {
} }
} }
})); }));
Ox.Event.bind({ pandora.UI.bind({
itemSort: function(value) { itemSort: function(value) {
pandora.$ui.clips.options({sort: value}); pandora.$ui.clips.options({sort: value});
} }
@ -323,14 +323,14 @@ pandora.ui.item = function() {
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
}).bindEvent({ }).bindEvent({
points: function(data) { points: function(data) {
pandora.UI.set('videoPoints|' + pandora.user.ui.item, { pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
'in': data['in'], 'in': data['in'],
out: data.out, out: data.out,
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position position: pandora.user.ui.videoPoints[pandora.user.ui.item].position
}); });
}, },
position: function(data) { position: function(data) {
pandora.UI.set('videoPoints|' + pandora.user.ui.item + '|position', data.position); pandora.UI.set('videoPoints.' + pandora.user.ui.item + '|position', data.position);
}, },
resize: function(data) { resize: function(data) {
Ox.print('RESIZE!!', data.size) Ox.print('RESIZE!!', data.size)
@ -453,7 +453,7 @@ pandora.ui.item = function() {
items: [], items: [],
keys: ['id', 'value', 'in', 'out', 'aspectRatio', 'item'], keys: ['id', 'value', 'in', 'out', 'aspectRatio', 'item'],
size: 128, size: 128,
sort: pandora.user.ui.lists[pandora.user.ui.list].sort, sort: pandora.user.ui.itemSort,
unique: 'id' unique: 'id'
}).bindEvent({ }).bindEvent({
open: function(data) { open: function(data) {
@ -463,7 +463,7 @@ pandora.ui.item = function() {
'in': pandora.$ui.clips.value(id, 'in'), 'in': pandora.$ui.clips.value(id, 'in'),
out: pandora.$ui.clips.value(id, 'out') out: pandora.$ui.clips.value(id, 'out')
}; };
pandora.UI.set('videoPoints|' + item, Ox.extend(points, { pandora.UI.set('videoPoints.' + item, Ox.extend(points, {
position: points['in'] position: points['in']
})); }));
pandora.URL.set(item + '/timeline'); pandora.URL.set(item + '/timeline');

View file

@ -112,18 +112,18 @@ pandora.ui.list = function() {
.bindEvent({ .bindEvent({
columnchange: function(data) { columnchange: function(data) {
var columnWidth = {}; var columnWidth = {};
pandora.UI.set(['lists', pandora.user.ui.list, 'columns'].join('|'), data.ids); pandora.UI.set({listColumns: data.ids});
/* /*
data.ids.forEach(function(id) { data.ids.forEach(function(id) {
columnWidth[id] = columnWidth[id] =
pandora.user.ui.lists[pandora.user.ui.list].columnWidth[id] || pandora.user.ui.lists[pandora.user.ui.list].columnWidth[id]
Ox.getObjectById(pandora.site.sortKeys, id).width || Ox.getObjectById(pandora.site.sortKeys, id).width
}); });
pandora.UI.set(['lists', pandora.user.ui.list, 'columnWidth'].join('|'), columnWidth); pandora.UI.set({listColumnWidth: columnWidth});
*/ */
}, },
columnresize: function(data) { columnresize: function(data) {
pandora.UI.set(['lists', pandora.user.ui.list, 'columnWidth', data.id].join('|'), data.width); pandora.UI.set('listColumnWidth.' + data.id, data.width);
}, },
resize: function(data) { // this is the resize event of the split panel resize: function(data) { // this is the resize event of the split panel
that.size(); that.size();
@ -276,7 +276,7 @@ pandora.ui.list = function() {
'in': that.value(id, 'in'), 'in': that.value(id, 'in'),
out: that.value(id, 'out') out: that.value(id, 'out')
}; };
pandora.UI.set('videoPoints|' + item, Ox.extend(points, { pandora.UI.set('videoPoints.' + item, Ox.extend(points, {
position: points['in'] position: points['in']
})); }));
pandora.UI.set({ pandora.UI.set({
@ -474,7 +474,7 @@ pandora.ui.list = function() {
'in': pandora.$ui.clips.value(id, 'in'), 'in': pandora.$ui.clips.value(id, 'in'),
out: pandora.$ui.clips.value(id, 'out') out: pandora.$ui.clips.value(id, 'out')
}; };
pandora.UI.set('videoPoints|' + item, Ox.extend(points, { pandora.UI.set('videoPoints.' + item, Ox.extend(points, {
position: points['in'] position: points['in']
})); }));
pandora.URL.set(item + '/timeline'); pandora.URL.set(item + '/timeline');
@ -680,13 +680,13 @@ pandora.ui.list = function() {
pandora.$ui.rightPanel.replaceElement(1, pandora.$ui.contentPanel = pandora.ui.contentPanel()); pandora.$ui.rightPanel.replaceElement(1, pandora.$ui.contentPanel = pandora.ui.contentPanel());
}; };
Ox.Event.bind({ pandora.UI.bind({
listSort: function(value) { listSort: function(value) {
that.options({sort: value}); that.options({sort: value});
} }
}); });
if (pandora.user.ui.listView == 'grid') { if (pandora.user.ui.listView == 'grid') {
Ox.Event.bind({ pandora.UI.bind({
icons: function(value) { icons: function(value) {
that.options({ that.options({
borderRadius: value == 'posters' ? 0 : 16, borderRadius: value == 'posters' ? 0 : 16,

View file

@ -128,7 +128,7 @@ pandora.ui.listIconPanel = function(list) {
min: 1, min: 1,
orientation: 'vertical', orientation: 'vertical',
size: 128, size: 128,
sort: pandora.user.ui.lists[pandora.user.ui.list].sort, sort: pandora.user.ui.listSort,
unique: 'id' unique: 'id'
}) })
.css({width: '144px'}) .css({width: '144px'})

View file

@ -17,7 +17,7 @@ pandora.ui.mainPanel = function() {
], ],
orientation: 'horizontal' orientation: 'horizontal'
}); });
Ox.Event.bind({ pandora.UI.bind({
item: function(value) { item: function(value) {
if (!value || !pandora.UI.getPrevious('item')) { if (!value || !pandora.UI.getPrevious('item')) {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());

View file

@ -25,7 +25,7 @@ pandora.ui.orderButton = function() {
function getTitle() { function getTitle() {
return pandora.user.ui.listSort[0].operator == '+' ? 'up' : 'down'; return pandora.user.ui.listSort[0].operator == '+' ? 'up' : 'down';
} }
Ox.Event.bind({ pandora.UI.bind({
listSort: function() { listSort: function() {
that.options({title: getTitle()}); that.options({title: getTitle()});
} }

View file

@ -39,12 +39,12 @@ pandora.ui.rightPanel = function() {
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
pandora.resizeGroups(); pandora.resizeGroups();
pandora.$ui.list.size(); pandora.$ui.list.size();
if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'timelines') { if (pandora.user.ui.listView == 'timelines') {
pandora.$ui.list.options({width: data.size}); pandora.$ui.list.options({width: data.size});
} else if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'map') { } else if (pandora.user.ui.listView == 'map') {
pandora.$ui.map.resizeMap(); pandora.$ui.map.resizeMap();
} else if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'calendar') { } else if (pandora.user.ui.listView == 'calendar') {
pandora.$ui.calendar.resizeCalendar();
} }
} else { } else {
pandora.$ui.browser.scrollToSelection(); pandora.$ui.browser.scrollToSelection();
@ -57,7 +57,7 @@ pandora.ui.rightPanel = function() {
} }
}); });
} }
Ox.Event.bind({ pandora.UI.bind({
itemView: function(value) { itemView: function(value) {
if (pandora.isClipView() != pandora.isClipView(pandora.UI.getPrevious('itemView'))) { if (pandora.isClipView() != pandora.isClipView(pandora.UI.getPrevious('itemView'))) {
that.replaceElement(0, pandora.$ui.toolbar = pandora.ui.toolbar()); that.replaceElement(0, pandora.$ui.toolbar = pandora.ui.toolbar());

View file

@ -34,7 +34,7 @@ pandora.ui.sortSelect = function() {
pandora.UI.set(sortKey, [{key: data.selected[0].id, operator: ''}]); pandora.UI.set(sortKey, [{key: data.selected[0].id, operator: ''}]);
} }
}); });
Ox.Event.bind({ pandora.UI.bind({
listSort: function(value) { listSort: function(value) {
that.selectItem(value[0].key); that.selectItem(value[0].key);
}, },

View file

@ -28,11 +28,12 @@ pandora.ui.videoPreview = function(data) {
}); });
} else { } else {
pandora.UI.set( pandora.UI.set(
'videoPoints|' + data.id, 'videoPoints.' + data.id,
{'in': 0, out: 0, position: event.position} {'in': 0, out: 0, position: event.position}
); );
pandora.URL.push( pandora.UI.set(
'/' + data.id + '/' + pandora.user.ui.videoView + '/' + Ox.formatDuration(event.position, 2) item: data.id,
itemView: pandora.user.ui.videoView
); );
} }
} }

View file

@ -21,7 +21,7 @@ pandora.ui.viewSelect = function() {
pandora.UI.set(viewKey, data.selected[0].id); pandora.UI.set(viewKey, data.selected[0].id);
} }
}); });
Ox.Event.bind({ pandora.UI.bind({
listView: function(value) { listView: function(value) {
that.selectItem(value); that.selectItem(value);
}, },