diff --git a/plugins/c9.ide.dialog.common/alert_internal.js b/plugins/c9.ide.dialog.common/alert_internal.js index 042b3277..98744ee1 100644 --- a/plugins/c9.ide.dialog.common/alert_internal.js +++ b/plugins/c9.ide.dialog.common/alert_internal.js @@ -26,6 +26,8 @@ define(function(require, module, exports) { /***** Methods *****/ function show(title, header, msg, onhide, options) { + options = options || {}; + metrics.increment("dialog.error"); return plugin.queue(function(){ @@ -37,15 +39,15 @@ define(function(require, module, exports) { else { plugin.title = title; } - plugin.heading = options && options.isHTML ? header : util.escapeXml(header); - plugin.body = options && options.isHTML ? msg : (util.escapeXml(msg) || "") + plugin.heading = options.isHTML ? header : util.escapeXml(header); + plugin.body = options.isHTML ? msg : (util.escapeXml(msg) || "") .replace(/\n/g, "
") .replace(/(https?:\/\/[^\s]*\b)/g, "$1"); plugin.getElement("ok").setCaption(options.yes || "OK"); plugin.update([ - { id: "dontshow", visible: options && options.showDontShow } + { id: "dontshow", visible: options.showDontShow } ]); plugin.once("hide", function(){