diff --git a/controllers/plugin_dbui.py b/controllers/plugin_dbui.py index 089048867f85819357c2e10aa0fb766b64e25456..8f24ddd3383a74cbfaec2950b7c12c9689b21fca 100644 --- a/controllers/plugin_dbui.py +++ b/controllers/plugin_dbui.py @@ -25,15 +25,28 @@ App.REMOTE_API = { App.storeCfgs = %s; """ +MATHJAX = """ +MathJax.Hub.Config({ + extensions: ["tex2jax.js"], + jax: ["input/TeX", "output/HTML-CSS"], + tex2jax: { + inlineMath: [ ['$','$'], ["\\(","\\)"] ], + displayMath: [ ['$$','$$'], ["\\[","\\]"] ], + processEscapes: true + }, + "HTML-CSS": { availableFonts: ["TeX"] } +}); +""" + def call(): - """Controller to handle the Ext.Direct protocol. + """Action to handle the Ext.Direct protocol. """ return directSvc() def csv(): - """Controller returning the content of a table as a CSV file. + """Action returning the content of a table as a CSV file. Foreign keys are replaced by the parent column. """ @@ -72,7 +85,7 @@ def csv(): def dbui_conf(): - """Controller returning the javascript script configuring + """Action returning the javascript script configuring the plugin dbui: application name, store definition,... """ @@ -116,7 +129,7 @@ def dbui_conf(): def debug(): - """Main Controller to run the plugin in debug mode + """Action to run the plugin in debug mode Load the javascript source code for all libraries. Active the debug mode on the server side. @@ -171,7 +184,7 @@ def debug(): def index(): - """Default Controller to run the plugin + """Default Action to run the plugin Load compressed version of all libraries. EXAMPLES @@ -220,5 +233,12 @@ def index(): return dict(plugin=plugin) +def mathjax_conf(): + """Action returning the js configuration script for the MathJax library. + + """ + return MATHJAX + + def status(): return dict(request=request, response=response, session=session) \ No newline at end of file diff --git a/models/plugin_dbui.py b/models/plugin_dbui.py index a67ce4aecea81998df16aafd11b02fa8418db4c8..0dadf220f4a4a42c361fcd2974dac51239f961da 100644 --- a/models/plugin_dbui.py +++ b/models/plugin_dbui.py @@ -47,7 +47,8 @@ plugins = PluginManager('dbui', extjs_libmin=['static/plugin_extjs/adapter/ext/ext-base.js', 'static/plugin_extjs/ext-all.js'], extjs_lg='static/plugin_extjs/src/locale/ext-lang-%s.js' % lg, - + + mathjax_conf=URL(c='plugin_dbui', f='mathjax_conf'), mathjax_libmin='static/plugin_mathjax/MathJax.js', modifier_fields={},