1c6c924436ec6dfb8e8164b73f659c655fa98a7d larrym Wed Feb 22 15:45:09 2012 -0800 convert showWarning calls to warn in javascript code (I'm cleaning up code by removing a reimplementation of the warn code) diff --git src/hg/js/ajax.js src/hg/js/ajax.js index a1857d2..fb489ac 100644 --- src/hg/js/ajax.js +++ src/hg/js/ajax.js @@ -246,57 +246,49 @@ $(main).attr('action',window.location.href); setTimeout("submitMain()",50); // Delay in submit helps ensure that cart var has gotten there first. return false; } function errorHandler(request, textStatus) { var str; if(textStatus && textStatus.length && textStatus != "error") { str = "Encountered network error : '" + textStatus + "'."; } else { str = "Encountered a network error." } str += " Please try again. If the problem persists, please check your network connection."; - showWarning(str); + warn(str); jQuery('body').css('cursor', ''); if(this.disabledEle) { this.disabledEle.removeAttr('disabled'); } if(this.loadingId) { hideLoadingImage(this.loadingId); } } function catchErrorOrDispatch(obj, textStatus) { // generic ajax success handler (handles fact that success is not always success). if(textStatus == 'success') this.trueSuccess(obj, textStatus); else errorHandler.call(this, obj, textStatus); } -function showWarning(str) -{ - $("#warningText").text(str); - $("#warning").show(); - // reset window to the top so the user sees this message. - $(window).scrollTop(0); -} - // Specific calls... function lookupMetadata(trackName,showLonglabel,showShortLabel) { // Ajax call to repopulate a metadata vals select when mdb var changes var thisData = "db=" + getDb() + "&cmd=tableMetadata&track=" + trackName; if(showLonglabel) thisData += "&showLonglabel=1"; if(showShortLabel) thisData += "&showShortLabel=1"; $.ajax({ type: "GET", dataType: "html", url: "../cgi-bin/hgApi", data: thisData, trueSuccess: loadMetadataTable, success: catchErrorOrDispatch,