@wiris/mathtype-tinymce6 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor_plugin.src.js +10 -5
- package/package.json +2 -4
- package/plugin.min.js +1 -1
- package/project.json +18 -4
- package/webpack.config.js +73 -51
package/editor_plugin.src.js
CHANGED
|
@@ -3,6 +3,7 @@ import Configuration from '@wiris/mathtype-html-integration-devkit/src/configura
|
|
|
3
3
|
import Parser from '@wiris/mathtype-html-integration-devkit/src/parser';
|
|
4
4
|
import Util from '@wiris/mathtype-html-integration-devkit/src/util';
|
|
5
5
|
import Listeners from '@wiris/mathtype-html-integration-devkit/src/listeners';
|
|
6
|
+
import StringManager from '@wiris/mathtype-html-integration-devkit/src/stringmanager';
|
|
6
7
|
|
|
7
8
|
import packageInfo from './package.json';
|
|
8
9
|
|
|
@@ -69,12 +70,12 @@ export class TinyMceIntegration extends IntegrationModel {
|
|
|
69
70
|
getLanguage() {
|
|
70
71
|
const editorSettings = this.editorObject;
|
|
71
72
|
try {
|
|
72
|
-
return editorSettings.mathTypeParameters.editorParameters.language;
|
|
73
|
+
return editorSettings.getParam('mathTypeParameters').editorParameters.language;
|
|
73
74
|
} catch (e) { console.error(); }
|
|
74
75
|
// Get the deprecated wirisformulaeditorlang
|
|
75
|
-
if (editorSettings.wirisformulaeditorlang) {
|
|
76
|
+
if (editorSettings.getParam('wirisformulaeditorlang')) {
|
|
76
77
|
console.warn('Deprecated property wirisformulaeditorlang. Use mathTypeParameters on instead.');
|
|
77
|
-
return editorSettings.wirisformulaeditorlang;
|
|
78
|
+
return editorSettings.getParam('wirisformulaeditorlang');
|
|
78
79
|
}
|
|
79
80
|
const langParam = this.editorObject.getParam('language');
|
|
80
81
|
return langParam || super.getLanguage();
|
|
@@ -359,9 +360,13 @@ export const currentInstance = null;
|
|
|
359
360
|
}
|
|
360
361
|
});
|
|
361
362
|
|
|
363
|
+
// Get editor language code
|
|
364
|
+
let lang_code = editor.getParam('language');
|
|
365
|
+
lang_code = (lang_code.split("-")[0]).split("_")[0];
|
|
366
|
+
|
|
362
367
|
// MathType button.
|
|
363
368
|
commonEditor.addButton('tiny_mce_wiris_formulaEditor', {
|
|
364
|
-
tooltip: '
|
|
369
|
+
tooltip: StringManager.get('insert_math', lang_code),
|
|
365
370
|
image: `${WirisPlugin.instances[editor.id].getIconsPath()}formula.png`,
|
|
366
371
|
onAction: openFormulaEditorFunction,
|
|
367
372
|
icon: mathTypeIcon,
|
|
@@ -378,7 +383,7 @@ export const currentInstance = null;
|
|
|
378
383
|
}
|
|
379
384
|
editor.addCommand(cmd, commandFunction);
|
|
380
385
|
commonEditor.addButton(`tiny_mce_wiris_formulaEditor${customEditors.editors[customEditor].name}`, {
|
|
381
|
-
tooltip:
|
|
386
|
+
tooltip: StringManager.get('insert_chem', lang_code),
|
|
382
387
|
onAction: commandFunction,
|
|
383
388
|
image: WirisPlugin.instances[editor.id].getIconsPath() + customEditors.editors[customEditor].icon,
|
|
384
389
|
icon: chemTypeIcon, // At the moment only chemTypeIcon because of the provisional solution for TinyMCE6.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiris/mathtype-tinymce6",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "MathType Web for TinyMCE6 editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chem",
|
|
@@ -43,8 +43,6 @@
|
|
|
43
43
|
"shx": "^0.3.3",
|
|
44
44
|
"style-loader": "^3.3.0",
|
|
45
45
|
"terser-webpack-plugin": "^5.3.0",
|
|
46
|
-
"url-loader": "^4.1.1"
|
|
47
|
-
"webpack": "^5.50.0",
|
|
48
|
-
"webpack-cli": "^4.8.0"
|
|
46
|
+
"url-loader": "^4.1.1"
|
|
49
47
|
}
|
|
50
48
|
}
|