Update mathjax plugin

1.10.x
Julio Montoya 10 years ago
parent bb4b90d552
commit 32d76ffdd4
  1. 12
      main/inc/lib/javascript/ckeditor/plugins/mathjax/lang/ar.js
  2. 4
      main/inc/lib/javascript/ckeditor/plugins/mathjax/lang/da.js
  3. 4
      main/inc/lib/javascript/ckeditor/plugins/mathjax/lang/de.js
  4. 2
      main/inc/lib/javascript/ckeditor/plugins/mathjax/lang/sv.js
  5. 36
      main/inc/lib/javascript/ckeditor/plugins/mathjax/plugin.js

@ -3,11 +3,11 @@ Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'mathjax', 'ar', {
title: 'Mathematics in TeX', // MISSING
button: 'Math', // MISSING
dialogInput: 'Write your TeX here', // MISSING
title: 'الرياصيات في Tex',
button: 'رياضيات',
dialogInput: 'أكتب Tex خاصتك هنا',
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
docLabel: 'TeX documentation', // MISSING
loading: 'تحميل',
pathName: 'math' // MISSING
docLabel: 'وثائق Tex',
loading: 'جاري التحميل...',
pathName: 'رياضيات'
} );

@ -5,9 +5,9 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
CKEDITOR.plugins.setLang( 'mathjax', 'da', {
title: 'Matematik i TeX',
button: 'Matematik',
dialogInput: 'Write your TeX here', // MISSING
dialogInput: 'Skriv din TeX her',
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
docLabel: 'TeX dokumentation',
loading: 'loading...', // MISSING
loading: 'henter...',
pathName: 'matematik'
} );

@ -7,7 +7,7 @@ CKEDITOR.plugins.setLang( 'mathjax', 'de', {
button: 'Rechnung',
dialogInput: 'Schreiben Sie hier in Tex',
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
docLabel: 'Tex Dokumentation',
loading: 'lädt...',
docLabel: 'TeX-Dokumentation',
loading: 'Ladevorgang...',
pathName: 'rechnen'
} );

@ -8,6 +8,6 @@ CKEDITOR.plugins.setLang( 'mathjax', 'sv', {
dialogInput: 'Skriv din TeX här',
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
docLabel: 'TeX dokumentation',
loading: 'laddar',
loading: 'laddar...',
pathName: 'matte'
} );

@ -4,17 +4,14 @@
*/
/**
* @fileOverview [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin.
* @fileOverview The [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin that allows you to create and modify mathematical equations written in TeX directly in CKEditor..
*/
'use strict';
( function() {
var cdn = 'http:\/\/cdn.mathjax.org\/mathjax\/2.2-latest\/MathJax.js?config=TeX-AMS_HTML';
CKEDITOR.plugins.add( 'mathjax', {
lang: 'af,ar,ca,cs,cy,da,de,el,en,en-gb,eo,es,fa,fi,fr,gl,he,hr,hu,it,ja,km,ku,lt,nb,nl,no,pl,pt,pt-br,ro,ru,sk,sl,sq,sv,tr,tt,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
lang: 'af,ar,bg,ca,cs,cy,da,de,el,en,en-gb,eo,es,eu,fa,fi,fr,gl,he,hr,hu,id,it,ja,km,ko,ku,lt,nb,nl,no,pl,pt,pt-br,ro,ru,sk,sl,sq,sv,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
requires: 'widget,dialog',
icons: 'mathjax',
hidpi: true, // %REMOVE_LINE_CORE%
@ -22,6 +19,10 @@
init: function( editor ) {
var cls = editor.config.mathJaxClass || 'math-tex';
if ( !editor.config.mathJaxLib ) {
CKEDITOR.error( 'mathjax-no-config' );
}
editor.widgets.add( 'mathjax', {
inline: true,
dialog: 'mathjax',
@ -127,8 +128,10 @@
// Add MathJax script to page preview.
editor.on( 'contentPreview', function( evt ) {
evt.data.dataValue = evt.data.dataValue.replace( /<\/head>/,
'<script src="' + ( editor.config.mathJaxLib ? CKEDITOR.getUrl( editor.config.mathJaxLib ) : cdn ) + '"><\/script><\/head>' );
evt.data.dataValue = evt.data.dataValue.replace(
/<\/head>/,
'<script src="' + CKEDITOR.getUrl( editor.config.mathJaxLib ) + '"><\/script><\/head>'
);
} );
editor.on( 'paste', function( evt ) {
@ -337,7 +340,7 @@
'</script>' +
// Load MathJax lib.
'<script src="' + ( editor.config.mathJaxLib || cdn ) + '"></script>' +
'<script src="' + ( editor.config.mathJaxLib ) + '"></script>' +
'</head>' +
'<body style="padding:0;margin:0;background:transparent;overflow:hidden">' +
'<span id="preview"></span>' +
@ -431,14 +434,20 @@
} )();
/**
* Sets the path to the MathJax library. It can be both a local
* resource and a location different than the default CDN.
* Sets the path to the MathJax library. It can be both a local resource and a location different than the default CDN.
*
* Please note that this must be a full or absolute path.
*
* config.mathJaxLib = 'http:\/\/example.com\/libs\/MathJax.js';
* Read more in the [documentation](#!/guide/dev_mathjax)
* and see the [SDK sample](http://sdk.ckeditor.com/samples/mathjax.html).
*
* @cfg {String} [mathJaxLib='http:\/\/cdn.mathjax.org\/mathjax\/2.2-latest\/MathJax.js?config=TeX-AMS_HTML']
* config.mathJaxLib = '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML';
*
* **Note:** Since CKEditor 4.5 this option does not have a default value, so it must
* be set in order to enable the MathJax plugin.
*
* @since 4.3
* @cfg {String} mathJaxLib
* @member CKEDITOR.config
*/
@ -455,6 +464,9 @@
*
* <span class="my-math">\( \sqrt{4} = 2 \)</span>
*
* Read more in the [documentation](#!/guide/dev_mathjax)
* and see the [SDK sample](http://sdk.ckeditor.com/samples/mathjax.html).
*
* @cfg {String} [mathJaxClass='math-tex']
* @member CKEDITOR.config
*/

Loading…
Cancel
Save