support https urls and serving via https

This commit is contained in:
j 2012-06-03 12:22:09 +02:00
parent 7be47e61dd
commit 4ad3f35560
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,8 @@ var padmaConfig = {
'background': 'rgba(0,0,0,0.85)',
'color': '#fff',
'links_url': 'pad.ma/',
'data_url': 'http://pad.ma/',
'data_url': document.location.protocol + '//pad.ma/',
'data_re': /https?:\/\/pad.ma\//,
'default_layers': ['transcripts', 'descriptions'],
};

View File

@ -92,7 +92,7 @@ Gives a bunch of data parsed from a pad.ma url
*/
function parsePadmaUrl(link, padma_url) {
var regex = padmaConfig.data_url;
var regex = padmaConfig.data_re;
// var regex = new RegExp("http://.*" + padma_url);
var linkStr = link.replace(regex, "");
// alert(linkStr);
@ -109,6 +109,7 @@ Gives a bunch of data parsed from a pad.ma url
var postIdStr = linkStr.replace(r.videoId, '');
postIdStr = postIdStr.replace("/", ""); //FIXME
// console.log("postId", postIdStr);
if (postIdStr == 'info' || postIdStr == '') {
r.type = 'info';
return r;