From 90cde2771f609c8e80907d5f98784d1a2dfdece3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 14 Jul 2013 17:22:26 +0000 Subject: [PATCH] add edit overview placeholder --- static/js/pandora/editPanel.js | 37 +++++++++++++++++++++++++++++++++- static/js/pandora/folders.js | 11 ++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/editPanel.js b/static/js/pandora/editPanel.js index 70864e77..11591eae 100644 --- a/static/js/pandora/editPanel.js +++ b/static/js/pandora/editPanel.js @@ -14,7 +14,7 @@ pandora.ui.editPanel = function() { smallTimelineContext, that = Ox.Element(); - ui.edit && render(); + ui.edit ? render() : renderOverview(); function editPointsKey(key) { return 'editPoints.' + ui.edit.replace(/\./g, '\\.') + '.' + key; @@ -255,6 +255,41 @@ pandora.ui.editPanel = function() { updateSmallTimelineURL(); }); } + function renderOverview() { + that = Ox.IconList({ + borderRadius: 16, + defaultRatio: 1, + draggable: true, + item: function(data, sort, size) { + size = size || 128; + var ui = pandora.user.ui, + url = '/edit/' + data.id + '/icon'+size+'.jpg?' + data.modified, + info = Ox.formatDuration(data.duration); + return { + height: size, + id: data.id, + title: data.name, + info: info, + url: url, + width: size, + } + }, + items: function(data, callback) { + pandora.api.findEdits(data, callback); + return Ox.clone(data, true); + }, + keys: ['id', 'modified', 'name', 'duration'], + size: 128, + sort: [{key: 'id', operator: '+'}], + unique: 'id' + }) + .addClass('OxMedia') + .bindEvent({ + open: function(data) { + pandora.UI.set('edit', data.ids[0]); + } + }); + } function orderClips(ids) { edit.clips.forEach(function(clip) { diff --git a/static/js/pandora/folders.js b/static/js/pandora/folders.js index bcccf339..6afd7ae7 100644 --- a/static/js/pandora/folders.js +++ b/static/js/pandora/folders.js @@ -380,6 +380,17 @@ pandora.ui.folders = function() { }); } that.bindEvent({ + pandora_edit: function() { + if (!pandora.user.ui.edit) { + Ox.forEach(pandora.$ui.folderList, function($list, id) { + $list.options('selected', []); + }); + } else { + Ox.forEach(pandora.$ui.folderList, function($list, id) { + $list.options('selected', [pandora.user.ui.edit]); + }); + } + }, pandora_find: function() { var folder = pandora.getListData().folder, list = pandora.user.ui._list,