fixed js indentation

This commit is contained in:
sanj 2010-07-13 17:38:50 +05:30
parent 794febfc6d
commit 30b4f1aeee
8 changed files with 44 additions and 45 deletions

View File

@ -25,7 +25,7 @@ def fetchSrt(request):
if request.GET['id']:
padmaId = request.GET['id']
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)
return HttpResponse(srt)
else:
@ -36,7 +36,10 @@ def index(request):
def listDetail(request):
if request.GET:
rDict = {'listId': request.GET['id'] }
rDict = {
'listId': request.GET['id'] },
'padma_url': PADMA_URL,
}
return render_to_response("list.html", rDict)
else:
return HttpResponse("Please pass me a list id")

View File

@ -10,7 +10,7 @@ LOGGING_INTERCEPT_REDIRECTS = True
LOGGING_LOG_SQL = True
LOGGING_SHOW_METRICS = True
LOGGING_OUTPUT_ENABLED = True
PADMA_URL = "http://padma.local/"
PADMA_URL = "http://padma.local"
PROJECT_PATH = os.path.dirname(__file__)

View File

@ -47,7 +47,7 @@ get html of template with tmpl("foo", json)
// window.PADMA = new padmaApi();
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;
$.getJSON(url, function(json) {
callback(json, extra_params);
@ -73,7 +73,7 @@ get html of template with tmpl("foo", json)
'endTime': '0:00:00',
'tracks': ['description', 'transcript'],
'tmpl_id': '',
'baseUrl': 'http://pad.ma/',
'baseUrl': PADMA_BASE_URL || 'http://pad.ma/',
'globalVar': 'PADMA',
'localUrl': '/padmaApi/'
}, options);

View File

@ -12,16 +12,16 @@ var padmaLayer = function(json, video) {
this.value_html = json.value_html;
this.creator = json.creator;
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.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.lastFrame320 = this.lastFrameStr + ".320.jpg";
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.videoSrc128 = 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.videoSrc128 = PADMA_BASE_URL + "v/128/" + 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) {

View File

@ -1,10 +1,8 @@
var BASE_URL = "http://padma.local/";
$(document).ready(function() {
var apiUrl = "/list/videos?listId=" + listId;
callPadma(apiUrl, initList);
prevSearchTerms = [];
});

View File

@ -7,6 +7,9 @@ $(document).ready(function() {
return;
}
doSearch(val);
});
});
/*
var words = val.split(" ");
for (var i = 0; i < words.length; i++) {
@ -17,14 +20,6 @@ $(document).ready(function() {
}
}
*/
});
/*
$('#search').keyup(function() {
});
*/
});
function getVideoById(id) {
for (var i=0; i < padmaVideos.length; i++) {

View File

@ -3,8 +3,8 @@ var padmaVideo = function(json, index) {
this.index = index;
this.title = json.title;
this.jq = {};
this.poster = BASE_URL + this.id + "/poster.jpg";
this.timeline = BASE_URL + this.id + "/timeline.png";
this.poster = PADMA_BASE_URL + this.id + "/poster.jpg";
this.timeline = PADMA_BASE_URL + this.id + "/timeline.png";
this.wrapperHtml = this.getWrapperHtml()
this.init();
this.dataLoaded = false;
@ -84,11 +84,11 @@ padmaVideo.prototype.layersLoaded = function() {
padmaVideo.prototype.loadData = function() {
var that = this;
var metaUrl = BASE_URL + that.id + "/video.js";
var metaUrl = PADMA_BASE_URL + that.id + "/video.js";
$.getScript(metaUrl, function() {
that.meta = video;
that.metaLoaded();
var layersUrl = BASE_URL + that.id + "/layers.js";
var layersUrl = PADMA_BASE_URL + that.id + "/layers.js";
$.getScript(layersUrl, function() {
var theseLayers = layers;
for (var i=0; i < theseLayers.length; i++) {

View File

@ -2,6 +2,9 @@
<html>
<head>
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript">
PADMA_BASE_URL = "{{ padma_url }}";
</script>
{% block head %}
{% endblock %}