Skip to content

Commit

Permalink
Merge pull request #42 from OmarWKH/no-innerHTML
Browse files Browse the repository at this point in the history
use textContent instead of innerHTML
  • Loading branch information
czue authored Aug 23, 2020
2 parents cd6a981 + 255130b commit f96b68d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions celery_progress/static/celery_progress/celery_progress.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
var CeleryProgressBar = (function () {
function onSuccessDefault(progressBarElement, progressBarMessageElement, result) {
progressBarElement.style.backgroundColor = '#76ce60';
progressBarMessageElement.innerHTML = "Success!";
progressBarMessageElement.textContent = "Success!";
}

function onResultDefault(resultElement, result) {
if (resultElement) {
resultElement.innerHTML = result;
resultElement.textContent = result;
}
}

function onErrorDefault(progressBarElement, progressBarMessageElement, excMessage) {
progressBarElement.style.backgroundColor = '#dc4f63';
progressBarMessageElement.innerHTML = "Uh-Oh, something went wrong! " + excMessage;
progressBarMessageElement.textContent = "Uh-Oh, something went wrong! " + excMessage;
}

function onProgressDefault(progressBarElement, progressBarMessageElement, progress) {
progressBarElement.style.backgroundColor = '#68a9ef';
progressBarElement.style.width = progress.percent + "%";
var description = progress.description || "";
progressBarMessageElement.innerHTML = progress.current + ' of ' + progress.total + ' processed. ' + description;
progressBarMessageElement.textContent = progress.current + ' of ' + progress.total + ' processed. ' + description;
}

function updateProgress (progressUrl, options) {
Expand Down

0 comments on commit f96b68d

Please sign in to comment.