scratch/output/Scratch/js/MathJax/docs/html/api/message.html
2010-08-16 12:02:28 +02:00

224 lines
No EOL
11 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The MathJax.Message Object &mdash; MathJax v1.0 documentation</title>
<link rel="stylesheet" href="../_static/mj.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="MathJax v1.0 documentation" href="../index.html" />
<link rel="up" title="The MathJax API" href="index.html" />
<link rel="next" title="The MathJax.HTML Object" href="html.html" />
<link rel="prev" title="The MathJax.Ajax Object" href="ajax.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="html.html" title="The MathJax.HTML Object"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="ajax.html" title="The MathJax.Ajax Object"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">MathJax v1.0 documentation</a> &raquo;</li>
<li><a href="index.html" accesskey="U">The MathJax API</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-mathjax-message-object">
<span id="api-message"></span><h1>The MathJax.Message Object<a class="headerlink" href="#the-mathjax-message-object" title="Permalink to this headline"></a></h1>
<p>The <tt class="docutils literal"><span class="pre">MathJax.Message</span></tt> object contains the methods used to manage the
small message area that appears at the lower-left corner of the
window. MathJax uses this area to inform the user of time-consuming
actions, like loading files and fonts, or how far along in the
typesetting process it is.</p>
<p>The page author can customize the look of the message window by
setting styles for the <tt class="docutils literal"><span class="pre">#MathJax_Message</span></tt> selector (which can be
set via</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Config</span><span class="p">({</span>
<span class="nx">styles</span><span class="o">:</span> <span class="p">{</span>
<span class="s2">&quot;#MathJax_Message&quot;</span><span class="o">:</span> <span class="p">{</span>
<span class="p">...</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">});</span>
</pre></div>
</div>
<p>Because of a bug in Internet Explorer, in order to change the side of
the screen where the the message occurs, you must also set the side
for <tt class="docutils literal"><span class="pre">#MathJax_MSIE_Frame</span></tt>, as in</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Config</span><span class="p">({</span>
<span class="nx">styles</span><span class="o">:</span> <span class="p">{</span>
<span class="s2">&quot;#MathJax_Message&quot;</span><span class="o">:</span> <span class="p">{</span><span class="nx">left</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="nx">right</span><span class="o">:</span> <span class="mi">0</span><span class="p">},</span>
<span class="s2">&quot;#MathJax_MSIE_Frame&quot;</span><span class="o">:</span> <span class="p">{</span><span class="nx">left</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="nx">right</span><span class="o">:</span> <span class="mi">0</span><span class="p">}</span>
<span class="p">}</span>
<span class="p">});</span>
</pre></div>
</div>
<p>It is possible that a message is already being displayed when another
message needs to be posted. For this reason, when a message is
displayed on screen, it gets an id number that is used when you want
to remove or change that message. That way, when a message is
removed, the previous message (if any) can be redisplayed if it hasn&#8217;t
been removed. This allows for intermittent messages (like file
loading messages) to obscure longer-term message (like &#8220;Processing
Math&#8221; messages) temporarily.</p>
<div class="section" id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline"></a></h2>
<dl class="method">
<dt id="Set">
<tt class="descname">Set</tt><big>(</big><em>message</em><span class="optional">[</span>, <em>n</em><span class="optional">[</span>, <em>delay</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Set" title="Permalink to this definition"></a></dt>
<dd><p>This sets the message being displayed to the given <cite>message</cite>
string. If <cite>n</cite> is not <tt class="docutils literal"><span class="pre">null</span></tt>, it represents a message id
number and the text is set for that message id, otherwise a new id
number is created for this message. If <cite>delay</cite> is provided, it is
the time (in milliseconds) to display the message before it is
cleared. If <cite>delay</cite> is not provided, the message will not be
removed automatically; you must call the
<tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Messsage.Clear()</span></tt> method by hand to remove it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>message</strong> &#8212; the text to display in the message area</li>
<li><strong>n</strong> &#8212; the message id number</li>
<li><strong>delay</strong> &#8212; amout of time to display the message</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the message id nuber for this message.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Clear">
<tt class="descname">Clear</tt><big>(</big><em>n</em><span class="optional">[</span>, <em>delay</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#Clear" title="Permalink to this definition"></a></dt>
<dd><p>This causes the message with id <cite>n</cite> to be removed after the given
<cite>delay</cite>, in milliseconds. The default delay is 600 milliseconds.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>n</strong> &#8212; the message id number</li>
<li><strong>delay</strong> &#8212; the delay before removing the message</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Log">
<tt class="descname">Log</tt><big>(</big><big>)</big><a class="headerlink" href="#Log" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string of all the messages issued so far, separated by
newlines. This is used in debugging MathJax operations.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns :</th><td class="field-body">string of all messages so far</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The MathJax.Message Object</a><ul>
<li><a class="reference internal" href="#methods">Methods</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="ajax.html"
title="previous chapter">The MathJax.Ajax Object</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="html.html"
title="next chapter">The MathJax.HTML Object</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/api/message.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="html.html" title="The MathJax.HTML Object"
>next</a> |</li>
<li class="right" >
<a href="ajax.html" title="The MathJax.Ajax Object"
>previous</a> |</li>
<li><a href="../index.html">MathJax v1.0 documentation</a> &raquo;</li>
<li><a href="index.html" >The MathJax API</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2010 Design Science.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b2.
</div>
</body>
</html>