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", "icons": "posters",
"infoIconSize": 256, "infoIconSize": 256,
"item": "", "item": "",
"itemSort": [{"key": "clip:position", "operator": ""}], "itemSort": [{"key": "clip:position", "operator": "+"}],
"itemView": "info", "itemView": "info",
"listColumns": ["title", "director", "country", "year", "language", "runtime", "genre"], "listColumns": ["title", "director", "country", "year", "language", "runtime", "genre"],
"listColumnWidth": {}, "listColumnWidth": {},
"listSelection": [], "listSelection": [],
"listSort": [{"key": "director", "operator": ""}], "listSort": [{"key": "director", "operator": "+"}],
"listView": "grid", "listView": "grid",
"lists": {}, "lists": {},
"mapFind": "", "mapFind": "",

View file

@ -26,7 +26,7 @@ appPanel
Ox.load({ Ox.load({
UI: { UI: {
debug: true, //debug: true,
hideScreen: false, hideScreen: false,
loadImages: true, loadImages: true,
showScreen: true, showScreen: true,
@ -42,15 +42,6 @@ Ox.load({
load: function(data) { load: function(data) {
if (!browserSupported) { 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; return;
} }
@ -63,8 +54,6 @@ Ox.load({
Ox.print('Ox.App load', data); Ox.print('Ox.App load', data);
// Ox.UI.hideLoadingScreen();
Ox.extend(pandora, { Ox.extend(pandora, {
$ui: { $ui: {
body: $('body'), body: $('body'),
@ -118,15 +107,6 @@ Ox.load({
pandora.site.listSettings[key] = key[4].toLowerCase() + key.substr(5); 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, { Ox.extend(pandora.user, {
sectionElement: 'buttons', sectionElement: 'buttons',
@ -163,8 +143,8 @@ Ox.load({
$.getJSON(json, function(files) { $.getJSON(json, function(files) {
var promises = []; var promises = [];
files.forEach(function(file) { files.forEach(function(file) {
// fixme: opera doesnt fire onload for svg // fixme: opera doesnt fire onload for svgs
// fixme: we don't have any svgs, right? // (but neither do we support opera nor do we have svgs)
if ($.browser.opera && Ox.endsWith(file, '.svg')) { if ($.browser.opera && Ox.endsWith(file, '.svg')) {
return; return;
} }

View file

@ -43,11 +43,12 @@ pandora.UI = (function() {
pandora.user.ui._list = list; pandora.user.ui._list = list;
pandora.user.ui._groupsState = pandora.getGroupsState(val); pandora.user.ui._groupsState = pandora.getGroupsState(val);
pandora.user.ui._findState = pandora.getFindState(val); pandora.user.ui._findState = pandora.getFindState(val);
// make sure we don't do this on page load
if (pandora.$ui.appPanel && list != self.previousUI._list) {
if (!pandora.user.ui.lists[list]) { if (!pandora.user.ui.lists[list]) {
add['lists.' + that.encode(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) {
Ox.forEach(listSettings, function(listSetting, setting) { Ox.forEach(listSettings, function(listSetting, setting) {
if (!pandora.user.ui.lists[list]) { if (!pandora.user.ui.lists[list]) {
// add default list setting and copy to settings // 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.URL.update(Object.keys(
!pandora.$ui.appPanel ? args : trigger !pandora.$ui.appPanel ? args : trigger
)); ));

View file

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

View file

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

View file

@ -391,11 +391,11 @@ pandora.ui.infoView = function(data) {
} }
$text.find('a').click(function(event) { $text.find('a').click(function(event) {
pandora.URL.push( if (event.target.hostname == document.location.hostname) {
event.target.hostname == document.location.hostname pandora.URL.push(event.target.pathname);
? event.target.pathname } else {
: '/url=' + encodeURIComponent(event.target.href) document.location.href = '/url=' + encodeURIComponent(event.target.href);
); }
return false; return false;
}); });
@ -429,7 +429,7 @@ pandora.ui.infoView = function(data) {
: ['index', 'position', 'width', 'height', 'url'], : ['index', 'position', 'width', 'height', 'url'],
max: 1, max: 1,
min: 1, min: 1,
orientation: 'vertical', orientation: 'both',
selected: [selectedImage['index']], selected: [selectedImage['index']],
size: 128, size: 128,
sort: [{key: 'index', operator: '+'}], 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) { }, pandora.user.level == 'admin' && pandora.user.ui.itemView == 'info' ? 0 : -1, function(result) {
if (result.status.code == 200) { if (result.status.code == 200) {
// fixme: can the history state title get updated too?
document.title = pandora.getPageTitle(result.data.title); document.title = pandora.getPageTitle(result.data.title);
} }

View file

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