source: spip-zone/_plugins_/jsMath/jsMath/jsMath-loader-post.html @ 111365

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

Mise à jour (jsMath 3.6) pour avoir les numéros d'équations

File size: 2.4 KB
Line 
1<html>
2<head>
3<!--
4 | jsMath-loader-post.html
5 |
6 | Part of the jsMath package for mathematics on the web.
7 |
8 | This file is used for loading jsMath components in Firefox3 when
9 | used in a file: url from a directory other than the one containing
10 | jsMath (gets around Firefox3's more restrictive same-origin policy.
11 |
12 | ---------------------------------------------------------------------
13 |
14 | Copyright 2008 by Davide P. Cervone
15 |
16 | Licensed under the Apache License, Version 2.0 (the "License");
17 | you may not use this file except in compliance with the License.
18 | You may obtain a copy of the License at
19 |
20 |     http://www.apache.org/licenses/LICENSE-2.0
21 |
22 | Unless required by applicable law or agreed to in writing, software
23 | distributed under the License is distributed on an "AS IS" BASIS,
24 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 | See the License for the specific language governing permissions and
26 | limitations under the License.
27-->
28</head>
29<body>
30
31<script>
32var isCheck = 0;
33var url = location.search.substr(1); var ID = "jsMLD";
34if (url.substr(0,9) == "autoload=") {url = url.substr(9); ID = "jsMAL"}
35
36if (url == 'http://www.math.union.edu/locate/jsMath/jsMath/jsMath-version-check.js') {
37  //
38  // Handle version check separately
39  //
40  var jsMath = {Controls: {}}; isCheck = 1;
41  document.write('<script src="'+url+'"></'+'script>');
42} else if (url != "" && url.match(/\.js$/) && !url.match('(^|[/\\?#=])[a-z]+://')) {
43  //
44  //  Load the file and pass it to jsMath
45  //
46  var request = new XMLHttpRequest;
47  try {
48    request.open("GET",url,false);
49    request.send(null);
50    window.parent.postMessage(ID+":BGN:","*");
51    window.parent.postMessage(ID+":SCR:"+request.responseText,"*");
52    window.parent.postMessage(ID+":END:1","*");
53  } catch (err) {
54alert(err.message);
55    window.parent.postMessage(ID+":ERR:Can't load "+url+": "+err.message,"*");
56  }
57} else {
58  window.parent.postMessage(ID+":END:","*");
59}
60</script>
61
62<script>
63//
64//  If we are loading the version check, pass it to jsMath
65//  and run the check.
66//
67if (isCheck) {
68  var fn = jsMath.Controls.TestVersion.toString();
69  window.parent.postMessage(ID+":SCR:" +
70    "jsMath.Controls.TestVersion = "+fn+";" +
71    "jsMath.Message.Clear(); jsMath.Message.doClear();" +
72    "jsMath.Controls.TestVersion()","*"
73  );
74  window.parent.postMessage(ID+":END:","*");
75}
76</script>
77
78</body>
79</html>
Note: See TracBrowser for help on using the repository browser.