CC-3820 : when using reupload to soundcloud on calendar, progress icon never goes away unless you refresh the page
This commit is contained in:
parent
803c44611a
commit
71c279a2f9
|
@ -467,7 +467,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
checkImportStatus();
|
||||
setInterval(checkImportStatus, 5000);
|
||||
setInterval(checkSCUploadStatus, 5000);
|
||||
setInterval(checkLibrarySCUploadStatus, 5000);
|
||||
|
||||
addQtipToSCIcons();
|
||||
|
||||
|
@ -653,28 +653,32 @@ function addProgressIcon(id) {
|
|||
}
|
||||
}
|
||||
|
||||
function checkSCUploadStatus(){
|
||||
function checkLibrarySCUploadStatus(){
|
||||
|
||||
var url = '/Library/get-upload-to-soundcloud-status';
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
$("span[class*=progress]").each(function(){
|
||||
var span, id;
|
||||
function checkSCUploadStatusCallback(json) {
|
||||
|
||||
if (json.sc_id > 0) {
|
||||
span.removeClass("progress").addClass("soundcloud");
|
||||
|
||||
}
|
||||
else if (json.sc_id == "-3") {
|
||||
span.removeClass("progress").addClass("sc-error");
|
||||
}
|
||||
}
|
||||
|
||||
function checkSCUploadStatusRequest() {
|
||||
|
||||
span = $(this);
|
||||
id = span.parent().parent().data("aData").id;
|
||||
id = span.parents("tr").data("aData").id;
|
||||
|
||||
$.post(url, {format: "json", id: id, type:"file"}, function(json){
|
||||
if (json.sc_id > 0) {
|
||||
span.removeClass("progress")
|
||||
.addClass("soundcloud");
|
||||
|
||||
}
|
||||
else if (json.sc_id == "-3") {
|
||||
span.removeClass("progress")
|
||||
.addClass("sc-error");
|
||||
}
|
||||
});
|
||||
});
|
||||
$.post(url, {format: "json", id: id, type:"file"}, checkSCUploadStatusCallback);
|
||||
}
|
||||
|
||||
$("#library_display span.progress").each(checkSCUploadStatusRequest);
|
||||
}
|
||||
|
||||
function addQtipToSCIcons(){
|
||||
|
|
|
@ -79,6 +79,34 @@ function uploadToSoundCloud(show_instance_id){
|
|||
}
|
||||
}
|
||||
|
||||
function checkCalendarSCUploadStatus(){
|
||||
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
function checkSCUploadStatusCallback(json) {
|
||||
|
||||
if (json.sc_id > 0) {
|
||||
span.removeClass("progress").addClass("soundcloud");
|
||||
|
||||
}
|
||||
else if (json.sc_id == "-3") {
|
||||
span.removeClass("progress").addClass("sc-error");
|
||||
}
|
||||
}
|
||||
|
||||
function checkSCUploadStatusRequest() {
|
||||
|
||||
span = $(this);
|
||||
id = span.parents("div.fc-event").data("event").id;
|
||||
|
||||
$.post(url, {format: "json", id: id, type:"show"}, checkSCUploadStatusCallback);
|
||||
}
|
||||
|
||||
$("#schedule_calendar span.progress").each(checkSCUploadStatusRequest);
|
||||
}
|
||||
|
||||
function findViewportDimensions() {
|
||||
var viewportwidth,
|
||||
viewportheight;
|
||||
|
@ -254,6 +282,7 @@ $(document).ready(function() {
|
|||
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
|
||||
, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
setInterval(checkCalendarSCUploadStatus, 5000);
|
||||
|
||||
$.contextMenu({
|
||||
selector: 'div.fc-event',
|
||||
|
|
Loading…
Reference in New Issue