Update alert() to implement navigator.notification.alert API. This update is from janmonschke (Jan Monschke).

This commit is contained in:
Bryce Curtis
2010-10-06 13:31:30 -05:00
parent dc960b9835
commit 98206852de
2 changed files with 33 additions and 3 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ function Notification() {
* @param {String} [buttonLabel="OK"] Label of the close button (default: OK)
*/
Notification.prototype.alert = function(message, title, buttonLabel) {
// Default is to use a browser alert; this will use "index.html" as the title though
alert(message);
var _title = (title || "Alert");
var _buttonLabel = (buttonLabel || "OK");
PhoneGap.execAsync(null, null, "Notification", "alert", [message,_title,_buttonLabel]);
};
/**