~ubuntu-branches/ubuntu/trusty/qiime/trusty

« back to all changes in this revision

Viewing changes to web/home_static/nih-cloud-apr2012/NIHCloudDemo_Complete_files/initmathjax.js

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2013-06-17 18:28:26 UTC
  • mfrom: (9.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130617182826-376az5ad080a0sfe
Tags: 1.7.0+dfsg-1
Upload preparations done for BioLinux to Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//----------------------------------------------------------------------------
2
 
//  Copyright (C) 2008-2011  The IPython Development Team
3
 
//
4
 
//  Distributed under the terms of the BSD License.  The full license is in
5
 
//  the file COPYING, distributed as part of this software.
6
 
//----------------------------------------------------------------------------
7
 
 
8
 
//============================================================================
9
 
// MathJax initialization
10
 
//============================================================================
11
 
 
12
 
var IPython = (function (IPython) {
13
 
 
14
 
    var init_mathjax = function () {
15
 
        if (window.MathJax) { 
16
 
            // MathJax loaded
17
 
            MathJax.Hub.Config({
18
 
                tex2jax: {
19
 
                    inlineMath: [ ['$','$'], ["\\(","\\)"] ],
20
 
                    displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
21
 
                },
22
 
                displayAlign: 'left', // Change this to 'center' to center equations.
23
 
                "HTML-CSS": {
24
 
                    styles: {'.MathJax_Display': {"margin": 0}}
25
 
                }
26
 
            });
27
 
        } else if (window.mathjax_url != "") {
28
 
            // Don't have MathJax, but should. Show dialog.
29
 
            var dialog = $('<div></div>')
30
 
                .append(
31
 
                    $("<p></p>").addClass('dialog').html(
32
 
                        "Math/LaTeX rendering will be disabled."
33
 
                    )
34
 
                ).append(
35
 
                    $("<p></p>").addClass('dialog').html(
36
 
                        "If you have administrative access to the notebook server and" +
37
 
                        " a working internet connection, you can install a local copy" +
38
 
                        " of MathJax for offline use with the following command on the server" +
39
 
                        " at a Python or IPython prompt:"
40
 
                    )
41
 
                ).append(
42
 
                    $("<pre></pre>").addClass('dialog').html(
43
 
                        ">>> from IPython.external import mathjax; mathjax.install_mathjax()"
44
 
                    )
45
 
                ).append(
46
 
                    $("<p></p>").addClass('dialog').html(
47
 
                        "This will try to install MathJax into the IPython source directory."
48
 
                    )
49
 
                ).append(
50
 
                    $("<p></p>").addClass('dialog').html(
51
 
                        "If IPython is installed to a location that requires" +
52
 
                        " administrative privileges to write, you will need to make this call as" +
53
 
                        " an administrator, via 'sudo'."
54
 
                    )
55
 
                ).append(
56
 
                    $("<p></p>").addClass('dialog').html(
57
 
                        "When you start the notebook server, you can instruct it to disable MathJax support altogether:"
58
 
                    )
59
 
                ).append(
60
 
                    $("<pre></pre>").addClass('dialog').html(
61
 
                        "$ ipython notebook --no-mathjax"
62
 
                    )
63
 
                ).append(
64
 
                    $("<p></p>").addClass('dialog').html(
65
 
                        "which will prevent this dialog from appearing."
66
 
                    )
67
 
                ).dialog({
68
 
                    title: "Failed to retrieve MathJax from '" + window.mathjax_url + "'",
69
 
                    width: "70%",
70
 
                    modal: true,
71
 
                })
72
 
        } else {
73
 
            // No MathJax, but none expected. No dialog.
74
 
        };
75
 
    };
76
 
 
77
 
 
78
 
    // Set module variables
79
 
    IPython.init_mathjax = init_mathjax;
80
 
 
81
 
    return IPython;
82
 
 
83
 
}(IPython));
 
 
b'\\ No newline at end of file'