diff --git a/pandora/0xdb.json b/pandora/0xdb.json index 8c11f412a..0784e0690 100644 --- a/pandora/0xdb.json +++ b/pandora/0xdb.json @@ -499,7 +499,6 @@ "site": { "id": "{{settings.SITEID}}", "name": "{{settings.SITENAME}}", - "sectionName": "{{settings.SITENAME}}", "url": "{{settings.URL}}" }, "sitePages": [ @@ -572,15 +571,11 @@ "showInfo": true, "showMovies": true, "showFolder": { - "site": { - "site": true, - "user": true, - "admin": true - }, "items": { "personal": true, "favorite": true, - "featured": true + "featured": true, + "volumes": true } }, "showSidebar": true, @@ -594,7 +589,10 @@ "videoView": "player", "videoVolume": 1 }, - "username": "" + "username": "", + "volumes": [ + {"name": "Movies A-Z", "path": "", "items": 1234} + ] }, "userLevels": ["guest", "member", "staff", "admin"], "video": { diff --git a/static/js/pandora.js b/static/js/pandora.js index 8a55cf149..9be010288 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -48,28 +48,22 @@ Ox.load('Geo', function() { return key.find ? key : null; }), sectionFolders: { - site: $.merge([ - {id: 'site', title: 'Site', items: $.merge([ - {id: 'home', title: 'Home'} - ], $.merge(data.site.sitePages, [ - {id: 'software', title: 'Software'}, - {id: 'help', title: 'Help'} - ]))}, - {id: 'user', title: 'User', items: [ - {id: 'preferences', title: 'Preferences'}, - {id: 'archives', title: 'Archives'} - ]} - ], data.user.level == 'admin' ? [ - {id: 'admin', title: 'Admin', items: [ - {id: 'statistics', title: 'Statistics'}, - {id: 'users', title: 'Users'} - ]} - ] : []), items: [ {id: 'personal', title: 'Personal Lists'}, {id: 'favorite', title: 'Favorite Lists', showBrowser: false}, - {id: 'featured', title: 'Featured Lists', showBrowser: false} - ] + {id: 'featured', title: 'Featured Lists', showBrowser: false}, + {id: 'volumes', title: 'Local Volumes'} + ], + edits: [ + {id: 'personal', title: 'Personal Edits'}, + {id: 'favorite', title: 'Favorite Edits', showBrowser: false}, + {id: 'featured', title: 'Featured Edits', showBrowser: false} + ], + texts: [ + {id: 'personal', title: 'Personal Texts'}, + {id: 'favorite', title: 'Favorite Texts', showBrowser: false}, + {id: 'featured', title: 'Featured Texts', showBrowser: false} + ] }, sortKeys: $.map(data.site.itemKeys, function(key, i) { return key.columnWidth ? key : null; diff --git a/static/js/pandora/pandora.js b/static/js/pandora/pandora.js index 7cc2bc95b..5a33e5cbb 100644 --- a/static/js/pandora/pandora.js +++ b/static/js/pandora/pandora.js @@ -25,9 +25,9 @@ pandora.exitFullscreen = function() { }; pandora.getFoldersHeight = function() { - var height = 48; + var height = 0; pandora.site.sectionFolders[pandora.user.ui.section].forEach(function(folder, i) { - height += pandora.user.ui.showFolder[pandora.user.ui.section][folder.id] * ( + height += 16 + pandora.user.ui.showFolder[pandora.user.ui.section][folder.id] * ( !!folder.showBrowser * 40 + folder.items * 16 ); Ox.print('h', height); @@ -212,11 +212,9 @@ pandora.resizeGroups = function(width) { pandora.resizeFolders = function() { var width = pandora.getFoldersWidth(), columnWidth = {}; - if (pandora.user.ui.section == 'site') { - columnWidth.title = width - 16; - } else if (pandora.user.ui.section == 'items') { - columnWidth = {user: parseInt((width - 88) * 0.4)}; - columnWidth.name = (width - 88) - columnWidth.user; + if (pandora.user.ui.section == 'items') { + columnWidth = {user: parseInt((width - 96) * 0.4)}; + columnWidth.name = (width - 96) - columnWidth.user; } //Ox.print('sectionsWidth', width) $.each(pandora.$ui.folderList, function(id, $list) { @@ -224,14 +222,12 @@ pandora.resizeFolders = function() { pandora.$ui.folder[i].css({width: width + 'px'}); $list.css({width: width + 'px'}); Ox.print('...', width, id, $list.options()) - if (pandora.user.ui.section == 'site') { - $list.resizeColumn('title', columnWidth.title); - } else if (pandora.user.ui.section == 'items') { + if (pandora.user.ui.section == 'items') { if (pandora.site.sectionFolders[pandora.user.ui.section][i].showBrowser) { $list.resizeColumn('user', columnWidth.user) .resizeColumn('name', columnWidth.name); } else { - $list.resizeColumn(id == 'favorite' ? 'id' : 'name', width - 88); + $list.resizeColumn(id == 'favorite' ? 'id' : 'name', width - 96); } } if (!pandora.user.ui.showFolder[pandora.user.ui.section][id]) { diff --git a/static/js/pandora/ui/account.js b/static/js/pandora/ui/account.js index 08518d6df..0304026f4 100644 --- a/static/js/pandora/ui/account.js +++ b/static/js/pandora/ui/account.js @@ -330,7 +330,7 @@ pandora.ui.accountSignoutDialog = function() { .css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'}) ) .append( - Ox.Element() + $('
') .css({position: 'absolute', left: '96px', top: '16px', width: '192px'}) .html('Are you sure you want to sign out?') ), diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js index 39f536e6f..2736a7205 100644 --- a/static/js/pandora/ui/folderBrowserList.js +++ b/static/js/pandora/ui/folderBrowserList.js @@ -1,6 +1,8 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript pandora.ui.folderBrowserList = function(id) { - var columnWidth = (pandora.user.ui.sidebarSize - Ox.UI.SCROLLBAR_SIZE - 88) / 2, + // fixme: user and name are set to the same width here, + // but resizeFolders will set them to different widths + var columnWidth = (pandora.user.ui.sidebarSize - Ox.UI.SCROLLBAR_SIZE - 96) / 2, i = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id), that = Ox.TextList({ columns: [ @@ -43,10 +45,11 @@ pandora.ui.folderBrowserList = function(id) { { align: 'right', id: 'items', + format: {type: 'number'}, operator: '-', title: 'Items', visible: true, - width: 40 + width: 48 }, { clickable: function(data) { @@ -68,7 +71,7 @@ pandora.ui.folderBrowserList = function(id) { operator: '+', title: $('') .attr({ - src: Ox.UI.getImageURL('symbolFind') + src: Ox.UI.getImageURL('symbolEdit') }) .css({ width: '10px', @@ -89,7 +92,7 @@ pandora.ui.folderBrowserList = function(id) { return $('') .attr({ src: Ox.UI.getImageURL( - 'symbol' + (id == 'favorite' ? 'Check' : 'Star') + 'symbol' + (id == 'favorite' ? 'Like' : 'Star') ) }) .css({ @@ -106,7 +109,7 @@ pandora.ui.folderBrowserList = function(id) { title: $('') .attr({ src: Ox.UI.getImageURL( - 'symbol' + (id == 'favorite' ? 'Check' : 'Star') + 'symbol' + (id == 'favorite' ? 'Like' : 'Star') ) }) .css({ diff --git a/static/js/pandora/ui/folders.js b/static/js/pandora/ui/folders.js index 2c5dd7251..3b0db53f2 100644 --- a/static/js/pandora/ui/folders.js +++ b/static/js/pandora/ui/folders.js @@ -12,125 +12,130 @@ pandora.ui.folders = function() { pandora.$ui.folder = []; pandora.$ui.folderBrowser = {}; pandora.$ui.folderList = {}; - if (pandora.user.ui.section == 'site') { - pandora.site.sectionFolders.site.forEach(function(folder, i) { - var height = (Ox.getObjectById(pandora.site.sectionFolders.site, folder.id).items.length * 16); - pandora.$ui.folder[i] = Ox.CollapsePanel({ - id: folder.id, - collapsed: !pandora.user.ui.showFolder.site[folder.id], - size: 16, - title: folder.title - }) - .bindEvent({ - toggle: function(event, data) { - - } - }); - //alert(JSON.stringify(Ox.getObjectById(pandora.site.sectionFolders.site, folder.id))) - pandora.$ui.folder[i].$content.css({ - height: height + 'px' - }) - //.appendTo(that); - pandora.$ui.folderList[folder.id] = pandora.ui.folderList(folder.id) - .css({ - height: height + 'px' - }) - .appendTo(pandora.$ui.folder[i].$content); - pandora.$ui.folder.forEach(function($folder) { - that.append($folder); - }); - }); - //pandora.resizeFolders(); - } else if (pandora.user.ui.section == 'items') { + if (pandora.user.ui.section == 'items') { pandora.site.sectionFolders.items.forEach(function(folder, i) { - var extras = []; - if (folder.id == 'personal' && pandora.user.level != 'guest') { - extras = [Ox.Select({ - items: [ - { id: 'new', title: 'New List...' }, - { id: 'newfromselection', title: 'New List from Current Selection...', disabled: true }, - { id: 'newsmart', title: 'New Smart List...' }, - { id: 'newfromresults', title: 'New Smart List from Current Results...', disabled: true }, - {}, - { id: 'addselection', title: 'Add Selection to List...' } - ], - max: 0, - min: 0, - selectable: false, - type: 'image' - }) - .bindEvent({ - click: function(event, data) { - var $list = pandora.$ui.folderList[folder.id], - id; - if (data.id == 'new' || data.id == 'newsmart') { - pandora.api.addList({ - name: 'Untitled', - status: 'private', - type: data.id == 'new' ? 'static' : 'smart' - }, function(result) { - id = result.data.id; - pandora.UI.set(['lists', id].join('|'), pandora.site.user.ui.lists['']); // fixme: necessary? - pandora.URL.set('?find=list:' + id) - Ox.Request.clearCache(); // fixme: remove - $list.reloadList().bindEventOnce({ - load: function(event, data) { - $list.gainFocus() - .options({selected: [id]}) - .editCell(id, 'name'); - } + var extras; + if (folder.id == 'personal') { + if (pandora.user.level == 'guest') { + extras = [infoButton('Personal Lists', 'To create and publish your own lists of movies, please sign up or sign in.')]; + } else { + extras = [Ox.Select({ + items: [ + { id: 'new', title: 'New List...' }, + { id: 'newfromselection', title: 'New List from Current Selection...', disabled: true }, + { id: 'newsmart', title: 'New Smart List...' }, + { id: 'newfromresults', title: 'New Smart List from Current Results...', disabled: true }, + {}, + { id: 'addselection', title: 'Add Selection to List...' } + ], + max: 0, + min: 0, + selectable: false, + type: 'image' + }) + .bindEvent({ + click: function(event, data) { + var $list = pandora.$ui.folderList[folder.id], + id; + if (data.id == 'new' || data.id == 'newsmart') { + pandora.api.addList({ + name: 'Untitled', + status: 'private', + type: data.id == 'new' ? 'static' : 'smart' + }, function(result) { + id = result.data.id; + pandora.UI.set(['lists', id].join('|'), pandora.site.user.ui.lists['']); // fixme: necessary? + pandora.URL.set('?find=list:' + id) + Ox.Request.clearCache(); // fixme: remove + $list.reloadList().bindEventOnce({ + load: function(event, data) { + $list.gainFocus() + .options({selected: [id]}) + .editCell(id, 'name'); + } + }); }); - }); + } } - } - })]; - } else if (folder.id == 'favorite' && pandora.user.level != 'guest') { - extras = [Ox.Button({ - selectable: true, - style: 'symbol', - title: 'Edit', - tooltip: 'Manage Favorite Lists', - type: 'image' - }) - .bindEvent({ - change: function(event, data) { - Ox.Request.clearCache(); // fixme: remove - pandora.site.sectionFolders.items[i].showBrowser = !pandora.site.sectionFolders.items[i].showBrowser; - if (pandora.site.sectionFolders.items[i].showBrowser) { - pandora.$ui.folderList.favorite.replaceWith( - pandora.$ui.folderBrowser.favorite = pandora.ui.folderBrowser('favorite') - ); - } else { - pandora.$ui.folderBrowser.favorite.replaceWith( - pandora.$ui.folderList.favorite = pandora.ui.folderList('favorite') - ); + })]; + } + } else if (folder.id == 'favorite') { + if (pandora.user.level == 'guest') { + extras = [infoButton('Favorite Lists', 'To browse and subscribe to shared lists from other users, please sign up or sign in.')]; + } else { + extras = [Ox.Button({ + selectable: true, + style: 'symbol', + title: 'Edit', + tooltip: 'Manage Favorite Lists', + type: 'image' + }) + .bindEvent({ + change: function(event, data) { + Ox.Request.clearCache(); // fixme: remove + pandora.site.sectionFolders.items[i].showBrowser = !pandora.site.sectionFolders.items[i].showBrowser; + if (pandora.site.sectionFolders.items[i].showBrowser) { + pandora.$ui.folderList.favorite.replaceWith( + pandora.$ui.folderBrowser.favorite = pandora.ui.folderBrowser('favorite') + ); + } else { + pandora.$ui.folderBrowser.favorite.replaceWith( + pandora.$ui.folderList.favorite = pandora.ui.folderList('favorite') + ); + } + pandora.resizeFolders(); } - pandora.resizeFolders(); - } - })]; - } else if (folder.id == 'featured' && pandora.user.level == 'admin') { - extras = [Ox.Button({ - selectable: true, - style: 'symbol', - title: 'Edit', - tooltip: 'Manage Featured Lists', - type: 'image' - }) - .bindEvent({ - change: function(event, data) { - Ox.Request.clearCache(); // fixme: remove - pandora.site.sectionFolders.items[i].showBrowser = !pandora.site.sectionFolders.items[i].showBrowser; - if (pandora.site.sectionFolders.items[i].showBrowser) { - pandora.$ui.folderList.featured.replaceWith( - pandora.$ui.folderBrowser.featured = pandora.ui.folderBrowser('featured')); - } else { - pandora.$ui.folderBrowser.featured.replaceWith( - pandora.$ui.folderList.featured = pandora.ui.folderList('featured') - ); + })]; + } + } else if (folder.id == 'featured') { + if (pandora.user.level != 'admin') { + extras = [infoButton('Featured Lists', 'Featured lists are selected public lists, picked by the ' + pandora.site.site.name + ' staff.')]; + } else { + extras = [Ox.Button({ + selectable: true, + style: 'symbol', + title: 'Edit', + tooltip: 'Manage Featured Lists', + type: 'image' + }) + .bindEvent({ + change: function(event, data) { + Ox.Request.clearCache(); // fixme: remove + pandora.site.sectionFolders.items[i].showBrowser = !pandora.site.sectionFolders.items[i].showBrowser; + if (pandora.site.sectionFolders.items[i].showBrowser) { + pandora.$ui.folderList.featured.replaceWith( + pandora.$ui.folderBrowser.featured = pandora.ui.folderBrowser('featured')); + } else { + pandora.$ui.folderBrowser.featured.replaceWith( + pandora.$ui.folderList.featured = pandora.ui.folderList('featured') + ); + } + pandora.resizeFolders(); } - pandora.resizeFolders(); - } - })]; + })]; + } + } else if (folder.id == 'volumes') { + if (pandora.user.level == 'guest') { + extras = [infoButton('Local Volumes', 'To import movies from a local disk, please sign up or sign in.')]; + } else { + extras = [Ox.Select({ + items: [ + { id: 'add', title: 'Add Volume...' }, + { id: 'scan', title: 'Scan Selected Volume...' }, + { id: 'remove', title: 'Remove Selected Volume...' }, + {}, + { id: 'import', title: 'Import Movies...' } + ], + max: 0, + min: 0, + selectable: false, + type: 'image' + }) + .bindEvent({ + click: function(data) { + } + })]; + } } pandora.$ui.folder[i] = Ox.CollapsePanel({ id: folder.id, @@ -180,7 +185,7 @@ pandora.ui.folders = function() { .bindEventOnce({ init: function(event, data) { Ox.print('init', i, counter) - if (++counter == 3) { + if (++counter == 4) { pandora.$ui.folder.forEach(function($folder) { that.append($folder); }); @@ -192,6 +197,53 @@ pandora.ui.folders = function() { .appendTo(pandora.$ui.folder[i].$content); }); } + function infoButton(title, text) { + return Ox.Button({ + style: 'symbol', + title: 'info', + type: 'image' + }).bindEvent({ + click: function() { + var $dialog = Ox.Dialog({ + buttons: Ox.merge([ + Ox.Button({title: 'Close'}).bindEvent({ + click: function() { + $dialog.close(); + } + }) + ], title != 'Featured Lists' ? [ + Ox.Button({title: 'Sign Up'}).bindEvent({ + click: function() { + $dialog.close(); + pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open(); + } + }), + Ox.Button({title: 'Sign In'}).bindEvent({ + click: function() { + $dialog.close(); + pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open(); + } + }) + ] : []), + content: Ox.Element() + .append( + $('') + .attr({src: '/static/png/icon64.png'}) + .css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'}) + ) + .append( + $('
') + .css({position: 'absolute', left: '96px', top: '16px', width: '192px'}) + .html(text) + ), + fixedSize: true, + height: 128, + width: 304, + title: title + }).open(); + } + }); + } that.toggle = function() { }; diff --git a/static/js/pandora/ui/foldersList.js b/static/js/pandora/ui/foldersList.js index 7a8a577fb..e1fe1912c 100644 --- a/static/js/pandora/ui/foldersList.js +++ b/static/js/pandora/ui/foldersList.js @@ -2,59 +2,116 @@ 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 = Ox.TextList({ - columns: [ + if (pandora.user.ui.section == 'items') { + var columns, items; + if (id == 'volumes') { + columns = [ { format: function() { - return $('') - .attr({ - src: Ox.UI.PATH + 'png/icon16.png' - }) + return $('').attr({ + src: Ox.UI.getImageURL('symbolVolume') + }).css({ + width: '10px', + height: '10px', + padding: '3px 1px 1px 3px' + }); }, - id: 'id', + id: 'user', operator: '+', - unique: true, visible: true, width: 16 }, { - id: 'title', + editable: true, + id: 'name', operator: '+', + tooltip: 'Edit Title', + unique: true, visible: true, - width: pandora.user.ui.sidebarSize - 16 + width: pandora.user.ui.sidebarWidth - 96 + }, + { + align: 'right', + id: 'items', + format: {type: 'number'}, + operator: '-', + visible: true, + width: 48 + }, + { + clickable: function(data) { + return data.mounted; + }, + format: function(value, data) { + return $('') + .attr({ + src: Ox.UI.getImageURL(data.mounted ? 'symbolScan' : 'symbolEdit') + }) + .css({ + width: '10px', + height: '10px', + padding: '3px 2px 1px 2px' + }); + }, + id: 'path', + operator: '+', + tooltip: function(data) { + return data.mounted ? 'Scan Volume' : 'Edit Path'; + }, + visible: true, + width: 16 + }, + { + clickable: true, + format: function(value, data) { + return $('') + .attr({ + src: Ox.UI.getImageURL('symbolMount') + }) + .css({ + width: '10px', + height: '10px', + padding: '3px 2px 1px 2px', + opacity: data.mounted ? 1 : 0.25 + }); + }, + id: 'mounted', + operator: '+', + tooltip: function(data) { + return data.mounted ? 'Unmount Volume' : 'Mount Volume'; + }, + visible: true, + width: 16 } - ], - items: function(data, callback) { - var result = {data: {}}; - if (!data.range) { - result.data.items = Ox.getObjectById(pandora.site.sectionFolders.site, id).items.length; + ]; + items = function(data, callback) { + var volumes = pandora.user.volumes || [ + {"name": "Movies A-M", "path": "/Volumes/Movies A-M", "items": 1234}, + {"name": "Movies N-Z", "path": "/Volumes/Movies N-Z", "items": 987} + ]; + if (!data.keys) { + data = {items: volumes.length}; } else { - result.data.items = Ox.getObjectById(pandora.site.sectionFolders.site, id).items; + data = {items: volumes.map(function(volume) { + return Ox.extend({id: volume.name, user: pandora.user.username, mounted: false}, volume); + })}; } - callback(result); - }, - max: 1, - min: 1, - sort: [{key: '', operator: ''}] - }) - .bindEvent({ - select: function(event, data) { - // fixme: duplicated - $.each(pandora.$ui.folderList, function(id_, $list) { - id != id_ && $list.options('selected', []); - }) - pandora.URL.set((id == 'admin' ? 'admin/' : '' ) + data.ids[0]); - }, - }); - } else if (pandora.user.ui.section == 'items') { - that = Ox.TextList({ - columns: [ + // fixme: ridiculous (we're binding to init too late) + setTimeout(function() { + callback({data: data}); + }, 1000); + }; + } else { + columns = [ { format: function() { return $('').attr({ - src: Ox.UI.PATH + 'png/icon16.png' - }); + src: Ox.UI.getImageURL('symbolIcon') + }).css({ + width: '10px', + height: '10px', + padding: '3px 1px 1px 3px' + }); }, id: 'user', operator: '+', @@ -69,7 +126,9 @@ pandora.ui.folderList = function(id) { operator: '+', unique: true, visible: id == 'favorite', - width: pandora.user.ui.sidebarWidth - 88 + // fixme: user and name are set to the same width here, + // but resizeFolders will set them to different widths + width: pandora.user.ui.sidebarWidth - 96 }, { editable: function(data) { @@ -82,14 +141,15 @@ pandora.ui.folderList = function(id) { operator: '+', tooltip: id == 'personal' ? 'Edit Title' : null, visible: id != 'favorite', - width: pandora.user.ui.sidebarWidth - 88 + width: pandora.user.ui.sidebarWidth - 96 }, { align: 'right', id: 'items', + format: {type: 'number'}, operator: '-', visible: true, - width: 40 + width: 48 }, { clickable: function(data) { @@ -120,11 +180,11 @@ pandora.ui.folderList = function(id) { { clickable: id == 'personal', format: function(value) { - //var symbols = {private: 'Publish', public: 'Publish', featured: 'Star'}; + var symbols = {personal: 'Publish', favorite: 'Like', featured: 'Star'}; return $('') .attr({ src: Ox.UI.getImageURL( - 'symbol' + (value == 'featured' ? 'Star' : 'Publish') + 'symbol' + symbols[id] ) }) .css({ @@ -142,8 +202,8 @@ pandora.ui.folderList = function(id) { visible: true, width: 16 } - ], - items: function(data, callback) { + ]; + items = function(data, callback) { var query; if (id == 'personal') { query = {conditions: [ @@ -161,25 +221,22 @@ pandora.ui.folderList = function(id) { return pandora.api.findLists(Ox.extend(data, { query: query }), callback); - }, + }; + } + that = Ox.TextList({ + columns: columns, + items: items, max: 1, min: 0, pageLength: 1000, - sort: [ - {key: 'position', operator: '+'} - ], - sortable: id == 'personal' || id == 'favorite' || pandora.user.level == 'admin' + sort: [{key: 'position', operator: '+'}], + sortable: id != 'featured' || pandora.user.level == 'admin' }) .css({ left: 0, top: 0, width: pandora.user.ui.sidebarWidth + 'px', }) - .bind({ - dragenter: function(e) { - //Ox.print('DRAGENTER', e) - } - }) .bindEvent({ click: function(event, data) { var $list = pandora.$ui.folderList[id]; @@ -192,6 +249,10 @@ pandora.ui.folderList = function(id) { }, function(result) { $list.value(result.data.id, 'status', result.data.status); }); + } else if (data.key == 'path') { + + } else if (data.key == 'mounted') { + alert(JSON.stringify(data)); } }, 'delete': function(event, data) { @@ -203,7 +264,6 @@ pandora.ui.folderList = function(id) { id: data.ids[0] }, function(result) { pandora.UI.set(['lists', data.ids[0]].join('|'), null); - Ox.print('SHOULD BE DELETED:', pandora.user.ui.lists) Ox.Request.clearCache(); // fixme: remove $list.reloadList(); }); @@ -259,7 +319,7 @@ pandora.ui.folderList = function(id) { $.each(pandora.$ui.folderList, function(id_, $list) { id != id_ && $list.options('selected', []); }) - pandora.URL.set('?find=list:' + data.ids[0]); + pandora.URL.set('?find=' + (id == 'volumes' ? 'volume' : 'list') + ':' + data.ids[0]); } else { pandora.URL.set('?find='); } diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 483093d5c..18a7dd3a0 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -459,6 +459,7 @@ pandora.ui.list = function() { // fixme: remove view argument var $tooltip = Ox.Tooltip({ animate: false }).css({ + fontSize: '11px', textAlign: 'center' }); @@ -500,7 +501,7 @@ pandora.ui.list = function() { // fixme: remove view argument dragover: function(e) { $tooltip.options({ title: getTitle(e, ids.length == 1 ? item : items, data.id.split('/').pop()) - + (editable && e.shiftKey && result.data.items + + (editable && e.metaKey && result.data.items ? '
and remove ' + result.data.items + ' ' + pandora.site.itemName[result.data.items == 1 ? 'singular' : 'plural'].toLowerCase() + '
from the list "' + pandora.user.ui.list.split('/').pop() + '"' @@ -516,7 +517,7 @@ pandora.ui.list = function() { // fixme: remove view argument drop: function(e) { Ox.print('DROP', data); var $this = $(this), folder, listData; - if (editable && e.shiftKey) { + if (editable && e.metaKey) { pandora.api.removeListItems({ list: pandora.user.ui.list, items: ids @@ -563,7 +564,7 @@ pandora.ui.list = function() { // fixme: remove view argument } }); function getTitle(e, item, list) { - return (editable && e.shiftKey ? 'Move' : 'Copy') + ' ' + return (editable && e.metaKey ? 'Move' : 'Copy') + ' ' + (Ox.isString(item) ? '"' + item + '"' : item + ' ' + pandora.site.itemName[item == 1 ? 'singular' : 'plural'].toLowerCase()) + (list ? '
to the list "' + list + '"' : ''); } diff --git a/static/js/pandora/ui/sectionButtons.js b/static/js/pandora/ui/sectionButtons.js index f3bea733b..be5ff8f22 100644 --- a/static/js/pandora/ui/sectionButtons.js +++ b/static/js/pandora/ui/sectionButtons.js @@ -2,10 +2,9 @@ pandora.ui.sectionButtons = function() { 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}, - {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts'}, - {id: 'admin', selected: pandora.user.ui.section == 'admin', title: 'Admin'} + {id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits'}, + {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts'} ], id: 'sectionButtons', selectable: true @@ -16,14 +15,12 @@ pandora.ui.sectionButtons = function() { .bindEvent({ change: function(event, data) { var section = data.selected[0]; - if (section == 'site') { - pandora.URL.set(pandora.user.ui.sitePage); - } else if (section == 'items') { + if (section == 'items') { pandora.URL.set(pandora.Query.toString()); + } else if (section == 'clips') { + pandora.URL.set('clips'); } else if (section == 'texts') { pandora.URL.set('texts'); - } else if (section == 'admin') { - pandora.URL.set('admin'); } } }); diff --git a/static/js/pandora/ui/sectionSelect.js b/static/js/pandora/ui/sectionSelect.js index a23ce5dda..ee1fe3cb1 100644 --- a/static/js/pandora/ui/sectionSelect.js +++ b/static/js/pandora/ui/sectionSelect.js @@ -4,10 +4,9 @@ pandora.ui.sectionSelect = function() { var that = Ox.Select({ id: 'sectionSelect', items: [ - {checked: pandora.user.ui.section == 'site', id: 'site', title: pandora.site.site.name}, {checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, - {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts'}, - {checked: pandora.user.ui.section == 'admin', id: 'admin', title: 'Admin'} + {checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits'}, + {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts'} ] }).css({ float: 'left',