File:  [LON-CAPA] / loncom / html / adm / jsMath / plugins / CHMmode.js
Revision 1.2: download - view: text, annotated - select for diffs
Tue Oct 9 21:29:28 2007 UTC (16 years, 9 months ago) by albertel
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_99_1, version_2_5_99_0, version_2_12_X, version_2_11_X, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
- jsMath 3.4e

    1: /*
    2:  *  CHMmode.js
    3:  *  
    4:  *  Part of the jsMath package for mathematics on the web.
    5:  *
    6:  *  This file makes jsMath work with MicroSoft's HTML Help system
    7:  *  from within .chm files (compiled help archives).
    8:  *  
    9:  *  This file should be loaded BEFORE jsMath.js.
   10:  *
   11:  *  ---------------------------------------------------------------------
   12:  *
   13:  *  Copyright 2006-2007 by Davide P. Cervone
   14:  * 
   15:  *  Licensed under the Apache License, Version 2.0 (the "License");
   16:  *  you may not use this file except in compliance with the License.
   17:  *  You may obtain a copy of the License at
   18:  * 
   19:  *      http://www.apache.org/licenses/LICENSE-2.0
   20:  * 
   21:  *  Unless required by applicable law or agreed to in writing, software
   22:  *  distributed under the License is distributed on an "AS IS" BASIS,
   23:  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   24:  *  See the License for the specific language governing permissions and
   25:  *  limitations under the License.
   26:  */
   27: 
   28: if (!window.jsMath) {window.jsMath = {}}
   29: if (!jsMath.Controls) {jsMath.Controls = {}}
   30: if (!jsMath.Controls.cookie) {jsMath.Controls.cookie = {}}
   31: 
   32: jsMath.isCHMmode = 1;
   33: 
   34: jsMath.noChangeGlobal = 1;
   35: jsMath.noShowGlobal = 1;
   36: jsMath.noImgFonts = 1;
   37: jsMath.Controls.cookie.global = 'always';
   38: jsMath.Controls.cookie.hiddenGlobal = 1;
   39: 
   40: if (window.location.protocol == "mk:") {
   41: 
   42:   /*
   43:    *  Work around bug in hh.exe that causes it to run at 100% CPU
   44:    *  and not exit if the page is reloaded after an IFRAME is used
   45:    *  to load the controls file, so fake it using XMLHttpRequest.
   46:    *  Load the data into a DIV instead of an IFRAME, and make sure
   47:    *  that the styles are correct for it.  Change the GetPanel()
   48:    *  call to get the hide the other panel and open the cirrect one.
   49:    */
   50: 
   51:   jsMath.Controls.Init = function () {
   52:     this.controlPanels = jsMath.Setup.DIV("controlPanels");
   53:     if (!jsMath.Browser.msieButtonBug) {this.Button()}
   54:     else {setTimeout("jsMath.Controls.Button()",500)}
   55:   }
   56:   
   57:   jsMath.Controls.Panel = function () {
   58:     jsMath.Translate.Cancel();
   59:     jsMath.Setup.AddStyleSheet({
   60:       '#jsMath_options': jsMath.styles['#jsMath_panel'],
   61:       '#jsMath_options .disabled': jsMath.styles['#jsMath_panel .disabled'],
   62:       '#jsMath_options .infoLink': jsMath.styles['#jsMath_panel .infoLink']
   63:     });
   64:     if (this.loaded) {this.panel = jsMath.Element("panel"); this.Main(); return}
   65:     var html = jsMath.Script.xmlRequest(jsMath.root+"jsMath-controls.html");
   66:     var body = (html.match(/<body>([\s\S]*)<\/body>/))[1];
   67:     this.controlPanels.innerHTML = body;
   68:     var script = (body.match(/<script>([\s\S]*?)<\/script>/))[1];
   69:     jsMath.window.eval(script);
   70:     jsMath.Controls.GetPanel = function (name) {
   71:       if (this.panel) {this.panel.style.display = "none"}
   72:       this.panel = jsMath.Element(name);
   73:     }
   74:     jsMath.Controls.oldClose = jsMath.Controls.Close;
   75:     jsMath.Controls.Close = function () {this.oldClose(); this.panel = null}
   76:     jsMath.Element("options").style.display = "none";
   77:     jsMath.Controls.Main();
   78:     if (!jsMath.Browser.IE7 || jsMath.Browser.quirks) {
   79:       jsMath.window.attachEvent("onscroll",jsMath.Controls.MoveButton);
   80:       if (jsMath.Browser.IE7) jsMath.window.attachEvent("onresize",jsMath.Controls.MoveButton);
   81:     }
   82:   }
   83:   
   84: }
   85: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>