# HG changeset patch # User Atul Varma # Date 1272630774 25200 # Node ID 00d6b3149165b68ffb7b39b03cde42810642893f # Parent 4567dc69cb3e5be0468831ec5c4b39a5d2ae5ae1 added addFailMsg() global. diff -r 4567dc69cb3e -r 00d6b3149165 js/black-box.js --- a/js/black-box.js Fri Apr 30 05:26:01 2010 -0700 +++ b/js/black-box.js Fri Apr 30 05:32:54 2010 -0700 @@ -75,8 +75,7 @@ window.onDashboardLoaded = function onDashboardLoaded(dashboard, options) { $(dashboard).error( function(event) { - if (window.console) - window.console.warn("An error occurred in the dashboard iframe."); + addFailMsg("An error occurred in the dashboard iframe."); }); delegate("blackBox.onDashboardLoaded", [dashboard, options]); @@ -111,6 +110,13 @@ iframe.src = "index.html?testing=1"; } +function addFailMsg(msg) { + var msgElem = $('

').text(msg); + msgElem.hide(); + $("#messages").append(msgElem); + msgElem.slideDown(); +} + function initialize() { $(".test-button").click( function() { @@ -121,12 +127,8 @@ $(testButton).addClass("running"); function onFail(reason) { $(testButton).addClass("fail"); - var msg = ("Failure in " + $(testButton).text() + ": " + + addFailMsg("Failure in " + $(testButton).text() + ": " + reason); - var msgElem = $('

').text(msg); - msgElem.hide(); - $("#messages").append(msgElem); - msgElem.slideDown(); } function onDone() { $(testButton).removeClass("running");