diff --git a/dollar.rkt b/dollar.rkt index 4fab93138..ba74ca8f4 100644 --- a/dollar.rkt +++ b/dollar.rkt @@ -59,6 +59,43 @@ (collection-file-path "MathJax" "scribble-math"))) |# + +;; take into account last scroll event, to avoid locking up the page +;; TODO: should actually pause the whole MathJax queue, as it still locks +;; up the browser between "processing Math" and "rendering math". +;; + set the #MathJax_Message CSS to opacity: 0.5. +(define gradually-rename-texMath-to-texMathX-js #< 1000) { + if (e.id == "") { e.id = "texMathElement" + pos; } + e[pos++].className = "texMathX"; + MathJax.Hub.Queue(["Typeset",MathJax.Hub,e.id]); + MathJax.Hub.Queue(["next",o]); + } else { + window.setTimeout(process, 100); + } + } else { + window.removeEventListener("scroll", scrollEventHandler); + } + }; + o.next = function() { + window.setTimeout(process, 100); + } + process(); +})(); +EOJS + ) + (define (load-script-string src [async-defer #f]) (string-append #<