@wiris/mathtype-tinymce6 7.31.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/README.md CHANGED
@@ -71,7 +71,7 @@ Easily include quality math equations in your documents and digital content.
71
71
 
72
72
  This npm module uses remotely hosted services to render MathML data. However, we recommend you install these services on your backend. This will allow you, among other things, to configure the service and to locally store the images generated by MathType.
73
73
 
74
- The services are available for Java, PHP, .NET and Ruby on Rails. If you use any of these technologies, please download the plugin for your backend technology from [here](https://store.wiris.com/en/products/downloads/mathtype/integrations#froala3?utm_source=npmjs&utm_medium=referral).
74
+ The services are available for Java, PHP, .NET and Ruby on Rails. If you use any of these technologies, please download the plugin for your backend technology from [here](https://store.wiris.com/en/products/downloads/mathtype/integrations#froala?utm_source=npmjs&utm_medium=referral).
75
75
 
76
76
  ## Displaying on Target Page
77
77
 
@@ -92,4 +92,4 @@ To find out more information about MathType, please go to the following document
92
92
 
93
93
  ## Privacy policy
94
94
 
95
- The [MathType Privacy Policy](https://www.wiris.com/en/mathtype-privacy-policy/?utm_source=npmjs&utm_medium=referral) covers the data processing operations for the MathType users. It is an addendum of the company’s general Privacy Policy and the [general Privacy Policy](https://www.wiris.com/en/privacy-policy?utm_source=npmjs&utm_medium=referral) still applies to MathType users.
95
+ The [MathType Privacy Policy](https://www.wiris.com/en/mathtype-privacy-policy/?utm_source=npmjs&utm_medium=referral) covers the data processing operations for the MathType users. It is an addendum of the company’s general Privacy Policy and the [general Privacy Policy](https://www.wiris.com/en/privacy-policy?utm_source=npmjs&utm_medium=referral) still applies to MathType users.
@@ -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();
@@ -174,9 +175,10 @@ export const currentInstance = null;
174
175
  * @property {String} editor - Editor name.
175
176
  */
176
177
  const integrationModelProperties = {};
177
- integrationModelProperties.serviceProviderProperties = {};
178
- integrationModelProperties.serviceProviderProperties.URI = 'https://www.wiris.net/demo/plugins/app';
179
- integrationModelProperties.serviceProviderProperties.server = 'java';
178
+ integrationModelProperties.serviceProviderProperties = {
179
+ URI: process.env.SERVICE_PROVIDER_URI,
180
+ server: process.env.SERVICE_PROVIDER_SERVER,
181
+ };
180
182
  integrationModelProperties.version = packageInfo.version;
181
183
  integrationModelProperties.isMoodle = (!!((typeof M === 'object' && M !== null))); // eslint-disable-line no-undef
182
184
  if (integrationModelProperties.isMoodle) {
@@ -358,9 +360,13 @@ export const currentInstance = null;
358
360
  }
359
361
  });
360
362
 
363
+ // Get editor language code
364
+ let lang_code = editor.getParam('language');
365
+ lang_code = (lang_code.split("-")[0]).split("_")[0];
366
+
361
367
  // MathType button.
362
368
  commonEditor.addButton('tiny_mce_wiris_formulaEditor', {
363
- tooltip: 'Insert a math equation - MathType',
369
+ tooltip: StringManager.get('insert_math', lang_code),
364
370
  image: `${WirisPlugin.instances[editor.id].getIconsPath()}formula.png`,
365
371
  onAction: openFormulaEditorFunction,
366
372
  icon: mathTypeIcon,
@@ -377,7 +383,7 @@ export const currentInstance = null;
377
383
  }
378
384
  editor.addCommand(cmd, commandFunction);
379
385
  commonEditor.addButton(`tiny_mce_wiris_formulaEditor${customEditors.editors[customEditor].name}`, {
380
- tooltip: customEditors.editors[customEditor].tooltip,
386
+ tooltip: StringManager.get('insert_chem', lang_code),
381
387
  onAction: commandFunction,
382
388
  image: WirisPlugin.instances[editor.id].getIconsPath() + customEditors.editors[customEditor].icon,
383
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": "7.31.0",
3
+ "version": "8.1.0",
4
4
  "description": "MathType Web for TinyMCE6 editor",
5
5
  "keywords": [
6
6
  "chem",
@@ -29,11 +29,10 @@
29
29
  "build": "webpack --mode production",
30
30
  "build-dev": "webpack --mode development",
31
31
  "clean": "shx rm -f plugin.min.js",
32
- "compile": "node ../../scripts/services/compile editor_plugin.src.js .",
33
- "prepack": "npm install && npm run compile -- npm"
32
+ "prepack": "npm install && npm run build"
34
33
  },
35
34
  "dependencies": {
36
- "@wiris/mathtype-html-integration-devkit": "1.8.1"
35
+ "@wiris/mathtype-html-integration-devkit": "1.9.0"
37
36
  },
38
37
  "devDependencies": {
39
38
  "@babel/core": "^7.15.0",
@@ -44,8 +43,6 @@
44
43
  "shx": "^0.3.3",
45
44
  "style-loader": "^3.3.0",
46
45
  "terser-webpack-plugin": "^5.3.0",
47
- "url-loader": "^4.1.1",
48
- "webpack": "^5.50.0",
49
- "webpack-cli": "^4.8.0"
46
+ "url-loader": "^4.1.1"
50
47
  }
51
48
  }