function showUnfinishedUploadDialog(projectId, projectName, dateTime, count) { var alertDiv = document.createElement('div'); alertDiv.classList.add('alert-notification'); var message = document.createTextNode("You have an incomplete data upload for "+projectName+" ("+count+" files remaining) that was started at "+dateTime+". Would you like to continue it?"); var continueButton = document.createElement('button'); continueButton.classList.add('button'); continueButton.classList.add('continue'); continueButton.appendChild(document.createTextNode("Continue")); var forgetButton = document.createElement('button'); forgetButton.classList.add('button'); forgetButton.classList.add('cancel'); forgetButton.appendChild(document.createTextNode("Forget Upload")); var closeButton = document.createElement('button'); closeButton.classList.add('alert-close'); closeButton.appendChild(document.createTextNode("X")); alertDiv.appendChild(message); alertDiv.appendChild(document.createTextNode(" ")); alertDiv.appendChild(continueButton); alertDiv.appendChild(document.createTextNode(" ")); alertDiv.appendChild(forgetButton); alertDiv.appendChild(document.createTextNode(" ")); alertDiv.appendChild(closeButton); continueButton.addEventListener("click", function() { window.location = "/dashboard/data/?resume="+projectId; }); forgetButton.addEventListener("click", function() { var data = { "project_id": projectId }; var doForget = confirm("Are you sure you want to abandon this upload?"); if(doForget) { var promise = ajaxPost("/api/forgetupload", data); promise.success = function() { document.getElementById("message-center").removeChild(alertDiv); }; } }); closeButton.addEventListener("click", function() { document.getElementById("message-center").removeChild(alertDiv); }); document.getElementById("message-center").appendChild(alertDiv); } function errorMessage(message) { var alertDiv = document.createElement('div'); alertDiv.classList.add('alert-notification'); var messageNode = document.createTextNode(message); alertDiv.appendChild(messageNode); document.getElementById("message-center").appendChild(alertDiv); } function superadminNotice() { var alertDiv = document.createElement('div'); alertDiv.classList.add('alert-notification'); var messageNode = document.createTextNode("Super User Account"); alertDiv.appendChild(messageNode); document.getElementById("message-center").appendChild(alertDiv); }