From 86a6d6cdbb46faae969dff1e27b6b52c23012174 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Sun, 4 Aug 2013 17:56:45 -0700 Subject: Adding VideosResource to return JSON blobs of video data for the training page. --- web/scripts/growth.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'web/scripts/growth.js') diff --git a/web/scripts/growth.js b/web/scripts/growth.js index b9a36b0..5bc30d4 100644 --- a/web/scripts/growth.js +++ b/web/scripts/growth.js @@ -126,7 +126,7 @@ function playVideo(videoId) { $.ajax({ type: "GET", - url: "videos/" + videoId + ".json", + url: location.href + "/videos/" + videoId + ".json", dataType: "json" }).done(function(data) { if (data == null) { @@ -175,6 +175,15 @@ function reportVideoComplete(data) $('#chapterprogress .progresslabel').html(percent); closeVideo(); + + $.ajax({ + type: "POST", + url: location.href + "/videos/" + videoId + ".json", + dataType: "json", + data: {'completed':'true'} + }).error(function(jqXHR, error) { + notice('Could not record video completiton due to ' + error + '. If the problem persists, please contact us.'); + }); if (completed == total) { chapterComplete(); -- cgit v1.2.3