From e3e117588fbf14b85f89959085096be0ab4becbe Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 30 Jan 2012 23:29:04 +0000 Subject: [PATCH] fix manage events bugs --- pandora/urls.py | 2 +- static/js/pandora/embedDialog.js | 39 +++++++++++++++++++++++++++++++ static/js/pandora/eventsDialog.js | 1 - static/js/pandora/item.js | 17 ++++++++++---- static/js/pandora/placesDialog.js | 3 +-- 5 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 static/js/pandora/embedDialog.js diff --git a/pandora/urls.py b/pandora/urls.py index 939a5f88..ad2b3c12 100644 --- a/pandora/urls.py +++ b/pandora/urls.py @@ -49,7 +49,7 @@ urlpatterns += patterns('', (r'^(V[a-z0-9]*/.*)$', 'urlalias.views.padma_video'), ) urlpatterns += patterns('', - (r'^(?P[A-Z0-9].+)/embed', 'app.views.embed'), + (r'^(?P[A-Z0-9].*)/embed', 'app.views.embed'), (r'^(?P[A-Z0-9].*)$', 'item.views.item'), (r'^[a-z0-9].+$', 'app.views.index'), (r'^$', 'app.views.index'), diff --git a/static/js/pandora/embedDialog.js b/static/js/pandora/embedDialog.js new file mode 100644 index 00000000..70d6c42e --- /dev/null +++ b/static/js/pandora/embedDialog.js @@ -0,0 +1,39 @@ +// vim: et:ts=4:sw=4:sts=4:ft=javascript +'use strict'; + +pandora.ui.embedDialog = function(data) { + var content = Ox.Element().css({margin: '16px'}), + height = 240, + width = 320, + that = Ox.Dialog({ + buttons: [ + Ox.Button({ + id: 'close', + title: 'Close' + }).bindEvent({ + click: function() { + that.close(); + } + }) + ], + closeButton: true, + content: content, + height: Math.round((window.innerHeight - 24) * 0.75), + keys: { + 'escape': 'close' + }, + maximizeButton: true, + minHeight: 256, + minWidth: 640, + title: 'Embed Video', + width: Math.round(window.innerWidth * 0.75) + }) + .bindEvent({ + close: function(data) { + } + }), + url = document.location.origin + '/' + pandora.user.ui.item + '/embed'; + content.html('To embed this video you need unicorns... or try this code:
'); + content.append($('