File:  [LON-CAPA] / loncom / html / adm / jsMath / jsMath-controls.html
Revision 1.3: download - view: text, annotated - select for diffs
Tue Oct 9 21:29:16 2007 UTC (16 years, 7 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_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: <html>
    2: <head>
    3: <!--
    4:  | jsMath-controls.html
    5:  |
    6:  | Part of the jsMath package for mathematics on the web.
    7:  | 
    8:  | This file handles the details of the jsMath control panels
    9:  | 
   10:  | ---------------------------------------------------------------------
   11:  | 
   12:  | Copyright 2004-2007 by Davide P. Cervone
   13:  |
   14:  | Licensed under the Apache License, Version 2.0 (the "License");
   15:  | you may not use this file except in compliance with the License.
   16:  | You may obtain a copy of the License at
   17:  |
   18:  |     http://www.apache.org/licenses/LICENSE-2.0
   19:  |
   20:  | Unless required by applicable law or agreed to in writing, software
   21:  | distributed under the License is distributed on an "AS IS" BASIS,
   22:  | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   23:  | See the License for the specific language governing permissions and
   24:  | limitations under the License.
   25: -->
   26: </head>
   27: <body>
   28: 
   29: <script>
   30: var showWarning = 0;
   31: while (!window.jsMath && !showWarning) {
   32:   try {
   33:     window.jsMath = window.parent.jsMath;
   34:     if (!window.jsMath) {throw "no jsMath";}
   35:   } catch (err) {
   36:     showWarning = 1; pageDomain = '';
   37:     try {pageDomain = document.domain} catch (err) {}
   38:     //
   39:     // MSIE on Mac can't change document.domain, and 'try' won't
   40:     //   catch the error (Grrr!) so don't even attempt it.
   41:     //
   42:     if (pageDomain.match(/\..*\./) &&
   43:         (navigator.appName != 'Microsoft Internet Explorer' ||
   44:          !navigator.platform.match(/Mac/) || !navigator.userProfile || !document.all)) {
   45:       try {
   46:         document.domain = pageDomain.replace(/^[^.]*\./,'');
   47:         showWarning = 0;
   48:       } catch(err) {}
   49:     }
   50:   }
   51: }
   52: 
   53: function Warning () {
   54:   alert(
   55:     "jsMath can't open the control panel, since jsMath was not " +
   56:     "obtained from a server that is in the same domain as the " +
   57:     "page that loaded it."
   58:   );
   59: }
   60: 
   61: if (showWarning) {setTimeout("Warning()",1)} else {
   62: var debug = window.parent.debug; var show = window.parent.show;
   63: 
   64: jsMath.Add(jsMath.Controls,{
   65: 
   66:   loaded: 1,
   67: 
   68:   mainLabels: {
   69:     print: 'Print',  reload: 'Reload', local: 'Go Local', global: 'Go Global',
   70:     ctrls: 'Controls', opts: 'Options', done: 'Done'
   71:   },
   72:   optionLabels: {back: 'Back', done: 'Done'},
   73: 
   74:   Close: function () {
   75:     this.panel.style.display = "none";
   76:     jsMath.Element("button").style.display = (this.cookie.button ? "block" : "none");
   77:     if (jsMath.document.location.protocol == 'file:' && jsMath.Global.islocal) return;
   78:     for (var id in {scale:1, scaleImg:1, font:1, print:1, printwarn:1,
   79:                     stayhires:1, autofont:1, alpha:1, tex2math:1, global:1}) {
   80:       if (this.cookie[id] && this.cookie[id] != this.oldCookie[id] &&
   81:           this.oldCookie[id] != null) {
   82:         this.Reload();
   83:         return;
   84:       }
   85:     }
   86:   },
   87: 
   88:   Main: function () {
   89:     this.oldCookie = {}; jsMath.Add(this.oldCookie,this.cookie);
   90:     this.GetPanel("panel");
   91: 
   92:     jsMath.Element("_version").innerHTML = jsMath.version;
   93: 
   94:     jsMath.Element("_fontType").innerHTML =
   95:       ({tex:"TeX",
   96:         image:"Image",
   97:         symbol:"Image symbol",
   98:         unicode:"Unicode"})[this.cookie.font];
   99: 
  100:      jsMath.Element("_mailto").href =
  101:        "mailto:dpvc@union.edu?subject=Bug Report for jsMath "
  102:            + jsMath.version + " (using " + jsMath.browser
  103:            + " in " + this.cookie.font + " mode)";
  104: 
  105:     if (this.cookie.print ||
  106:        (this.cookie.font != 'image' && this.cookie.font != 'symbol'))
  107:          {jsMath.Element("_resolution").disabled = true}
  108: 
  109:     if (jsMath.Global.isLocal) {
  110:       jsMath.Element("_ctrls").disabled = true;
  111:     } else {
  112:       this.cookie.hiddenGlobal = jsMath.Global.isHidden;
  113:       jsMath.Element("_global").style.display = "none";
  114:       jsMath.Element("_local").style.display = "";
  115:       if (!jsMath.Global.isHidden || jsMath.noShowGlobal)
  116:         {jsMath.Element("_ctrls").disabled = true}
  117:     }
  118:     if (jsMath.noChangeGlobal) {
  119:       for (var id in {global:1, local:1, ctrls: 1})
  120:         {jsMath.Element('_'+id).disabled = true}
  121:     }
  122:     if (!window.print) {jsMath.Element("_print").disabled = true}
  123: 
  124:     if (jsMath.Browser.safariButtonBug) {
  125:       for (var id in this.mainLabels)
  126:         {jsMath.Element('_'+id).value = this.mainLabels[id]}
  127:     }
  128: 
  129:     this.panel.style.display = "block";
  130:     this.openMain = 0;
  131: 
  132:     if (jsMath.Browser.msieMoveButtonHack) {
  133:       this.panel.style.left = "0px";
  134:       this.panel.style.top = "0px";
  135:       jsMath.Controls.MoveButton();
  136:     }
  137:   },
  138: 
  139:   Options: function () {
  140:     this.GetPanel("options");
  141:     jsMath.Element("_scale").value = this.cookie.scale;
  142:     jsMath.Element("_keep").value = this.cookie.keep;
  143:     jsMath.Element("_global").value = this.cookie.global;
  144:     for (var id in {autofont:1, scaleImg:1, alpha:1, warn:1, printwarn: 1,
  145:                     stayhires: 1, button:1, progress:1, asynch:1, blank:1, tex2math:1}) {
  146:       if (this.cookie[id]) {jsMath.Element('_'+id).checked = true}
  147:     }
  148:     var font = jsMath.document.getElementsByName("jsMath__font");
  149:     for (var i = 0; i < font.length; i++) {
  150:       if ((font[i].value == 'tex' && jsMath.nofonts) ||
  151:           ((font[i].value == 'symbol' || font[i].value == 'image') &&
  152:              jsMath.noImgFonts)) {
  153:         jsMath.Element('_'+font[i].value+"Text").className = "disabled";
  154:         font[i].disabled = true;
  155:       }
  156:       else if (this.cookie.font == font[i].value) {font[i].checked = true}
  157:     }
  158:     if (jsMath.noImgFonts) {
  159:       for (var id in {alpha:1, printwarn:1, stayhires:1}) {
  160:         var obj = jsMath.Element("_"+id);
  161:         obj.disabled = true;
  162:         obj.parentNode.className = "disabled";
  163:       }
  164:     } else if (jsMath.Browser.imgScale != 1) {
  165:       jsMath.Element("_alphaText").className = "disabled";
  166:       jsMath.Element("_alpha").disabled = true;
  167:     }
  168:     if (jsMath.tex2math.Convert) {
  169:       jsMath.Element("_separator").style.display = '';
  170:       jsMath.Element("_tex2mathRow").style.display = '';
  171:     }
  172:     if (jsMath.noChangeGlobal) {
  173:       jsMath.Element("_globalText").className = "disabled";
  174:       jsMath.Element("_global").disabled = true;
  175:     }
  176:     if (jsMath.isCHMmode) {
  177:       jsMath.Element("_asynchText").className  = "disabled";
  178:       jsMath.Element("_asynch").disabled = true;
  179:     }
  180: 
  181:     if (jsMath.Browser.safariButtonBug) {
  182:       for (var id in this.optionLabels)
  183:         {jsMath.Element('_'+id).value = this.optionLabels[id]}
  184:     }
  185: 
  186:     this.panel.style.display = "block";
  187: 
  188:     if (jsMath.Browser.msieMoveButtonHack) {
  189:       this.panel.style.left = "0px";
  190:       this.panel.style.top = "0px";
  191:       jsMath.Controls.MoveButton();
  192:     }
  193:   },
  194: 
  195:   GetPanel: function (name) {
  196:     this.panel.innerHTML = ""; // for MSIE on the Mac
  197:     if (jsMath.browser == 'Mozilla') {
  198:       this.panel.appendChild(document.getElementById("jsMath_"+name).cloneNode(true));
  199:     } else {
  200:       this.panel.innerHTML = document.getElementById("jsMath_"+name).innerHTML;
  201:     }
  202:   },
  203: 
  204:   SaveOptions: function (close) {
  205:     this.cookie.scale = jsMath.Element("_scale").value;
  206:     var font = jsMath.document.getElementsByName("jsMath__font");
  207:     for (var i = 0; i < font.length; i++) 
  208:       {if (font[i].checked) {this.cookie.font = font[i].value}}
  209:     for (var id in {autofont:1, scaleImg:1, alpha:1, warn:1, printwarn: 1,
  210:                     stayhires: 1, button:1, progress:1, asynch:1, blank:1, tex2math:1}) {
  211:       if (this.cookie[id] != null) {
  212:         this.cookie[id] = jsMath.Element('_'+id).checked ? 1: 0;
  213:       }
  214:     }
  215:     this.cookie.keep = jsMath.Element("_keep").value;
  216:     this.cookie.global = jsMath.Element("_global").value;
  217:     this.cookie.print = this.cookie.stayhires;
  218:     this.SetCookie(1);
  219:     if (close) {this.Close()} else {this.Main()}
  220:   },
  221: 
  222:   PrintResolution: function () {
  223:     this.cookie.print = 1;
  224:     this.SetCookie(1);
  225:     this.Close();
  226:   },
  227: 
  228:   Print: function () {
  229:     this.Close();
  230:     jsMath.window.print();
  231:   },
  232: 
  233:   GoGlobal: function () {
  234:     this.cookie.global = "always";
  235:     jsMath.Global.GoGlobal(this.SetCookie(2));
  236:   },
  237:   GoLocal: function () {jsMath.Global.GoLocal()},
  238: 
  239:   ShowControls: function () {
  240:     this.Close();
  241:     jsMath.Global.Show();
  242:   },
  243: 
  244:   CheckVersion: function () {
  245:     jsMath.Script.delayedLoad('http://www.math.union.edu/locate/jsMath/jsMath/jsMath-version-check.js');
  246:   },
  247: 
  248:   NoAuto: function () {jsMath.Element("_autofont").checked = false}
  249: 
  250: });
  251: 
  252: }
  253: </script>
  254: 
  255: <!------------------------------------------------------------>
  256: 
  257: <div id="jsMath_panel">
  258: <div style="text-align:center">
  259: <b style="font-size:133%">jsMath v<span ID="jsMath__version"></span></b>
  260: (<span id="jsMath__fontType">type</span> fonts)
  261: [<a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/main.html">help</a>]
  262: <p style="margin-bottom:0px">
  263: <table border="0" cellspacing="0" cellpadding="0" style="margin:0px">
  264: <tr valign="middle"><td align="center">
  265: <table border="0" cellspacing="0" cellpadding="0">
  266: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/quickstart.html">Quick Start</a></td></tr>
  267: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/fonts.html">Missing Fonts</a></td></tr>
  268: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/printing.html">Printing Issues</a></td></tr>
  269: <tr><td height="5"></td></tr>
  270: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath">Home Page</a></td></tr>
  271: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/">Documentation</a></td></tr>
  272: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="https://sourceforge.net/forum/?group_id=172663">User Community</a></td></tr>
  273: <tr><td height="5"></td></tr>
  274: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/bugs.html">Known Bugs</a></td></tr>
  275: <tr><td class="infoLink" align="left">&#8226; <a id="jsMath__mailto" href="mailto:dpvc@union.edu?subject=jsMath Bug Report">Report a Bug</a></td></tr>
  276: <tr><td height="5"></td></tr>
  277: <tr><td class="infoLink" align="left">&#8226; <a target="_blank" href="http://www.math.union.edu/locate/jsMath/jsMath/COPYING.txt">License</a></td></tr>
  278: </table>
  279: </td>
  280: 
  281: <td style="width:1em">&nbsp;</td>
  282: 
  283: <td align="center">
  284: <table border="0" cellspacing="0" cellpadding="0">
  285: <tr><td align="center" colspan="3">
  286: <input type="button" value="Check for jsMath Updates"
  287:        style="width:18em" onclick="jsMath.Controls.CheckVersion()" /><br />
  288: <input type="button" id="jsMath__resolution" value="Hi-Res Fonts for Printing"
  289:        style="width:18em" onclick="jsMath.Controls.PrintResolution()" />
  290: </td></tr>
  291: 
  292: <tr><td height="8"></td></tr>
  293: 
  294: <tr valign="bottom"><td align="left">
  295: <input type="button" value="Print" id="jsMath__print" style="width:8em" onclick="jsMath.Controls.Print()" /><br />
  296: <input type="button" value="Reload" id="jsMath__reload" style="width:8em" style="width:8em" onclick="jsMath.window.location.reload()" /><br />
  297: </td><td>
  298: &nbsp;
  299: </td><td align="right">
  300: <input type="button" value="Go Global" id="jsMath__global" style="width:8em" onclick="jsMath.Controls.GoGlobal()"a /><!--
  301: --><input type="button" value="Go Local" id="jsMath__local" style="width:8em;display:none" onclick="jsMath.Controls.GoLocal()" /><br />
  302: <input type="button" value="Controls" id="jsMath__ctrls" style="width:8em" onclick="jsMath.Controls.ShowControls()" /><br/>
  303: </td></tr>
  304: 
  305: <tr><td height="8"></td></tr>
  306: 
  307: <tr valign="bottom"><td align="left">
  308: <input type="button" value="Options" id="jsMath__opts" style="width:8em" onclick="jsMath.Controls.Options()" /><br/>
  309: </td><td>
  310: &nbsp;
  311: </td><td align="right">
  312: <input type="button" value="Done" id="jsMath__done" style="width:8em" onclick="jsMath.Controls.Close()" />
  313: </td></tr>
  314: </table></td></tr>
  315: 
  316: <tr><td height="10"></td></tr>
  317: 
  318: <tr>
  319: <td colspan="3" align="center" style="width:26em">
  320: <i style="font-size:75%">Click the jsMath button or <nobr>ALT-click</nobr>
  321: on mathematics to reopen this panel.</i>
  322: </td></tr>
  323: 
  324: </table></p>
  325: </div>
  326: </div>
  327: 
  328: <!------------------------------------------------------------>
  329: 
  330: <div id="jsMath_options">
  331: <div style="text-align:center">
  332: <b style="font-size:133%">jsMath Options</b>
  333: [<a target="_blank" href="http://www.math.union.edu/locate/jsMath/users/help.html">help</a>]
  334: <p>
  335: <form action="javascript:" style="margin:0px">
  336: <table border="0" cellspacing="0" cellpadding="0">
  337: <tr valign="top"><td>
  338: 
  339: <table border="0" cellspacing="0" cellpadding="0" style="text-align:left">
  340: 
  341: <tr><td><input type="checkbox" id="jsMath__autofont"  value="1" /> Autoselect best font</td></tr>
  342: <tr><td><input type="checkbox" id="jsMath__warn"      value="1" /> Show font warnings</td></tr>
  343: <tr><td><input type="checkbox" id="jsMath__alpha"     value="1" /> Use image alpha channels</td></tr>
  344: <tr><td><input type="checkbox" id="jsMath__printwarn" value="1" /> Print image-font help</td></tr>
  345: <tr><td><input type="checkbox" id="jsMath__stayhires" value="1" /> Always use hi-res fonts</td></tr>
  346: 
  347: <tr><td style="height:.8em"></td></tr>
  348: 
  349: <tr><td><input type="checkbox" id="jsMath__progress" value="1" /> Show progress messages</td></tr>
  350: <tr><td><input type="checkbox" id="jsMath__asynch"   value="1" /> <span id="jsMath__asynchText">Force asynchronous processing</span></td></tr>
  351: <tr><td><input type="checkbox" id="jsMath__blank"    value="1" /> Don't show page until complete</td></tr>
  352: <tr><td><input type="checkbox" id="jsMath__button"   value="1" /> Show jsMath button</td></tr>
  353: 
  354: <tr id="jsMath__separator" style="display:none"><td style="height:.8em"></td></tr>
  355: 
  356: <tr id="jsMath__tex2mathRow" style="display:none"><td><input type="checkbox" id="jsMath__tex2math" value="1" /> Enable <code>tex2math</code> plug-in</td></tr>
  357: 
  358: </td></tr>
  359: </table>
  360: </td>
  361: <td style="width:2em"></td>
  362: <td>
  363: 
  364: <table border="0" cellspacing="0" cellpadding="0" style="text-align:left">
  365: <tr><td>Scale all mathematics to <input type="text" id="jsMath__scale" value="100" size="3" />%</td></tr>
  366: 
  367: <tr><td style="height:.5em"></td></tr>
  368: 
  369: <tr><td><input type="radio" name="jsMath__font" value="tex" onclick="jsMath.Controls.NoAuto()" />
  370: <span id="jsMath__texText">Use native TeX fonts</span>
  371: <small>(<a target="_blank" href="http://www.math.union.edu/locate/jsMath/download/jsMath-fonts.html">download</a>)</small>
  372: </td></tr>
  373: <tr><td><input type="radio" name="jsMath__font" value="image" onclick="jsMath.Controls.NoAuto()" />
  374: <span id="jsMath__imageText">Use image fonts
  375: <span id="jsMath__scaleImgText">(<input type="checkbox" id="jsMath__scaleImg" value="1" /> scalable)</span></span></td></tr>
  376: <tr><td><input type="radio" name="jsMath__font" value="symbol" onclick="jsMath.Controls.NoAuto()" />
  377: <span id="jsMath__symbolText">Use images for symbols only</span></td></tr>
  378: <tr><td height="2"></td></tr>
  379: <tr><td><input type="radio" name="jsMath__font" value="unicode" onclick="jsMath.Controls.NoAuto()" />
  380: Use native Unicode fonts</td></tr>
  381: 
  382: <tr><td style="height:1em"></td></tr>
  383: 
  384: <tr><td align="center"><span id="jsMath__globalText">Use Global mode</span>
  385: <select id="jsMath__global">
  386: <option value="auto">when requested
  387: <option value="always">always
  388: <option value="never">never
  389: </select>
  390: </td></tr>
  391: <tr><td height="3"></td></tr>
  392: <tr><td>Save settings for
  393: <select id="jsMath__keep">
  394: <option value="0D">this session only
  395: <option value="1D">1 day
  396: <option value="2D">2 days
  397: <option value="3D">3 days
  398: <option value="1W">1 week
  399: <option value="2W">2 weeks
  400: <option value="1M">1 month
  401: <option value="2M">2 months
  402: <option value="3M">3 months
  403: <option value="6M">6 months
  404: <option value="1Y">1 year
  405: <option value="5Y">5 years
  406: </select>
  407: </td></tr>
  408: 
  409: <tr><td style="height:1em"></td></tr>
  410: 
  411: </table>
  412: 
  413: <table border="0" cellspacing="0" cellpadding="0" width="100%">
  414: <tr>
  415: <td align="left">&nbsp;
  416: <input type="button" value="Back" id="jsMath__back" style="width:8em" onclick="jsMath.Controls.SaveOptions(0)" />
  417: &nbsp;&nbsp;
  418: </td>
  419: <td align="right">
  420: <input type="button" value="Done" id="jsMath__done" style="width:8em" onclick="jsMath.Controls.SaveOptions(1)" />
  421: &nbsp;
  422: </td>
  423: </tr>
  424: </table>
  425: 
  426: </td></tr>
  427: 
  428: </table>
  429: </form>
  430: </div>
  431: </div>
  432: </p>
  433: 
  434: <!------------------------------------------------------------>
  435: 
  436: <script>
  437:   if (!showWarning) {jsMath.Controls.Main()}
  438: </script>
  439: <script>
  440:   if (window.jsMath) {
  441:     jsMath.Script.endLoad();
  442:     jsMath.Message.doClear();
  443:   }
  444: </script>
  445: </body>
  446: </html>

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