remove dead code, fix absolute_url
This commit is contained in:
parent
e64dd48ee2
commit
d727097a7c
3 changed files with 4 additions and 12 deletions
|
@ -12,7 +12,6 @@ urlpatterns = patterns("backend.views",
|
||||||
(r'^(?P<id>.*)/poster\.(?P<size>large)\.jpg$', 'poster'),
|
(r'^(?P<id>.*)/poster\.(?P<size>large)\.jpg$', 'poster'),
|
||||||
(r'^(?P<id>.*)/poster\.jpg$', 'poster'),
|
(r'^(?P<id>.*)/poster\.jpg$', 'poster'),
|
||||||
(r'^(?P<id>.*)/timelines/(?P<timeline>.+)\.(?P<size>\d+)\.(?P<position>\d+)\.png$', 'timeline'),
|
(r'^(?P<id>.*)/timelines/(?P<timeline>.+)\.(?P<size>\d+)\.(?P<position>\d+)\.png$', 'timeline'),
|
||||||
(r'^(?P<id>.*)/data/(?P<data>.+)\.json$', 'data'),
|
|
||||||
(r'^api/$', 'api'),
|
(r'^api/$', 'api'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -532,17 +532,8 @@ def apidoc(request):
|
||||||
return render_to_response('api.html', context)
|
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):
|
def frame(request, id, position, size):
|
||||||
movie = get_object_or_404(models.Movie, movieId=id)
|
movie = get_object_or_404(models.Movie, movieId=id)
|
||||||
position = float(position.replace(',', '.'))
|
position = float(position.replace(',', '.'))
|
||||||
|
|
|
@ -373,7 +373,9 @@ app.afterLaunch.push(function() {
|
||||||
absolute_url: function (url) {
|
absolute_url: function (url) {
|
||||||
var base = document.location.href;
|
var base = document.location.href;
|
||||||
if (url.substring(0, 1) == '/') {
|
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 {
|
else {
|
||||||
if(base.substring(base.length-1) == '/')
|
if(base.substring(base.length-1) == '/')
|
||||||
|
|
Loading…
Reference in a new issue