forked from 0x2620/pandora
merge
This commit is contained in:
commit
34f778f331
3 changed files with 79 additions and 65 deletions
|
@ -19,7 +19,7 @@ pandora.ui.folders = function() {
|
||||||
var extras;
|
var extras;
|
||||||
if (folder.id == 'personal') {
|
if (folder.id == 'personal') {
|
||||||
if (pandora.user.level == 'guest') {
|
if (pandora.user.level == 'guest') {
|
||||||
extras = [infoButton('Personal Lists', 'To create and publish your own lists of movies, please sign up or sign in.')];
|
extras = [infoButton('Personal Lists', 'To create and share your own lists of movies, please sign up or sign in.')];
|
||||||
} else {
|
} else {
|
||||||
extras = [Ox.Select({
|
extras = [Ox.Select({
|
||||||
items: [
|
items: [
|
||||||
|
@ -256,26 +256,30 @@ pandora.ui.folders = function() {
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
click: function() {
|
click: function() {
|
||||||
var $dialog = Ox.Dialog({
|
var $dialog = Ox.Dialog({
|
||||||
buttons: Ox.merge([
|
buttons: Ox.merge(
|
||||||
Ox.Button({title: 'Close'}).bindEvent({
|
title != 'Featured Lists' ? [
|
||||||
click: function() {
|
Ox.Button({title: 'Sign Up...'}).bindEvent({
|
||||||
$dialog.close();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
], title != 'Featured Lists' ? [
|
|
||||||
Ox.Button({title: 'Sign Up'}).bindEvent({
|
|
||||||
click: function() {
|
click: function() {
|
||||||
$dialog.close();
|
$dialog.close();
|
||||||
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
Ox.Button({title: 'Sign In'}).bindEvent({
|
Ox.Button({title: 'Sign In...'}).bindEvent({
|
||||||
click: function() {
|
click: function() {
|
||||||
$dialog.close();
|
$dialog.close();
|
||||||
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
|
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
{}
|
||||||
|
] : [],
|
||||||
|
[
|
||||||
|
Ox.Button({title: 'Close'}).bindEvent({
|
||||||
|
click: function() {
|
||||||
|
$dialog.close();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
] : []),
|
]
|
||||||
|
),
|
||||||
content: Ox.Element()
|
content: Ox.Element()
|
||||||
.append(
|
.append(
|
||||||
$('<img>')
|
$('<img>')
|
||||||
|
|
|
@ -332,14 +332,14 @@ pandora.ui.mainMenu = function() {
|
||||||
}),
|
}),
|
||||||
[
|
[
|
||||||
{},
|
{},
|
||||||
{ id: 'newlist', title: 'New List', keyboard: 'control n' },
|
{ id: 'newlist', title: 'New List', disabled: isGuest, keyboard: 'control n' },
|
||||||
{ id: 'newlistfromselection', title: 'New List from Selection', disabled: ui.listSelection.length == 0, keyboard: 'shift control n' },
|
{ id: 'newlistfromselection', title: 'New List from Selection', disabled: isGuest || ui.listSelection.length == 0, keyboard: 'shift control n' },
|
||||||
{ id: 'newsmartlist', title: 'New Smart List', keyboard: 'alt control n' },
|
{ id: 'newsmartlist', title: 'New Smart List', disabled: isGuest, 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', disabled: isGuest, keyboard: 'shift alt control n' },
|
||||||
{},
|
{},
|
||||||
{ id: 'duplicatelist', title: 'Duplicate Selected List', disabled: !pandora.user.ui._list, keyboard: 'control d' },
|
{ id: 'duplicatelist', title: 'Duplicate Selected List', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control d' },
|
||||||
{ id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list, keyboard: 'control e' },
|
{ id: 'editlist', title: 'Edit Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control e' },
|
||||||
{ id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list, keyboard: 'delete' },
|
{ id: 'deletelist', title: 'Delete Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
|
||||||
]
|
]
|
||||||
)};
|
)};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,62 +6,72 @@ pandora.ui.preferencesDialog = function() {
|
||||||
];
|
];
|
||||||
var $tabPanel = Ox.TabPanel({
|
var $tabPanel = Ox.TabPanel({
|
||||||
content: function(id) {
|
content: function(id) {
|
||||||
var content = Ox.Element().css({padding: '16px', overflowY: 'auto'});
|
var $content = Ox.Element()
|
||||||
|
.css({overflowY: 'auto'})
|
||||||
|
.append(
|
||||||
|
$('<img>')
|
||||||
|
.attr({src: '/static/png/icon64.png'})
|
||||||
|
.css({position: 'absolute', left: '16px', top: '16px'})
|
||||||
|
);
|
||||||
if (id == 'account') {
|
if (id == 'account') {
|
||||||
content.append(Ox.FormElementGroup({
|
$content.append(
|
||||||
elements: Ox.values(Ox.map(pandora.user.preferences, function(v, k) {
|
Ox.Form({
|
||||||
return Ox.Input({
|
items: [
|
||||||
id: k,
|
Ox.Input({
|
||||||
width: 400,
|
disabled: true,
|
||||||
label: Ox.toTitleCase(k),
|
id: 'username',
|
||||||
value: v
|
label: 'Username',
|
||||||
});
|
labelWidth: 120,
|
||||||
}))
|
value: pandora.user.username,
|
||||||
}));
|
width: 320
|
||||||
|
}),
|
||||||
|
Ox.Input({
|
||||||
|
id: 'password',
|
||||||
|
label: 'New Passowrd',
|
||||||
|
labelWidth: 120,
|
||||||
|
type: 'password',
|
||||||
|
width: 320
|
||||||
|
}),
|
||||||
|
Ox.Input({
|
||||||
|
id: 'email',
|
||||||
|
label: 'E-Mail Address',
|
||||||
|
labelWidth: 120,
|
||||||
|
value: pandora.user.email,
|
||||||
|
width: 320
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
.css({position: 'absolute', left: '96px', top: '16px'})
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
content.append(Ox.FormElementGroup({
|
content.append(Ox.FormElementGroup({
|
||||||
elements: [
|
elements: [
|
||||||
Ox.Checkbox({
|
Ox.Checkbox({
|
||||||
checked: true ,
|
checked: true ,
|
||||||
id: 'showEpisodes',
|
id: 'showEpisodes',
|
||||||
title: 'Show Episodes',
|
title: 'Show Episodes',
|
||||||
width: 400
|
width: 320
|
||||||
}),
|
}),
|
||||||
Ox.Checkbox({
|
Ox.Checkbox({
|
||||||
checked: true ,
|
checked: true ,
|
||||||
id: 'newsletter',
|
id: 'newsletter',
|
||||||
title: 'Receive Newsletter',
|
title: 'Receive Newsletter',
|
||||||
width: 400
|
width: 320
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}));
|
}));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return Ox.SplitPanel({
|
return $content;
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
element: Ox.Element()
|
|
||||||
.css({padding: '16px'})
|
|
||||||
.append(
|
|
||||||
$('<img>')
|
|
||||||
.attr({src: '/static/png/logo256.png'})
|
|
||||||
.css({width: '128px'})
|
|
||||||
),
|
|
||||||
size: 144
|
|
||||||
},
|
|
||||||
{
|
|
||||||
element: content
|
|
||||||
}
|
|
||||||
],
|
|
||||||
orientation: 'horizontal'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
tabs: tabs
|
tabs: tabs
|
||||||
});
|
});
|
||||||
var $dialog = Ox.Dialog({
|
var $dialog = Ox.Dialog({
|
||||||
buttons: [
|
buttons: [
|
||||||
Ox.Button({
|
Ox.Button({
|
||||||
id: 'close',
|
id: 'done',
|
||||||
title: 'Close'
|
title: 'Done'
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
click: function() {
|
click: function() {
|
||||||
$dialog.close();
|
$dialog.close();
|
||||||
|
@ -71,12 +81,12 @@ pandora.ui.preferencesDialog = function() {
|
||||||
],
|
],
|
||||||
//closeButton: true,
|
//closeButton: true,
|
||||||
content: $tabPanel,
|
content: $tabPanel,
|
||||||
height: Math.round((window.innerHeight - 24) * 0.5),
|
height: 192,
|
||||||
//maximizeButton: true,
|
//maximizeButton: true,
|
||||||
minHeight: 256,
|
minHeight: 192,
|
||||||
minWidth: 640,
|
minWidth: 432,
|
||||||
title: 'Preferences',
|
title: 'Preferences',
|
||||||
width: Math.round(window.innerWidth * 0.5),
|
width: 432
|
||||||
});
|
});
|
||||||
|
|
||||||
return $dialog;
|
return $dialog;
|
||||||
|
|
Loading…
Reference in a new issue