Update of /cvsroot/aimmath/AIM/WEB-INF/java
In directory sc8-pr-cvs1:/tmp/cvs-serv9939
Modified Files:
Tag: develop_2_1
Alice.java Maple.java
Log Message:
changes to allow -u option depending on browser detection
Index: Alice.java
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -C2 -d -r1.2.2.2 -r1.2.2.3
*** Alice.java 24 Aug 2003 14:44:42 -0000 1.2.2.2
--- Alice.java 30 Aug 2003 16:54:31 -0000 1.2.2.3
***************
*** 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.2.2.3
retrieving revision 1.2.2.4
diff -C2 -d -r1.2.2.3 -r1.2.2.4
*** Maple.java 24 Aug 2003 14:44:42 -0000 1.2.2.3
--- Maple.java 30 Aug 2003 16:54:31 -0000 1.2.2.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));
}
}
|