From b77045f37503ee05967383e45ce4d6a13fe46696 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 21 Feb 2012 10:11:01 +0000 Subject: [PATCH] some work towards making places and events editable from annotations panel (#561) --- static/js/pandora/URL.js | 1 + static/js/pandora/appPanel.js | 1 + static/js/pandora/eventsDialog.js | 4 +++- static/js/pandora/home.padma.js | 3 ++- static/js/pandora/item.js | 5 +++-- static/js/pandora/placesDialog.js | 1 + 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 671117e7..0eaa1bde 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -66,6 +66,7 @@ pandora.URL = (function() { if (Ox.isEmpty(state)) { if (pandora.user.ui.showHome) { + Ox.print('*** showScreen via URL') pandora.$ui.home = pandora.ui.home().showScreen(); } callback && callback(); diff --git a/static/js/pandora/appPanel.js b/static/js/pandora/appPanel.js index 5dfd4296..978eb7df 100644 --- a/static/js/pandora/appPanel.js +++ b/static/js/pandora/appPanel.js @@ -49,6 +49,7 @@ pandora.ui.appPanel = function() { } } else if (page == 'home') { // if we're on page load, show screen immediately + Ox.print('*** ' + (!pandora.$ui.appPanel ? 'showScreen' : 'fadeInScreen') + ' via appPanel') pandora.$ui.home = pandora.ui.home()[ !pandora.$ui.appPanel ? 'showScreen' : 'fadeInScreen' ](); diff --git a/static/js/pandora/eventsDialog.js b/static/js/pandora/eventsDialog.js index 9c189f75..d82f9b26 100644 --- a/static/js/pandora/eventsDialog.js +++ b/static/js/pandora/eventsDialog.js @@ -2,7 +2,8 @@ 'use strict'; -pandora.ui.eventsDialog = function() { +pandora.ui.eventsDialog = function(options) { + // options can be {id: '...'} or {name: '...'} var height = Math.round((window.innerHeight - 48) * 0.9), width = Math.round(window.innerWidth * 0.9), that = Ox.Dialog({ @@ -93,6 +94,7 @@ pandora.ui.eventsDialog = function() { callback(result); }); }, + selected: options ? options.id : '', showControls: pandora.user.ui.showCalendarControls, width: width }) diff --git a/static/js/pandora/home.padma.js b/static/js/pandora/home.padma.js index 923054f9..762aa522 100644 --- a/static/js/pandora/home.padma.js +++ b/static/js/pandora/home.padma.js @@ -585,7 +585,7 @@ pandora.ui.home = function() { return that; }; - that.showScreen = function() { + that.showScreen = function(callback) { that.css({opacity: 1}).appendTo(Ox.UI.$body); $box.css({marginTop: '80px'}); that.find('*').css({opacity: 1}); @@ -600,6 +600,7 @@ pandora.ui.home = function() { }); }, 250); */ + callback && callback(); return that; }; diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 46359bf3..8b7b2a5f 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -339,8 +339,9 @@ pandora.ui.item = function() { pandora.UI.set({annotationsSort: data.sort}); }, define: function(data) { - pandora.$ui.placesDialog && pandora.$ui.placesDialog.remove(); - pandora.$ui.placesDialog = pandora.ui.placesDialog(data).open(); + var dialog = data.type + 'sDialog'; + pandora.$ui[dialog] && pandora.$ui[dialog].remove(); + pandora.$ui[dialog] = pandora.ui[dialog](data).open(); }, downloadvideo: function(data) { document.location.href = '/' + pandora.user.ui.item + '/torrent/'; diff --git a/static/js/pandora/placesDialog.js b/static/js/pandora/placesDialog.js index 9ddb561c..ca0f5bb5 100644 --- a/static/js/pandora/placesDialog.js +++ b/static/js/pandora/placesDialog.js @@ -4,6 +4,7 @@ pandora.ui.placesDialog = function(options) { // options can be {id: '...'} or {name: '...'} + Ox.print('placesDialog', options); var height = Math.round((window.innerHeight - 48) * 0.9), width = Math.round(window.innerWidth * 0.9), $content = Ox.ListMap({