fixed js indentation
This commit is contained in:
parent
794febfc6d
commit
30b4f1aeee
|
@ -25,7 +25,7 @@ def fetchSrt(request):
|
||||||
if request.GET['id']:
|
if request.GET['id']:
|
||||||
padmaId = request.GET['id']
|
padmaId = request.GET['id']
|
||||||
track = request.GET['track'] or 'transcript'
|
track = request.GET['track'] or 'transcript'
|
||||||
url = "%s%s/export/%s.srt" % (PADMA_URL, padmaId, track,)
|
url = "%s/%s/export/%s.srt" % (PADMA_URL, padmaId, track,)
|
||||||
srt = getHtmlFromUrl(url)
|
srt = getHtmlFromUrl(url)
|
||||||
return HttpResponse(srt)
|
return HttpResponse(srt)
|
||||||
else:
|
else:
|
||||||
|
@ -36,7 +36,10 @@ def index(request):
|
||||||
|
|
||||||
def listDetail(request):
|
def listDetail(request):
|
||||||
if request.GET:
|
if request.GET:
|
||||||
rDict = {'listId': request.GET['id'] }
|
rDict = {
|
||||||
|
'listId': request.GET['id'] },
|
||||||
|
'padma_url': PADMA_URL,
|
||||||
|
}
|
||||||
return render_to_response("list.html", rDict)
|
return render_to_response("list.html", rDict)
|
||||||
else:
|
else:
|
||||||
return HttpResponse("Please pass me a list id")
|
return HttpResponse("Please pass me a list id")
|
||||||
|
|
|
@ -10,7 +10,7 @@ LOGGING_INTERCEPT_REDIRECTS = True
|
||||||
LOGGING_LOG_SQL = True
|
LOGGING_LOG_SQL = True
|
||||||
LOGGING_SHOW_METRICS = True
|
LOGGING_SHOW_METRICS = True
|
||||||
LOGGING_OUTPUT_ENABLED = True
|
LOGGING_OUTPUT_ENABLED = True
|
||||||
PADMA_URL = "http://padma.local/"
|
PADMA_URL = "http://padma.local"
|
||||||
|
|
||||||
PROJECT_PATH = os.path.dirname(__file__)
|
PROJECT_PATH = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ get html of template with tmpl("foo", json)
|
||||||
// window.PADMA = new padmaApi();
|
// window.PADMA = new padmaApi();
|
||||||
|
|
||||||
function callPadma(api, callback, extra_params) {
|
function callPadma(api, callback, extra_params) {
|
||||||
var local_json_url = "/jPadma?url=http://padma.local";
|
var local_json_url = "/jPadma?url=" + PADMA_BASE_URL;
|
||||||
var url = local_json_url + api;
|
var url = local_json_url + api;
|
||||||
$.getJSON(url, function(json) {
|
$.getJSON(url, function(json) {
|
||||||
callback(json, extra_params);
|
callback(json, extra_params);
|
||||||
|
@ -73,7 +73,7 @@ get html of template with tmpl("foo", json)
|
||||||
'endTime': '0:00:00',
|
'endTime': '0:00:00',
|
||||||
'tracks': ['description', 'transcript'],
|
'tracks': ['description', 'transcript'],
|
||||||
'tmpl_id': '',
|
'tmpl_id': '',
|
||||||
'baseUrl': 'http://pad.ma/',
|
'baseUrl': PADMA_BASE_URL || 'http://pad.ma/',
|
||||||
'globalVar': 'PADMA',
|
'globalVar': 'PADMA',
|
||||||
'localUrl': '/padmaApi/'
|
'localUrl': '/padmaApi/'
|
||||||
}, options);
|
}, options);
|
||||||
|
|
|
@ -12,16 +12,16 @@ var padmaLayer = function(json, video) {
|
||||||
this.value_html = json.value_html;
|
this.value_html = json.value_html;
|
||||||
this.creator = json.creator;
|
this.creator = json.creator;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.firstFrameStr = BASE_URL + padmaVideos[this.video].id + "/frame/" + ms2npt(that.time_in);
|
this.firstFrameStr = PADMA_BASE_URL + padmaVideos[this.video].id + "/frame/" + ms2npt(that.time_in);
|
||||||
this.firstFrame128 = this.firstFrameStr + ".128.jpg";
|
this.firstFrame128 = this.firstFrameStr + ".128.jpg";
|
||||||
this.firstFrame320 = this.firstFrameStr + ".320.jpg";
|
this.firstFrame320 = this.firstFrameStr + ".320.jpg";
|
||||||
this.lastFrameStr = BASE_URL + padmaVideos[this.video].id + "/frame/" + ms2npt(that.time_out);
|
this.lastFrameStr = PADMA_BASE_URL + padmaVideos[this.video].id + "/frame/" + ms2npt(that.time_out);
|
||||||
this.lastFrame128 = this.lastFrameStr + ".128.jpg";
|
this.lastFrame128 = this.lastFrameStr + ".128.jpg";
|
||||||
this.lastFrame320 = this.lastFrameStr + ".320.jpg";
|
this.lastFrame320 = this.lastFrameStr + ".320.jpg";
|
||||||
this.videoSrc128 = this.padmaVideo.meta.urls['128'] + "?t=" + ms2npt(that.time_in);
|
this.videoSrc128 = this.padmaVideo.meta.urls['128'] + "?t=" + ms2npt(that.time_in);
|
||||||
this.videoSrc320 = this.padmaVideo.meta.urls['320'] + "?t=" + ms2npt(that.time_in);
|
this.videoSrc320 = this.padmaVideo.meta.urls['320'] + "?t=" + ms2npt(that.time_in);
|
||||||
// this.videoSrc128 = BASE_URL + "v/128/" + padmaVideos[this.video].id + ".ogv?t=" + ms2npt(that.time_in);
|
// this.videoSrc128 = PADMA_BASE_URL + "v/128/" + padmaVideos[this.video].id + ".ogv?t=" + ms2npt(that.time_in);
|
||||||
// this.videoSrc320 = BASE_URL + "v/320/" + padmaVideos[this.video].id + ".ogv?t=" + ms2npt(that.time_in);
|
// this.videoSrc320 = PADMA_BASE_URL + "v/320/" + padmaVideos[this.video].id + ".ogv?t=" + ms2npt(that.time_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
padmaLayer.prototype.showResult = function(word) {
|
padmaLayer.prototype.showResult = function(word) {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
var BASE_URL = "http://padma.local/";
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var apiUrl = "/list/videos?listId=" + listId;
|
var apiUrl = "/list/videos?listId=" + listId;
|
||||||
callPadma(apiUrl, initList);
|
callPadma(apiUrl, initList);
|
||||||
prevSearchTerms = [];
|
prevSearchTerms = [];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,9 @@ $(document).ready(function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
doSearch(val);
|
doSearch(val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var words = val.split(" ");
|
var words = val.split(" ");
|
||||||
for (var i = 0; i < words.length; i++) {
|
for (var i = 0; i < words.length; i++) {
|
||||||
|
@ -17,14 +20,6 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
$('#search').keyup(function() {
|
|
||||||
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
|
|
||||||
function getVideoById(id) {
|
function getVideoById(id) {
|
||||||
for (var i=0; i < padmaVideos.length; i++) {
|
for (var i=0; i < padmaVideos.length; i++) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ var padmaVideo = function(json, index) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.title = json.title;
|
this.title = json.title;
|
||||||
this.jq = {};
|
this.jq = {};
|
||||||
this.poster = BASE_URL + this.id + "/poster.jpg";
|
this.poster = PADMA_BASE_URL + this.id + "/poster.jpg";
|
||||||
this.timeline = BASE_URL + this.id + "/timeline.png";
|
this.timeline = PADMA_BASE_URL + this.id + "/timeline.png";
|
||||||
this.wrapperHtml = this.getWrapperHtml()
|
this.wrapperHtml = this.getWrapperHtml()
|
||||||
this.init();
|
this.init();
|
||||||
this.dataLoaded = false;
|
this.dataLoaded = false;
|
||||||
|
@ -84,11 +84,11 @@ padmaVideo.prototype.layersLoaded = function() {
|
||||||
|
|
||||||
padmaVideo.prototype.loadData = function() {
|
padmaVideo.prototype.loadData = function() {
|
||||||
var that = this;
|
var that = this;
|
||||||
var metaUrl = BASE_URL + that.id + "/video.js";
|
var metaUrl = PADMA_BASE_URL + that.id + "/video.js";
|
||||||
$.getScript(metaUrl, function() {
|
$.getScript(metaUrl, function() {
|
||||||
that.meta = video;
|
that.meta = video;
|
||||||
that.metaLoaded();
|
that.metaLoaded();
|
||||||
var layersUrl = BASE_URL + that.id + "/layers.js";
|
var layersUrl = PADMA_BASE_URL + that.id + "/layers.js";
|
||||||
$.getScript(layersUrl, function() {
|
$.getScript(layersUrl, function() {
|
||||||
var theseLayers = layers;
|
var theseLayers = layers;
|
||||||
for (var i=0; i < theseLayers.length; i++) {
|
for (var i=0; i < theseLayers.length; i++) {
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript" src="/static/js/jquery.js"></script>
|
<script type="text/javascript" src="/static/js/jquery.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
PADMA_BASE_URL = "{{ padma_url }}";
|
||||||
|
</script>
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user