From d727097a7c1010885d91d0765f1574256c1df04c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 18 Sep 2010 17:16:45 +0200 Subject: [PATCH] remove dead code, fix absolute_url --- pandora/backend/urls.py | 1 - pandora/backend/views.py | 11 +---------- pandora/static/js/pandora.local.js | 4 +++- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pandora/backend/urls.py b/pandora/backend/urls.py index 9d91372cc..c4c188db3 100644 --- a/pandora/backend/urls.py +++ b/pandora/backend/urls.py @@ -12,7 +12,6 @@ urlpatterns = patterns("backend.views", (r'^(?P.*)/poster\.(?Plarge)\.jpg$', 'poster'), (r'^(?P.*)/poster\.jpg$', 'poster'), (r'^(?P.*)/timelines/(?P.+)\.(?P\d+)\.(?P\d+)\.png$', 'timeline'), - (r'^(?P.*)/data/(?P.+)\.json$', 'data'), (r'^api/$', 'api'), ) diff --git a/pandora/backend/views.py b/pandora/backend/views.py index 899cc15ab..46963fbcf 100644 --- a/pandora/backend/views.py +++ b/pandora/backend/views.py @@ -532,17 +532,8 @@ def apidoc(request): return render_to_response('api.html', context) ''' - media and data delivery + media delivery ''' -def data(request, id, data): - movie = get_object_or_404(models.Movie, movieId=id) - response = {} - if data == 'video': - response = movie.get_stream() - if data == 'cuts': - response = movie.metadata.get('cuts', {}) - return render_to_json_response(response) - def frame(request, id, position, size): movie = get_object_or_404(models.Movie, movieId=id) position = float(position.replace(',', '.')) diff --git a/pandora/static/js/pandora.local.js b/pandora/static/js/pandora.local.js index 1c2298d65..47050b83d 100644 --- a/pandora/static/js/pandora.local.js +++ b/pandora/static/js/pandora.local.js @@ -373,7 +373,9 @@ app.afterLaunch.push(function() { absolute_url: function (url) { var base = document.location.href; if (url.substring(0, 1) == '/') { - url = document.location.href.substring(0, document.location.href.length-document.location.pathname.length) + url; + base = document.location.protocol + '//' + document.location.hostname; + if(document.location.port) base += ':'+document.location.port + url = base + url; } else { if(base.substring(base.length-1) == '/')