~ubuntu-branches/ubuntu/utopic/yelp/utopic-proposed

« back to all changes in this revision

Viewing changes to data/mathjax/unpacked/extensions/HTML-CSS/handle-floats.js

  • Committer: Package Import Robot
  • Author(s): Matthew Fischer
  • Date: 2013-05-25 20:01:06 UTC
  • mfrom: (1.1.67) (131.1.1 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130525200106-4re1oimhqy8exd9b
Tags: 3.8.1-0ubuntu1
* New upstream release (LP: #1184244)
  - Added test token for classic mode (Matthias Clasen)
  - Updated translations
  - Stop checking for pangox and X11 (Emilio Pozuelo Monfort)
  - Add keywords to the desktop file (Matthias Clasen)
  - Fixed handling of xref links with anchors, #686095 (Tails developers)
  - Fixed various memory management bugs, #683100 (Carlos Garcia Campos)
  - Added local copy of MathJax for MathML display (Shaun McCance)
  - Added support for xdg help system in All Documents (Shaun McCance)
  - Fixed if:test="action:install" (Shaun McCance)
  - Switched to using 'itstool -j' for XSL domain (Shaun McCance)
* Refreshed patches, removed some patches that have been unused for some
  time.
  - debian/patches/00_no_am_gnu_gettext.patch - Removed, unused
  - debian/patches/02_man-utf8.patch - Removed, unused
  - debian/patches/04_man-utf8.patch - Removed, unused

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*************************************************************
 
2
 *
 
3
 *  MathJax/extensions/HTML-CSS/handle-floats.js
 
4
 *
 
5
 *  This extension allows HTML-CSS output to deal with floating elements
 
6
 *  better.  In particular, when there are tags or equation numbers, these
 
7
 *  would overlap floating elements, but with this extension, the width of
 
8
 *  the line should properly correspond to the amount of space remaining.
 
9
 *  
 
10
 *  To load it, include
 
11
 *  
 
12
 *      "HTML-CSS": {
 
13
 *        extensions: ["handle-floats.js"]
 
14
 *      }
 
15
 *  
 
16
 *  in your configuration.
 
17
 *
 
18
 *  ---------------------------------------------------------------------
 
19
 *  
 
20
 *  Copyright (c) 2012 Design Science, Inc.
 
21
 * 
 
22
 *  Licensed under the Apache License, Version 2.0 (the "License");
 
23
 *  you may not use this file except in compliance with the License.
 
24
 *  You may obtain a copy of the License at
 
25
 * 
 
26
 *      http://www.apache.org/licenses/LICENSE-2.0
 
27
 * 
 
28
 *  Unless required by applicable law or agreed to in writing, software
 
29
 *  distributed under the License is distributed on an "AS IS" BASIS,
 
30
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
31
 *  See the License for the specific language governing permissions and
 
32
 *  limitations under the License.
 
33
 */
 
34
 
 
35
 
 
36
MathJax.Extension["HTML-CSS/handle-floats"] = {
 
37
  version: "2.1"
 
38
};
 
39
 
 
40
//
 
41
//  Make the display DIV be a table-cell
 
42
//  Use padding to get the separation, since table cells don't do margin
 
43
//  Make the width large (it will shrink to fit the remaining room)
 
44
//
 
45
MathJax.Hub.Config({
 
46
  "HTML-CSS": {
 
47
    styles: {
 
48
      ".MathJax_Display": {
 
49
        display: "table-cell",
 
50
        padding: "1em 0 ! important",
 
51
        width: (MathJax.Hub.Browser.isMSIE && (document.documentMode||0) < 8 ? "100%" : "1000em")
 
52
      }
 
53
    }
 
54
  }
 
55
});
 
56
 
 
57
//
 
58
//  Two consecutive equations would end up side-by-side, so force a separator
 
59
//  (Needed by IE8, IE9, and Firefox, at least).
 
60
//  
 
61
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
 
62
  var HTMLCSS = MathJax.OutputJax["HTML-CSS"],
 
63
      TRANSLATE = HTMLCSS.Translate;
 
64
  HTMLCSS.Augment({
 
65
    Translate: function (script,state) {
 
66
      TRANSLATE.call(this,script,state);
 
67
      if (script.MathJax.elementJax.HTMLCSS.display) {
 
68
        var next = script.nextSibling;
 
69
        if (!next || next.className !== "MathJax_MSIE_Separator") {
 
70
          var span = HTMLCSS.Element("span",{className:"MathJax_MSIE_Separator"});
 
71
          script.parentNode.insertBefore(span,next);
 
72
        }
 
73
      }
 
74
    }
 
75
  });
 
76
  MathJax.Hub.Startup.signal.Post("HTML-CSS handle-floats Ready");
 
77
});
 
78
 
 
79
MathJax.Ajax.loadComplete("[MathJax]/extensions/HTML-CSS/handle-floats.js");