VRFS-2582 : Hook up to client rather than stubbed API to list backing tracks. Implement in fakeJamClient for easy testing.
This commit is contained in:
parent
33177ddae6
commit
d9d3e67fc5
|
|
@ -28,11 +28,11 @@
|
|||
resetPagination();
|
||||
showing = true;
|
||||
getBackingTracks()
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
// initialize pagination
|
||||
var $paginator = context.JK.Paginator.create(parseInt(jqXHR.getResponseHeader('total-entries')), perPage, 0, onPageSelected)
|
||||
$paginatorHolder.append($paginator);
|
||||
});
|
||||
// .done(function(data, textStatus, jqXHR) {
|
||||
// // initialize pagination
|
||||
// var $paginator = context.JK.Paginator.create(parseInt(jqXHR.getResponseHeader('total-entries')), perPage, 0, onPageSelected)
|
||||
// $paginatorHolder.append($paginator);
|
||||
// });
|
||||
}
|
||||
|
||||
function afterHide() {
|
||||
|
|
@ -45,33 +45,25 @@
|
|||
}
|
||||
|
||||
function getBackingTracks(page) {
|
||||
return rest.getBackingTracks({page:page + 1, per_page:10})
|
||||
.done(function(result) {
|
||||
console.log("result: ", result)
|
||||
var backingTracks = result.backing_tracks
|
||||
console.log("Backing Tracks: ", backingTracks)
|
||||
emptyList();
|
||||
|
||||
$.each(backingTracks, function(index, backingTrack) {
|
||||
console.log("Backing TRACK: ", backingTrack)
|
||||
var options = {
|
||||
backingTrackState: null,
|
||||
path: backingTrack.path,
|
||||
name: backingTrack.name,
|
||||
length: backingTrack.length ? backingTrack.length : 0
|
||||
}
|
||||
console.log("options: ", options)
|
||||
var $tr = $(context._.template($templateOpenBackingTrackRow.html(), options, { variable: 'data' }));
|
||||
console.log("foo")
|
||||
$tr.data('server-model', backingTrack);
|
||||
console.log("bar")
|
||||
console.log("Appending TR:")
|
||||
$tbody.append($tr);
|
||||
});
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorMessage) {
|
||||
app.ajaxError(jqXHR, textStatus, errorMessage);
|
||||
var backingTracks = context.jamClient.getBackingTrackList();
|
||||
console.log("Backing Tracks: ", backingTracks)
|
||||
|
||||
if (typeof(backingTracks)=="undefined") {
|
||||
$tbody.append("<tr><td colspan='100%'>No Tracks found</td></tr>");
|
||||
} else {
|
||||
$.each(backingTracks, function(index, backingTrack) {
|
||||
var options = {
|
||||
backingTrackState: null,
|
||||
path: backingTrack.path,
|
||||
name: backingTrack.name
|
||||
//length: backingTrack.length ? backingTrack.length : 0
|
||||
}
|
||||
var $tr = $(context._.template($templateOpenBackingTrackRow.html(), options, { variable: 'data' }));
|
||||
$tr.data('server-model', backingTrack);
|
||||
$tbody.append($tr);
|
||||
});
|
||||
}//end
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -784,6 +784,14 @@
|
|||
fire();
|
||||
|
||||
}
|
||||
|
||||
function getBackingTrackList() {
|
||||
return [
|
||||
{name:'foo',path:"foobar.mp3", length:4283},
|
||||
{name:'bar',path:"foo.mp3",length:3257}
|
||||
];
|
||||
}
|
||||
|
||||
function ClientUpdateStartUpdate(path, successCallback, failureCallback) {}
|
||||
|
||||
// -------------------------------
|
||||
|
|
@ -1044,6 +1052,7 @@
|
|||
this.GetScoreWorkTimingInterval = GetScoreWorkTimingInterval;
|
||||
this.SetScoreWorkTimingInterval = SetScoreWorkTimingInterval;
|
||||
|
||||
this.getBackingTrackList = getBackingTrackList;
|
||||
this.SessionCloseBackingTrackFile = SessionCloseBackingTrackFile;
|
||||
this.SessionOpenBackingTrackFile = SessionOpenBackingTrackFile;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
tbody
|
||||
br
|
||||
|
||||
.left.paginator-holder
|
||||
/ .left.paginator-holder
|
||||
|
||||
.help-links
|
||||
a.what-are-backingtracks href='#'
|
||||
|
|
|
|||
Loading…
Reference in New Issue