From f838af237e6d97a7c1cf482101e861b2f2a9e331 Mon Sep 17 00:00:00 2001 From: sanj Date: Sat, 6 Nov 2010 06:26:06 +0530 Subject: [PATCH] fixing taha.html to work --- padma.tooltip.js | 2 +- taha.js | 1 + utils.js | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/padma.tooltip.js b/padma.tooltip.js index 5cbc41b..1f6629e 100644 --- a/padma.tooltip.js +++ b/padma.tooltip.js @@ -8,7 +8,7 @@ $(this).attr("target", "_blank"); var link = $(this).attr("href"); if (link.indexOf(PADMA_URL) != -1) { - var linkData = parsePadmaUrl(link); + var linkData = parsePadmaUrl(link, PADMA_URL); if (linkData) { // console.log(linkData); var v = new padmaVideo(linkData.videoId); diff --git a/taha.js b/taha.js index 0cb7f58..b7edf19 100644 --- a/taha.js +++ b/taha.js @@ -15,6 +15,7 @@ $(function() { */ function setupPadmaLink(video, data) { + console.log(data); // console.log(data); var jq = $(data.jq); var linkData = data.linkData; diff --git a/utils.js b/utils.js index 75909f3..fc0ac58 100644 --- a/utils.js +++ b/utils.js @@ -92,15 +92,20 @@ Gives a bunch of data parsed from a pad.ma url */ function parsePadmaUrl(link, padma_url) { +// console.log(padma_url); var linkStr = link.replace(padma_url, ""); +// console.log(linkStr); // console.log(linkStr); var r = { }; r.url = link; +// console.log(link); if (linkStr.charAt(0) == 'V') { +// console.log("Hello"); var idRegex = /V(.{1,7})/; var idMatch = linkStr.match(idRegex); // console.log("match", idMatch); - r.videoId = idMatch[0]; + r.videoId = idMatch[0]; +// console.log(videoId); var postIdStr = linkStr.replace(idMatch[0] + "/", ''); if (postIdStr == 'info' || postIdStr == '') { r.type = 'info';