[Aimmath-developers] RE: AiM Community: Re: Works with all browsers
Brought to you by:
gustav_delius,
npstrick
From: Greg G. <gr...@ma...> - 2003-07-18 03:30:05
|
On Wed, 16 Jul 2003, Gustav W Delius wrote: > I would certainly like to look at what you have done. Where do I look? Dear Gustav and everyone, What I've done is a bit half-baked and it's been about a month since I've done any work on it ... so I'll explain the components and what I changed (the java script stuff really needs to be added in automatically via a .mpl file, but I haven't looked at that yet). The components are in the attached .zip file which expands to the following hierarchy: ROOT/ index.html Uindex.html WEB-INF/ java/ Alice.java Maple.java tth/ TtH.java * Firstly, the idea is that there be two variants of the index.html page. The default uses symbol font but has a javascript function to redirect to the other variant Uindex.html. o You will observe two extra javascript functions: Trim and BrowserDetector in the head of index.html o Inside the <form ...> ... </form> tags you will find <input type="hidden" name="Browser" value="IE"> in index.html and <input type="hidden" name="Browser" value="Unicode"> in Uindex.html. * Alice.java is supposed to grab the value of "Browser" and pass it down to subsequent webpages that the student visits, like the various "Command"s are. You will notice on lines 595 - 599: maple.exec("`aim/Main`(" + commandargs + "):\n", // "", " -u", // (alicereq.browser.equals("IE") ? "" : " -u"), webOutput); If everything was working the commented out line, line 598 would be used instead of line 597 (line 597 causes the option " -u" (Unicode) to be always passed to tth). The commented out line, line 596 instead of line 597 would pass "" (for symbol font) always. * Maple.java is modified essentially for the adjustment in TtH.java. * MaplePool.java was not changed and so is not included. * TtH.java is modified so that its exec method accepts an extra argument tthOpt which is either "" (for IE (symbol font) browsers) or " -u" (for Unicode browsers) The java script browser detection part works; the java code compiles, but subsequent webpages visited don't get the value of "Browser" passed down. Can anyone see what I might be doing wrong? Any hints about how to get the java code to write out info. as it's going would be helpful too. My main problem is I don't know enough java ... I'm better at C etc. Also, if someone can see a way of doing it without having two separate index.html variants that would be good too. If we can the rudimentary detection working, we can beef this up further to print messages like: Internet Explorer 5: Your browser has a bug that `flattens' multiple levels of indices, e.g. e^(x^2) will appear as e^(x2). Please upgrade to at least Internet Explorer 6 ... and we can detect for Netscape 4 on windows and make it use symbol font, and warn that Netscape 4 on UNIX requires some special configuration, and then we can look at other browsers like safari, opera and konqueror and decide if the Unicode option is the correct one etc. Regards, Greg |