MMLorHTML.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
  2. /* vim: set ts=2 et sw=2 tw=80: */
  3. /*************************************************************
  4. *
  5. * MathJax/config/MMLorHTML.js
  6. *
  7. * Chooses between the NativeMML and HTML-CSS output jax depending
  8. * on the capabilities of the browser and configuration settings
  9. * of the page.
  10. *
  11. * This file should be added to the config array when configuring
  12. * MathJax. Note that if you include this, you should NOT include
  13. * an output jax in the jax array (it will be added for you by
  14. * this file).
  15. *
  16. * You can specify the preferred output jax on a global or
  17. * browser-by-browser basis. To specify it globally, use
  18. *
  19. * MathJax.Hub.Config({
  20. * MMLorHTML: {prefer: "MML"} // or "HTML"
  21. * });
  22. *
  23. * To specify on a browser-by-borwser basis, use
  24. *
  25. * MathJax.Hub.Config({
  26. * MMLorHTML: {prefer: {
  27. * MSIE: "MML",
  28. * Firefox: "MML",
  29. * Opera: "HTML",
  30. * other: "HTML"
  31. * }}
  32. * });
  33. *
  34. * ---------------------------------------------------------------------
  35. *
  36. * Copyright (c) 2010-2013 The MathJax Consortium
  37. *
  38. * Licensed under the Apache License, Version 2.0 (the "License");
  39. * you may not use this file except in compliance with the License.
  40. * You may obtain a copy of the License at
  41. *
  42. * http://www.apache.org/licenses/LICENSE-2.0
  43. *
  44. * Unless required by applicable law or agreed to in writing, software
  45. * distributed under the License is distributed on an "AS IS" BASIS,
  46. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  47. * See the License for the specific language governing permissions and
  48. * limitations under the License.
  49. */(function(b,a){var c=MathJax.Hub.CombineConfig("MMLorHTML",{prefer:{MSIE:"MML",Firefox:"HTML",Opera:"HTML",Chrome:"HTML",Safari:"HTML",other:"HTML"}}),f={Firefox:3,Opera:9.52,MSIE:6,Chrome:.3,Safari:2,Konqueror:4},d="0.0"===a.version||a.versionAtLeast(f[a]||0),e=a.isFirefox&&a.versionAtLeast("1.5")||a.isMSIE&&a.hasMathPlayer||a.isSafari&&a.versionAtLeast("5.0")||a.isOpera&&a.versionAtLeast("9.52");b.Register.StartupHook("End Config",function(){var a=c.prefer&&"object"===typeof c.prefer?c.prefer[MathJax.Hub.Browser]||c.prefer.other||"HTML":c.prefer;d||e?!e||"MML"!==a&&d?(MathJax.OutputJax["HTML-CSS"]?MathJax.OutputJax["HTML-CSS"].Register("jax/mml"):b.config.jax.unshift("output/HTML-CSS"),b.Startup.signal.Post("HTML-CSS output selected")):(MathJax.OutputJax.NativeMML?MathJax.OutputJax.NativeMML.Register("jax/mml"):b.config.jax.unshift("output/NativeMML"),b.Startup.signal.Post("NativeMML output selected")):(b.PreProcess.disabled=!0,b.prepareScripts.disabled=!0,MathJax.Message.Set(["MathJaxNotSupported","Your browser does not support MathJax"],null,4E3),b.Startup.signal.Post("MathJax not supported"))})})(MathJax.Hub,MathJax.Hub.Browser);MathJax.Ajax.loadComplete("[MathJax]/config/MMLorHTML.js");