File:  [LON-CAPA] / loncom / html / adm / jsMath / jsMath-msie-mac.js
Revision 1.1: download - view: text, annotated - select for diffs
Fri Feb 25 04:57:49 2005 UTC (19 years, 5 months ago) by albertel
Branches: MAIN
CVS tags: version_2_0_X, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, HEAD
- adding jsMath to repository

    1: /*
    2:  *  jsMath-msie-mac.js
    3:  *  
    4:  *  Part of the jsMath package for mathematics on the web.
    5:  *
    6:  *  This file makes changes needed for use with MSIE on the Mac.
    7:  *
    8:  *  ---------------------------------------------------------------------
    9:  *
   10:  *  jsMath is free software; you can redistribute it and/or modify
   11:  *  it under the terms of the GNU General Public License as published by
   12:  *  the Free Software Foundation; either version 2 of the License, or
   13:  *  (at your option) any later version.
   14:  *
   15:  *  jsMath is distributed in the hope that it will be useful,
   16:  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   17:  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18:  *  GNU General Public License for more details.
   19:  *
   20:  *  You should have received a copy of the GNU General Public License
   21:  *  along with jsMath; if not, write to the Free Software
   22:  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23:  */
   24: 
   25: 
   26: 
   27: /********************************************************************
   28:  *
   29:  *  Mac MSIE has problems accessing a number of the characters in
   30:  *  the TeX fonts, so we replace them by other characters when
   31:  *  possible.
   32:  */
   33: 
   34: jsMath.UpdateTeXfonts({
   35: 
   36:   cmr10: {
   37:     '3':  {c: '<FONT FACE="Symbol">L</FONT>', tclass: 'normal'},
   38:     '5':  {c: '<FONT FACE="Symbol">P</FONT>', tclass: 'normal'},
   39:     '10': {c: '<FONT FACE="Symbol">W</FONT>', tclass: 'normal'},
   40:     '16': {c: '&#x0131;', tclass: 'normal'},
   41:     '20': {c: '&#xAD;'},
   42:     '22': {c: '&#xAF;', tclass: 'normal', w: .3},
   43:     '25': {c: '&#xDF;', tclass: 'normal'},
   44:     '26': {c: '&#xE6;', tclass: 'normal'},
   45:     '27': {c: '&#x153;', tclass: 'normal'}
   46:   },
   47: 
   48:   cmmi10: {
   49:     '3':  {c: '<I><FONT FACE="Symbol">L</FONT></I>', tclass: 'normal'},
   50:     '5':  {c: '<I><FONT FACE="Symbol">P</FONT></I>', tclass: 'normal'},
   51:     '10': {c: '<I><FONT FACE="Symbol">W</FONT></I>', tclass: 'normal'},
   52:     '15': {c: '<I><FONT FACE="Symbol">e</FONT></I>', tclass: 'normal'},
   53:     '16': {c: '<I><FONT FACE="Symbol">z</FONT></I>', tclass: 'normal'},
   54:     '20': {c: '<I><FONT FACE="Symbol">k</FONT></I>', tclass: 'normal'},
   55:     '22': {c: '<I><FONT FACE="Symbol">m</FONT></I>', tclass: 'normal'},
   56:     '25': {c: '<I><FONT FACE="Symbol">p</FONT></I>', tclass: 'normal'},
   57:     '26': {c: '<I><FONT FACE="Symbol">r</FONT></I>', tclass: 'normal'},
   58:     '27': {c: '<I><FONT FACE="Symbol">s</FONT></I>', tclass: 'normal'}
   59:   },
   60: 
   61:   cmsy10: {
   62:     '3':  {c: '<SPAN STYLE="vertical-align:-.3em">*</SPAN>', tclass: 'normal'},
   63:     '5':  {c: '&#x389;', tclass: 'normal'},
   64:     '10': {c: '&otimes;', tclass: 'normal'},
   65:     '15': {c: '&#x2022;', tclass: 'normal'},
   66:     '16': {c: '&#x224D;', tclass: 'normal'},
   67:     '20': {c: '&le;', tclass: 'normal'},
   68:     '22': {c: '&le;', tclass: 'normal'},
   69:     '25': {c: '&#x2248;', tclass: 'normal'},
   70:     '26': {c: '<FONT FACE="Symbol">&#xCC;</FONT>', tclass: 'normal'},
   71:     '27': {c: '<FONT FACE="Symbol">&#xC9;</FONT>', tclass: 'normal'}
   72:   },
   73: 
   74:   cmex10: {
   75:     '3':  {c: '<SPAN STYLE="font-size: 67%">&#x69;</SPAN>'},
   76:     '5':  {c: '<SPAN STYLE="font-size: 67%">&#x6B;</SPAN>'},
   77:     '10': {c: '<SPAN STYLE="font-size: 67%">&#x44;</SPAN>'},
   78:     '15': {c: '<SPAN STYLE="font-size: 55%">&#xC2;</SPAN>'},
   79:     '16': {c: '<SPAN STYLE="font-size: 83%">&#xB5;</SPAN>'},
   80:     '20': {c: '<SPAN STYLE="font-size: 83%">"</SPAN>'},
   81:     '22': {c: '<SPAN STYLE="font-size: 83%">$</SPAN>'},
   82:     '25': {c: '<SPAN STYLE="font-size: 83%">\'</SPAN>'},
   83:     '26': {c: '<SPAN STYLE="font-size: 83%">(</SPAN>'},
   84:     '27': {c: '<SPAN STYLE="font-size: 83%">)</SPAN>'}
   85:   },
   86: 
   87:   cmti10: {
   88:     '3':  {c: '<I><FONT FACE="Symbol">L</FONT></I>', tclass: 'normal'},
   89:     '5':  {c: '<I><FONT FACE="Symbol">P</FONT></I>', tclass: 'normal'},
   90:     '10': {c: '<I><FONT FACE="Symbol">W</FONT></I>', tclass: 'normal'},
   91:     '16': {c: '<I>&#x0131;</I>', tclass: 'normal'},
   92:     '20': {c: '<I>&#xAD;</I>'},
   93:     '22': {c: '<I>&#xAF;</I>', tclass: 'normal', w: .3},
   94:     '25': {c: '<I>&#xDF;</I>', tclass: 'normal'},
   95:     '26': {c: '<I>&#xE6;</I>', tclass: 'normal'},
   96:     '27': {c: '<I>&#x153;</I>', tclass: 'normal'}
   97:   },
   98: 
   99:   cmbx10: {
  100:     '3':  {c: '<B><FONT FACE="Symbol">L</FONT></B>', tclass: 'normal'},
  101:     '5':  {c: '<B><FONT FACE="Symbol">P</FONT></B>', tclass: 'normal'},
  102:     '10': {c: '<B><FONT FACE="Symbol">W</FONT></B>', tclass: 'normal'},
  103:     '16': {c: '<B>&#x0131;</B>', tclass: 'normal'},
  104:     '20': {c: '<B>&#xAD;</B>'},
  105:     '22': {c: '<B>&#xAF;</B>', tclass: 'normal', w: .3},
  106:     '25': {c: '<B>&#xDF;</B>', tclass: 'normal'},
  107:     '26': {c: '<B>&#xE6;</B>', tclass: 'normal'},
  108:     '27': {c: '<B>&#x153;</B>', tclass: 'normal'}
  109:   }
  110: });
  111: 
  112: /*
  113:  *  MSIE crashes if it changes the page too quickly, so we add a
  114:  *  delay between processing math entries.  Unfortunately, this really
  115:  *  slows down math in MSIE on the mac.
  116:  */
  117: 
  118: jsMath.Add(jsMath,{
  119: 
  120:   msieProcess: jsMath.Process,
  121:   msieProcessBeforeShowing: jsMath.ProcessBeforeShowing,
  122: 
  123:   Process: function () {
  124:     // we need to delay a bit before starting to process the page
  125:     //   in order to avoid an MSIE display bug
  126:     setTimeout('jsMath.msieProcess()',jsMath.delay);
  127:   },
  128: 
  129:   ProcessBeforeShowing: function () {
  130:     // we need to delay a bit before starting to process the page
  131:     //   in order to avoid an MSIE display bug
  132:     window.status = "Processing Math...";
  133:     setTimeout('jsMath.msieProcessBeforeShowing()',5*jsMath.delay);
  134:   }
  135: 
  136: });
  137: 
  138: jsMath.delay = 50;  // hope this is enogh of a delay!
  139: 

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