From d6658849d20b600ab235dd7806ccf6a00ec539c2 Mon Sep 17 00:00:00 2001 From: Satoru Majima Date: Tue, 15 Mar 2016 19:32:24 +0900 Subject: [PATCH] =?UTF-8?q?WYSIWYG=E3=81=A7=E5=BF=85=E8=A6=81=E3=81=AA=20M?= =?UTF-8?q?athJax=E3=81=AE=E9=81=A9=E7=94=A8=E7=AF=84=E5=9B=B2=E3=82=92?= =?UTF-8?q?=E9=99=90=E5=AE=9A=E3=81=99=E3=82=8B=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 自動的に全てのページへの MathJax対応を行っていたのを WYSIWYGが置かれる想定の要素内(id: nc-container)に限定する対応。 --- View/Elements/mathjax_js.ctp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/View/Elements/mathjax_js.ctp b/View/Elements/mathjax_js.ctp index 05072a2..79afd62 100644 --- a/View/Elements/mathjax_js.ctp +++ b/View/Elements/mathjax_js.ctp @@ -8,9 +8,31 @@ * @license http://www.netcommons.org/license.txt NetCommons License */ +// skipStartupTypeset: true によって MathJaxの自動読み込みを無効にする +echo $this->Html->scriptStart(array('inline' => false, 'type' => 'text/x-mathjax-config')); +?> +MathJax.Hub.Config({ + skipStartupTypeset: true +}); + +Html->scriptEnd(); + // wysiwyg呼び出し echo $this->NetCommonsHtml->script( array( '/components/MathJax/MathJax.js?config=TeX-MML-AM_CHTML', ) ); +?> + +Html->scriptStart(array('inline' => false)); +?> +$(document).ready(function(){ + MathJax.Hub.Queue(["Typeset", MathJax.Hub, 'nc-container']); +}); +Html->scriptEnd();