Example #1
0
 def setStyleSheet(self, sheet):
     e = DOM.createElement('link')
     e.setAttribute('rel', 'stylesheet')
     e.setAttribute('type', 'text/css')
     e.setAttribute('href', sheet)
     html = Window.getDocumentRoot().parentElement
     head = html.getElementsByTagName('head').item(0)
     head.appendChild(e)
Example #2
0
    def includeMathJax(self, config):
        html = Window.getDocumentRoot().parentElement
        head = html.getElementsByTagName('head').item(0)

        e = DOM.createElement('script')
        e.setAttribute('type', 'text/javascript')
        e.setAttribute(
            'src', 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=' +
            config)
        head.appendChild(e)

        e = DOM.createElement('script')
        e.setAttribute('type', 'text/javascript')
        e.textContent = 'function Typeset() { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); }'
        head.appendChild(e)