From 06bea0b1165ca5c8ffa72bd10d24d2dad5f56868 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 19 Jun 2011 19:49:25 +0200 Subject: [PATCH] dont use new Ox. --- static/js/pandora/ui/Ox.FilesView.js | 10 ++-- static/js/pandora/ui/account.js | 50 +++++++++---------- static/js/pandora/ui/appPanel.js | 2 +- static/js/pandora/ui/browser.js | 4 +- static/js/pandora/ui/contentPanel.js | 2 +- static/js/pandora/ui/editor.js | 4 +- static/js/pandora/ui/filter.js | 2 +- static/js/pandora/ui/filterDialog.js | 8 +-- static/js/pandora/ui/findElement.js | 8 +-- static/js/pandora/ui/flipbook.js | 2 +- static/js/pandora/ui/folderBrowser.js | 2 +- static/js/pandora/ui/folderBrowserBar.js | 4 +- static/js/pandora/ui/folderBrowserList.js | 18 +++---- static/js/pandora/ui/folders.js | 12 ++--- static/js/pandora/ui/foldersList.js | 4 +- static/js/pandora/ui/group.js | 6 +-- static/js/pandora/ui/info.js | 6 +-- static/js/pandora/ui/item.js | 24 ++++----- static/js/pandora/ui/leftPanel.js | 2 +- static/js/pandora/ui/list.js | 20 ++++---- static/js/pandora/ui/mainPanel.js | 2 +- static/js/pandora/ui/menu.js | 60 +++++++++++------------ static/js/pandora/ui/placesDialog.js | 6 +-- static/js/pandora/ui/publicLists.js | 4 +- static/js/pandora/ui/rightPanel.js | 4 +- static/js/pandora/ui/sectionButtons.js | 2 +- static/js/pandora/ui/sectionSelect.js | 2 +- static/js/pandora/ui/sectionbar.js | 2 +- static/js/pandora/ui/sortSelect.js | 2 +- static/js/pandora/ui/statusbar.js | 2 +- static/js/pandora/ui/toolbar.js | 2 +- static/js/pandora/ui/viewSelect.js | 2 +- 32 files changed, 140 insertions(+), 140 deletions(-) diff --git a/static/js/pandora/ui/Ox.FilesView.js b/static/js/pandora/ui/Ox.FilesView.js index 3886b8105..176141cd8 100644 --- a/static/js/pandora/ui/Ox.FilesView.js +++ b/static/js/pandora/ui/Ox.FilesView.js @@ -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', diff --git a/static/js/pandora/ui/account.js b/static/js/pandora/ui/account.js index 30fab3d52..d89290fb5 100644 --- a/static/js/pandora/ui/account.js +++ b/static/js/pandora/ui/account.js @@ -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] + '

') ) @@ -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 + '!

Your account has been created.'), + content: Ox.Element().html('Welcome, ' + pandora.user.username + '!

Your account has been created.'), height: 160, keys: {enter: 'close', escape: 'close'}, title: 'Welcome to ' + pandora.site.site.name, diff --git a/static/js/pandora/ui/appPanel.js b/static/js/pandora/ui/appPanel.js index 9dd411e4f..882391133 100644 --- a/static/js/pandora/ui/appPanel.js +++ b/static/js/pandora/ui/appPanel.js @@ -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(), diff --git a/static/js/pandora/ui/browser.js b/static/js/pandora/ui/browser.js index 7430fa110..c4de5c578 100644 --- a/static/js/pandora/ui/browser.js +++ b/static/js/pandora/ui/browser.js @@ -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) { diff --git a/static/js/pandora/ui/contentPanel.js b/static/js/pandora/ui/contentPanel.js index 51e3c8831..89a17d730 100644 --- a/static/js/pandora/ui/contentPanel.js +++ b/static/js/pandora/ui/contentPanel.js @@ -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, diff --git a/static/js/pandora/ui/editor.js b/static/js/pandora/ui/editor.js index 66306ef1f..702a6c1ef 100644 --- a/static/js/pandora/ui/editor.js +++ b/static/js/pandora/ui/editor.js @@ -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 diff --git a/static/js/pandora/ui/filter.js b/static/js/pandora/ui/filter.js index f3d31d3c8..aabf6c9d7 100644 --- a/static/js/pandora/ui/filter.js +++ b/static/js/pandora/ui/filter.js @@ -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, diff --git a/static/js/pandora/ui/filterDialog.js b/static/js/pandora/ui/filterDialog.js index d9e9eb8a1..ed0f07b7e 100644 --- a/static/js/pandora/ui/filterDialog.js +++ b/static/js/pandora/ui/filterDialog.js @@ -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' }) diff --git a/static/js/pandora/ui/findElement.js b/static/js/pandora/ui/findElement.js index 05c237b70..4ce6dfcb0 100644 --- a/static/js/pandora/ui/findElement.js +++ b/static/js/pandora/ui/findElement.js @@ -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, diff --git a/static/js/pandora/ui/flipbook.js b/static/js/pandora/ui/flipbook.js index ee3fad8b2..7ce9e2ee0 100644 --- a/static/js/pandora/ui/flipbook.js +++ b/static/js/pandora/ui/flipbook.js @@ -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'); diff --git a/static/js/pandora/ui/folderBrowser.js b/static/js/pandora/ui/folderBrowser.js index f5d7785f3..b628a7fc6 100644 --- a/static/js/pandora/ui/folderBrowser.js +++ b/static/js/pandora/ui/folderBrowser.js @@ -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(), diff --git a/static/js/pandora/ui/folderBrowserBar.js b/static/js/pandora/ui/folderBrowserBar.js index 146c633ca..2aab4abe8 100644 --- a/static/js/pandora/ui/folderBrowserBar.js +++ b/static/js/pandora/ui/folderBrowserBar.js @@ -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 }) diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js index 68c86793e..78d3d871c 100644 --- a/static/js/pandora/ui/folderBrowserList.js +++ b/static/js/pandora/ui/folderBrowserList.js @@ -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, diff --git a/static/js/pandora/ui/folders.js b/static/js/pandora/ui/folders.js index 3144657f1..f58d4d6d8 100644 --- a/static/js/pandora/ui/folders.js +++ b/static/js/pandora/ui/folders.js @@ -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, diff --git a/static/js/pandora/ui/foldersList.js b/static/js/pandora/ui/foldersList.js index ea0b97172..9e4813b28 100644 --- a/static/js/pandora/ui/foldersList.js +++ b/static/js/pandora/ui/foldersList.js @@ -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() { diff --git a/static/js/pandora/ui/group.js b/static/js/pandora/ui/group.js index abc540548..a2914ee83 100644 --- a/static/js/pandora/ui/group.js +++ b/static/js/pandora/ui/group.js @@ -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], diff --git a/static/js/pandora/ui/info.js b/static/js/pandora/ui/info.js index e8a95b344..77de3690d 100644 --- a/static/js/pandora/ui/info.js +++ b/static/js/pandora/ui/info.js @@ -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('') + pandora.$ui.infoTimeline = Ox.Element('') .css({ position: 'absolute', left: 0, diff --git a/static/js/pandora/ui/item.js b/static/js/pandora/ui/item.js index a0902d587..3c9d18413 100644 --- a/static/js/pandora/ui/item.js +++ b/static/js/pandora/ui/item.js @@ -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 }) ); diff --git a/static/js/pandora/ui/leftPanel.js b/static/js/pandora/ui/leftPanel.js index aa0718bd7..10276feb1 100644 --- a/static/js/pandora/ui/leftPanel.js +++ b/static/js/pandora/ui/leftPanel.js @@ -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'), diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 4f5eccd0b..86fe56c63 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -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('
') + $list = Ox.Element('
') .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() { diff --git a/static/js/pandora/ui/mainPanel.js b/static/js/pandora/ui/mainPanel.js index 9551a49d2..4638227c4 100644 --- a/static/js/pandora/ui/mainPanel.js +++ b/static/js/pandora/ui/mainPanel.js @@ -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, diff --git a/static/js/pandora/ui/menu.js b/static/js/pandora/ui/menu.js index bbecb5895..d44a1f87a 100644 --- a/static/js/pandora/ui/menu.js +++ b/static/js/pandora/ui/menu.js @@ -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: [ $('
').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), diff --git a/static/js/pandora/ui/placesDialog.js b/static/js/pandora/ui/placesDialog.js index 546b3a006..b955725f7 100644 --- a/static/js/pandora/ui/placesDialog.js +++ b/static/js/pandora/ui/placesDialog.js @@ -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({ diff --git a/static/js/pandora/ui/publicLists.js b/static/js/pandora/ui/publicLists.js index 952f84375..4fd58a55f 100644 --- a/static/js/pandora/ui/publicLists.js +++ b/static/js/pandora/ui/publicLists.js @@ -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({ diff --git a/static/js/pandora/ui/rightPanel.js b/static/js/pandora/ui/rightPanel.js index 3759998ab..28eac1313 100644 --- a/static/js/pandora/ui/rightPanel.js +++ b/static/js/pandora/ui/rightPanel.js @@ -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(), diff --git a/static/js/pandora/ui/sectionButtons.js b/static/js/pandora/ui/sectionButtons.js index bdff75436..954032609 100644 --- a/static/js/pandora/ui/sectionButtons.js +++ b/static/js/pandora/ui/sectionButtons.js @@ -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}, diff --git a/static/js/pandora/ui/sectionSelect.js b/static/js/pandora/ui/sectionSelect.js index 8da3d8125..50ad242b2 100644 --- a/static/js/pandora/ui/sectionSelect.js +++ b/static/js/pandora/ui/sectionSelect.js @@ -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}, diff --git a/static/js/pandora/ui/sectionbar.js b/static/js/pandora/ui/sectionbar.js index fb8aff1e4..625014859 100644 --- a/static/js/pandora/ui/sectionbar.js +++ b/static/js/pandora/ui/sectionbar.js @@ -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( diff --git a/static/js/pandora/ui/sortSelect.js b/static/js/pandora/ui/sortSelect.js index 87d20a36d..33ad0c274 100644 --- a/static/js/pandora/ui/sortSelect.js +++ b/static/js/pandora/ui/sortSelect.js @@ -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) diff --git a/static/js/pandora/ui/statusbar.js b/static/js/pandora/ui/statusbar.js index 164872741..6f495843a 100644 --- a/static/js/pandora/ui/statusbar.js +++ b/static/js/pandora/ui/statusbar.js @@ -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({ diff --git a/static/js/pandora/ui/toolbar.js b/static/js/pandora/ui/toolbar.js index 9635a3672..2ea4f724d 100644 --- a/static/js/pandora/ui/toolbar.js +++ b/static/js/pandora/ui/toolbar.js @@ -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 diff --git a/static/js/pandora/ui/viewSelect.js b/static/js/pandora/ui/viewSelect.js index d208495cc..16f9d69bb 100644 --- a/static/js/pandora/ui/viewSelect.js +++ b/static/js/pandora/ui/viewSelect.js @@ -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), {