misc fixes

This commit is contained in:
rolux 2011-10-08 17:22:56 +00:00
parent 41f6ca478c
commit d800c49c8e
8 changed files with 23 additions and 39 deletions

View file

@ -566,12 +566,12 @@
"icons": "posters",
"infoIconSize": 256,
"item": "",
"itemSort": [{"key": "clip:position", "operator": ""}],
"itemSort": [{"key": "clip:position", "operator": "+"}],
"itemView": "info",
"listColumns": ["title", "director", "country", "year", "language", "runtime", "genre"],
"listColumnWidth": {},
"listSelection": [],
"listSort": [{"key": "director", "operator": ""}],
"listSort": [{"key": "director", "operator": "+"}],
"listView": "grid",
"lists": {},
"mapFind": "",

View file

@ -26,7 +26,7 @@ appPanel
Ox.load({
UI: {
debug: true,
//debug: true,
hideScreen: false,
loadImages: true,
showScreen: true,
@ -42,15 +42,6 @@ Ox.load({
load: function(data) {
if (!browserSupported) {
$('.OxLoadingScreen').find('div').append(
$('<div>')
.css({
width: '100%',
paddingTop: '78px',
textAlign: 'center'
})
.html(data.site.site.name + ' does not support your browser,<br /> please update to one of these browsers.')
);
return;
}
@ -63,8 +54,6 @@ Ox.load({
Ox.print('Ox.App load', data);
// Ox.UI.hideLoadingScreen();
Ox.extend(pandora, {
$ui: {
body: $('body'),
@ -118,15 +107,6 @@ Ox.load({
pandora.site.listSettings[key] = key[4].toLowerCase() + key.substr(5);
}
});
/*
if (Ox.isEmpty(pandora.user.ui.lists)) {
var listSettings = {};
Ox.forEach(pandora.site.listSettings, function(listSetting, setting) {
listSettings[listSetting] = pandora.site.user.ui[setting];
});
pandora.UI.set('lists.', listSettings);
}
*/
Ox.extend(pandora.user, {
sectionElement: 'buttons',
@ -163,8 +143,8 @@ Ox.load({
$.getJSON(json, function(files) {
var promises = [];
files.forEach(function(file) {
// fixme: opera doesnt fire onload for svg
// fixme: we don't have any svgs, right?
// fixme: opera doesnt fire onload for svgs
// (but neither do we support opera nor do we have svgs)
if ($.browser.opera && Ox.endsWith(file, '.svg')) {
return;
}

View file

@ -43,11 +43,12 @@ pandora.UI = (function() {
pandora.user.ui._list = list;
pandora.user.ui._groupsState = pandora.getGroupsState(val);
pandora.user.ui._findState = pandora.getFindState(val);
// make sure we don't do this on page load
if (!pandora.user.ui.lists[list]) {
add['lists.' + that.encode(list)] = {};
}
// fixme: if we did this on page load,
// find would get set to advanced
if (pandora.$ui.appPanel && list != self.previousUI._list) {
if (!pandora.user.ui.lists[list]) {
add['lists.' + that.encode(list)] = {};
}
Ox.forEach(listSettings, function(listSetting, setting) {
if (!pandora.user.ui.lists[list]) {
// add default list setting and copy to settings
@ -111,7 +112,6 @@ pandora.UI = (function() {
});
});
});
Ox.print('isBooting?', !pandora.$ui.appPanel, Object.keys(args), pandora.user.ui.listView);
pandora.URL.update(Object.keys(
!pandora.$ui.appPanel ? args : trigger
));

View file

@ -392,9 +392,12 @@ pandora.URL = (function() {
} else {
if (
!pandora.$ui.appPanel
|| (keys.length == 1 && keys[0] == 'span')
|| keys.every(function(key) {
return /^videoPoints/.test(key);
return [
'listColumnWidth', 'listColumns', 'listSelection',
'mapFind', 'mapSelection'
].indexOf(key) > -1
|| /^videoPoints/.test(key);
})
) {
action = 'replace';

View file

@ -9,7 +9,6 @@ pandora.ui.clipList = function(videoRatio) {
that = Ox.IconList({
fixedRatio: fixedRatio,
item: function(data, sort, size) {
Ox.print('*********', data)
size = size || 128; // fixme: is this needed?
var ratio, width, height, url, sortKey, info;
if (!ui.item) {

View file

@ -391,11 +391,11 @@ pandora.ui.infoView = function(data) {
}
$text.find('a').click(function(event) {
pandora.URL.push(
event.target.hostname == document.location.hostname
? event.target.pathname
: '/url=' + encodeURIComponent(event.target.href)
);
if (event.target.hostname == document.location.hostname) {
pandora.URL.push(event.target.pathname);
} else {
document.location.href = '/url=' + encodeURIComponent(event.target.href);
}
return false;
});
@ -429,7 +429,7 @@ pandora.ui.infoView = function(data) {
: ['index', 'position', 'width', 'height', 'url'],
max: 1,
min: 1,
orientation: 'vertical',
orientation: 'both',
selected: [selectedImage['index']],
size: 128,
sort: [{key: 'index', operator: '+'}],

View file

@ -10,6 +10,7 @@ pandora.ui.item = function() {
}, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
if (result.status.code == 200) {
// fixme: can the history state title get updated too?
document.title = pandora.getPageTitle(result.data.title);
}

View file

@ -565,6 +565,7 @@ pandora.getMetadataByIdOrName = function(item, view, str, callback) {
(function() {
var itemTitles = {};
pandora.getPageTitle = function(itemTitle) {
Ox.print('ITEM TITLES', itemTitles)
if (itemTitle) {
itemTitles[pandora.user.ui.item] = itemTitle
}