source: spip-zone/_plugins_/_test_/jsMath/jsMath/jsMath-controls.html @ 20067

Last change on this file since 20067 was 20067, checked in by vbeffara+ml@…, 13 years ago

Inclusion de la librairie jsMath (sauf les fontes) dans le plugin.

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