dont use new Ox.

This commit is contained in:
j 2011-06-19 19:49:25 +02:00
parent 0b8b0a6b20
commit 06bea0b116
32 changed files with 140 additions and 140 deletions

View file

@ -3,7 +3,7 @@
Ox.FilesView = function(options, self) {
var self = self || {},
that = new Ox.Element({}, self)
that = Ox.Element({}, self)
.defaults({
id: ''
})
@ -11,11 +11,11 @@ Ox.FilesView = function(options, self) {
self.selected = [];
self.$toolbar = new Ox.Bar({
self.$toolbar = Ox.Bar({
size: 24
});
self.$orderButton = new Ox.Button({
self.$orderButton = Ox.Button({
title: 'Change Order of Users...'
})
.css({
@ -24,7 +24,7 @@ Ox.FilesView = function(options, self) {
})
.appendTo(self.$toolbar);
self.$moveButton = new Ox.Button({
self.$moveButton = Ox.Button({
disabled: 'true',
title: 'Move Selected Files...'
})
@ -34,7 +34,7 @@ Ox.FilesView = function(options, self) {
})
.appendTo(self.$toolbar);
self.$filesList = new Ox.TextList({
self.$filesList = Ox.TextList({
columns: [
{
align: 'left',

View file

@ -1,7 +1,7 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.accountDialog = function(action) {
var that = new Ox.Dialog($.extend({
var that = Ox.Dialog($.extend({
height: 256,
id: 'accountDialog',
minHeight: 256,
@ -48,14 +48,14 @@ pandora.ui.accountDialogOptions = function(action, value) {
};
function button(type) {
if (type == 'cancel') {
return new Ox.Button({
return Ox.Button({
id: 'cancel' + Ox.toTitleCase(action),
title: 'Cancel'
}).bindEvent('click', function() {
pandora.$ui.accountDialog.close();
});
} else if (type == 'submit') {
return new Ox.Button({
return Ox.Button({
disabled: true,
id: 'submit' + Ox.toTitleCase(action),
title: buttonTitle[action]
@ -63,7 +63,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
pandora.$ui.accountForm.submit();
});
} else {
return new Ox.Button({
return Ox.Button({
id: type,
title: buttonTitle[type] + '...'
}).bindEvent('click', function() {
@ -79,9 +79,9 @@ pandora.ui.accountDialogOptions = function(action, value) {
}),
[button('cancel'), button('submit')]
],
content: new Ox.Element()
content: Ox.Element()
.append(
new Ox.Element()
Ox.Element()
.addClass('OxText')
.html(dialogText[action] + '<br/><br/>')
)
@ -118,7 +118,7 @@ pandora.ui.accountForm = function(action, value) {
$items = $.map(items[action], function(v) {
return item(v, value);
}),
that = new Ox.Form({
that = Ox.Form({
id: 'accountForm' + Ox.toTitleCase(action),
items: $items,
submit: function(data, callback) {
@ -178,7 +178,7 @@ pandora.ui.accountForm = function(action, value) {
that.items = $items;
function item(type, value) {
if (type == 'code') {
return new Ox.Input({
return Ox.Input({
autovalidate: autovalidateCode,
id: 'code',
label: 'Code',
@ -192,7 +192,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'email') {
return new Ox.Input({
return Ox.Input({
autovalidate: autovalidateEmail,
id: 'email',
label: 'E-Mail Address',
@ -202,7 +202,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'newPassword') {
return new Ox.Input({
return Ox.Input({
autovalidate: /.+/,
id: 'password',
label: 'New Password',
@ -217,7 +217,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'newUsername') {
return new Ox.Input({
return Ox.Input({
autovalidate: pandora.autovalidateUsername,
id: 'username',
label: 'Username',
@ -226,7 +226,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'oldUsername') {
return new Ox.Input({
return Ox.Input({
disabled: true,
id: 'username',
label: 'Username',
@ -235,7 +235,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'password') {
return new Ox.Input({
return Ox.Input({
autovalidate: /.+/,
id: 'password',
label: 'Password',
@ -250,7 +250,7 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'username') {
return new Ox.Input({
return Ox.Input({
autovalidate: pandora.autovalidateUsername,
id: 'username',
label: 'Username',
@ -259,10 +259,10 @@ pandora.ui.accountForm = function(action, value) {
width: 352
});
} else if (type == 'usernameOrEmail') {
return new Ox.FormElementGroup({
return Ox.FormElementGroup({
id: 'usernameOrEmail',
elements: [
pandora.$ui.usernameOrEmailSelect = new Ox.Select({
pandora.$ui.usernameOrEmailSelect = Ox.Select({
id: 'usernameOrEmailSelect',
items: [
{id: 'username', title: 'Username'},
@ -281,7 +281,7 @@ pandora.ui.accountForm = function(action, value) {
}).focus();
}
}),
pandora.$ui.usernameOrEmailInput = new Ox.Input({
pandora.$ui.usernameOrEmailInput = Ox.Input({
autovalidate: pandora.autovalidateUsername,
id: 'usernameOrEmailInput',
validate: pandora.validateUser('username', true),
@ -298,16 +298,16 @@ pandora.ui.accountForm = function(action, value) {
};
pandora.ui.accountLogoutDialog = function() {
var that = new Ox.Dialog({
var that = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'cancel',
title: 'Cancel'
}).bindEvent('click', function() {
that.close();
pandora.$ui.mainMenu.getItem('loginlogout').toggleTitle();
}),
new Ox.Button({
Ox.Button({
id: 'logout',
title: 'Logout'
}).bindEvent('click', function() {
@ -317,7 +317,7 @@ pandora.ui.accountLogoutDialog = function() {
});
})
],
content: new Ox.Element().html('Are you sure you want to logout?'),
content: Ox.Element().html('Are you sure you want to logout?'),
height: 160,
keys: {enter: 'logout', escape: 'cancel'},
title: 'Logout',
@ -326,10 +326,10 @@ pandora.ui.accountLogoutDialog = function() {
return that;
};
pandora.ui.accountWelcomeDialog = function() {
var that = new Ox.Dialog({
var that = Ox.Dialog({
buttons: [
[
new Ox.Button({
Ox.Button({
id: 'preferences',
title: 'Preferences...'
}).bindEvent('click', function() {
@ -337,7 +337,7 @@ pandora.ui.accountWelcomeDialog = function() {
})
],
[
new Ox.Button({
Ox.Button({
id: 'close',
title: 'Close'
}).bindEvent('click', function() {
@ -345,7 +345,7 @@ pandora.ui.accountWelcomeDialog = function() {
})
]
],
content: new Ox.Element().html('Welcome, ' + pandora.user.username + '!<br/><br/>Your account has been created.'),
content: Ox.Element().html('Welcome, ' + pandora.user.username + '!<br/><br/>Your account has been created.'),
height: 160,
keys: {enter: 'close', escape: 'close'},
title: 'Welcome to ' + pandora.site.site.name,

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.appPanel = function() {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.mainMenu = pandora.ui.mainMenu(),

View file

@ -3,7 +3,7 @@ pandora.ui.browser = function() {
var that;
if (!pandora.user.ui.item) {
pandora.$ui.groups = pandora.ui.groups();
that = new Ox.SplitPanel({
that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.groups[0],
@ -36,7 +36,7 @@ pandora.ui.browser = function() {
}
});
} else {
var that = new Ox.IconList({
var that = Ox.IconList({
centered: true,
id: 'list',
item: function(data, sort, size) {

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.contentPanel = function() {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: pandora.user.ui.item == '' ? [
{
collapsed: !pandora.user.ui.showGroups,

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.annotations = function() {
var that = new Ox.Element({
var that = Ox.Element({
id: 'annotations'
})
.bindEvent({
@ -16,7 +16,7 @@ pandora.ui.annotations = function() {
}),
$bins = [];
$.each(pandora.site.layers, function(i, layer) {
var $bin = new Ox.CollapsePanel({
var $bin = Ox.CollapsePanel({
id: layer.id,
size: 16,
title: layer.title

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.filter = function() {
var that = new Ox.Filter({
var that = Ox.Filter({
findKeys: Ox.map(pandora.site.itemKeys, function(key) {
return key.id == 'all' ? null : {
autocomplete: key.autocomplete,

View file

@ -1,8 +1,8 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.filterDialog = function() {
var that = new Ox.Dialog({
var that = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'debug',
title: 'Debug',
})
@ -11,7 +11,7 @@ pandora.ui.filterDialog = function() {
alert(JSON.stringify(pandora.$ui.filter.options('query')));
}
}),
new Ox.Button({
Ox.Button({
id: 'cancel',
title: 'Cancel'
})
@ -20,7 +20,7 @@ pandora.ui.filterDialog = function() {
pandora.$ui.filterDialog.close();
}
}),
new Ox.Button({
Ox.Button({
id: 'save',
title: 'Save'
})

View file

@ -6,9 +6,9 @@ pandora.ui.findElement = function() {
findKey = pandora.user.ui.findQuery.conditions[0].key;
findValue = pandora.user.ui.findQuery.conditions[0].value;
}
var that = new Ox.FormElementGroup({
var that = Ox.FormElementGroup({
elements: $.merge(pandora.user.ui.list ? [
pandora.$ui.findListSelect = new Ox.Select({
pandora.$ui.findListSelect = Ox.Select({
items: [
{id: 'all', title: 'Find: All ' + pandora.site.itemName.plural},
{id: 'list', title: 'Find: This List'}
@ -25,7 +25,7 @@ pandora.ui.findElement = function() {
}
}),
] : [], [
pandora.$ui.findSelect = new Ox.Select({
pandora.$ui.findSelect = Ox.Select({
id: 'select',
items: $.merge($.map(pandora.site.findKeys,
function(key, i) {
@ -59,7 +59,7 @@ pandora.ui.findElement = function() {
}
}
}),
pandora.$ui.findInput = new Ox.Input({
pandora.$ui.findInput = Ox.Input({
autocomplete: autocompleteFunction(),
autocompleteSelect: true,
autocompleteSelectHighlight: true,

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.flipbook = function(item) {
var that = new Ox.Flipbook({
var that = Ox.Flipbook({
}).bindEvent('click', function(event, data) {
pandora.UI.set('videoPosition|' + item, data.position);
pandora.URL.set(item + '/timeline');

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.folderBrowser = function(id) {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
element: pandora.ui.folderBrowserBar(),

View file

@ -1,9 +1,9 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.folderBrowserBar = function(id) {
var that = new Ox.Bar({
var that = Ox.Bar({
size: 24
});
pandora.$ui.findListInput = new Ox.Input({
pandora.$ui.findListInput = Ox.Input({
placeholder: 'Find User',
width: 184 - Ox.UI.SCROLLBAR_SIZE
})

View file

@ -2,7 +2,7 @@
pandora.ui.folderBrowserList = function(id) {
var columnWidth = (pandora.user.ui.sidebarSize - Ox.UI.SCROLLBAR_SIZE - 88) / 2,
i = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id),
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
format: function() {
@ -193,7 +193,7 @@ pandora.ui.folderList = function(id) {
var i = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id),
that;
if (pandora.user.ui.section == 'site') {
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
format: function() {
@ -238,7 +238,7 @@ pandora.ui.folderList = function(id) {
},
});
} else if (pandora.user.ui.section == 'items') {
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
format: function() {
@ -464,7 +464,7 @@ pandora.ui.folderList = function(id) {
};
pandora.ui.folders = function() {
var that = new Ox.Element()
var that = Ox.Element()
.css({overflowX: 'hidden', overflowY: 'auto'})
.bindEvent({
resize: function(event, data) {
@ -479,7 +479,7 @@ pandora.ui.folders = function() {
if (pandora.user.ui.section == 'site') {
$.each(pandora.site.sectionFolders.site, function(i, folder) {
var height = (Ox.getObjectById(pandora.site.sectionFolders.site, folder.id).items.length * 16);
pandora.$ui.folder[i] = new Ox.CollapsePanel({
pandora.$ui.folder[i] = Ox.CollapsePanel({
id: folder.id,
collapsed: !pandora.user.ui.showFolder.site[folder.id],
size: 16,
@ -509,7 +509,7 @@ pandora.ui.folders = function() {
$.each(pandora.site.sectionFolders.items, function(i, folder) {
var extras = [];
if (folder.id == 'personal' && pandora.user.level != 'guest') {
extras = [new Ox.Select({
extras = [Ox.Select({
items: [
{ id: 'new', title: 'New List...' },
{ id: 'newfromselection', title: 'New List from Current Selection...', disabled: true },
@ -549,7 +549,7 @@ pandora.ui.folders = function() {
}
})];
} else if (folder.id == 'favorite' && pandora.user.level != 'guest') {
extras = [new Ox.Button({
extras = [Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
@ -573,7 +573,7 @@ pandora.ui.folders = function() {
}
})];
} else if (folder.id == 'featured' && pandora.user.level == 'admin') {
extras = [new Ox.Button({
extras = [Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
@ -596,7 +596,7 @@ pandora.ui.folders = function() {
}
})];
}
pandora.$ui.folder[i] = new Ox.CollapsePanel({
pandora.$ui.folder[i] = Ox.CollapsePanel({
id: folder.id,
collapsed: !pandora.user.ui.showFolder.items[folder.id],
extras: extras,

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.folders = function() {
var that = new Ox.Element()
var that = Ox.Element()
.css({overflowX: 'hidden', overflowY: 'auto'})
.bindEvent({
resize: function(event, data) {
@ -15,7 +15,7 @@ pandora.ui.folders = function() {
if (pandora.user.ui.section == 'site') {
$.each(pandora.site.sectionFolders.site, function(i, folder) {
var height = (Ox.getObjectById(pandora.site.sectionFolders.site, folder.id).items.length * 16);
pandora.$ui.folder[i] = new Ox.CollapsePanel({
pandora.$ui.folder[i] = Ox.CollapsePanel({
id: folder.id,
collapsed: !pandora.user.ui.showFolder.site[folder.id],
size: 16,
@ -45,7 +45,7 @@ pandora.ui.folders = function() {
$.each(pandora.site.sectionFolders.items, function(i, folder) {
var extras = [];
if (folder.id == 'personal' && pandora.user.level != 'guest') {
extras = [new Ox.Select({
extras = [Ox.Select({
items: [
{ id: 'new', title: 'New List...' },
{ id: 'newfromselection', title: 'New List from Current Selection...', disabled: true },
@ -85,7 +85,7 @@ pandora.ui.folders = function() {
}
})];
} else if (folder.id == 'favorite' && pandora.user.level != 'guest') {
extras = [new Ox.Button({
extras = [Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
@ -109,7 +109,7 @@ pandora.ui.folders = function() {
}
})];
} else if (folder.id == 'featured' && pandora.user.level == 'admin') {
extras = [new Ox.Button({
extras = [Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
@ -132,7 +132,7 @@ pandora.ui.folders = function() {
}
})];
}
pandora.$ui.folder[i] = new Ox.CollapsePanel({
pandora.$ui.folder[i] = Ox.CollapsePanel({
id: folder.id,
collapsed: !pandora.user.ui.showFolder.items[folder.id],
extras: extras,

View file

@ -3,7 +3,7 @@ pandora.ui.folderList = function(id) {
var i = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id),
that;
if (pandora.user.ui.section == 'site') {
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
format: function() {
@ -48,7 +48,7 @@ pandora.ui.folderList = function(id) {
},
});
} else if (pandora.user.ui.section == 'items') {
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
format: function() {

View file

@ -11,7 +11,7 @@ pandora.ui.group = function(id, query) {
panelWidth = pandora.$ui.document.width() - (pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize) - 1,
title = Ox.getObjectById(pandora.site.groups, id).title,
width = pandora.getGroupWidth(i, panelWidth),
that = new Ox.TextList({
that = Ox.TextList({
columns: [
{
align: 'left',
@ -70,7 +70,7 @@ pandora.ui.group = function(id, query) {
pandora.reloadGroups(i);
}
});
new Ox.Select({
Ox.Select({
items: $.map(pandora.site.groups, function(v) {
return {
checked: v.id == id,
@ -149,7 +149,7 @@ pandora.ui.groups = function() {
};
pandora.ui.groupsInnerPanel = function() {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.groups[1],

View file

@ -1,8 +1,8 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.info = function() {
var that = new Ox.Element()
var that = Ox.Element()
.append(
pandora.$ui.infoStill = new Ox.Element()
pandora.$ui.infoStill = Ox.Element()
.css({
position: 'absolute',
left: 0,
@ -11,7 +11,7 @@ pandora.ui.info = function() {
})
)
.append(
pandora.$ui.infoTimeline = new Ox.Element('<img>')
pandora.$ui.infoTimeline = Ox.Element('<img>')
.css({
position: 'absolute',
left: 0,

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.item = function() {
var that = new Ox.Element();
var that = Ox.Element();
pandora.api.getItem(pandora.user.ui.item, function(result) {
if (result.status.code != 200) {
pandora.$ui.contentPanel.replaceElement(1,
@ -9,7 +9,7 @@ pandora.ui.item = function() {
} else if (pandora.user.ui.itemView == 'calendar') {
pandora.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar'));
} else if (pandora.user.ui.itemView == 'clips') {
pandora.$ui.contentPanel.replaceElement(1, new Ox.IconList({
pandora.$ui.contentPanel.replaceElement(1, Ox.IconList({
item: function(data, sort, size) {
size = size || 128;
var ratio = result.data.stream.aspectRatio,
@ -45,10 +45,10 @@ pandora.ui.item = function() {
//Ox.print('result.data', result.data)
if (pandora.user.level == 'admin') {
var $form,
$edit = new Ox.Element()
.append($form = new Ox.FormElementGroup({
$edit = Ox.Element()
.append($form = Ox.FormElementGroup({
elements: Ox.map(pandora.site.itemKeys, function(key) {
return new Ox.Input({
return Ox.Input({
id: key.id,
label: key.title,
labelWidth: 100,
@ -61,7 +61,7 @@ pandora.ui.item = function() {
{title: '', width: 0}
]
}))
.append(new Ox.Button({
.append(Ox.Button({
title: 'Save',
type: 'text'
}).bindEvent({
@ -90,14 +90,14 @@ pandora.ui.item = function() {
$.get('/static/html/itemInfo.html', {}, function(template) {
//Ox.print(template);
pandora.$ui.contentPanel.replaceElement(1,
pandora.$ui.item = new Ox.Element()
pandora.$ui.item = Ox.Element()
.append($.tmpl(template, result.data))
);
});
}
} else if (pandora.user.ui.itemView == 'map') {
pandora.$ui.contentPanel.replaceElement(1, new Ox.SplitPanel({
pandora.$ui.contentPanel.replaceElement(1, Ox.SplitPanel({
elements: [
{
element: pandora.$ui.map = Ox.Map({
@ -120,7 +120,7 @@ pandora.ui.item = function() {
})
},
{
element: new Ox.Element(),
element: Ox.Element(),
id: 'place',
size: 144 + Ox.UI.SCROLLBAR_SIZE
}
@ -136,7 +136,7 @@ pandora.ui.item = function() {
video.height = video.profiles[0];
video.width = parseInt(video.height * video.aspectRatio / 2) * 2;
video.url = video.baseUrl + '/' + video.height + 'p.' + format;
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.player = new Ox.VideoPanelPlayer({
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.player = Ox.VideoPanelPlayer({
annotationsSize: pandora.user.ui.annotationsSize,
duration: video.duration,
height: pandora.$ui.contentPanel.size(1),
@ -183,7 +183,7 @@ pandora.ui.item = function() {
$.each(pandora.site.layers, function(i, layer) {
layers[i] = $.extend({}, layer, {items: result.data.layers[layer.id]});
});
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.editor = new Ox.VideoEditor({
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.editor = Ox.VideoEditor({
annotationsSize: pandora.user.ui.annotationsSize,
cuts: cuts,
duration: video.duration,
@ -263,7 +263,7 @@ pandora.ui.item = function() {
*/
} else if (pandora.user.ui.itemView == 'files') {
pandora.$ui.contentPanel.replaceElement(1,
pandora.$ui.item = new Ox.FilesView({
pandora.$ui.item = Ox.FilesView({
id: result.data.id
})
);

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.leftPanel = function() {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.sectionbar = pandora.ui.sectionbar('buttons'),

View file

@ -12,7 +12,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
));
Ox.print('$$$$', keys)
*/
that = new Ox.TextList({
that = Ox.TextList({
columns: $.map(pandora.site.sortKeys, function(key, i) {
var position = pandora.user.ui.lists[pandora.user.ui.list].columns.indexOf(key.id);
return {
@ -70,7 +70,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
}
});
} else if (view == 'icons') {
that = new Ox.IconList({
that = Ox.IconList({
id: 'list',
item: function(data, sort, size) {
var ratio = data.poster.width / data.poster.height;
@ -96,7 +96,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
unique: 'id'
});
} else if (view == 'clip') {
that = new Ox.IconList({
that = Ox.IconList({
item: function(data, sort, size) {
size = size || 128;
var ratio = data.aspectRatio,
@ -132,7 +132,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
unique: 'id'
});
} else if (view == 'map') {
that = new Ox.SplitPanel({
that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.map = Ox.Map({
@ -151,7 +151,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
})
},
{
element: new Ox.Element(),
element: Ox.Element(),
id: 'place',
size: 144 + Ox.UI.SCROLLBAR_SIZE
}
@ -162,7 +162,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
pandora.$ui.map.resizeMap();
});
} else if (view == 'calendar') {
that = new Ox.SplitPanel({
that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.calendar = Ox.Calendar({
@ -188,7 +188,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
})
},
{
element: new Ox.Element(),
element: Ox.Element(),
id: 'place',
size: 144 + Ox.UI.SCROLLBAR_SIZE
}
@ -199,7 +199,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
});
} else {
$list = new Ox.Element('<div>')
$list = Ox.Element('<div>')
.css({
width: '100px',
height: '100px',
@ -313,9 +313,9 @@ pandora.ui.list = function(view) { // fixme: remove view argument
bottom: 0,
margin: 'auto',
});
pandora.$ui.previewDialog = new Ox.Dialog({
pandora.$ui.previewDialog = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
title: 'Close',
}).bindEvent({
click: function() {

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.mainPanel = function() {
var that = new Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
collapsible: true,

View file

@ -1,10 +1,10 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.mainMenu = function() {
var isGuest = pandora.user.level == 'guest',
that = new Ox.MainMenu({
that = Ox.MainMenu({
extras: [
$('<div>').html('beta').css({marginRight: '8px', color: 'rgb(128, 128, 128)'}),
pandora.$ui.loadingIcon = new Ox.LoadingIcon({
pandora.$ui.loadingIcon = Ox.LoadingIcon({
size: 'medium'
})
],
@ -192,9 +192,9 @@ pandora.ui.mainMenu = function() {
},
click: function(event, data) {
if (data.id == 'about') {
var $dialog = new Ox.Dialog({
var $dialog = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'close',
title: 'Close'
}).bindEvent({
@ -382,9 +382,9 @@ pandora.ui.mainMenu = function() {
$logo.animate({width: '320px'}, 500);
/*
var $dialog = new Ox.Dialog({
var $dialog = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'close',
title: 'Close'
}).bindEvent({
@ -408,20 +408,20 @@ pandora.ui.mainMenu = function() {
} else if (data.id == 'places') {
pandora.$ui.placesDialog = pandora.ui.placesDialog().open();
/*
var $manage = new Ox.SplitPanel({
var $manage = Ox.SplitPanel({
elements: [
{
collapsible: true,
element: new Ox.SplitPanel({
element: Ox.SplitPanel({
elements: [
{
element: new Ox.Toolbar({
element: Ox.Toolbar({
orientation: 'horizontal',
size: 44
}).append(
pandora.$ui.findPlacesElement = new Ox.FormElementGroup({
pandora.$ui.findPlacesElement = Ox.FormElementGroup({
elements: [
pandora.$ui.findPlacesSelect = new Ox.Select({
pandora.$ui.findPlacesSelect = Ox.Select({
id: 'findPlacesSelect',
items: [
{ id: 'name', title: 'Find: Name' },
@ -439,7 +439,7 @@ pandora.ui.mainMenu = function() {
});
}
}),
pandora.$ui.findPlacesInput = new Ox.Input({
pandora.$ui.findPlacesInput = Ox.Input({
clear: true,
id: 'findPlacesInput',
placeholder: 'Find: Name',
@ -453,7 +453,7 @@ pandora.ui.mainMenu = function() {
margin: '4px'
})
).append(
pandora.$ui.sortPlacesSelect = new Ox.Select({
pandora.$ui.sortPlacesSelect = Ox.Select({
id: 'sortPlacesSelect',
items: [
{ id: 'name', title: 'Sort by Name', checked: true },
@ -476,10 +476,10 @@ pandora.ui.mainMenu = function() {
size: 44
},
{
element: new Ox.Element('div')
element: Ox.Element('div')
},
{
element: new Ox.Toolbar({
element: Ox.Toolbar({
orientation: 'horizontal',
size: 16
}),
@ -491,14 +491,14 @@ pandora.ui.mainMenu = function() {
size: 256
},
{
element: new Ox.SplitPanel({
element: Ox.SplitPanel({
elements: [
{
element: new Ox.Toolbar({
element: Ox.Toolbar({
orientation: 'horizontal',
size: 24
}).append(
pandora.$ui.labelsButton = new Ox.Button({
pandora.$ui.labelsButton = Ox.Button({
id: 'labelsButton',
title: [
{id: 'show', title: 'Show Labels'},
@ -511,7 +511,7 @@ pandora.ui.mainMenu = function() {
margin: '4px'
})
).append(
pandora.$ui.findMapInput = new Ox.Input({
pandora.$ui.findMapInput = Ox.Input({
clear: true,
id: 'findMapInput',
placeholder: 'Find on Map',
@ -550,7 +550,7 @@ pandora.ui.mainMenu = function() {
size: 24
},
{
element: pandora.$ui.map = new Ox.Map({
element: pandora.$ui.map = Ox.Map({
places: ['Boston', 'Brussels', 'Barcelona', 'Berlin', 'Beirut', 'Bombay', 'Bangalore', 'Beijing']
})
.css({
@ -582,12 +582,12 @@ pandora.ui.mainMenu = function() {
})
},
{
element: pandora.$ui.bottomBar = new Ox.Toolbar({
element: pandora.$ui.bottomBar = Ox.Toolbar({
orientation: 'horizontal',
size: 24
})
.append(
pandora.$ui.placeNameInput = new Ox.Input({
pandora.$ui.placeNameInput = Ox.Input({
disabled: true,
id: 'placeName',
placeholder: 'Name',
@ -599,7 +599,7 @@ pandora.ui.mainMenu = function() {
})
)
.append(
pandora.$ui.placeAliasesInput = new Ox.Input({
pandora.$ui.placeAliasesInput = Ox.Input({
disabled: true,
id: 'aliases',
placeholder: 'Aliases',
@ -611,7 +611,7 @@ pandora.ui.mainMenu = function() {
})
)
.append(
pandora.$ui.placeGeonameLabel = new Ox.Label({
pandora.$ui.placeGeonameLabel = Ox.Label({
disabled: true,
id: 'placeGeoname',
title: 'Geoname',
@ -623,7 +623,7 @@ pandora.ui.mainMenu = function() {
})
)
.append(
pandora.$ui.addPlaceButton = new Ox.Button({
pandora.$ui.addPlaceButton = Ox.Button({
disabled: true,
id: 'addPlaceButton',
title: 'add',
@ -635,7 +635,7 @@ pandora.ui.mainMenu = function() {
})
)
.append(
pandora.$ui.removePlaceButton = new Ox.Button({
pandora.$ui.removePlaceButton = Ox.Button({
disabled: true,
id: 'removePlaceButton',
title: 'remove',
@ -658,7 +658,7 @@ pandora.ui.mainMenu = function() {
top: '24px',
bottom: '24px',
}),
$dialog = new Ox.Dialog({
$dialog = Ox.Dialog({
buttons: [
{
click: function() {
@ -681,9 +681,9 @@ pandora.ui.mainMenu = function() {
}).append($manage).open();
*/
} else if (data.id == 'query') {
var $dialog = new Ox.Dialog({
var $dialog = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'close',
title: 'Close'
}).bindEvent({
@ -692,7 +692,7 @@ pandora.ui.mainMenu = function() {
}
})
],
content: new Ox.Element()
content: Ox.Element()
.html([
'Query: ' + JSON.stringify(pandora.Query.toObject()),
'findQuery: ' + JSON.stringify(pandora.user.ui.findQuery),

View file

@ -2,9 +2,9 @@
pandora.ui.placesDialog = function() {
var height = Math.round(window.innerHeight * 0.9),
width = Math.round(window.innerWidth * 0.9),
that = new Ox.Dialog({
that = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'done',
title: 'Done'
}).bindEvent({
@ -13,7 +13,7 @@ pandora.ui.placesDialog = function() {
}
})
],
content: pandora.$ui.placesElement = new Ox.ListMap({
content: pandora.$ui.placesElement = Ox.ListMap({
height: height - 48,
places: function(data, callback) {
return pandora.api.findPlaces($.extend({

View file

@ -1,8 +1,8 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.publicListsDialog = function() { // fixme: unused
var that = new Ox.Dialog({
var that = Ox.Dialog({
buttons: [
new Ox.Button({
Ox.Button({
id: 'done',
title: 'Done'
}).bindEvent({

View file

@ -10,14 +10,14 @@ pandora.ui.rightPanel = function() {
}
});
} else {
that = new Ox.Element()
that = Ox.Element()
.css({padding: '8px'});
pandora.api.getPage(pandora.user.ui.sitePage, function(result) {
that.html(result.data.body).css({overflowY: 'auto'});
});
}
} else if (pandora.user.ui.section == 'items') {
that = new Ox.SplitPanel({
that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.toolbar = pandora.ui.toolbar(),

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.sectionButtons = function() {
var that = new Ox.ButtonGroup({
var that = Ox.ButtonGroup({
buttons: [
{id: 'site', selected: pandora.user.ui.section == 'site', title: pandora.site.site.name},
{id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural},

View file

@ -1,7 +1,7 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.sectionSelect = function() {
// fixme: duplicated
var that = new Ox.Select({
var that = Ox.Select({
id: 'sectionSelect',
items: [
{checked: pandora.user.ui.section == 'site', id: 'site', title: pandora.site.site.name},

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.sectionbar = function(mode) {
var that = new Ox.Bar({
var that = Ox.Bar({
size: 24
})
.append(

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.sortSelect = function() {
var that = new Ox.Select({
var that = Ox.Select({
id: 'sortSelect',
items: $.map(pandora.site.sortKeys, function(key) {
//Ox.print('????', pandora.user.ui.lists[pandora.user.ui.list].sort.key, key.id)

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.statusbar = function() {
var that = new Ox.Bar({
var that = Ox.Bar({
size: 16
})
.css({

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.toolbar = function() {
var that = new Ox.Bar({
var that = Ox.Bar({
size: 24
}).css({
zIndex: 2 // fixme: remove later

View file

@ -1,6 +1,6 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.viewSelect = function() {
var that = new Ox.Select({
var that = Ox.Select({
id: 'viewSelect',
items: !pandora.user.ui.item ? $.map(pandora.site.listViews, function(view) {
return $.extend($.extend({}, view), {