From: Mike G. v. a. <we...@ma...> - 2009-06-26 01:08:00
|
Log Message: ----------- adding show-source.cgi syncing with HEAD on 6/25/2009 Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/htdocs/helpFiles: InstructorPGProblemEditor.html Units.html webwork2/htdocs/js: ww_applet_support.js webwork2/htdocs/jsMath: jsMath-easy-load.js jsMath-fallback-pc.js jsMath.js webwork2/htdocs/jsMath/easy: load.js webwork2/htdocs/jsMath/extensions: AMSmath.js bbox.js eqn-number.js webwork2/htdocs/jsMath/plugins: autoload.js webwork2/htdocs/jsMath/uncompressed: jsMath-fallback-pc.js jsMath.js Added Files: ----------- webwork2/htdocs: show-source.cgi webwork2/htdocs/css: union.css webwork2/htdocs/images: navProbListGrey.gif webwork2/htdocs/js: Base64.js Revision Data ------------- --- /dev/null +++ htdocs/show-source.cgi @@ -0,0 +1,72 @@ +#!/usr/bin/env perl + +print "Content-type: text/HTML\n\n"; + +$file = $ENV{PATH_INFO}; + +Error("Can't load specified file") if ($file =~ m!(\.\./|//|:|~)!); +Error("Can't load specified file") if ($file !~ m!\.p[lg]$!); + + +#$root = '/usr/local/WeBWorK'; +$root = '/opt/webwork/'; +$filedir = $file; $filedir =~ s!/[^/]+$!!; +$file =~ s!.*/!!; + +@PGdirs = ( + "../templates$filedir", + "../templates/macros", +# "$root/local/macros", + "$root/pg/macros", +); + +foreach $dir (@PGdirs) {ShowSource("$dir/$file") if (-e "$dir/$file")} + +Error("Can't find specified file",join(",",@PGdirs).": ".$file); + +sub Error { + print "<HTML>\n<HEAD>\n<TITLE>Show-Source Error</TITLE>\n</HEAD>\n"; + print "<BODY>\n\n<H1>Show-Source Error:</H1>\n\n"; + print join("\n",@_),"\n"; + print "</BODY>\n</HTML>"; + exit; +} + +sub ShowSource { + my $file = shift; + my $name = $file; $name =~ s!.*/!!; + + open(PGFILE,$file); + $program = join('',<PGFILE>); + close(PGFILE); + + $program =~ s/&/\&/g; + $program =~ s/</\</g; + $program =~ s/>/\>/g; + $program =~ s/\t/ /g; + print "<HTML>\n<HEAD>\n<TITLE>Problem Source Code</TITLE>\n</HEAD>\n"; + print "<BODY>\n\n<H1>Source Code for <CODE>$name</CODE>:</H1>\n\n"; + print "<HR>\n<BLOCKQUOTE>\n"; + print "<PRE>"; + print MarkSource($program); + print "</PRE>\n"; + print "</BLOCKQUOTE>\n<HR>\n"; + print "</BODY>\n</HTML>\n"; + exit; +} + +sub MarkSource { + my $program = shift; + local $cgi = $ENV{SCRIPT_NAME}; + $program =~ s/loadMacros *\(([^\)]*)\)/MakeLinks($1)/ge; + return $program; +} + +sub MakeLinks { + my $macros = shift; + $macros =~ s!"([^\"<]*)"!"<A HREF="$cgi$filedir/\1">\1</A>"!g; + $macros =~ s!'([^\'<]*)'!'<A HREF="$cgi$filedir/\1">\1</A>'!g; + return 'loadMacros('.$macros.')'; +} + +1; --- /dev/null +++ htdocs/css/union.css @@ -0,0 +1,190 @@ +/******************************************************************************/ +/* union.css classes: These classes appear in ur.template and are NOT + * emitted by WeBWorK code. They need only appear in this template. */ + +body { margin: 0px; } + +/* left table cell, contains logo and menus */ +td.LeftPanel { background-color: #660033; color: white; white-space: nowrap; width: 8em; zoom: 1; } +td.LeftPanel ul { zoom: 1; margin-left: 0em} +td.LeftPanel ul ul ul li { margin-left: .5em} +td.LeftPanel a:link, +td.LeftPanel a:visited { color: #EEBBBB; } + +div.Logo { } +div.Links { font-size: small; } +div.Links ul { list-style: none; margin-left: 0; padding-left: 0; } +div.Links ul ul { list-style: none; margin-left: 0.5em; padding-left: 0; } +div.Siblings { font-size: small; } +div.Siblings ul { list-style: none; margin-left: 0; padding-left: 0; } +div.Siblings ul ul { list-style: none; margin-left: 0.5em; padding-left: 0; } +div.Options { font-size: small; } + +/* top table cell, contains login message and path */ +td.TopPanel { background-color: #660033; color: white; height: 1; } +td.TopPanel a:link, +td.TopPanel a:visited { color: #EEBBBB; } + +.Path { } + +.LoginStatus { text-align: right; font-size: small;} + +.TimeLeft { font-size: small; } +.LittleTimeLeft { font-size: small; color: #FF7777; font-weight: bold; margin: 3px} +.TimeLeftReload { font-size: small; color: #EEBBBB; font-style: italic; } +td.Timestamp { text-align: left; font-size: small; font-style: italic; } + +/* main content panel, contains body */ +td.ContentPanel { background-color: white; color: black; } +td.ContentPanel a:link, +td.ContentPanel a:visited { color: blue; } +td.ContentPanel a:active { color: red; } + +td.SetMakerPanel { background-color: #DDDDDD; color: black; width: 50%; padding: 3px; } + +div.Nav { } +div.Title { font-size: 16pt; padding-bottom: 5px; } +div.SubmitError { color: red; font-style: italic; } +div.Message { font-style: italic; } +div.Body { } +div.Warnings { } + +/* contains info */ +td.InfoPanel { background-color: #DDDDDD; color: black; width: 40%; } +td.InfoPanel a:link, +td.InfoPanel a:visited { color: blue; } +td.InfoPanel a:active { color: red; } +div.Info { } + +/******************************************************************************/ +/* WeBWorK classes: These classes are emitted by WeBWorK code and should + * appear in ANY WeBWorK template. */ + +/* tables used for laying out form fields shouldn't have a border */ +table.FormLayout { border: 0; } +table.FormLayout tr { vertical-align: top; } +table.FormLayout th.LeftHeader { text-align: right; white-space: nowrap; } +table.FormLayout tr.ButtonRow { text-align: left; } +table.FormLayout tr.ButtonRowCenter { text-align: center; } + + +/* for problems which are rendered by themselves, e.g., by Set Maker */ +div.RenderSolo { background-color: #E0E0E0; color: black; padding: 5px; } +div.AuthorComment { background-color: #00E0E0; color: black; } + +/* minimal style for lists of links (generated by the links escape) */ +/* ul.LinksMenu { list-style: none; margin: 0 0 0 0.5em; padding: 0; }*/ +/* ul.LinksMenu ul { list-style: none; margin: 0 0 0 0.5em; padding: 0; }*/ + +a.HelpLink { border: 0px; } +a.HelpLink img { vertical-align: -5px; margin: 1px 2px; border: 0px; } + +/* background colors for success and failure messages */ +div.WarningMessage { background-color: #ffcccc; padding: 3px 3px 3px 3px; } +div.ResultsWithoutError { + margin-right: 6px; margin-left: 6px; + border-color: #009900; border-style: solid; border-width: 1px; + text-align: center; font-weight: bold; font-style: italic; + margin-right: 6px; margin-left: 6px; + background-color: #99ffAA; + padding: 3px 3px 3px 10px; +} /* light green */ +div.ResultsWithError { + margin-right: 6px; margin-left: 6px; + border-color: #CC0000; border-style: solid; border-width: 1px; + text-align: center; font-weight: bold; font-style: italic; + background-color: #ffcccc; + padding: 3px 3px 3px 10px; +} /* light red */ +div.ResultsAlert { + margin-right: 6px; margin-left: 6px; + border-color: #CCCC00; border-style: solid; border-width: 1px; + text-align: center; font-weight: bold; font-style: italic; + background-color: #ffffcc; + padding: 3px 3px 3px 10px; +} /* light yellow */ + +/* styles used by WeBWorK::HTML::ScrollingRecordList */ +div.ScrollingRecordList { padding: 1em; white-space: nowrap; border: thin solid gray; } +div.ScrollingRecordList select.ScrollingRecordList { width: 99%; } + +/* wraps the View Options form (generated by &optionsMacro) */ +/* FIXME: can't this style information just go in div.Options above? */ +div.viewOptions { border: thin groove; background-color: #882848; + line-height: 75%; margin: .5ex; margin-top: 2ex; + padding: 1ex; align: left; } + +.viewChoices { margin: 5px 0px 5px 5px; } +.viewChoices input {margin-top: 0px} + + +/* messages, attempt results, answer previews, etc. go in this DIV */ +/* this used to be "float:left", but that was suspected of causing MSIE peekaboo bug */ + +div.problemHeader {} + +/* styles for the attemptResults table */ +table.attemptResults { + border-style: outset; + border-width: 1px; +# margin: 0px auto 10pt auto; + margin: 0px 10pt; + border-spacing: 1px; +} +table.attemptResults td, +table.attemptResults th { + border-style: inset; + border-width: 1px; + text-align: center; + padding: 2px 5px; + background-color: #DDDDDD; +} +/* override above settings in tables used to display ans_array results */ +table.attemptResults td td, +table.attemptResults td th, +table.ArrayLayout td { + border-style: none; + border-width: 0px; + padding: 0px; +} +table.attemptResults td.Message { text-align: left; width: auto; } +.attemptResultsSummary { font-style:italic; } + +.parsehilight { background-color:yellow; } + +/* the problem TEXT itself does in this box */ +div.problem { + clear: both; padding: 0 5px; color: black; + border-top-style: solid; border-bottom-style: solid; + border-width: 2px; border-color: #DDBBBB; +} + +/* jsMath emits this class when appropriate math fonts aren't available */ +div.NoFontMessage { + padding: 10; + border-style: solid; + border-width:3px; + border-color: #DD0000; + background-color: #FFF8F8; + width: 75%; + text-align: left; + margin: 10px auto 10px 12%; +} + +/* text colors for published and unpublished sets */ +font.Published { font-style: normal; font-weight: normal; color: #000000; } /* black */ +font.Unpublished { font-style: italic; font-weight: normal; color: #aaaaaa; } /* light grey */ + +/* styles used when editing a temporary file */ +.temporaryFile { + margin-right: 6px; margin-left: 6px; + border-color: #AA6600; border-style: solid; border-width: 1px; + text-align: center; font-style: italic; + background-color: #FFBB88; + padding: 3px 3px 3px 10px; +} + +/* text colors for Auditing, Current, and Dropped students */ +.Audit { font-style: normal; color: purple; } +.Enrolled { font-weight: normal; color: black; } +.Drop { font-style: italic; color: grey; } Index: InstructorPGProblemEditor.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/helpFiles/InstructorPGProblemEditor.html,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.1.2.1 diff -Lhtdocs/helpFiles/InstructorPGProblemEditor.html -Lhtdocs/helpFiles/InstructorPGProblemEditor.html -u -r1.3.4.1 -r1.3.4.1.2.1 --- htdocs/helpFiles/InstructorPGProblemEditor.html +++ htdocs/helpFiles/InstructorPGProblemEditor.html @@ -29,7 +29,7 @@ <h3>PG Problem Editor Help Page</h3> <blockquote> <p> -This page allows to edit the contents of PG problem files (templates) +This page allows one to edit the contents of PG problem files (templates) as well as set headers and other files. </p> <p> @@ -41,8 +41,40 @@ <dl> - <dt>| Manpages | macro list | pod docs | report problem bugs |</dt> - <dd>The first three links are to pages that give some information about writing problems: "Manpages" is an (incomplete) list of the most commonly used macros with a description of their parameters and how to use them; a complete list of macros is provided by the "macro list"; and details for many macros can be obtained using the "pod docs" link which links to documentation embedded in the macro files themselves. If you find an error in a library problem please use the "Report problem bugs" link to notify us so that we can fix it. You will need to register with an email address the first time you use bugzilla, but after that you will not. </dd> + <dt>| <a href="http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/">Manpages</a> + | <a href="http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile"> + macro list</a> + | <a href="http://webwork.maa.org/wiki/Category:Authors"> + authoring info and help</a> + | <a href="http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/"> + testing lab</a> + | <a href="http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/"> + pod docs</a> + | <a href="http://bugs.webwork.rochester.edu">Report problem bugs</a> + |</dt> + <dd>The first five links are to pages that give some information about writing problems: + + <dl> + <dt><a href="http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/">Manpages</a></dt> + <dd>This links to an (incomplete) list of the most commonly used macros with a description of their parameters and how to use them; </dd> + <dt><a href="http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile"> + macro list</a></dt> + <dd>This link provides a complete list of macros;</dd> + + <dt><a href="http://webwork.maa.org/wiki/Category:Authors"> + authoring info and help</a> </dt> + <dd>This link takes you to the authoring section of the WeBWorK wiki;</dd> + <dt><a href="http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/"> + testing lab</a></dt> + <dd>This links to a WeBWorK "problem" which allows you to try out fragments of PG code.</dd> + <dt><a href="http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/"> + pod docs</a></dt> + <dd>This link gives details for many macros. It links to documentation embedded in the macro files themselves;</dd> + <dt><a href="http://bugs.webwork.rochester.edu">Report problem bugs</a></dt> + <dd>If you find an error in a library problem please use the link to notify us so that we can fix it. You will need to register with an email address the first time you use bugzilla, but after that you will not. </dd> + </dl> + + </dd> <dt> The large text window</dt> <dd> This is where you edit the text of the problem template. Nothing happens until you pick an action (below) and click the "Take action!" button.</dd> @@ -50,7 +82,7 @@ <h4>Action items:</h4> <i>(If an action cannot be executed it will not appear as an action item.) </i> -</dl> +<dl> <dt> View using seed "12345" and display mode "image"</dt> <dd> Will bring up a window to show the results of your editing. It does not change the permanent file on the disk. You can view different versions of the same problem by changing the seed (any number will do). You can also change mannerin which the @@ -59,22 +91,23 @@ <dd> Add this problem as the last problem of an existing set, either as a problem or as the set header (the text that appears on the home page of a homework set). You can rearrange the order of the problems later using the "Hmwk Sets Editor"</dd> - <dt> Create a copy at [TMPL]/"path"...</dt> + <dt> Save as [TMPL]/"path"...</dt> <dd> Makes a new copy of the file you are editing at the location relative to the course's templates ([TMPL]) directory given by "path". - The checkbox allows you to replace the current problem with the new problem in the homework set. + The checkbox allows you to replace the current problem with the new problem in the current homework set. <p> Check the checkbox if you want to edit the current problem without changing the original problem file.</p> <p> Leave the checkbox unchecked if you are using the current problem as a model for a brand new problem. You can add the new file to the homework set from the Library Browser.</p> - <p>If the original problem could not be edited than you will have to change the path name - before you will be allowed to save the problem. (Adding "local/" to the beginning of the suggested path will work. All of your - edited files will then appear in a subdirectory named "local". A new problem whose path ends in blankProblem.pg should be given - a new name, for example, "myNewProblem.pg")</P.</dd> + <p>If the original problem can not be edited than the path name + must be changed in order to be allowed to save the problem. (Adding "local/" to the beginning of the original path is the default solution. All locally created and + edited files will then appear in a subdirectory named "local". </p> + <p>A new problem whose path ends in blankProblem.pg should be given a new name, for example, "myNewProblem.pg")</P></dd> <dt> Revert</dt> <dd> Reverts to the copy of the file saved on the disk -- all unsaved editing changes will be lost. This option only appears when you have making provisional edits using the first option "View..." above</dd> <dt> Take action</dt> - <dd> Executes the</dd> action item selected above. You can elect to have this action appear in a new window or not. + <dd> Executes the action item selected above. You can elect to have the results of this action appear in a new window. + </dd> </dl> </blockquote> Index: Units.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/helpFiles/Units.html,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -Lhtdocs/helpFiles/Units.html -Lhtdocs/helpFiles/Units.html -u -r1.3 -r1.3.10.1 --- htdocs/helpFiles/Units.html +++ htdocs/helpFiles/Units.html @@ -66,6 +66,15 @@ <tr><td> electron volts <td align="center"> eV <tr><td> kilo Watt hours <td align="center"> kWh +<tr><td colspan="2" align="center"><b>Misc</b> +<tr><td> Amperes <td align="center"> amp +<tr><td> Moles <td align="center"> mol +<tr><td> Degrees Centrigrade <td align="center"> degC +<tr><td> Degrees Fahrenheit <td align="center"> degF +<tr><td> Degrees Kelvin <td align="center"> degK +<tr><td> Angle degrees <td align="center"> deg +<tr><td> Angle radians <td align="center"> rad + </table> --- /dev/null +++ htdocs/js/Base64.js @@ -0,0 +1,143 @@ + +/** +* +* Base64 encode / decode +* http://www.webtoolkit.info/ +* +**/ + +var Base64 = { + + // private property + _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + + // public method for encoding + encode : function (input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + input = Base64._utf8_encode(input); + + while (i < input.length) { + + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); + + } + + return output; + }, + + // public method for decoding + decode : function (input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + } + + output = Base64._utf8_decode(output); + + return output; + + }, + + // private method for UTF-8 encoding + _utf8_encode : function (string) { + string = string.replace(/\r\n/g,"\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } + else if((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } + else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; + }, + + // private method for UTF-8 decoding + _utf8_decode : function (utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + + return string; + } + +} Index: ww_applet_support.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/js/ww_applet_support.js,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -Lhtdocs/js/ww_applet_support.js -Lhtdocs/js/ww_applet_support.js -u -r1.9.2.1 -r1.9.2.2 --- htdocs/js/ww_applet_support.js +++ htdocs/js/ww_applet_support.js @@ -53,7 +53,7 @@ } function initializeAction() { // deprecated call -- removed - alert("You might be using an old template (stored at webwork2/conf/templates). The <body> tag in the system.template calls a function 'initializeAction()' -- this function name should be replaced by 'initializeWWquestion()'. Please update to a recent version of system.template"); + alert("You might be using an old template (stored at webwork2/conf/templates). The <body> tag in the system.template calls a function 'initializeAction()' instead of 'intializeWWquestion()'-- this function name should be replaced by 'initializeWWquestion()'. Please update to a recent version of system.template"); initializeWWquestion(); } @@ -67,9 +67,9 @@ } // applet can set isReady flag by calling applet_loaded(appletName, loaded); -function applet_loaded(appletName,loaded) { - debug_add("applet reporting that it has been loaded = " + loaded ); - ww_applet_list[appletName].reportsLoaded = loaded; // 0 means not loaded +function applet_loaded(appletName,ready) { + debug_add("applet reporting that it has been loaded = " + ready ); + ww_applet_list[appletName].reportsLoaded = ready; // 0 means not loaded } @@ -209,17 +209,21 @@ var applet = getApplet(appletName); var setConfigAlias = this.setConfigAlias; - try { - if ( this.methodDefined(setConfigAlias) ) { + + try { + if ( this.methodDefined(this.setConfigAlias) ) { applet[setConfigAlias](this.configuration); - } + this.debug_add(" Calling " + appletName +"."+ setConfigAlias +"( " + this.configuration + " ) " ); + } else { + this.debug_add(" unable to execute " + appletName +"."+ setConfigAlias +"( " + this.configuration + " ) " ); + } } catch(e) { var msg = "Error in configuring " + appletName + " using command " + setConfigAlias + " : " + e ; alert(msg); } - this.debug_add(" Calling " + appletName +"."+ setConfigAlias +"( " + this.configuration + " ) " ); + }; @@ -273,11 +277,15 @@ if ( base64Q(state) ) { state=Base64.decode(state); } - - if (state.match(/^<xml>restart_applet<\/xml>/) ) { - alert("The applet " +appletName + "has been reset to its virgin state." + this.initialState); + if (state.match(/^<xml>restart_applet<\/xml>/) || + state.match(/^\s*$/) || + state.match(/^<xml>\s*<\/xml>/ ) ) { + //blank state also restarts applet ww_preserve_applet_state.value =this.initialState; //Fixme? should we set the last answer to blank as well? state = ww_preserve_applet_state.value; + if (state.match(/^<xml>restart_applet<\/xml>/) ) { + alert("The applet " +appletName + "has been reset to its virgin state." + this.initialState); + } } if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state starts with <?xml @@ -398,7 +406,7 @@ eval(this.submitActionScript); //getQE(this.answerBox).value = applet.[getAnswer](); //FIXME -- not needed in general? this.debug_add("Completed submitAction(" + this.submitActionScript + ") \nfor applet " + appletName+ "\n"); - if (this.debugMode){alert(debugText); debugText="";} + if (this.debugMode>=2){alert(debugText); debugText="";} }; @@ -418,13 +426,23 @@ this.debug_add("Test 4 methods to see if the applet " + appletName + " has been loaded: \n"); + try { + if ( this.methodDefined(this.setConfigAlias) ) { + ready = 1; + } + } catch(e) { + var msg = "Unable to find set configuration command in applet " + appletName; + alert(msg); + } - if ( this.methodDefined(this.setConfigAlias) ) { - ready = 1; + try { + if ( this.methodDefined(this.setStateAlias) ) { + ready =1; + } + } catch(e) { + var msg = "Unable to set State command in applet " + appletName; + alert(msg); } - if ( this.methodDefined(this.setStateAlias) ) { - ready =1; - } if (typeof(this.reportsLoaded) !="undefined" && this.reportsLoaded != 0 ) { @@ -449,7 +467,7 @@ return(ready); } ww_applet.prototype.debug_add = function(str) { - if (this.debugMode) { + if (this.debugMode>=2) { debugText = debugText + "\n" +str; // a global text string } } @@ -475,7 +493,7 @@ if ( 0 < i && !applet_loaded ) { // wait until applet is loaded this.debug_add("Applet " + appletName + " is not yet ready try again\n"); - if (this.debugMode) { + if (this.debugMode>=2) { alert(debugText ); debugText=""; } @@ -492,11 +510,11 @@ //alert("setDebug") try{ - this.setDebug(this.debugMode); + this.setDebug((this.debugMode) ? 1:0); } catch(e) { var msg = "Unable set debug in " + appletName + " \n " +e; - if (this.debugMode) {this.debug_add(msg);} else {alert(msg)}; + if (this.debugMode>=2) {this.debug_add(msg);} else {alert(msg)}; } //alert("config applet"); @@ -506,7 +524,7 @@ } catch(e) { var msg = "Unable to configure " + appletName + " \n " +e; - if (this.debugMode) {this.debug_add(msg);} else {alert(msg)}; + if (this.debugMode>=2) {this.debug_add(msg);} else {alert(msg)}; } @@ -517,20 +535,20 @@ } catch(e) { var msg = "unable to initialize " + appletName + " \n " +e; - if (this.debugMode) { + if (this.debugMode>=2) { this.debug_add(msg); } else { alert(msg); } } - if (this.debugMode) { + if (this.debugMode>=2) { alert("\nBegin debugmode\n " + debugText ); debugText=""; }; } else { this.debug_add("Error: timed out waiting for applet " +appletName + " to load"); //alert("4 jsDebugMode " + jsDebugMode + " applet debugMode " +ww_applet.debugMode + " local debugMode " +debugMode); - if (this.debugMode) { + if (this.debugMode>=2) { alert(" in safe applet " + debugText ); debugText=""; } Index: jsMath-easy-load.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath-easy-load.js,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -Lhtdocs/jsMath/jsMath-easy-load.js -Lhtdocs/jsMath/jsMath-easy-load.js -u -r1.1.4.2 -r1.1.4.3 --- htdocs/jsMath/jsMath-easy-load.js +++ htdocs/jsMath/jsMath-easy-load.js @@ -93,6 +93,7 @@ jsMath.Autoload.findCustomSettings = jsMath.Easy.findCustomSettings; jsMath.Autoload.loadFiles = jsMath.Easy.loadFiles; jsMath.Autoload.loadFonts = jsMath.Easy.loadFonts; + jsMath.Autoload.macros = jsMath.Easy.macros; jsMath.Autoload.delayCheck = 1; jsMath.Easy.autoloadCheck = 1; document.write('<script src="'+jsMath.Autoload.root+'plugins/autoload.js"></script>'); @@ -110,12 +111,26 @@ if (!jsMath.Setup) {jsMath.Setup = {}} if (!jsMath.Setup.UserEvent) {jsMath.Setup.UserEvent = {}} jsMath.Setup.UserEvent.onload = function () { - if (jsMath.Easy.tex2math) jsMath.Setup.Script("plugins/tex2math.js"); + var easy = jsMath.Easy; + if (easy.tex2math) jsMath.Setup.Script("plugins/tex2math.js"); var i; - for (i = 0; i < jsMath.Easy.loadFiles.length; i++) - jsMath.Setup.Script(jsMath.Easy.loadFiles[i]); - for (i = 0; i < jsMath.Easy.loadFonts.length; i++) - jsMath.Font.Load(jsMath.Easy.loadFonts[i]); + if (easy.loadFiles) { + for (i = 0; i < easy.loadFiles.length; i++) + jsMath.Setup.Script(easy.loadFiles[i]); + } + if (easy.loadFonts) { + for (i = 0; i < easy.loadFonts.length; i++) + jsMath.Font.Load(easy.loadFonts[i]); + } + if (easy.macros) { + for (i in easy.macros) { + if (typeof(easy.macros[i]) == 'string') { + jsMath.Macro(i,easy.macros[i]); + } else { + jsMath.Macro(i,easy.macros[i][0],easy.macros[i][1]); + } + } + } } document.write('<script src="'+jsMath.Easy.root+'/jsMath.js"></script>'+"\n"); } Index: jsMath.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/jsMath/jsMath.js,v retrieving revision 1.36.2.1.2.3 retrieving revision 1.36.2.1.2.4 diff -Lhtdocs/jsMath/jsMath.js -Lhtdocs/jsMath/jsMath.js -u -r1.36.2.1.2.3 -r1.36.2.1.2.4 --- htdocs/jsMath/jsMath.js +++ htdocs/jsMath/jsMath.js @@ -40,11 +40,11 @@ //start = new Date().getTime(); jsMath.Script.Uncompress([ - ['if(!','window','.jsMath','||!',1,'.','jsMath.','loaded','){var ','jsMath_old','=',1,2,';',0,'document.','getElementById','||!',15,'childNodes||!',15,'createElement','){','alert("','The',' mathematics ','on this page requires W3C DOM support in its JavaScript. Unfortunately, your ','browser',' doesn\'t seem to have this.")}else{',1,2,'={version:"3.6a",document:document,',1,':',1,',','platform',':(','navigator.',36,'.match(/','Mac/)?"mac":',38,36,40,'Win/)?"pc":"unix"),','sizes',':[50,60,70,85,100,120,144,173,207,249],styles:{".math','":{"font-family":"serif","font-style":"normal","font-weight":"normal','"},".typeset',48,'","line-height":"normal','","text-indent":"0px','"},".typeset .','normal',48,'"},"div','.typeset','":{"text-align":"','center",margin:"1em 0px"},"span',57,58,'left',49,' span',58,'left",border',':"0px",margin:"0px','",padding',':"0px"},"a .typeset img, .typeset a img','":{border:"0px','","border-bottom":"','1px solid',' blue;"},".typeset .size0','":{"fon! t-size":"','50','%"},".typeset .','size1',74,'60',76,'size2',74,'70',76,'size3',74,'85',76,'size4',74,'100',76,'size5',74,'120',76,'size6',74,'144',76,'size7',74,'173',76,'size8',74,'207',76,'size9',74,'249',76,'cmr10','":{"font-family":"jsMath-',113,', serif',53,'cmbx10',114,118,', ','jsMath-cmr10',53,'cmti10',114,124,', ',122,53,'cmmi10',114,130,53,'cmsy10',114,134,53,'cmex10',114,138,53,'textit','":{"font-family":"','serif","','font-style":"italic',53,'textbf',143,'serif","font-weight":"bold',53,'link":{"','text-decoration":"none',53,'error',74,'90%","',145,'","background-color','":"#FFFFCC',68,':"1px','",border:"',72,' #CC0000',53,'blank','":{display:"','inline-block','",overflow:"','hidden',162,'0px none",width:"0px",height:"0px',53,'spacer',167,168,'"},"#','jsMath_hiddenSpan":{','visibility:"hidden",position:"absolute",','top:"0px",left:"0px',51,52,177,'jsMath_message','":{position:"fixed",bottom:"','1px",left:"2px',158,'":"#E6E6E6','",border:"solid 1px #959595",margi! n:"0px",padding:"','1px 8px','","z-index":"','102','",color:"b! lack","f ont-size":"','small",width:"auto','"},"#jsMath_panel',185,'1.75em",right:"1.5em',68,':".8em 1.6em',158,'":"#DDDDDD',162,'outset 2px',191,'103",','width:"auto',193,'10pt","font-style":"',54,195,' .disabled":{color:"#888888',195,' .infoLink',74,'85%"},"#jsMath_panel *":{"','font-size":"inherit","font-style":"inherit","font-family":"inherit',51,195,' div":{"','background-color":"inherit",color:"inherit"},"#jsMath_panel ','span":{"',220,'td',70,68,67,'","',220,'tr',70,68,67,'","',220,'table',70,68,67,158,'":"inherit",color:"inherit",height:"auto",',206,177,'jsMath_button',185,'1px",right:"2px',158,'":"white',189,'0px 3px 1px 3px',191,'102",color:"black","',152,'","font-size":"x-',194,'",cursor:"hand"},"#',243,' *":{padding:"0px",border',67,51,'","',216,177,'jsMath_global":{"',145,177,'jsMath_noFont',' .message":{"text-align":"center",padding:".8em 1.6em",border:"3px solid #DD0000","background-color":"#FFF8F8",color:"#AA0000","font-size":"',194,177,'jsMath_noFont .link":{padding:! "0px 5px 2px 5px',162,'2px outset',158,'":"#E8E8E8',193,'80%",',206,255,'jsMath_PrintWarning',267,'x-',194,'"},"@media print":{"#',243,167,'none',177,'jsMath_Warning',167,'none"}},"@media screen":{"#',279,167,'none"}}},Element',':function(','A','){return ',6,15,16,'("jsMath_"+A)},','BBoxFor',294,'A','){this.','hidden.innerHTML','=\'<nobr><','span class="','typeset"><',307,'scale">\'+A+"</span></span></nobr>";var B={w:this.',170,'.offsetWidth',',h:this.',170,'.offsetHeight','};this.',305,'="";return B},EmBoxFor',294,'B){var A=',6,'Global.cache.R;if(!A[this.em]){A[this.em]={}}if(!A[this.em][B]){var C=this.BBoxFor(B);','A[this.em][B]={w:C.w/this.em,h:C.h/this.em}}return A[this.em][B]},','EmBoxForItalics',294,320,6,322,'if(B.match(/<i>|class=\\"(icm|italic|igreek|iaccent)/i)){C.w=C.Mw=','this.BBoxFor','(B+',6,'Browser.','italicString',').w-',6,333,'italicCorrection','}',323,'Init',':function(){','if(',6,'Setup.inited','!=1){',0,6,345,'){',6,'Setup.','Body()}if(',6,345,'!=1){if(! ',6,345,'==-100','){return }',23,'It looks like jsMath failed ! to set u p properly (error code "+',6,345,'+"). I will try to keep going, but it could get ugly.");',6,345,'=1}}this.em=this.CurrentEm();','var A=',6,'Global.cache','.B;',0,'A[this.em]){A[this.em]={};','A[this.em].','bb=',330,'("x");var C=',375,'bb.h;',375,'d=',330,'("x"+',6,'HTML.Rule(1,','C/',6,'em)).h-C;if(',6,333,334,'){',375,'ic=',6,301,'(',6,333,334,').w}}',6,333,338,'=',375,'ic;var F=',375,'bb;var D=F.h;var E=',375,'d;this.h=(D-E)/this.em;this.d=E/this.em;this.hd=this.h+','this.d;this.',352,'TeXfonts','();var B=this.EmBoxFor(\'<',307,113,'">M</span>\').w/2;this.TeX.M_height=B*(26/14);this.TeX.h=this.h;this.TeX.d=',413,'TeX.hd=this.hd;this.Img.Scale();',0,'this.initialized',304,352,'Sizes','();this.','Img.UpdateFonts()}this.p_height=(','this.TeX.cmex10[0].','h+',429,'d)/0.85;',423,'=1},ReInit',342,'if(this.','em!=this.CurrentEm()){this.Init()}},CurrentEm',342,369,330,'(\'<span style="\'+',6,333,'block+\';','width:13em;height:1em','"></span>\').','w/13;if(A>0',296,'A}return ',3! 30,'(\'<img src="\'+',6,166,'+\'" style="',445,'"/>\').w/13},Loaded',342,'if(',9,8,'B=["Process","ProcessBeforeShowing","ConvertTeX","ConvertTeX2","ConvertLaTeX","ConvertCustom","CustomSearch","Synchronize","Macro","document"];','for(var A=0;A<','B','.length;A++){','if(',9,'[B[A]]){','delete ',9,'[B[A]]}}}if(',9,304,'Insert(jsMath,',9,')}',9,'=null;',6,7,'=1},Add',294,'C,A){for(var B in A){','C[B]=A[B]}},Insert',294,482,'if(C[B]&&typeof (A[B])=="object"&&(','typeof (C[B])=="','object"||',487,'function")){this.Insert(C[B],A[B])}else{C[B]=A[B]}}},Package',294,'B,A',304,'Insert(B.prototype,A)}};',6,'Global={isLocal:1,cache:{','T:{},D:{},R:{},B',':{}},ClearCache',342,6,371,'={',497,':{}}},GoGlobal',294,320,'String(',6,1,'.','location);var C','=(',6,'isCHMmode','?"#":"?");if(B){A=A.replace(/\\?.*/,"")+"?"+B}',6,'Controls.','Reload(',6,'root+"jsMath-','global.html"+C+escape(A))},Init',342,'if(',6,'Controls.cookie.','global=="always"&&!',6,'noGoGlobal','){if(',38,'accentColorName'! ,360,0,6,1,'){',6,1,'=',1,'}',6,517,7,'=1;',6,517,'defaults.hi! ddenGlob al=null;this.GoGlobal(',6,517,'SetCookie(2))}},Register',342,369,6,1,'.parent;',0,6,'isCHMode){',6,514,'=(',6,1,'.','location.','protocol=="mk:")}try{',0,6,514,304,'Domain()}if(A',2,'&&A.',6,'isGlobal){A.',6,'Register(',6,1,')}}catch(B){',6,528,'=1}},Domain',342,'if(',38,'appName=="Microsoft Internet Explorer"&&',6,36,'=="mac"&&',38,'userProfile','!=null',360,'if(',1,'==parent',360,'var B=',6,15,'domain',';try{while(true){try{if(parent.',15,'title',594,'){return }}','catch(A){}',0,15,603,'.match(/\\..*\\./)){break}',6,15,603,'=',6,15,603,'.replace(/^[^.]*\\./,"")}}',609,6,15,603,'=B}};',6,'Script={request:null,Init',342,'if(!(',6,525,'asynch&&',6,525,'progress',')){if(',1,'.XMLHttpRequest','){try{','this.request','=new XMLHttpRequest}catch(C){}if(',641,'&&',6,'root.match','(/^file:\\/\\//)){try{',641,'.open("GET",',6,'root+"',6,'js",false);',641,'.send(null)}catch(','C){',641,'=null;if(',1,'.postMessage&&',1,'.addEventListener',304,'mustPost','=1;',6,1,662,'("message",',6,'P! ost.','Listener,false)}}}}',0,641,'&&',1,'.ActiveXObject&&!this.',664,8,'A=["MSXML2.XMLHTTP.5','.0","MSXML2.XMLHTTP','.4',681,'.3',681,'","Microsoft.XMLHTTP"];','for(var B=0;B<','A.length&&!',641,';B++){try{',641,'=new ActiveXObject(A[B])}catch(C){}}}}',0,641,'||',6,352,'domainChanged',304,'Load=this.delayedLoad;this.needsBody=1}},Load',294,'B,A){','if(A){',6,'Message.Set("Loading "+','B);',6,'Script.','Delay(1);',6,'Script.Push(','this,"xmlRequest",B',');',6,711,6,'Message',',"Clear")}else{',6,711,712,')}},xmlRequest',294,'url){','this.blocking','=1;try{',641,649,'url,false);',641,655,'err){',725,'=0;if(',6,'Translate.','restart&&',6,'Translate.asynchronous){return""}throw"jsMath can\'t load the file \'"+url+"\'\\','nMessage: "+err.message}if(',641,'.status',594,'&&(',641,742,'>=400||',641,742,'<0)){',725,'=0;if(',6,736,'restart&&',6,739,'nError status: "+',641,742,'}',0,'url','.match(/\\.js$/)){','return(',641,'.responseText',')}var tmpQueue','=this.queue;this.queue','=[]! ;',6,1,'.eval(',641,767,');',725,'=0;','this.queue=this.queue.! concat(' ,'tmpQueue);this.Process();return""},cancelTimeout:30*1000,blocking:0,cancelTimer:null,needsBody:0,queue:[],Synchronize',294,'A,B){','if(typeof (','A)!="string"){',6,711,'null,A,B',')}else{',6,711,6,1,',"eval",A)}},Push',294,'A,C,B',304,'queue[','this.queue.length',']=[A,C,B];if(!(',725,'||(this.needsBody&&!',6,15,'body))){this.Process()}},Process',342,'while(',798,'&&!',725,8,'C=this.queue[0];this.queue=this.queue.slice(1);',369,'this.SaveQueue();var B=C[0];var E=C[1];var D=C[2];if(B){B[E](D',788,'if(E){E(D)}}this.','RestoreQueue','(A)}},SaveQueue',342,'var A',769,'=[];return A},',816,294,'A){',779,'A)},delayedLoad',294,'A',304,'Push(','this,"','startLoad','",A)},',832,294,'A',8,'B=',6,15,21,'("iframe");','B.style.','visibility="','hidden";',843,'position="absolute";',843,'width="0px";B','.style.height="','0px";if(',6,15,'body.firstChild','){',6,15,'body.insertBefore(B,',6,15,854,788,6,15,'body','.appendChild(','B)}',725,'=1;this.','url=A;if(A','.substr(0,',6,'root.length',! ')==',6,'root){A=A.substr(',6,873,')}',6,705,'A);this.cancelTimer=setTimeout("',6,708,'cancelLoad','()",this.cancelTimeout);',436,664,'){B.src=',6,671,832,'(A,B',788,'if(A',764,'B.src=',6,520,'loader.html"}else{B.src=this.url}}},','endLoad',294,'A){if(this.cancelTimer){clearTimeout(this.cancelTimer);this.cancelTimer=null}',6,671,901,'();',6,717,'.Clear();if(A!="cancel"){',725,'=0;this.Process','()}},Start',342,'this.tmpQueue',769,'=[]},End',342,779,915,');',468,915,'},',885,294,'B,',903,'if(B==null){B','="Can\'t load file"}if(A==null){A=2000}',6,717,'.Set(B);setTimeout(\'',6,708,901,'("cancel")\',A)},Delay',294,'A){',725,'=1;setTimeout("',6,708,'endDelay','()",A)},',944,342,725,912,'()},','imageCount',':0,WaitForImage',294,'B){',725,869,951,'++;',436,'img==null',304,'img=[]}',369,'new Image',427,'img[this.img.length]=A;A.onload=function(){if(--',6,708,951,'==0){',6,708,944,'()}};A.onerror=A.onload;A.onabort=A.onload;A.src=B},Uncompress',294,'data){for(var k=0;k<data.length;! k++){var d=data[k];var n=d.length;for(var i=0;i<n;i++){',783,'! d[i])==" number"){d[i]=d[d[i]]}}data[k]=d.join("")}',1,773,'data.join(""))}};',6,'Post={',1,':null,Listener',294,'D){if(D.source!=',6,671,1,360,'var E=D.origin','.replace(/^file:\\/\\//,"");',369,15,603,993,'if(E==null||E==""){E','="localhost"}if(','A==null||A==""){A',999,'E!=A||!','D.data.substr(','0,6).match(/jsM(CP|LD):/)){return }var B=',1003,'6,3).replace(/ /g,"");var C=',1003,'10);if(',6,'Post.Commands[B',']){(',6,1010,'])(C)}},Commands:{SCR',294,'message){',6,1,773,'message)},ERR',294,'A){',6,708,885,'(A,3000)},BGN',294,'A){',6,708,'Start()},END',294,'A){',703,6,708,'End()}',6,708,901,'()}},',832,294,'A,B',304,1,'=B.contentWindow;',0,'A',764,'return ',6,'root+',449,6,520,'loader-post.html?"+A},',901,342,'this.',1,'=null}};',6,717,'={',166,':null,message:null,text:null,clear:null,Init',342,0,6,15,'body||!',6,525,636,360,'if(',6,352,'stylesReady){','this.message','=',6,'Setup.DIV("','message",{visibility:"',170,'"},',6,'fixedDiv',788,1081,'=',6,1084,'message",{',179,'bottom:"',1! 86,'",','backgroundColor',':"#E6E6E6',189,190,'",zIndex:102,color:"black",fontSize:"',194,'"},',6,1089,')}','this.text','=',6,15,'createTextNode','("");',1081,866,1110,');',1081,'.onmousedown=',6,736,'Cancel},Set',294,702,'if(this.clear){clearTimeout(this.clear',');this.clear=null}if(',6,525,636,'){',0,1110,304,'Init();',0,1110,608,'if(',6,333,'textNodeBug','){',1081,'.innerHTML','=B','}else{',1110,'.nodeValue','=B}','this.message.style.',844,'visible";',703,1152,'cursor="pointer','";',0,1152,'cursor){',1152,'cursor="hand"}',1081,'.title=" Cancel Processing of Math "}else{',1152,'cursor="";',1081,'.title=""}}else{if(B',871,'8)!="Loading "){',6,1,742,'=B}}},Clear',342,1127,')}this.clear=setTimeout("',6,717,'.doClear()",1000)},doClear',342,436,'clear',304,'clear=null;',6,1,742,'="";',436,'text){',1110,1150,'=""}if(',1081,'){',1152,844,170,'"}}},Blank',342,436,166,'||!',6,15,'body',360,'this.blank','=',6,1084,166,'",{position',':(',6,333,'msiePositionFixedBug','?"absolute":"fi! xed"),',180,'",bottom:"0px",right:"0px",zIndex:101,',1100,':"w! hite"},' ,6,1089,');if(',6,333,'msieBlankBug){',1210,1146,'=" ";',1210,'.style.width="110%";',1210,850,'110%"}},UnBlank',342,436,166,'){',6,15,'body.removeChild(',1210,')}',1210,'=null}};',6,'Setup={',7,':[],DIV',294,'E,C,B){',929,'=',6,15,'body}var D=',6,15,21,'("div");D.id="jsMath_"+E;','for(var A in C){','D.style[A]=C[A]}',0,'B.hasChildNodes){B',866,'D',788,'B.insertBefore(D,','B.firstChild',')}return D},Script',294,702,436,7,'[B]){return }else{this.',7,'[B]=1}',0,'B.match("^([a-zA-Z]+:/?)?/")){B=',6,'root+B}',6,708,'Load(B,A)},Hidden',342,6,170,'=this.DIV("Hidden",{',179,'top:0,left:0,border:0,padding:0,margin:0});',6,'hiddenTop=',6,170,';return },Source',342,'if(',6,'Autoload','&&',6,1303,'.root){',6,'root=',6,1303,'.','root}else{',6,'root="";',369,6,15,'getElementsByTagName("','script");',703,687,'A.','length;B++){','var D=A[B].src;if(D&&D.match("(^|/|\\\\\\\\)',6,'js$")){',6,1309,'D.replace','(/',6,'js$/,"");break}}}}if(',6,'root.charAt(','0)=="\\\\"){',6,1309,6,'root.rep! lace','(/\\\\/g,"/")}if(',6,1335,'0)=="/"){if(',6,1335,'1)!="/"){if(',6,15,566,'port){',6,'root=":"+',6,15,566,'port+',6,'root}',6,'root="//"+',6,15,566,'host+',6,1359,6,1309,6,15,566,'protocol+',6,1313,0,6,646,'(/^[a-z]+:/i)){var D=','new String(',6,15,511,'=new RegExp("/[^/]*/\\\\.\\\\./");',6,1309,1330,'(new RegExp("[^/]*$"),"")+',6,'root;while(',6,646,'(C)){',6,1309,6,1340,'(C,"/")}}}',6,'Img.',1309,6,651,'fonts/";',6,166,'=',6,651,166,'.gif";this.Domain()},Domain',342,'try{',6,15,603,'}catch(D',360,'var C="";',369,6,15,603,';if(',6,646,'("://([^/]*)/")){C=RegExp.$1}C=C.replace(/:\\d+$/,"");if(C==""||C==A',360,'if(',38,'appName=="Microsoft Internet Explorer"&&',6,36,'=="mac"&&',38,'onLine&&',38,593,'&&',6,15,'all',360,'C=C.split(/\\./);A=A.split(/\\./);if(C.length<2||A.length<2||','C[C.length-','1',']!=A[A.length-','1]||',1445,'2',1447,'2]){this.','DomainWarning','();return }var E=',1445,'2]+"."+',1445,'1];for(var B=3;B<=C.length&&B<=A.',1324,'if(',1445,'B',1447,'B]){br! eak}E=',1445,'B]+"."+E}',6,15,603,'=E;this.',698,'=1},',1453,3! 42,23,'I n order for jsMath to be able to load the additional components that it may need, the ',6,'js file must be ',7,' from a server in the same ',603,' as the page that contains it. Because that is not the case for this page, the',25,'displayed here may not appear correctly.")},','EncodeFont',294,'C',8,'B=',6,'TeX[C];if(B','[0].c',594,360,462,'128;A++){var D=B[A];B[A]=D[3];if(B[A]==null){B[A]={}}B[A].w=D[0];B[A].h=D[1];if(D[2]!=null){B[A].d=D[2]}B[A].c=',6,'TeX.encoding[A]}},Fonts',342,687,6,'TeX.fam','.',1324,369,6,1502,'[B];if(A',304,1485,'(A)}}},TeXfont',294,'C',8,'B=',6,1491,'==null',360,369,6,'EmBoxFor(\'<span class="\'+C+\'">\'+B[65].c','+"</span>");B.hd=A.h;B.dh=0.05;B.d=',6,1522,'+',6,386,'B.hd)+"</span>").h-B.hd;B.h=B.hd-B.d;if(C=="',130,'"){B.skewchar=','127','}else{if(','C=="',134,1531,'48}}},',415,342,462,6,1502,464,'if(',6,1502,'[A]){this.TeXfont(',6,1502,'[A])}}},Sizes',342,6,'TeXparams','=[];var B;var A;for(A=0;A<',6,46,464,6,1553,'[A]={}}for(B in ',6,'TeX){',783,! 6,'TeX[B])!="object"){for(A=0;A<',6,46,464,6,1553,'[A][B]=',6,46,'[A]*',6,'TeX[B]/100}}}},Styles',294,'A){',0,'A){A=',6,'styles;A[".typeset .scale"]={"font-size":',6,525,'scale+"%"};this.stylesReady=1}',6,711,831,'AddStyleSheet','",A);if(',6,333,'styleChangeDelay','){',6,711,6,'Script,"Delay",1)}},StyleString',294,'E',8,'A={},F;for(F in E){if(typeof E[F]==="string"){A[F]=E[F]}else{if(F',871,'1)==="@"){A[F]=','this.StyleString(','E[F])}else{if(E[F]!=null',8,'D=[];for(var C in E[F]){if(E[F][C]!=null){D[D.length]=C+": "+E[F][C]}}A[F]=D.join("; ")}}}}var B="";for(F in A){B+=F+" {"+A[F]+"}\\n"}return B},',1589,294,'D',8,'B=',6,15,1319,'head")[0];',369,1605,'D);if(',6,15,'createStyleSheet){B.insertAdjacentHTML("beforeEnd",\'<','span style="display:','none">x</span><style type="text/css">\'+A+"</style>")}else{var C=',6,15,21,'("style");C.type="text/css";C',866,6,15,1114,'(A));B',866,'C)}},Body',342,436,'inited',360,'this.inited=-','1;',6,352,'Hidden();',1641,'2;',6,333,1136,1641,'! 3;if(',6,525,166,'){',6,717,'.Blank()}',1641,'4;',6,352,'Style! s();',16 41,'5;',6,517,1136,1641,'6;',6,711,6,'Setup,"User","pre-font");',1641,'7;',6,711,6,'Font,"Check");if(',6,'Font.register.length){',6,711,6,'Font,"LoadRegistered")}this.inited=1},User',294,'A){if(',6,'Setup.UserEvent[A',']){(',6,1691,'])()}},UserEvent:{"pre-font":null,onload:null}};',6,'Update={',415,294,'D){for(var A in D){for(var B in D[A]){for(var C in D[A][B]){',6,'TeX[A][B][C]=D[A][B][C]}}}},TeXfontCodes',294,'C){',1265,687,'C[A].',1324,6,'TeX[A][B].c=C[A][B]}}}};',6,'Browser={allowAbsolute:1,allowAbsoluteDelim:0,','separateSkips',':0,valignBug:0,operaHiddenFix:"",','msieCenterBugFix',':"",','msieInlineBlockFix',':"",msieSpaceFix:"",imgScale:1,renameOK:1,',1593,':0,delay:1,version:0,','TestSpanHeight',342,6,305,'=\'<span><','span style="\'+this.block','+\';height:2em;width:','1px"></span></span>\';var B=',6,'hidden.firstChild;',369,1273,';this.','spanHeightVaries','=(B',315,'>=A',315,'&&B',315,'>0);','this.spanHeightTooBig','=(B',315,'>A',315,');',6,305,'=""},','TestInlin! eBlock',342,'this.block="display',':-','moz-inline-box";','this.hasInlineBlock','=',6,'BBoxFor(\'<span style="\'+this.block','+\';width:10px;height:5px"></span>\').w>0;if','(',1756,'){',6,'styles[".typeset',' .',166,'"].display="-',1755,468,6,1765,' .spacer"].display',1148,1753,':',168,'";',1756,'=',6,1759,1760,'(!',1756,608,'this.block+=";overflow:',845,369,6,301,'("x").h;this.mozInlineBlockBug=',6,1759,'+";height:"+A+\'px;width:1px','"></span>x','<',1726,'+";height:"+A+"px;width:1px;vertical-align:-"+A+\'px',446,'h>2*A;this.widthAddsBorder=',6,1759,'+\';overflow:',170,';height:1px;width:10px',';border-left:','10px solid',446,'w>10;','this.msieBorderBug','=',6,1759,1795,1796,'\').h!=',6,1759,1795,1807,72,1796,'\').h;','this.blankWidthBug=',1811,'||',6,1759,1727,'0px',446,'h==0},','TestRenameOK',342,6,305,'="<span></span>";',369,6,1730,'A.setAttribute("name","','jsMath_test','");this.renameOK=(',6,15,'getElementsByName("',1843,'").length>0);',6,305,1750,'TestStyleChange',34! 2,6,305,'=\'<span ID="',1843,'">x</span>\';var B=',6,1730,369,! 'B',312, ';',6,352,1589,'({"#',1843,'":"font-size:200%"});this.',1593,'=(B',312,'==A);',6,305,1750,'VersionAtLeast',294,320,1380,'this.version).split(".");B=',1380,'B).split(".");if(B[1]==null){B[1]="0"}return A[0]>B[0]||(A[0]==B[0]&&A[1]>=B[1])},Init',342,6,27,'="unknown";this.',1751,427,1721,427,1834,427,1853,427,'MSIE',427,'Mozilla',427,'Opera',427,'OmniWeb',427,'Safari',427,'Konqueror();if(','this.allowAbsoluteDelim','){',6,'Box.DelimExtend=',6,'Box.DelimExtendAbsolute;',6,'Box.Layout=',6,'Box.LayoutAbsolute',1148,6,'Box.DelimExtend=',6,'Box.DelimExtendRelative;',6,'Box.Layout=',6,'Box.LayoutRelative}',436,1713,'){',6,'HTML.Place=',6,'HTML.','PlaceSeparateSkips',';',6,'Typeset.prototype.','Place=',6,1938,1935,'}},MSIE',342,436,1734,'&&!',1742,'){',6,27,'="MSIE";if(',6,36,'=="pc"){this.','IE7=(',1,639,594,');','this.quirks','=(',6,15,'compatMode=="BackCompat");this.msieStandard6=!',1961,'&&!this.IE7;',1909,869,1713,'=1',';this.buttonCheck=1;this.','msieBlankBug=1;this.','msieAccen! tBug',869,'msieRelativeClipBug','=1;this.msieDivWidthBug=1;this.',1219,869,'msieIntegralBug',869,'waitForImages',869,'msieAlphaBug','=!this.IE7;this.','alphaPrintBug',1985,1715,'="position:relative; ";this.',1717,'=" display:',168,';";this.msieTeXfontBaselineBug=!',1961,';',1811,'=',1825,'1;this.msieSpaceFix=\'<',1624,168,'"></span>\';',6,'Macro("joinrel","\\\\mathrel{\\\\kern-5mu}"),',6,'Parser.prototype.mathchardef.','mapstocharOrig','=',6,2006,'mapstochar;',468,6,2006,2011,6,'Macro("mapstochar","\\\\rlap{\\\\',2007,'\\\\,}\\\\kern1mu"),',6,1765,' .arial"]={"font-family":"\'Arial unicode MS\'"};',0,'this.IE7||',1961,'){',6,'styles["#jsMath_message"].',847,468,6,2028,'width;',6,'styles["#jsMath_panel"].',847,468,6,2035,'width;',6,'styles["#jsMath_button"].','width="1px";',6,2042,847,468,6,2042,'width;',6,1089,'=',6,1084,1089,1215,':"absolute",zIndex:101});',6,1,'.attachEvent("','onscroll",',6,'Controls.MoveButton',');',6,1,2061,'onresize",',6,2064,');',6,2064,'()}',6,'styl! es["#jsMath_noFont .link"].','display="',168,'";',468,6,1765,1! 773,';', 6,'styles[".tex2math_div','"]={};',6,'Add(',6,2087,'"],',6,'styles["div',57,'"]);',6,2087,'"].width="100%";',6,2087,'"].',2078,168,'";',6,1765,'"]["letter-spacing"]="0";if(','screen.deviceXDPI','&&','screen.logicalXDPI','&&',2110,'!=',2112,304,'imgScale*=',2112,'/',2110,';',6,525,'alpha=0}this.',334,'="<i>x</i>";',6,'EmBoxFor=',6,324,1533,6,36,'=="mac"){this.msieAbsoluteBug',869,'msieButtonBug',1977,1973,'quirks=1;',6,'Setup.Script("jsMath-','msie-mac.js");',6,'Parser.prototype.macros.angle=["Replace","ord",\'<font face="Symbol">‹</font>\',"',54,'"];',6,2035,'width="42em";',6,525,'printwarn=0}}',6,'Macro("not","\\\\mathrel{\\\\rlap{\\\\kern3mu','/}}")}},',1900,342,'if(',6,170,'.ATTRIBUTE_NODE){',6,27,'="',1900,'";if(',6,36,1955,1986,'=1}',1909,'=1;',6,2042,'cursor=',6,2077,1157,'",',6,2155,'/}}");if(',38,'vendor=="Firefox"){','this.version=',38,'vendorSub',1533,38,'userAgent.match','(" Firefox/([0-9.]+)([a-z ]|$)")){',2187,'RegExp.$1}}',436,1879,'("3.0")){this.mozImageS! izeBug=1}}},',1904,342,'if(',38,'accentColorName){',6,27,'="',1904,'";','this.allowAbsolute','=',1756,';',1909,'=',2209,';this.valignBug=!',2209,1972,1143,'=1;',6,'noChangeGlobal=1;',0,1756,'){',6,2142,'old-browsers.js','")}}},Opera',342,'if(',1742,'){',6,27,'="Opera";var B=',38,2192,'("Opera 7");',2209,'=0;this.delay=10;this.operaHiddenFix="[Processing]";if(B){',6,2142,2228,'")}',369,38,'appVersion.match(/^(\\d+\\.\\d+)/);',703,2187,'A[1]}else{this.vesion=0}this.operaAbsoluteWidthBug=this.operaL'], - ['ineHeightBug=(A[1]>=9.5)}},Safari',':function(){','if(navigator.','appVersion.match(/Safari\\//)){','jsMath.','browser','="Safari";','var A=','navigator.userAgent.match','("Safari/([0-9]+)");A=(A)?A[1]:400;this.version=A;','for(var B=0;B<',4,'TeX.fam','.length',';B++){','if(',4,12,'[B]&&',4,'TeX[',4,12,'[B]]){',4,20,4,12,'[B]].dh=0.1}}',4,'TeX.axis_height+=0.05;',4,'TeX.','default_rule_thickness','+=0.025',';this.allowAbsoluteDelim=','A>=125;this.safariIFRAMEbug=A>=312&&A<412;this.safariButtonBug=A<412;this.safariImgBug=1;this.textNodeBug=1;this.buttonCheck=A<500;this.styleChangeDelay=1}},','Konqueror',1,2,'product&&navigator.product.match("',37,'")){',4,5,'="',37,'";this.allowAbsolute=0',35,'0;if(',8,'(/',37,'\\/(\\d+)\\.(\\d+)/)){if(RegExp.$1<3||(RegExp.$1==3&&RegExp.$2<3)){this.separateSkips=1;this.valignBug=1;',4,'Setup.Script("jsMath-','old-browsers.js")}}',4,'Add(',4,'styles,{".typeset .cmr10','":"font-family: jsMath-','cmr10',', jsMath ','cmr10, serif','",".types! et .','cmbx10',61,66,63,66,', jsMath-cmr10, jsMath cmr10",".typeset .','cmti10',61,72,63,72,71,'cmmi10',61,78,63,78,65,'cmsy10',61,84,63,84,65,'cmex10',61,'cmex10, jsMath cmex10','"});',4,'Font.testFont','="jsMath','-',92,'"}}};',4,'Font={testFont:"jsMath-cmex10",','fallback',':"symbol",register:[],message:"<b>No jsMath TeX fonts found</b> -- using',' image fonts instead','.<br/>\\nThese',' may be slow and might not print well.<br/>\\nUse the jsMath control panel to get additional information','.",','extra_message',':\'Extra TeX fonts not found: <b><span id="jsMath_ExtraFonts"></span></b><br/>Using',104,'. This',106,'.\',','print_message',':"To print higher-resolution math symbols, click the<br/>\\n<b>Hi-Res Fonts for Printing</b> button on',' the jsMath control panel.<br/>\\n",','alpha_message',':"If the math symbols print as black boxes, turn off <b>image alpha channels</b><br/>\\nusing the <B>Options</B> pane of',116,'Test1',':function(','C',',F,D,E){if(F==null){F=124}i! f(D==null){D=2}if(E==null){E=""}var B=jsMath.BBoxFor(\'<span s! tyle="fo nt-family: \'+E+C+\', serif">\'+jsMath.TeX[C][F].c+"</span>");var A=jsMath.BBoxFor(\'<span style="font-family: serif">\'+jsMath.TeX[C][F].c+"</span>");return','(B.w>D*A.w&&B.h!=0)},Test2',121,'C',123,'(A.w>D*B.w&&B.h!=0)},CheckTeX',1,7,4,'BBoxFor(\'<span style="font-family',': \'+',4,95,'+\', serif">\'+',4,'TeX.cmex10[1','].c+"</span>");',4,'nofonts=((A.w*3>A.h||A.h==0)&&!this.Test1("cmr10','",null,null,"jsMath-"));if(!',4,'nofonts){','return }if(',4,5,'!="Mozilla"||(',4,'platform','=="mac"&&(!',4,'Browser.VersionAtLeast(','1.5)||',4,153,'3)))||(',4,150,'!="mac"&&!',4,153,'3))){A=',4,132,': CMEX10, serif">\'+',4,'TeX.cmex10[1',139,4,141,'"));if(!',4,144,4,55,'BaKoMa-fonts.js")}}},Check',1,7,4,'Controls.','cookie;this.CheckTeX();if(',4,144,'if(A.autofont','||A','.font=="tex"){','A.font=this.',102,';if(A.warn){',4,'nofontMessage=1;A.warn=0;',4,181,'SetCookie(0);if','(',4,'window.NoFontMessage','){',4,198,'()}else{','this.Message(this.','message)}}}}else{',185,'){A.font="tex"}i! f(A',187,'return }}if(',4,'noImgFonts){','A.font="unicode"}if(A','.font=="unicode','"){',4,55,102,'-"+',4,150,'+".js");',4,'Box.TeXnonfallback=',4,'Box.TeX',';',4,224,'=',4,'Box.TeXfallback;return }','if(!A.print&&A.printwarn){this.','PrintMessage','((',4,'Browser.','alphaPrintBug&&',4,181,'cookie.alpha)?this.',114,'+this.',117,':this.',114,')}if(',4,235,'waitForImages){',4,'Script.','Push(',4,'Script,"WaitForImage",',4,'blank)}if(A.font=="symbol"){',4,55,102,'-symbols.js");',4,'Box.TeXnonfallback=',4,224,';',4,224,'=',4,230,4,'Img.SetFont','({cmr10',':["all"],',78,273,84,273,'cmex10',273,66,273,72,':["all"]});',4,'Img.LoadFont','("cm-fonts")},Message',121,'A){if(',4,'Element("Warning',42,'return }var ','B=',4,'Setup.DIV("','Warning','",{});B.innerHTML=\'<center><table><tr><td><div ','id="jsMath_noFont"><div ','class="message">\'+A','+\'<div style="text-align:left"><span style="float:left; margin: 8px 0px 0px 20px"><span onclick="',4,181,'Panel()" ','title=" Open ','the ','! jsMath Control Panel',' " class="link">',306,'</span></span','! ><span s tyle="margin: 8px 20px 0px 0px; float:right"><span onclick="',4,'Font.','HideMessage','()" title=" Remove this font warning message',307,'Hide this Message',309,'></div><div style="height:6px"></div><br clear="all"/></div></','div><div style="width:22em; height:1px"></div></td></tr></table></center><hr/>\'},',313,1,7,4,290,'");if(A','){A.style.display="none"}},',232,121,288,4,'Element("','PrintWarning',42,292,'B=',4,295,332,297,299,'+\'</',319,'Register',121,'H,B){if(typeof (H)=="string"){H={name:H}}if(!',4,'Setup.inited','&&!B){','this.register','[',349,13,']=H;',292,'I=H.name;',7,'I.replace(/10$/,"");var F=',4,12,13,';if(H.prefix==null){H.prefix=""}if(!H.style){H.style="font-family: "+H.prefix+I+", serif"}if(!H.styles){H.styles={}}if(!H.macros){H.macros={}}',4,12,'[F]=I;',4,'TeX.famName[I]=F;H.macros[A]=["HandleFont",F];',4,58,4,'Parser.prototype.macros,H.macros);H.styles[".typeset ."+I]=H.style;',4,'Setup.Styles(H.styles);if(',4,'initialized){',4,250,'Push(',4,'Setup,"TeX! font",I)}var C=',4,181,'cookie;var E=!',4,'nofonts&&H.test(I,H.testChar,H.testFactor,H.prefix);if(E&&C',187,'if(H.tex){H.tex(I,F,H)}return }if(!E&&C.warn&&C.font=="tex"&&!',4,144,'if(!C.fonts.match("/"+I+"/")){C.fonts+=I+"/";',4,181,195,'(!',4,290,42,203,108,')}var G=',4,331,'ExtraFonts");if(G){if(G','.innerHTML','!=""){G',403,'+=","}G',403,'+=" "+H.prefix+I}}}if(C',212,'"||',4,210,'if(H.',102,'){H.',102,'(I,F,H)}',292,'D={};if(C.font=="symbol"&&H.symbol!=null){D[I]=H.symbol(I,F,H)}else{D[I]=["all"]}',4,271,'(D);',4,285,'(I);if(',4,'initialized){',4,250,'Push(',4,'Img,"Scale");',4,250,'Push(',4,'Img,"UpdateFonts")}},LoadRegistered',1,7,'0;while(A<',349,13,'){this.Register(',349,'[A++],1)}',349,'=[]},Load',121,'A){',4,'Setup.Script(this.URL(A))},URL',121,'A){','return ',4,'Img.root+A+"/def.js"}};',4,'Controls={cookie:{scale:100,font:"tex",autofont:1,scaleImg:0,alpha:1,warn:1,fonts:"/",printwarn:1,stayhires:0,button:1,progress:1,asynch:0,blank:0,print:0,keep:"0D",global:"auto! ",hiddenGlobal:1},cookiePath:"/",','noCookiePattern',':/^(file! |mk):$/, Init',1,'this.panel=',4,295,'panel",{display:"none"},',4,'fixedDiv);','if(!',4,235,'msieButtonBug){this.Button',202,'setTimeout("',4,181,'Button()",500)}},Panel',1,4,'Translate.Cancel();if(this.loaded){this.Main',202,4,250,'delayedLoad(',4,'root+"jsMath-controls.html")}},Button',1,7,4,295,'button",{},',4,467,'A.',304,306,' ";A',403,'=\'<span onclick="',4,181,'Panel()">jsMath</span>\';if(!',4,'Global.','isLocal&&!',4,'noShowGlobal){A',403,'+=\'<span id="jsMath_global" ',304,'jsMath Global Panel " onclick="',4,503,'Show(1)">Global </span>\'}if(A.offsetWidth<30){A.style.width="auto"}if(!','this.cookie','.button',326,'MoveButton',1,4,'fixedDiv.style.','left','=document.body.','scrollLeft+"px";',4,520,'top',522,'scrollTop+"px";',4,520,'width',522,'clientWidth+"px";',4,520,'height',522,'clientHeight+"px"},GetCookie',1,'if(','this.defaults','==null){',541,'={}}',4,58,541,',',514,');this.userSet={};var C=',4,'document.cookie',';if(',4,'window.location','.protocol.match(this.',4! 59,')){C=this.','localGetCookie','();','this.isLocalCookie','=1}if(','C.match(/jsMath','=([^;]+)/)){var D=unescape(RegExp.$1).split(/,/);',10,'D',13,14,7,'D[B].match(/(.*):(.*)/);if(A[2].match(/^\\d+$/)){A[2]=1*A[2]}',514,'[A[1]]=A[2];this.userSet[A[1]]=1}}},',559,1,454,4,555,'.search.substr(1)},SetCookie',121,'F){var B=[];for(var E in ',514,'){if(',541,'[E]==null||',514,'[E]!=',541,'[E]){B[B',13,']=E+":"+',514,'[E]}}B=B.join(",");if(',561,'){if(F==2){return"','jsMath="+escape(B)}','this.','localSetCookie','(B,F)}else{B=escape(B);if(B==""){F=0}if(','this.cookiePath','){B+="; path="+',599,'}if(','this.cookieDomain','){B+="; domain="+',603,'}if(',514,'.keep!="0D"){var A={D',':1000*60*60*24',',W',609,'*7,M',609,'*30,Y',609,'*365};var D=new Date;D.setTime(D.getTime()+',514,'.keep.substr(','0,1)*A[',514,618,'1,1)]);B+="; expires="+D.toGMTString()}if(B!=""){',4,552,96,'="+B;var C=',4,552,';if(F&&!',563,'=/)){alert("Cookies must be enabled in order to save jsMath options")}}}',454! ,'null},',597,121,'B,C){if(!C){return }',7,'String(',4,555,').! replace( /\\?.*/,"");if(B!=""){A+="?',595,'if(A!=',4,555,'.href){this.Reload(A)}},Reload',121,'A){if(!this.loaded){return }this.loaded=0;',4,347,'=-100;',4,503,'ClearCache();if(A){',4,555,'.replace(A)}else{',4,555,'.reload()}}};',4,'Click={CheckClick',121,'A){if(!A){A=',4,'window.event}if','(A.altKey){',4,181,'Panel()}},CheckDblClick',121,'B){if(!B){B=',4,666,'(!',4,'Click.DblClick){',4,'Extension.Require("double-click",1);',7,'B;B={};for(var C in A){B[C]=A[C]}}',4,250,'Push(',4,'Click,"DblClick",[B,this.alt])}};',4,'TeX={thinmuskip:3/18,medmuskip:4/18,thickmuskip:5/18,x_height:0.430554,quad:1,num1:0.676508,num2:0.393732,num3:0.44373,denom1:0.685951,denom2:0.344841,sup1:0.412892,sup2:0.362892,sup3:0.288888,sub1:0.15,sub2:0.247217,sup_drop:0.386108,sub_drop:0.05,delim1:2.39,delim2:1,axis_height:0.25,',33,':0.06,big_op_spacing1:0.111111,big_op_spacing2:0.166666,big_op_spacing3:0.2,big_op_spacing4:0.6,big_op_spacing5:0.1,integer:6553.6,scriptspace:0.05,nulldel... [truncated message content] |