ab199f770d3a616c5a0113da7b049662f83540ff larrym Wed Feb 22 15:26:33 2012 -0800 window.scrollTo to showWarnBox to make sure user sees warnings diff --git src/lib/htmshell.c src/lib/htmshell.c index ccffdb5..464d3d4 100644 --- src/lib/htmshell.c +++ src/lib/htmshell.c @@ -253,30 +253,31 @@ // "if(app == 'Microsoft') {warnBox.style.display='';} else {warnBox.style.display=''; warnBox.style.width='auto';}" fprintf(f, "<script type='text/javascript'>\n"); fprintf(f, "document.write(\"<center>" "<div id='warnBox' style='display:none; background-color:Beige; " "border: 3px ridge DarkRed; width:640px; padding:10px; margin:10px; " "text-align:left;'>" "<CENTER><B id='warnHead' style='color:DarkRed;'></B></CENTER>" "<UL id='warnList'></UL>" "<CENTER><button id='warnOK' onclick='hideWarnBox();return false;'></button></CENTER>" "</div></center>\");\n"); fprintf(f,"function showWarnBox() {" "document.getElementById('warnOK').innerHTML=' OK ';" "var warnBox=document.getElementById('warnBox');" "warnBox.style.display=''; warnBox.style.width='65%%';" "document.getElementById('warnHead').innerHTML='Error(s):';" + "window.scrollTo(0, 0);" "}\n"); fprintf(f,"function hideWarnBox() {" "var warnBox=document.getElementById('warnBox');" "warnBox.style.display='none';warnBox.innerHTML='';" "var endOfPage = document.body.innerHTML.substr(document.body.innerHTML.length-20);" "if(endOfPage.lastIndexOf('-- ERROR --') > 0) { history.back(); }" "}\n"); // Note that the OK button goes to prev page when this page is interrupted by the error. fprintf(f,"window.onunload = function(){}; // Trick to avoid FF back button issue.\n"); fprintf(f,"</script>\n"); } void htmlVaWarn(char *format, va_list args) /* Write an error message. */ { va_list argscp;