[Aimmath-commit] AIM/WEB-INF/java Alice.java,1.3,1.4 Maple.java,1.3,1.4
Brought to you by:
gustav_delius,
npstrick
From: <gus...@us...> - 2003-08-30 22:40:59
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1:/tmp/cvs-serv26415/WEB-INF/java Modified Files: Alice.java Maple.java Log Message: Manolis' implementation of the -u tag setting Index: Alice.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alice.java 25 Aug 2003 21:47:18 -0000 1.3 --- Alice.java 30 Aug 2003 22:40:55 -0000 1.4 *************** *** 209,212 **** --- 209,213 ---- } + if (TtHProgram != null) { tth.TtH.program = TtHProgram; *************** *** 593,597 **** // execute command, sending output to the web page. try { ! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput, alicereq.mathdisplay); } catch(Exception e) { logentry.close("ERROR"); --- 594,613 ---- // execute command, sending output to the web page. try { ! ! String tthOpt = ""; ! //get user agent ! String browser = request.getHeader("User-Agent").toLowerCase(); ! ! //this captures real mozilla and netscape 6+ only ! //and not even Opera that will identify as Mozilla ! //add more if needed ! if ( ( (browser.indexOf("mozilla/5.0") >= 0) && ! (browser.indexOf("gecko") >= 0) ) ! ) ! { ! tthOpt = "-u"; ! } ! ! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput, alicereq.mathdisplay, tthOpt); } catch(Exception e) { logentry.close("ERROR"); Index: Maple.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Maple.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Maple.java 25 Aug 2003 21:47:18 -0000 1.3 --- Maple.java 30 Aug 2003 22:40:55 -0000 1.4 *************** *** 138,142 **** // The command need not have a semicolon or newline at the end public synchronized void exec(String cmd) throws Exception { ! exec(cmd, null, "html"); } --- 138,142 ---- // The command need not have a semicolon or newline at the end public synchronized void exec(String cmd) throws Exception { ! exec(cmd, null, "html", ""); } *************** *** 145,149 **** // Default to converting the latex output with tth public synchronized void exec(String cmd, PrintWriter out) throws Exception { ! exec(cmd, null, "html"); } --- 145,149 ---- // Default to converting the latex output with tth public synchronized void exec(String cmd, PrintWriter out) throws Exception { ! exec(cmd, null, "html", ""); } *************** *** 151,155 **** // The command need not have a semicolon or newline at the end // Convert latex using the option given ! public synchronized void exec(String cmd, PrintWriter out, String mathdisplay) throws Exception { --- 151,155 ---- // The command need not have a semicolon or newline at the end // Convert latex using the option given ! public synchronized void exec(String cmd, PrintWriter out, String mathdisplay, String tthOpt) throws Exception { *************** *** 179,187 **** if (out != null) { if (mathdisplay.toLowerCase().equals("html")) // this don't work! How do we do string comparisons? ! out.print(tth.TtH.convert(outstring.toString())); else if (mathdisplay.toLowerCase().equals("latex")) out.print(outstring.toString()); else // default to using tth ! out.print(tth.TtH.convert(outstring.toString())); } } --- 179,187 ---- if (out != null) { if (mathdisplay.toLowerCase().equals("html")) // this don't work! How do we do string comparisons? ! out.print(tth.TtH.convert(outstring.toString(), tthOpt)); else if (mathdisplay.toLowerCase().equals("latex")) out.print(outstring.toString()); else // default to using tth ! out.print(tth.TtH.convert(outstring.toString(), tthOpt)); } } |