SAAS-1061 - implement podcast list view skeleton; small bugfixes
This commit is contained in:
parent
fe5db4761e
commit
0fcf6a8dac
16 changed files with 512 additions and 439 deletions
|
@ -37,90 +37,13 @@ $(document).ready(function () {
|
|||
self.recentUploadsTable.fnDraw(); //Only works because we're using bServerSide
|
||||
//In DataTables 1.10 and greater, we can use .fnAjaxReload()
|
||||
});
|
||||
this.on("complete", function() {
|
||||
|
||||
this.on("queuecomplete", function() {
|
||||
uploadProgress = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
var uploader = new plupload.Uploader({
|
||||
runtimes: 'html5, flash, html4',
|
||||
browse_button: 'pickfiles',
|
||||
container: $("#container"),
|
||||
url : baseUrl+'rest/media',
|
||||
filters : [
|
||||
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,wav,m4a,mp4,opus,aac,oga,mp1,mp2,wma,au"}
|
||||
],
|
||||
multipart_params : {
|
||||
"csrf_token" : $("#csrf").attr('value')
|
||||
},
|
||||
|
||||
init: {
|
||||
PostInit: function() {
|
||||
document.getElementById('filelist').innerHTML = '';
|
||||
|
||||
document.getElementById('uploadfiles').onclick = function() {
|
||||
uploader.start();
|
||||
return false;
|
||||
};
|
||||
},
|
||||
|
||||
FilesAdded: function(up, files) {
|
||||
plupload.each(files, function(file) {
|
||||
document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
|
||||
});
|
||||
},
|
||||
|
||||
UploadProgress: function(up, file) {
|
||||
document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
|
||||
},
|
||||
|
||||
Error: function(up, err) {
|
||||
document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
uploader.init();
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
$("#plupload_files").pluploadQueue({
|
||||
// General settings
|
||||
runtimes : 'gears, html5, html4',
|
||||
url : baseUrl+'rest/media',
|
||||
//chunk_size : '5mb', //Disabling chunking since we're using the File Upload REST API now
|
||||
unique_names : 'true',
|
||||
multiple_queues : 'true',
|
||||
filters : [
|
||||
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,wav,m4a,mp4,opus,aac,oga,mp1,mp2,wma,au"}
|
||||
],
|
||||
multipart_params : {
|
||||
"csrf_token" : $("#csrf").attr('value'),
|
||||
}
|
||||
});
|
||||
|
||||
uploader = $("#plupload_files").pluploadQueue();
|
||||
|
||||
uploader.bind('FileUploaded', function(up, file, json)
|
||||
{
|
||||
//Refresh the upload table:
|
||||
self.recentUploadsTable.fnDraw(); //Only works because we're using bServerSide
|
||||
//In DataTables 1.10 and greater, we can use .fnAjaxReload()
|
||||
});
|
||||
|
||||
var uploadProgress = false;
|
||||
|
||||
uploader.bind('QueueChanged', function(){
|
||||
uploadProgress = (uploader.files.length > 0);
|
||||
});
|
||||
|
||||
uploader.bind('UploadComplete', function(){
|
||||
uploadProgress = false;
|
||||
});*/
|
||||
|
||||
$(window).bind('beforeunload', function () {
|
||||
if (uploadProgress) {
|
||||
return sprintf($.i18n._("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
||||
|
@ -173,11 +96,11 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
self.setupRecentUploadsTable = function () {
|
||||
recentUploadsTable = $("#recent_uploads_table").dataTable({
|
||||
return $("#recent_uploads_table").dataTable({
|
||||
"bJQueryUI": true,
|
||||
"bProcessing": false,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": '/Plupload/recent-uploads/format/json',
|
||||
"sAjaxSource": '/plupload/recent-uploads/format/json',
|
||||
"sAjaxDataProp": 'files',
|
||||
"bSearchable": false,
|
||||
"bInfo": true,
|
||||
|
@ -221,11 +144,13 @@ $(document).ready(function () {
|
|||
areAnyFileImportsPending = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (areAnyFileImportsPending) {
|
||||
//alert("pending uploads, starting refresh on timer");
|
||||
self.startRefreshingRecentUploads();
|
||||
} else {
|
||||
} else if (self.isRecentUploadsRefreshTimerActive) {
|
||||
self.stopRefreshingRecentUploads();
|
||||
self.recentUploadsTable.fnDraw();
|
||||
}
|
||||
|
||||
// Update usability hint - in common.js
|
||||
|
@ -239,7 +164,7 @@ $(document).ready(function () {
|
|||
var sw = $(this)[0].scrollWidth, iw = $(this).innerWidth();
|
||||
if (sw > iw) {
|
||||
$(this).stop().animate({
|
||||
textIndent: "-" + (sw + 2 - iw) + "px"
|
||||
textIndent: "-" + (sw - iw) + "px"
|
||||
}, sw * 8);
|
||||
}
|
||||
},
|
||||
|
@ -251,37 +176,41 @@ $(document).ready(function () {
|
|||
);
|
||||
}
|
||||
});
|
||||
|
||||
return recentUploadsTable;
|
||||
};
|
||||
|
||||
self.isRecentUploadsRefreshTimerActive = false;
|
||||
|
||||
self.startRefreshingRecentUploads = function () {
|
||||
if (self.isRecentUploadsRefreshTimerActive()) { //Prevent multiple timers from running
|
||||
return;
|
||||
if (!self.isRecentUploadsRefreshTimerActive) { //Prevent multiple timers from running
|
||||
self.recentUploadsRefreshTimer = setInterval(function() {
|
||||
self.recentUploadsTable.fnDraw();
|
||||
}, 3000);
|
||||
self.isRecentUploadsRefreshTimerActive = true;
|
||||
}
|
||||
self.recentUploadsRefreshTimer = setInterval("self.recentUploadsTable.fnDraw()", 3000);
|
||||
};
|
||||
|
||||
self.isRecentUploadsRefreshTimerActive = function () {
|
||||
return (self.recentUploadsRefreshTimer != null);
|
||||
};
|
||||
|
||||
self.stopRefreshingRecentUploads = function () {
|
||||
clearInterval(self.recentUploadsRefreshTimer);
|
||||
self.recentUploadsRefreshTimer = null;
|
||||
self.isRecentUploadsRefreshTimerActive = false;
|
||||
};
|
||||
|
||||
$("#upload_status_all").click(function () {
|
||||
self.uploadFilter = "all";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
if (self.uploadFilter !== "all") {
|
||||
self.uploadFilter = "all";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
}
|
||||
});
|
||||
$("#upload_status_pending").click(function () {
|
||||
self.uploadFilter = "pending";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
if (self.uploadFilter !== "pending") {
|
||||
self.uploadFilter = "pending";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
}
|
||||
});
|
||||
$("#upload_status_failed").click(function () {
|
||||
self.uploadFilter = "failed";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
if (self.uploadFilter !== "failed") {
|
||||
self.uploadFilter = "failed";
|
||||
self.recentUploadsTable.fnPageChange(0).fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
//Create the recent uploads table.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue