From 97cc035e65c577a3e4a8b28090d30472e6d3703c Mon Sep 17 00:00:00 2001 From: Jing Date: Sun, 17 Apr 2016 00:27:36 +0200 Subject: [PATCH] chapter --- client/static/index.html | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/client/static/index.html b/client/static/index.html index 9ee1b49..5a2a0df 100644 --- a/client/static/index.html +++ b/client/static/index.html @@ -71,7 +71,9 @@ margin-bottom: 1px; } font-size: 14px; opacity: 0.84; } - +.status-container { +height: 50px; +} @@ -119,10 +121,10 @@ margin-bottom: 1px; }
Chapter
- + skip_previous - + skip_next
@@ -140,13 +142,13 @@ margin-bottom: 1px; } volume_off - +
{{status}}
- +
@@ -191,10 +193,25 @@ var volume = function(delta) { showStatus("Volume " + direction + ": Error"); }); }; - + +var chapter = function(isNext) { + var direction = isNext ? "Next" : "Previous"; + var delta = isNext ? 1 : -1; + $http({ + method: 'GET', + url: '/seekChapter/' + delta + }).then(function successCallback(response) { + showStatus(direction + " chapter: Success"); + }, function errorCallback(response) { + showStatus(direction + " chapter: Error"); + }); +}; +// --------------------------------------------------------- $scope.status = ''; $scope.alert = ''; +$scope.previousChapter = function() { chapter(false) }; +$scope.nextChapter = function() { chapter(true) }; $scope.back = function() { seek(-10) }; $scope.togglePlay = function() { $http({