Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/externals/javelin/core/util.js
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | return function(msg) { | ||||
recent_alerts.push(JX.now()); | recent_alerts.push(JX.now()); | ||||
if (recent_alerts.length > 3) { | if (recent_alerts.length > 3) { | ||||
recent_alerts.splice(0, recent_alerts.length - 3); | recent_alerts.splice(0, recent_alerts.length - 3); | ||||
} | } | ||||
if (recent_alerts.length >= 3 && | if (recent_alerts.length >= 3 && | ||||
(recent_alerts[recent_alerts.length - 1] - recent_alerts[0]) < 5000) { | (recent_alerts[recent_alerts.length - 1] - recent_alerts[0]) < 5000) { | ||||
if (window.confirm(msg + "\n\nLots of alert()s recently. Kill them?")) { | if (window.confirm(msg + '\n\nLots of alert()s recently. Kill them?')) { | ||||
window.alert = JX.bag; | window.alert = JX.bag; | ||||
} | } | ||||
} else { | } else { | ||||
// Note that we can't .apply() the IE6 version of this "function". | // Note that we can't .apply() the IE6 version of this "function". | ||||
native_alert(msg); | native_alert(msg); | ||||
} | } | ||||
in_alert = false; | in_alert = false; | ||||
}; | }; | ||||
Show All 15 Lines |