config/site
This commit is contained in:
parent
1f3d39524f
commit
9e2f2b3666
20 changed files with 62 additions and 59 deletions
|
@ -73,11 +73,11 @@ def init(request):
|
||||||
value = ItemSort.objects.aggregate(Max(name))['%s__max'%name]
|
value = ItemSort.objects.aggregate(Max(name))['%s__max'%name]
|
||||||
key['format']['args'][0] = value
|
key['format']['args'][0] = value
|
||||||
|
|
||||||
response['data']['config'] = config
|
response['data']['site'] = config
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
response['data']['user'] = get_user_json(request.user)
|
response['data']['user'] = get_user_json(request.user)
|
||||||
else:
|
else:
|
||||||
response['data']['user'] = response['data']['config']['user']
|
response['data']['user'] = response['data']['site']['user']
|
||||||
|
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(init)
|
actions.register(init)
|
||||||
|
|
|
@ -11,9 +11,9 @@ var app = new Ox.App({
|
||||||
apiURL: '/api/',
|
apiURL: '/api/',
|
||||||
init: 'init',
|
init: 'init',
|
||||||
}).bindEvent('load', function(event, data) {
|
}).bindEvent('load', function(event, data) {
|
||||||
app.config = data.config;
|
app.site.= data.config;
|
||||||
app.user = data.user;
|
app.user = data.user;
|
||||||
app.config.default_info = '<div class="OxSelectable"><h2>Overview</h2>use this api in the browser with Ox.app or use <a href="http://code.0x2620.org/pandora_client">pandora_client</a> to use it in python</div>';
|
app.site.default_info = '<div class="OxSelectable"><h2>Overview</h2>use this api in the browser with Ox.app or use <a href="http://code.0x2620.org/pandora_client">pandora_client</a> to use it in python</div>';
|
||||||
app.$body = $('body');
|
app.$body = $('body');
|
||||||
app.$document = $(document);
|
app.$document = $(document);
|
||||||
app.$window = $(window);
|
app.$window = $(window);
|
||||||
|
@ -22,7 +22,7 @@ var app = new Ox.App({
|
||||||
|
|
||||||
app.$ui = {};
|
app.$ui = {};
|
||||||
app.$ui.actionList = constructList();
|
app.$ui.actionList = constructList();
|
||||||
app.$ui.actionInfo = Ox.Container().css({padding: '16px'}).html(app.config.default_info);
|
app.$ui.actionInfo = Ox.Container().css({padding: '16px'}).html(app.site.default_info);
|
||||||
|
|
||||||
app.api.api({docs: true, code: true}, function(results) {
|
app.api.api({docs: true, code: true}, function(results) {
|
||||||
app.actions = results.data.actions;
|
app.actions = results.data.actions;
|
||||||
|
@ -36,7 +36,7 @@ var app = new Ox.App({
|
||||||
elements: [
|
elements: [
|
||||||
{
|
{
|
||||||
element: new Ox.Element().append(new Ox.Element()
|
element: new Ox.Element().append(new Ox.Element()
|
||||||
.html(app.config.site.name + ' API').css({
|
.html(app.site.site.name + ' API').css({
|
||||||
'padding': '4px',
|
'padding': '4px',
|
||||||
})).css({
|
})).css({
|
||||||
'background-color': '#ddd',
|
'background-color': '#ddd',
|
||||||
|
@ -146,7 +146,7 @@ function constructList() {
|
||||||
hash += k + ','
|
hash += k + ','
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
info.html(app.config.default_info);
|
info.html(app.site.default_info);
|
||||||
|
|
||||||
document.location.hash = hash.substring(0, hash.length-1);
|
document.location.hash = hash.substring(0, hash.length-1);
|
||||||
app.$ui.actionInfo.html(info);
|
app.$ui.actionInfo.html(info);
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
// fixme: sort=-director doesn't work
|
// fixme: sort=-director doesn't work
|
||||||
// fixme: don't reload full right panel on sortSelect
|
// fixme: don't reload full right panel on sortSelect
|
||||||
// fixme: clear items cache after login/logout
|
// fixme: clear items cache after login/logout
|
||||||
// fixme: rename config to site (site/user is better than config/user)
|
|
||||||
// fixme: replace global app object with pandora.app or move to pandora itself
|
// fixme: replace global app object with pandora.app or move to pandora itself
|
||||||
Ox.load('UI', {
|
Ox.load('UI', {
|
||||||
debug: true,
|
debug: true,
|
||||||
|
@ -36,9 +35,9 @@ Ox.load('Geo', function() {
|
||||||
.resize(resizeWindow)
|
.resize(resizeWindow)
|
||||||
.unload(unloadWindow)
|
.unload(unloadWindow)
|
||||||
},
|
},
|
||||||
config: data.config,
|
site: data.site,
|
||||||
ui: {
|
ui: {
|
||||||
findKeys: $.map(data.config.itemKeys, function(key, i) {
|
findKeys: $.map(data.site.itemKeys, function(key, i) {
|
||||||
return key.find ? key : null;
|
return key.find ? key : null;
|
||||||
}),
|
}),
|
||||||
infoRatio: 16 / 9,
|
infoRatio: 16 / 9,
|
||||||
|
@ -47,7 +46,7 @@ Ox.load('Geo', function() {
|
||||||
site: $.merge([
|
site: $.merge([
|
||||||
{id: 'site', title: 'Site', items: $.merge([
|
{id: 'site', title: 'Site', items: $.merge([
|
||||||
{id: 'home', title: 'Home'}
|
{id: 'home', title: 'Home'}
|
||||||
], $.merge(data.config.sitePages, [
|
], $.merge(data.site.sitePages, [
|
||||||
{id: 'software', title: 'Software'},
|
{id: 'software', title: 'Software'},
|
||||||
{id: 'help', title: 'Help'}
|
{id: 'help', title: 'Help'}
|
||||||
]))},
|
]))},
|
||||||
|
@ -65,14 +64,14 @@ Ox.load('Geo', function() {
|
||||||
{id: 'personal', title: 'Personal Lists'},
|
{id: 'personal', title: 'Personal Lists'},
|
||||||
{id: 'favorite', title: 'Favorite Lists', showBrowser: false},
|
{id: 'favorite', title: 'Favorite Lists', showBrowser: false},
|
||||||
{id: 'featured', title: 'Featured Lists', showBrowser: false}
|
{id: 'featured', title: 'Featured Lists', showBrowser: false}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
selectedMovies: [],
|
selectedMovies: [],
|
||||||
sortKeys: $.map(data.config.itemKeys, function(key, i) {
|
sortKeys: $.map(data.site.itemKeys, function(key, i) {
|
||||||
return key.columnWidth ? key : null;
|
return key.columnWidth ? key : null;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
user: data.user.level == 'guest' ? $.extend({}, data.config.user) : data.user
|
user: data.user.level == 'guest' ? $.extend({}, data.site.user) : data.user
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data.user.level == 'guest' && $.browser.mozilla) {
|
if (data.user.level == 'guest' && $.browser.mozilla) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ pandora.Query = (function() {
|
||||||
if (app.user.ui.listQuery.conditions.length) {
|
if (app.user.ui.listQuery.conditions.length) {
|
||||||
list = app.user.ui.listQuery.conditions[0].value;
|
list = app.user.ui.listQuery.conditions[0].value;
|
||||||
!app.user.ui.lists[list] && pandora.UI.set(
|
!app.user.ui.lists[list] && pandora.UI.set(
|
||||||
['lists', list].join('|'), app.config.user.ui.lists['']
|
['lists', list].join('|'), app.site.user.ui.lists['']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
pandora.UI.set({list: list});
|
pandora.UI.set({list: list});
|
||||||
|
|
|
@ -29,7 +29,7 @@ pandora.URL = (function() {
|
||||||
pandora.UI.set({
|
pandora.UI.set({
|
||||||
section: 'site',
|
section: 'site',
|
||||||
sitePage: url
|
sitePage: url
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
'^(find)$': function() {
|
'^(find)$': function() {
|
||||||
pandora.Query.fromString('?find='); // fixme: silly hack
|
pandora.Query.fromString('?find='); // fixme: silly hack
|
||||||
|
@ -50,7 +50,7 @@ pandora.URL = (function() {
|
||||||
item = split[0],
|
item = split[0],
|
||||||
view = new RegExp(
|
view = new RegExp(
|
||||||
'^(' + $.map(app.config.itemViews, function(v) {
|
'^(' + $.map(app.config.itemViews, function(v) {
|
||||||
return v.id
|
return v.id;
|
||||||
}).join('|') + ')$'
|
}).join('|') + ')$'
|
||||||
).exec(split[1]);
|
).exec(split[1]);
|
||||||
view = view ? view[0] : app.user.ui.itemView;
|
view = view ? view[0] : app.user.ui.itemView;
|
||||||
|
|
|
@ -60,7 +60,7 @@ pandora.getGroupWidth = function(pos, panelWidth) { // fixme: don't pass panelWi
|
||||||
}
|
}
|
||||||
|
|
||||||
pandora.getSortOperator = function(key) { // fixme: make static
|
pandora.getSortOperator = function(key) { // fixme: make static
|
||||||
var type = Ox.getObjectById(app.config.itemKeys, key).type;
|
var type = Ox.getObjectById(app.site.itemKeys, key).type;
|
||||||
return ['hue', 'string', 'text'].indexOf(
|
return ['hue', 'string', 'text'].indexOf(
|
||||||
Ox.isArray(type) ? type[0] : type
|
Ox.isArray(type) ? type[0] : type
|
||||||
) > -1 ? '+' : '-';
|
) > -1 ? '+' : '-';
|
||||||
|
@ -74,7 +74,7 @@ pandora.login = function(data) {
|
||||||
|
|
||||||
pandora.logout = function(data) {
|
pandora.logout = function(data) {
|
||||||
app.user = data.user;
|
app.user = data.user;
|
||||||
Ox.Theme(app.config.user.ui.theme);
|
Ox.Theme(app.site.user.ui.theme);
|
||||||
app.$ui.appPanel.reload();
|
app.$ui.appPanel.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -348,7 +348,7 @@ pandora.ui.accountWelcomeDialog = function() {
|
||||||
content: new Ox.Element().html('Welcome, ' + app.user.username + '!<br/><br/>Your account has been created.'),
|
content: new Ox.Element().html('Welcome, ' + app.user.username + '!<br/><br/>Your account has been created.'),
|
||||||
height: 160,
|
height: 160,
|
||||||
keys: {enter: 'close', escape: 'close'},
|
keys: {enter: 'close', escape: 'close'},
|
||||||
title: 'Welcome to ' + app.config.site.name,
|
title: 'Welcome to ' + app.site.site.name,
|
||||||
width: 300
|
width: 300
|
||||||
});
|
});
|
||||||
return that;
|
return that;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||||
pandora.ui.backButton = function() {
|
pandora.ui.backButton = function() {
|
||||||
var that = Ox.Button({
|
var that = Ox.Button({
|
||||||
title: 'Back to ' + app.config.itemName.plural,
|
title: 'Back to ' + app.site.itemName.plural,
|
||||||
width: 96
|
width: 96
|
||||||
}).css({
|
}).css({
|
||||||
float: 'left',
|
float: 'left',
|
||||||
|
|
|
@ -15,7 +15,7 @@ pandora.ui.annotations = function() {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
$bins = [];
|
$bins = [];
|
||||||
$.each(app.config.layers, function(i, layer) {
|
$.each(app.site.layers, function(i, layer) {
|
||||||
var $bin = new Ox.CollapsePanel({
|
var $bin = new Ox.CollapsePanel({
|
||||||
id: layer.id,
|
id: layer.id,
|
||||||
size: 16,
|
size: 16,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||||
pandora.ui.filter = function() {
|
pandora.ui.filter = function() {
|
||||||
var that = new Ox.Filter({
|
var that = new Ox.Filter({
|
||||||
findKeys: $.map(app.config.itemKeys, function(key) {
|
findKeys: $.map(app.site.itemKeys, function(key) {
|
||||||
return {
|
return {
|
||||||
autocomplete: key.autocomplete,
|
autocomplete: key.autocomplete,
|
||||||
autocompleteSortKey: key.autocompleteSortKey,
|
autocompleteSortKey: key.autocompleteSortKey,
|
||||||
|
@ -9,12 +9,12 @@ pandora.ui.filter = function() {
|
||||||
id: key.id,
|
id: key.id,
|
||||||
title: key.title,
|
title: key.title,
|
||||||
type: key.type == 'layer' ? Ox.getObjectById(
|
type: key.type == 'layer' ? Ox.getObjectById(
|
||||||
app.config.layers, key.id
|
app.site.layers, key.id
|
||||||
).type : key.type
|
).type : key.type
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
sortKeys: app.ui.sortKeys,
|
sortKeys: app.ui.sortKeys,
|
||||||
viewKeys: app.config.listViews
|
viewKeys: app.site.listViews
|
||||||
});
|
});
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ pandora.ui.findElement = function() {
|
||||||
elements: $.merge(app.user.ui.list ? [
|
elements: $.merge(app.user.ui.list ? [
|
||||||
app.$ui.findListSelect = new Ox.Select({
|
app.$ui.findListSelect = new Ox.Select({
|
||||||
items: [
|
items: [
|
||||||
{id: 'all', title: 'Find: All ' + app.config.itemName.plural},
|
{id: 'all', title: 'Find: All ' + app.site.itemName.plural},
|
||||||
{id: 'list', title: 'Find: This List'}
|
{id: 'list', title: 'Find: This List'}
|
||||||
],
|
],
|
||||||
overlap: 'right',
|
overlap: 'right',
|
||||||
|
|
|
@ -534,7 +534,7 @@ pandora.ui.folders = function() {
|
||||||
type: data.id == 'new' ? 'static' : 'smart'
|
type: data.id == 'new' ? 'static' : 'smart'
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
id = result.data.id;
|
id = result.data.id;
|
||||||
pandora.UI.set(['lists', id].join('|'), app.config.user.ui.lists['']); // fixme: necessary?
|
pandora.UI.set(['lists', id].join('|'), app.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({
|
||||||
|
|
|
@ -70,7 +70,7 @@ pandora.ui.folders = function() {
|
||||||
type: data.id == 'new' ? 'static' : 'smart'
|
type: data.id == 'new' ? 'static' : 'smart'
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
id = result.data.id;
|
id = result.data.id;
|
||||||
pandora.UI.set(['lists', id].join('|'), app.config.user.ui.lists['']); // fixme: necessary?
|
pandora.UI.set(['lists', id].join('|'), app.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({
|
||||||
|
|
|
@ -9,7 +9,7 @@ pandora.ui.group = function(id, query) {
|
||||||
//alert(id + ' ' + JSON.stringify(pandora.Query.toObject(id)))
|
//alert(id + ' ' + JSON.stringify(pandora.Query.toObject(id)))
|
||||||
var i = app.user.ui.groups.indexOf(id),
|
var i = app.user.ui.groups.indexOf(id),
|
||||||
panelWidth = app.$ui.document.width() - (app.user.ui.showSidebar * app.user.ui.sidebarSize) - 1,
|
panelWidth = app.$ui.document.width() - (app.user.ui.showSidebar * app.user.ui.sidebarSize) - 1,
|
||||||
title = Ox.getObjectById(app.config.groups, id).title,
|
title = Ox.getObjectById(app.site.groups, id).title,
|
||||||
width = pandora.getGroupWidth(i, panelWidth),
|
width = pandora.getGroupWidth(i, panelWidth),
|
||||||
that = new Ox.TextList({
|
that = new Ox.TextList({
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -71,7 +71,7 @@ pandora.ui.group = function(id, query) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new Ox.Select({
|
new Ox.Select({
|
||||||
items: $.map(app.config.groups, function(v) {
|
items: $.map(app.site.groups, function(v) {
|
||||||
return {
|
return {
|
||||||
checked: v.id == id,
|
checked: v.id == id,
|
||||||
id: v.id,
|
id: v.id,
|
||||||
|
@ -123,7 +123,7 @@ pandora.ui.group = function(id, query) {
|
||||||
}
|
}
|
||||||
function getGroupObject(id) {
|
function getGroupObject(id) {
|
||||||
var i = app.user.ui.groups.indexOf(id),
|
var i = app.user.ui.groups.indexOf(id),
|
||||||
title = Ox.getObjectById(app.config.groups, id).title,
|
title = Ox.getObjectById(app.site.groups, id).title,
|
||||||
width = pandora.getGroupWidth(i, panelWidth);
|
width = pandora.getGroupWidth(i, panelWidth);
|
||||||
return {
|
return {
|
||||||
id: id,
|
id: id,
|
||||||
|
|
|
@ -5,7 +5,7 @@ pandora.ui.item = function() {
|
||||||
if (result.status.code != 200) {
|
if (result.status.code != 200) {
|
||||||
app.$ui.contentPanel.replaceElement(1,
|
app.$ui.contentPanel.replaceElement(1,
|
||||||
Ox.Element().html(
|
Ox.Element().html(
|
||||||
'The '+app.config.itemName.singular+' you are looking for does not exist.'));
|
'The '+app.site.itemName.singular+' you are looking for does not exist.'));
|
||||||
} else if (app.user.ui.itemView == 'calendar') {
|
} else if (app.user.ui.itemView == 'calendar') {
|
||||||
app.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar'));
|
app.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar'));
|
||||||
} else if (app.user.ui.itemView == 'clips') {
|
} else if (app.user.ui.itemView == 'clips') {
|
||||||
|
@ -16,7 +16,7 @@ pandora.ui.item = function() {
|
||||||
var $form,
|
var $form,
|
||||||
$edit = new Ox.Element()
|
$edit = new Ox.Element()
|
||||||
.append($form = new Ox.FormElementGroup({
|
.append($form = new Ox.FormElementGroup({
|
||||||
elements: Ox.map(app.config.itemKeys, function(key) {
|
elements: Ox.map(app.site.itemKeys, function(key) {
|
||||||
return new Ox.Input({
|
return new Ox.Input({
|
||||||
id: key.id,
|
id: key.id,
|
||||||
label: key.title,
|
label: key.title,
|
||||||
|
@ -37,7 +37,7 @@ pandora.ui.item = function() {
|
||||||
click: function(event, data) {
|
click: function(event, data) {
|
||||||
var values = $form.value();
|
var values = $form.value();
|
||||||
var changed = {};
|
var changed = {};
|
||||||
Ox.map(app.config.itemKeys, function(key, i) {
|
Ox.map(app.site.itemKeys, function(key, i) {
|
||||||
if(values[i] && values[i] != ''+result.data[key.id]) {
|
if(values[i] && values[i] != ''+result.data[key.id]) {
|
||||||
if(Ox.isArray(key.type) && key.type[0] == 'string') {
|
if(Ox.isArray(key.type) && key.type[0] == 'string') {
|
||||||
changed[key.id] = values[i].split(', ');
|
changed[key.id] = values[i].split(', ');
|
||||||
|
@ -117,7 +117,7 @@ pandora.ui.item = function() {
|
||||||
video.profiles.forEach(function(profile) {
|
video.profiles.forEach(function(profile) {
|
||||||
streams[profile] = video.baseUrl + '/' + profile + 'p.' + format;
|
streams[profile] = video.baseUrl + '/' + profile + 'p.' + format;
|
||||||
});
|
});
|
||||||
$.each(app.config.layers, function(i, layer) {
|
$.each(app.site.layers, function(i, layer) {
|
||||||
layers[i] = $.extend({}, layer, {items: result.data.layers[layer.id]});
|
layers[i] = $.extend({}, layer, {items: result.data.layers[layer.id]});
|
||||||
});
|
});
|
||||||
app.$ui.contentPanel.replaceElement(1, app.$ui.editor = new Ox.VideoEditor({
|
app.$ui.contentPanel.replaceElement(1, app.$ui.editor = new Ox.VideoEditor({
|
||||||
|
|
|
@ -6,9 +6,9 @@ pandora.ui.list = function(view) { // fixme: remove view argument
|
||||||
/*
|
/*
|
||||||
keys = Ox.unique($.merge(
|
keys = Ox.unique($.merge(
|
||||||
$.map(app.user.ui.lists[app.user.ui.list].columns, function(id) {
|
$.map(app.user.ui.lists[app.user.ui.list].columns, function(id) {
|
||||||
return Ox.getObjectById(app.config.sortKeys, id);
|
return Ox.getObjectById(app.site.sortKeys, id);
|
||||||
}),
|
}),
|
||||||
app.config.sortKeys
|
app.site.sortKeys
|
||||||
));
|
));
|
||||||
Ox.print('$$$$', keys)
|
Ox.print('$$$$', keys)
|
||||||
*/
|
*/
|
||||||
|
@ -236,7 +236,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
|
||||||
init: function(event, data) {
|
init: function(event, data) {
|
||||||
app.$ui.total.html(pandora.ui.status('total', data));
|
app.$ui.total.html(pandora.ui.status('total', data));
|
||||||
data = [];
|
data = [];
|
||||||
$.each(app.config.totals, function(i, v) {
|
$.each(app.site.totals, function(i, v) {
|
||||||
data[v.id] = 0;
|
data[v.id] = 0;
|
||||||
});
|
});
|
||||||
app.$ui.selected.html(pandora.ui.status('selected', data));
|
app.$ui.selected.html(pandora.ui.status('selected', data));
|
||||||
|
|
|
@ -10,11 +10,11 @@ pandora.ui.mainMenu = function() {
|
||||||
],
|
],
|
||||||
id: 'mainMenu',
|
id: 'mainMenu',
|
||||||
menus: [
|
menus: [
|
||||||
{ id: app.config.site.id + 'Menu', title: app.config.site.name, items: [
|
{ id: app.site.site.id + 'Menu', title: app.site.site.name, items: [
|
||||||
{ id: 'home', title: 'Home' },
|
{ id: 'home', title: 'Home' },
|
||||||
{},
|
{},
|
||||||
{ id: 'about', title: 'About ' + app.config.site.name },
|
{ id: 'about', title: 'About ' + app.site.site.name },
|
||||||
{ id: 'news', title: app.config.site.name + ' News' },
|
{ id: 'news', title: app.site.site.name + ' News' },
|
||||||
{ id: 'tour', title: 'Take a Tour' },
|
{ id: 'tour', title: 'Take a Tour' },
|
||||||
{ id: 'faq', title: 'Frequently Asked Questions' },
|
{ id: 'faq', title: 'Frequently Asked Questions' },
|
||||||
{ id: 'terms', title: 'Terms of Service' },
|
{ id: 'terms', title: 'Terms of Service' },
|
||||||
|
@ -25,7 +25,7 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'report', title: 'Report a Bug' }
|
{ id: 'report', title: 'Report a Bug' }
|
||||||
] },
|
] },
|
||||||
{},
|
{},
|
||||||
{ id: 'contact', title: 'Contact ' + app.config.site.name }
|
{ id: 'contact', title: 'Contact ' + app.site.site.name }
|
||||||
] },
|
] },
|
||||||
{ id: 'userMenu', title: 'User', items: [
|
{ id: 'userMenu', title: 'User', items: [
|
||||||
{ id: 'username', title: 'User: ' + (isGuest ? 'not logged in' : app.user.username), disabled: true },
|
{ id: 'username', title: 'User: ' + (isGuest ? 'not logged in' : app.user.username), disabled: true },
|
||||||
|
@ -37,7 +37,7 @@ pandora.ui.mainMenu = function() {
|
||||||
] },
|
] },
|
||||||
{ id: 'listMenu', title: 'List', items: [
|
{ id: 'listMenu', title: 'List', items: [
|
||||||
{ id: 'history', title: 'History', items: [
|
{ id: 'history', title: 'History', items: [
|
||||||
{ id: 'allmovies', title: 'All ' + app.config.itemName.plural }
|
{ id: 'allmovies', title: 'All ' + app.site.itemName.plural }
|
||||||
] },
|
] },
|
||||||
{ id: 'lists', title: 'View List', items: [
|
{ id: 'lists', title: 'View List', items: [
|
||||||
{ id: 'favorites', title: 'Favorites' }
|
{ id: 'favorites', title: 'Favorites' }
|
||||||
|
@ -52,7 +52,7 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'newsmartlist', title: 'New Smart List...', keyboard: 'alt control n' },
|
{ id: 'newsmartlist', title: 'New Smart List...', keyboard: 'alt control n' },
|
||||||
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results...', keyboard: 'shift alt control n' },
|
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results...', keyboard: 'shift alt control n' },
|
||||||
{},
|
{},
|
||||||
{ id: 'addmovietolist', title: ['Add Selected ' + app.config.itemName.singular + ' to List...', 'Add Selected ' + app.config.itemName.plural + ' to List...'], disabled: true },
|
{ id: 'addmovietolist', title: ['Add Selected ' + app.site.itemName.singular + ' to List...', 'Add Selected ' + app.site.itemName.plural + ' to List...'], disabled: true },
|
||||||
{},
|
{},
|
||||||
{ id: 'setposterframe', title: 'Set Poster Frame', disabled: true }
|
{ id: 'setposterframe', title: 'Set Poster Frame', disabled: true }
|
||||||
]},
|
]},
|
||||||
|
@ -70,8 +70,8 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' }
|
{ id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' }
|
||||||
] },
|
] },
|
||||||
{ id: 'viewMenu', title: 'View', items: [
|
{ id: 'viewMenu', title: 'View', items: [
|
||||||
{ id: 'movies', title: 'View ' + app.config.itemName.plural, items: [
|
{ id: 'movies', title: 'View ' + app.site.itemName.plural, items: [
|
||||||
{ group: 'viewmovies', min: 0, max: 1, items: $.map(app.config.listViews, function(view, i) {
|
{ group: 'viewmovies', min: 0, max: 1, items: $.map(app.site.listViews, function(view, i) {
|
||||||
return $.extend({
|
return $.extend({
|
||||||
checked: app.user.ui.lists[app.user.ui.list].listView == view.id,
|
checked: app.user.ui.lists[app.user.ui.list].listView == view.id,
|
||||||
}, view);
|
}, view);
|
||||||
|
@ -87,8 +87,8 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'video', title: 'Video' }
|
{ id: 'video', title: 'Video' }
|
||||||
] },
|
] },
|
||||||
{},
|
{},
|
||||||
{ id: 'openmovie', title: ['Open ' + app.config.itemName.singular, 'Open ' + app.config.itemName.plural], disabled: true, items: [
|
{ id: 'openmovie', title: ['Open ' + app.site.itemName.singular, 'Open ' + app.site.itemName.plural], disabled: true, items: [
|
||||||
{ group: 'movieview', min: 0, max: 1, items: $.map(app.config.itemViews, function(view, i) {
|
{ group: 'movieview', min: 0, max: 1, items: $.map(app.site.itemViews, function(view, i) {
|
||||||
return $.extend({
|
return $.extend({
|
||||||
checked: app.user.ui.itemView == view.id,
|
checked: app.user.ui.itemView == view.id,
|
||||||
}, view);
|
}, view);
|
||||||
|
@ -98,17 +98,17 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'lists', title: 'Hide Lists', keyboard: 'shift l' },
|
{ id: 'lists', title: 'Hide Lists', keyboard: 'shift l' },
|
||||||
{ id: 'info', title: 'Hide Info', keyboard: 'shift i' },
|
{ id: 'info', title: 'Hide Info', keyboard: 'shift i' },
|
||||||
{ id: 'groups', title: 'Hide Groups', keyboard: 'shift g' },
|
{ id: 'groups', title: 'Hide Groups', keyboard: 'shift g' },
|
||||||
{ id: 'movies', title: 'Hide ' + app.config.itemName.plural, disabled: true, keyboard: 'shift m' }
|
{ id: 'movies', title: 'Hide ' + app.site.itemName.plural, disabled: true, keyboard: 'shift m' }
|
||||||
]},
|
]},
|
||||||
{ id: 'sortMenu', title: 'Sort', items: [
|
{ id: 'sortMenu', title: 'Sort', items: [
|
||||||
{ id: 'sortmovies', title: 'Sort ' + app.config.itemName.plural + ' by', items: [
|
{ id: 'sortmovies', title: 'Sort ' + app.site.itemName.plural + ' by', items: [
|
||||||
{ group: 'sortmovies', min: 1, max: 1, items: $.map(app.ui.sortKeys, function(key, i) {
|
{ group: 'sortmovies', min: 1, max: 1, items: $.map(app.ui.sortKeys, function(key, i) {
|
||||||
return $.extend({
|
return $.extend({
|
||||||
checked: app.user.ui.lists[app.user.ui.list].sort[0].key == key.id,
|
checked: app.user.ui.lists[app.user.ui.list].sort[0].key == key.id,
|
||||||
}, key);
|
}, key);
|
||||||
}) }
|
}) }
|
||||||
] },
|
] },
|
||||||
{ id: 'ordermovies', title: 'Order ' + app.config.itemName.plural, items: [
|
{ id: 'ordermovies', title: 'Order ' + app.site.itemName.plural, items: [
|
||||||
{ group: 'ordermovies', min: 1, max: 1, items: [
|
{ group: 'ordermovies', min: 1, max: 1, items: [
|
||||||
{ id: 'ascending', title: 'Ascending', checked: app.user.ui.lists[app.user.ui.list].sort[0].operator === '' },
|
{ id: 'ascending', title: 'Ascending', checked: app.user.ui.lists[app.user.ui.list].sort[0].operator === '' },
|
||||||
{ id: 'descending', title: 'Descending', checked: app.user.ui.lists[app.user.ui.list].sort[0].operator == '-' }
|
{ id: 'descending', title: 'Descending', checked: app.user.ui.lists[app.user.ui.list].sort[0].operator == '-' }
|
||||||
|
@ -149,7 +149,7 @@ pandora.ui.mainMenu = function() {
|
||||||
{ id: 'report', title: 'Report a Bug' },
|
{ id: 'report', title: 'Report a Bug' },
|
||||||
] },
|
] },
|
||||||
{ id: 'helpMenu', title: 'Help', items: [
|
{ id: 'helpMenu', title: 'Help', items: [
|
||||||
{ id: 'help', title: app.config.site.name + ' Help', keyboard: 'shift ?' }
|
{ id: 'help', title: app.site.site.name + ' Help', keyboard: 'shift ?' }
|
||||||
] },
|
] },
|
||||||
{ id: 'debugMenu', title: 'Debug', items: [
|
{ id: 'debugMenu', title: 'Debug', items: [
|
||||||
{ id: 'query', title: 'Show pandora.Query' },
|
{ id: 'query', title: 'Show pandora.Query' },
|
||||||
|
@ -221,7 +221,7 @@ pandora.ui.mainMenu = function() {
|
||||||
height: 498,
|
height: 498,
|
||||||
id: 'home',
|
id: 'home',
|
||||||
keys: {enter: 'close', escape: 'close'},
|
keys: {enter: 'close', escape: 'close'},
|
||||||
title: app.config.site.name,
|
title: app.site.site.name,
|
||||||
width: 800
|
width: 800
|
||||||
}).open();
|
}).open();
|
||||||
} else if (data.id == 'register') {
|
} else if (data.id == 'register') {
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
pandora.ui.sectionButtons = function() {
|
pandora.ui.sectionButtons = function() {
|
||||||
var that = new Ox.ButtonGroup({
|
var that = new Ox.ButtonGroup({
|
||||||
buttons: [
|
buttons: [
|
||||||
{id: 'site', selected: app.user.ui.section == 'site', title: app.config.site.name},
|
{id: 'site', selected: app.user.ui.section == 'site', title: app.site.site.name},
|
||||||
{id: 'items', selected: app.user.ui.section == 'items', title: app.config.itemName.plural},
|
{id: 'items', selected: app.user.ui.section == 'items', title: app.site.itemName.plural},
|
||||||
{id: 'texts', selected: app.user.ui.section == 'texts', title: 'Texts'},
|
{id: 'texts', selected: app.user.ui.section == 'texts', title: 'Texts'},
|
||||||
{id: 'admin', selected: app.user.ui.section == 'admin', title: 'Admin'}
|
{id: 'admin', selected: app.user.ui.section == 'admin', title: 'Admin'}
|
||||||
],
|
],
|
||||||
|
@ -20,6 +20,10 @@ pandora.ui.sectionButtons = function() {
|
||||||
pandora.URL.set(app.user.ui.sitePage);
|
pandora.URL.set(app.user.ui.sitePage);
|
||||||
} else if (section == 'items') {
|
} else if (section == 'items') {
|
||||||
pandora.URL.set(pandora.Query.toString());
|
pandora.URL.set(pandora.Query.toString());
|
||||||
|
} else if (section == 'texts') {
|
||||||
|
pandora.URL.set('texts');
|
||||||
|
} else if (section == 'admin') {
|
||||||
|
pandora.URL.set('admin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,8 +4,8 @@ pandora.ui.sectionSelect = function() {
|
||||||
var that = new Ox.Select({
|
var that = new Ox.Select({
|
||||||
id: 'sectionSelect',
|
id: 'sectionSelect',
|
||||||
items: [
|
items: [
|
||||||
{checked: app.user.ui.section == 'site', id: 'site', title: app.config.site.name},
|
{checked: app.user.ui.section == 'site', id: 'site', title: app.site.site.name},
|
||||||
{checked: app.user.ui.section == 'items', id: 'items', title: app.config.itemName.plural},
|
{checked: app.user.ui.section == 'items', id: 'items', title: app.site.itemName.plural},
|
||||||
{checked: app.user.ui.section == 'texts', id: 'texts', title: 'Texts'},
|
{checked: app.user.ui.section == 'texts', id: 'texts', title: 'Texts'},
|
||||||
{checked: app.user.ui.section == 'admin', id: 'admin', title: 'Admin'}
|
{checked: app.user.ui.section == 'admin', id: 'admin', title: 'Admin'}
|
||||||
]
|
]
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
pandora.ui.viewSelect = function() {
|
pandora.ui.viewSelect = function() {
|
||||||
var that = new Ox.Select({
|
var that = new Ox.Select({
|
||||||
id: 'viewSelect',
|
id: 'viewSelect',
|
||||||
items: !app.user.ui.item ? $.map(app.config.listViews, function(view) {
|
items: !app.user.ui.item ? $.map(app.site.listViews, function(view) {
|
||||||
return $.extend($.extend({}, view), {
|
return $.extend($.extend({}, view), {
|
||||||
checked: app.user.ui.lists[app.user.ui.list].listView == view.id,
|
checked: app.user.ui.lists[app.user.ui.list].listView == view.id,
|
||||||
title: 'View ' + view.title
|
title: 'View ' + view.title
|
||||||
});
|
});
|
||||||
}) : $.map(app.config.itemViews, function(view) {
|
}) : $.map(app.site.itemViews, function(view) {
|
||||||
return $.extend($.extend({}, view), {
|
return $.extend($.extend({}, view), {
|
||||||
checked: app.user.ui.itemView == view.id,
|
checked: app.user.ui.itemView == view.id,
|
||||||
title: 'View: ' + view.title
|
title: 'View: ' + view.title
|
||||||
|
|
Loading…
Reference in a new issue