Display errors in red.

This commit is contained in:
Michael Jumper
2013-10-15 12:57:56 -07:00
parent 76049fbc38
commit 47dcada639
3 changed files with 47 additions and 2 deletions

View File

@@ -750,6 +750,22 @@ GuacUI.Download = function(filename) {
progress.textContent = text;
};
/**
* Updates the content of the dialog to reflect an error condition
* represented by the given text.
*
* @param {String} text A human-readable description of the error.
*/
this.showError = function(text) {
element.removeChild(progress);
GuacUI.addClass(element, "error");
var status = GuacUI.createChildElement(element, "div", "status");
status.textContent = text;
};
/**
* Removes the progress indicator and replaces it with a download button.
*/
@@ -845,6 +861,22 @@ GuacUI.Upload = function(filename) {
progress.textContent = text;
};
/**
* Updates the content of the dialog to reflect an error condition
* represented by the given text.
*
* @param {String} text A human-readable description of the error.
*/
this.showError = function(text) {
element.removeChild(progress);
GuacUI.addClass(element, "error");
var status = GuacUI.createChildElement(element, "div", "status");
status.textContent = text;
};
/**
* Returns the element representing this notification.
*/