From 2e85069f5461a4ef7b9d84113fd435743f3236fa Mon Sep 17 00:00:00 2001 From: Manuel Cagigas Date: Fri, 16 Jun 2017 10:34:05 +0200 Subject: [PATCH] 4.4.0 Stable version --- .travis.yml | 6 ++ README.md | 5 +- VERSION | 2 +- tinymce/VERSION | 2 +- tinymce/core/core.js | 187 +++++++++++++++++++++------------ tinymce/core/editor.js | 46 +++++--- tinymce/editor_plugin.js | 2 +- tinymce/editor_plugin_src.js | 2 +- tinymce/lang/ar/strings.js | 3 + tinymce/lang/ca/strings.js | 3 + tinymce/lang/cs/strings.js | 3 + tinymce/lang/da/strings.js | 3 + tinymce/lang/de/strings.js | 3 + tinymce/lang/el/strings.js | 3 + tinymce/lang/en/strings.js | 3 + tinymce/lang/es/strings.js | 3 + tinymce/lang/et/strings.js | 3 + tinymce/lang/eu/strings.js | 3 + tinymce/lang/fi/strings.js | 3 + tinymce/lang/fr/strings.js | 3 + tinymce/lang/gl/strings.js | 3 + tinymce/lang/he/strings.js | 3 + tinymce/lang/hr/strings.js | 3 + tinymce/lang/hu/strings.js | 3 + tinymce/lang/it/strings.js | 3 + tinymce/lang/ja/strings.js | 3 + tinymce/lang/ko/strings.js | 3 + tinymce/lang/nl/strings.js | 3 + tinymce/lang/no/strings.js | 3 + tinymce/lang/pl/strings.js | 3 + tinymce/lang/pt/strings.js | 3 + tinymce/lang/pt_br/strings.js | 3 + tinymce/lang/ru/strings.js | 3 + tinymce/lang/sv/strings.js | 3 + tinymce/lang/tr/strings.js | 3 + tinymce/lang/zh/strings.js | 3 + tinymce/plugin.js | 2 +- tinymce/plugin.min.js | 2 +- tinymce/wirisplugin-generic.js | 4 +- version.php | 8 +- 40 files changed, 259 insertions(+), 93 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8551765..583bf37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ php: - 7.0 env: + - MOODLE_BRANCH=MOODLE_33_STABLE DB=mysqli + - MOODLE_BRANCH=MOODLE_32_STABLE DB=mysqli - MOODLE_BRANCH=MOODLE_31_STABLE DB=mysqli - MOODLE_BRANCH=MOODLE_30_STABLE DB=pgsql - MOODLE_BRANCH=MOODLE_29_STABLE DB=mysqli @@ -35,6 +37,10 @@ matrix: env: MOODLE_BRANCH=MOODLE_28_STABLE DB=pgsql - php: 5.6 env: MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli + - php: 5.4 + env: MOODLE_BRANCH=MOODLE_32_STABLE DB=mysqli + - php: 5.4 + env: MOODLE_BRANCH=MOODLE_33_STABLE DB=mysqli include: - php: 5.4 env: MOODLE_BRANCH=MOODLE_31_STABLE DB=mysqli diff --git a/README.md b/README.md index 217a23d..296dc09 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ WIRIS plugin for Moodle ========== +### Master Build Status [![Build Status](https://travis-ci.org/wiris/moodle-tinymce_tiny_mce_wiris.svg?branch=master)](https://travis-ci.org/wiris/moodle-tinymce_tiny_mce_wiris) +### Development Build Status +[![Build Status](https://travis-ci.org/wiris/moodle-tinymce_tiny_mce_wiris.svg?branch=development)](https://travis-ci.org/wiris/moodle-tinymce_tiny_mce_wiris) -Add a fully WYSIWYG editor for scientific expressions ([WIRIS EDITOR](http://www.wiris.com/editor)) and, optionally, an advanced calculator tool ([WIRIS CAS](http://www.wiris.com/cas)). Enabled editing to STEM related topics (Science, Technology, Engineering and Mathematics). +Add a fully WYSIWYG editor for scientific expressions ([WIRIS EDITOR](http://www.wiris.com/editor)) and, optionally, an advanced calculator tool ([WIRIS CAS](http://www.wiris.com/cas)). Enabled editing to STEM related topics (Science, Technology, Engineering and Mathematics). [WIRIS EDITOR](http://www.wiris.com/editor) is a mathematical **visual (WYSIWYG) editor**. You can use a large collection of icons nicely organized in thematic tabs in order to create formulas or equations for any web content. You can create and edit your formulas in a visual environment, just click on the WIRIS editor icon for creation or double-click on the formula for edition. It is based on JavaScript and compatible with HTML 5. diff --git a/VERSION b/VERSION index a2914fe..4756899 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.1.1366 +4.4.0.1366 diff --git a/tinymce/VERSION b/tinymce/VERSION index a2914fe..4756899 100644 --- a/tinymce/VERSION +++ b/tinymce/VERSION @@ -1 +1 @@ -4.3.1.1366 +4.4.0.1366 diff --git a/tinymce/core/core.js b/tinymce/core/core.js index 231ae6f..829ace1 100644 --- a/tinymce/core/core.js +++ b/tinymce/core/core.js @@ -116,7 +116,7 @@ if (!(window._wrs_conf_CASClassName)) { if (typeof MutationObserver != 'undefined') { var wrs_observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - if (mutation.oldValue == _wrs_conf_imageClassName && mutation.attributeName == 'class' && mutation.target.className.indexOf(_wrs_conf_imageClassName) == -1 ) { + if (mutation.oldValue == _wrs_conf_imageClassName && mutation.attributeName == 'class' && mutation.targetpassName.indexOf(_wrs_conf_imageClassName) == -1 ) { mutation.target.className = _wrs_conf_imageClassName; } }); @@ -894,7 +894,15 @@ function wrs_getLatexFromMathML(mathml) { 'mml': mathml }; - return wrs_getContent(_wrs_conf_servicePath, data); + var jsonResponse = JSON.parse(wrs_getContent(_wrs_conf_servicePath, data)); + + var latex; + + if (jsonResponse.status == "ok") { + latex = jsonResponse.result.text; + } + + return latex; } /** @@ -1019,10 +1027,19 @@ function wrs_getMathMLFromLatex(latex, includeLatexOnSemantics) { data['saveLatex'] = ''; } - var mathML = wrs_getContent(_wrs_conf_servicePath, data); - // Populate LatexCache. - wrs_populateLatexCache(latex, mathML); - return mathML.split("\r").join('').split("\n").join(' '); + var jsonResponse = JSON.parse(wrs_getContent(_wrs_conf_servicePath, data)); + + var output; + if (jsonResponse.status == "ok") { + var output = jsonResponse.result.text; + output = output.split("\r").join('').split("\n").join(' '); + // Populate LatexCache. + wrs_populateLatexCache(latex, output); + } else { + output = "$$" + latex + "$$"; + } + + return output; } /** @@ -1504,8 +1521,6 @@ function wrs_getElementsByNameFromString(code, name, autoClosed) { */ function wrs_insertElementOnSelection(element, focusElement, windowTarget) { try { - focusElement.focus(); - // Integration function // If wrs_int_insertElementOnSelection function exists on // integration script can call focus method from the editor instance. @@ -1515,6 +1530,9 @@ function wrs_insertElementOnSelection(element, focusElement, windowTarget) { if (typeof wrs_int_insertElementOnSelection != 'undefined') { wrs_int_insertElementOnSelection(); } + else { + focusElement.focus(); + } if (_wrs_isNewElement) { if (document.selection && document.getSelection == 0) { @@ -1827,7 +1845,10 @@ function wrs_mathmlToAccessible(mathml, language, data) { } else { data['service'] = 'mathml2accessible'; - var accessibleText = wrs_getContent(_wrs_conf_servicePath, data); + var accesibleJsonResponse = JSON.parse(wrs_getContent(_wrs_conf_servicePath, data)); + if (accesibleJsonResponse.status != 'error') { + accessibleText = accesibleJsonResponse.result.text; + } } return accessibleText; @@ -2206,7 +2227,6 @@ function wrs_openEditorWindow(language, target, isIframe) { document.getElementsByTagName("head")[0].appendChild(fileref); _wrs_css_loaded = true; } - _wrs_modalWindow.setTitle(title); _wrs_modalWindow.open(); } } @@ -2648,21 +2668,7 @@ function wrs_initSetSize() { function wrs_loadConfiguration() { if (typeof _wrs_conf_path == 'undefined') { - // Discover path. - var scriptName = "core/core.js"; - var col = document.getElementsByTagName("script"); - for (i = 0; i < col.length; i++) { - var d; - var src; - d = col[i]; - src = d.src; - var j = src.lastIndexOf(scriptName); - if (j >= 0) { - // That's my script! - baseURL = src.substr(0, j - 1); - } - } - _wrs_conf_path = baseURL; + _wrs_conf_path = wrs_getCorePath(); } var script = document.createElement('script'); @@ -2676,6 +2682,29 @@ function wrs_loadConfiguration() { document.getElementsByTagName('head')[0].appendChild(script); // Asynchronous load of configuration. } +function wrs_getCorePath() { + var scriptName = "core/core.js"; + var col = document.getElementsByTagName("script"); + for (i = 0; i < col.length; i++) { + var d; + var src; + d = col[i]; + src = d.src; + var j = src.lastIndexOf(scriptName); + if (j >= 0) { + // That's my script! + return src.substr(0, j - 1); + } + } +} + +function wrs_loadLangFile() { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = wrs_getCorePath() + "/lang/" + _wrs_int_langCode + "/strings.js"; + document.getElementsByTagName('head')[0].appendChild(script); +} + function wrs_concatenateUrl(path1, path2) { return (path1 + path2).replace(/([^:]\/)\/+/g, "$1"); } @@ -2688,7 +2717,7 @@ if (typeof _wrs_conf_configuration_loaded == 'undefined') { _wrs_conf_plugin_loaded = true; } - +wrs_loadLangFile() /** * Create modal window with embebbed iframe @@ -3381,6 +3410,17 @@ function wrs_addPluginListener(listener) { wrs_pluginListeners.push(listener); } +/** + * For now its not possible comunicate directly between editor.js and ModalWindow object. + * We need to use this method to call ModalWindow prototype from editor.js + * @param {object} editor WIRIS Editor + */ +function wrs_setModalWindowEditor(editor) { + if (_wrs_conf_modalWindow) { + _wrs_modalWindow.setEditor(editor); + } +} + // Production steps of ECMA-262, Edition 5, 15.4.4.18 // Reference: http://es5.github.io/#x15.4.4.18. if (!Array.prototype.forEach) { @@ -4054,19 +4094,19 @@ function ModalWindow(path, editorAttributes) { attributes = {}; attributes['class'] = 'wrs_modal_close_button'; - attributes['title'] = 'Close'; + attributes['title'] = strings['close']; var closeModalDiv = wrs_createElement('div', attributes); this.closeDiv = closeModalDiv; attributes = {}; attributes['class'] = 'wrs_modal_stack_button'; - attributes['title'] = 'Full-screen'; + attributes['title'] = strings['fullscreen']; var stackModalDiv = wrs_createElement('div', attributes); this.stackDiv = stackModalDiv; attributes = {}; attributes['class'] = 'wrs_modal_minimize_button'; - attributes['title'] = 'Minimise'; + attributes['title'] = strings['minimise']; var minimizeModalDiv = wrs_createElement('div', attributes); this.minimizeDiv = minimizeModalDiv; @@ -4088,8 +4128,7 @@ function ModalWindow(path, editorAttributes) { var iframeModalContainer = wrs_createElement('div', attributes); this.iframeContainer = iframeModalContainer; - this.editor = null; - + this.lastImageWasNew = true; } ModalWindow.prototype.create = function() { @@ -4143,30 +4182,47 @@ ModalWindow.prototype.open = function() { if (this.properties.open == true || this.properties.created) { - var editor = this.iframe.contentWindow._wrs_modalWindowProperties.editor; - var update_toolbar = function() { + var editor = this.editor; + var updateToolbar = function() { if (customEditor = wrs_int_getCustomEditorEnabled()) { - toolbar = customEditor.toolbar ? customEditor.toolbar : wrs_attributes['toolbar']; + var toolbar = customEditor.toolbar ? customEditor.toolbar : _wrs_int_wirisProperties['toolbar']; + _wrs_modalWindow.setTitle(customEditor.title); if (typeof editor.params.toolbar == 'undefined' || editor.params.toolbar != toolbar) { editor.setParams({'toolbar' : toolbar}); - _wrs_modalWindow.setTitle(customEditor.title); } - } else if (typeof editor.params.toolbar != 'undefined' && editor.params.toolbar != 'general') { - editor.setParams({'toolbar' : 'general'}); + } else { + var toolbar = (typeof _wrs_int_wirisProperties == 'undefined' || typeof _wrs_int_wirisProperties['toolbar'] == 'undefined') ? 'general' : _wrs_int_wirisProperties['toolbar']; _wrs_modalWindow.setTitle('WIRIS EDITOR math'); + if (typeof editor.params.toolbar == 'undefined' || editor.params.toolbar != toolbar) { + editor.setParams({'toolbar' : toolbar}); + wrs_int_disableCustomEditors(); + } + } + }; + + var self = this; + + // It controls cases where is needed to set an empty mathml or copy the current mathml value. + var updateMathMLContent = function () { + if (!self.lastImageWasNew) { + if (self.properties.deviceProperties.isAndroid || self.properties.deviceProperties.isIOS) { + editor.setMathML('[]"'); + } else { + editor.setMathML(''); + } } }; if (this.properties.open == true) { - var customEditorClass = _wrs_temporalImage.getAttribute('data-custom-editor'); - if (customEditorClass) { - wrs_int_enableCustomEditor(customEditorClass); + updateToolbar(); + if (_wrs_isNewElement) { + updateMathMLContent(); + self.lastImageWasNew = true; } else { - wrs_int_disableCustomEditors(); + editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml'))); + this.lastImageWasNew = false; } - update_toolbar(); - this.iframe.contentWindow._wrs_modalWindowProperties.editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml'))); } else { this.containerDiv.style.visibility = ''; @@ -4176,26 +4232,18 @@ ModalWindow.prototype.open = function() { this.properties.open = true; + updateToolbar(); + if (_wrs_isNewElement) { - if (this.properties.deviceProperties.isAndroid || this.properties.deviceProperties.isIOS) { - editor.setMathML('[]"'); - } else { - editor.setMathML(''); - } - update_toolbar(); + updateMathMLContent(); + self.lastImageWasNew = true; } else { - var customEditorClass = _wrs_temporalImage.getAttribute('data-custom-editor'); - if (customEditorClass) { - wrs_int_enableCustomEditor(customEditorClass); - } - else { - wrs_int_disableCustomEditors(); - } - update_toolbar(); editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml'))); + this.lastImageWasNew = false; } editor.focus(); + if (!this.properties.deviceProperties.isAndroid && !this.properties.deviceProperties.isIOS) { this.stackModalWindow(); } @@ -4205,6 +4253,8 @@ ModalWindow.prototype.open = function() { this.maximizeModalWindow(); } } else { + var title = wrs_int_getCustomEditorEnabled() != null ? wrs_int_getCustomEditorEnabled().title : 'WIRIS EDITOR math'; + _wrs_modalWindow.setTitle(title); this.create(); } @@ -4215,13 +4265,14 @@ ModalWindow.prototype.open = function() { * @ignore */ ModalWindow.prototype.close = function() { + // Is mandatory make this BEFORE hide modalwindow. + this.editor.setMathML(''); this.overlayDiv.style.visibility = 'hidden'; this.containerDiv.style.visibility = 'hidden'; this.containerDiv.style.display = 'none'; this.overlayDiv.style.display = 'none'; this.properties.open = false; wrs_int_disableCustomEditors(); - document.getElementsByClassName('wrs_modal_iframe')[0].contentWindow._wrs_modalWindowProperties.editor.setMathML(''); // Properties to initial state. this.properties.state = ''; this.properties.previousState = ''; @@ -4468,9 +4519,6 @@ ModalWindow.prototype.startDrag = function(ev) { }; } - if (typeof dialogContainerDiv != 'undefined') { - this.addClass('wrs_drag'); - } } /** @@ -4508,7 +4556,6 @@ ModalWindow.prototype.stopDrag = function(ev) { this.containerDiv.style.top = parseInt(this.containerDiv.style.top) - window.pageYOffset + "px"; } this.containerDiv.style.bottom = null; - wrs_addClass(this.containerDiv, 'wrs_drag'); this.dragDataObject = null; } @@ -4539,10 +4586,14 @@ ModalWindow.prototype.hideKeyboard = function() { }, 200); }; - // ...focus function changes scroll value, so we need to restore it. - if (typeof scrollY != 'undefined') { - var keepScroll = scrollY; - field.focus(); - window.scrollTo(0, keepScroll); - } + var keepScroll = window.pageYOffset; + field.focus(); + window.scrollTo(0, keepScroll); +} + +/** + * Set WIRIS Editor as variable + */ +ModalWindow.prototype.setEditor = function(editor) { + this.editor = editor; } diff --git a/tinymce/core/editor.js b/tinymce/core/editor.js index 0111797..3e6faca 100644 --- a/tinymce/core/editor.js +++ b/tinymce/core/editor.js @@ -220,10 +220,6 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl wrs_attributes['toolbar'] = _wrs_conf_editorToolbar; } - if (customEditor = wrs_int_getCustomEditorEnabled()) { - wrs_attributes['toolbar'] = customEditor.toolbar ? customEditor.toolbar : wrs_attributes['toolbar']; - } - if (typeof(_wrs_int_wirisProperties) != 'undefined') { for (var key in _wrs_int_wirisProperties) { if (_wrs_int_wirisProperties.hasOwnProperty(key) && typeof(_wrs_int_wirisProperties[key]) != 'undefined') { @@ -232,12 +228,20 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl } } + if (customEditor = wrs_int_getCustomEditorEnabled()) { + wrs_attributes['toolbar'] = customEditor.toolbar ? customEditor.toolbar : wrs_attributes['toolbar']; + } + if (com.wiris.jsEditor.defaultBasePath) { editor = com.wiris.jsEditor.JsEditor.newInstance(wrs_attributes); } else { editor = new com.wiris.jsEditor.JsEditor('editor', null); } + + // Set ModalWindow editor attribute. + getMethod(null, 'wrs_setModalWindowEditor', [editor], function(){ + }); _wrs_modalWindowProperties.editor = editor; var ua = navigator.userAgent.toLowerCase(); @@ -303,6 +307,7 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl }); wrs_addEvent(submitButton, 'click', function () { + // In order to avoid n-formulas on n-clicks // submit button is disabled 1 second. submitButton.disabled = true; @@ -311,18 +316,33 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl submitButton.disabled = false; }, 1000); - var mathml = ''; + // There are vars that are updated during the execution in core.js, we need to sync. + var varsToUpdate = ['_wrs_int_customEditors']; + getVars(varsToUpdate, function(object) { // Callback method to set variables. + for (var varName in object) { + window[varName] = object[varName]; // Variables set as global variables on window (core.js is on window can't change the scope). + } - if (!editor.isFormulaEmpty()) { - mathml += editor.getMathML(); // If isn't empty, get mathml code to mathml variable. - if (customEditor) { - mathml = wrs_mathmlAddEditorAttribute(mathml); + var mathml = ''; + + if (!editor.isFormulaEmpty()) { + mathml += editor.getMathML(); // If isn't empty, get mathml code to mathml variable. + if (wrs_int_getCustomEditorEnabled() != null) { + mathml = wrs_mathmlAddEditorAttribute(mathml); + } + else { + var startIndex = mathml.indexOf(' class="'); + if (startIndex != -1) { + var lastIndex = mathml.indexOf('"', startIndex + 8); + mathml = mathml.substring(0, startIndex) + mathml.substring(lastIndex + 1); + } + } + mathml = wrs_mathmlEntities(mathml); // Apply a parse. } - mathml = wrs_mathmlEntities(mathml); // Apply a parse. - } - getMethod(null, 'wrs_int_updateFormula', [mathml, null, queryParams['lang']], function(){ - _wrs_closeFunction(); + getMethod(null, 'wrs_int_updateFormula', [mathml, null, queryParams['lang']], function(){ + _wrs_closeFunction(); + }); }); }); diff --git a/tinymce/editor_plugin.js b/tinymce/editor_plugin.js index 7e1de53..83f1767 100644 --- a/tinymce/editor_plugin.js +++ b/tinymce/editor_plugin.js @@ -259,7 +259,7 @@ var _wrs_int_langCode = 'en'; if (editor.settings['wirisformulaeditorlang']) { language = editor.settings['wirisformulaeditorlang']; } - + wrs_int_disableCustomEditors(); wrs_int_openNewFormulaEditor(element, language, editor.inline ? false : true); }); diff --git a/tinymce/editor_plugin_src.js b/tinymce/editor_plugin_src.js index 7e1de53..83f1767 100644 --- a/tinymce/editor_plugin_src.js +++ b/tinymce/editor_plugin_src.js @@ -259,7 +259,7 @@ var _wrs_int_langCode = 'en'; if (editor.settings['wirisformulaeditorlang']) { language = editor.settings['wirisformulaeditorlang']; } - + wrs_int_disableCustomEditors(); wrs_int_openNewFormulaEditor(element, language, editor.inline ? false : true); }); diff --git a/tinymce/lang/ar/strings.js b/tinymce/lang/ar/strings.js index edb851e..3455ca6 100644 --- a/tinymce/lang/ar/strings.js +++ b/tinymce/lang/ar/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'إلغاء'; strings['accept'] = 'مواÙ?Ù‚'; strings['manual'] = 'الدليل'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/ca/strings.js b/tinymce/lang/ca/strings.js index 148514d..efb791a 100644 --- a/tinymce/lang/ca/strings.js +++ b/tinymce/lang/ca/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancel·lar'; strings['accept'] = 'Acceptar'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/cs/strings.js b/tinymce/lang/cs/strings.js index d7f26e7..04fc767 100644 --- a/tinymce/lang/cs/strings.js +++ b/tinymce/lang/cs/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Storno'; strings['accept'] = 'OK'; strings['manual'] = 'PříruÄ?ka'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/da/strings.js b/tinymce/lang/da/strings.js index 0a9c68d..e048ef7 100644 --- a/tinymce/lang/da/strings.js +++ b/tinymce/lang/da/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Annuller'; strings['accept'] = 'OK'; strings['manual'] = 'Brugervejledning'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/de/strings.js b/tinymce/lang/de/strings.js index 15d6baa..d046de3 100644 --- a/tinymce/lang/de/strings.js +++ b/tinymce/lang/de/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Abbrechen'; strings['accept'] = 'OK'; strings['manual'] = 'Handbuch'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/el/strings.js b/tinymce/lang/el/strings.js index 7ec63cb..c2426c1 100644 --- a/tinymce/lang/el/strings.js +++ b/tinymce/lang/el/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Άκυ strings['accept'] = 'ΟΚ'; strings['manual'] = 'ΧειÏ?οκίνητα'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/en/strings.js b/tinymce/lang/en/strings.js index b23a577..3a910eb 100644 --- a/tinymce/lang/en/strings.js +++ b/tinymce/lang/en/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancel'; strings['accept'] = 'OK'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/es/strings.js b/tinymce/lang/es/strings.js index f890ebc..1faba7e 100644 --- a/tinymce/lang/es/strings.js +++ b/tinymce/lang/es/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancelar'; strings['accept'] = 'Aceptar'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/et/strings.js b/tinymce/lang/et/strings.js index ca42413..22d8e3a 100644 --- a/tinymce/lang/et/strings.js +++ b/tinymce/lang/et/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Loobu'; strings['accept'] = 'OK'; strings['manual'] = 'Käsiraamat'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/eu/strings.js b/tinymce/lang/eu/strings.js index a38e784..76f21b0 100644 --- a/tinymce/lang/eu/strings.js +++ b/tinymce/lang/eu/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Ezeztatu'; strings['accept'] = 'Onartu'; strings['manual'] = 'Gida'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/fi/strings.js b/tinymce/lang/fi/strings.js index e00d906..4c479ce 100644 --- a/tinymce/lang/fi/strings.js +++ b/tinymce/lang/fi/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Peruuta'; strings['accept'] = 'OK'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/fr/strings.js b/tinymce/lang/fr/strings.js index 832eb3f..84d07a9 100644 --- a/tinymce/lang/fr/strings.js +++ b/tinymce/lang/fr/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Annuler'; strings['accept'] = 'OK'; strings['manual'] = 'Manuel'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/gl/strings.js b/tinymce/lang/gl/strings.js index f890ebc..1faba7e 100644 --- a/tinymce/lang/gl/strings.js +++ b/tinymce/lang/gl/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancelar'; strings['accept'] = 'Aceptar'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/he/strings.js b/tinymce/lang/he/strings.js index 867cd9a..e00bd68 100644 --- a/tinymce/lang/he/strings.js +++ b/tinymce/lang/he/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'ביטול'; strings['accept'] = '×?ישור'; strings['manual'] = 'מדריך'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/hr/strings.js b/tinymce/lang/hr/strings.js index ef67db9..381ed3c 100644 --- a/tinymce/lang/hr/strings.js +++ b/tinymce/lang/hr/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'PoniÅ¡ti'; strings['accept'] = 'U redu'; strings['manual'] = 'PriruÄ?nik'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/hu/strings.js b/tinymce/lang/hu/strings.js index 89f1311..2ba267d 100644 --- a/tinymce/lang/hu/strings.js +++ b/tinymce/lang/hu/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Mégsem'; strings['accept'] = 'OK'; strings['manual'] = 'Kézikönyv'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/it/strings.js b/tinymce/lang/it/strings.js index fcffa66..c2b539b 100644 --- a/tinymce/lang/it/strings.js +++ b/tinymce/lang/it/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Annulla'; strings['accept'] = 'Accetta'; strings['manual'] = 'Manuale'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/ja/strings.js b/tinymce/lang/ja/strings.js index 3833b53..c017287 100644 --- a/tinymce/lang/ja/strings.js +++ b/tinymce/lang/ja/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'キャンセル'; strings['accept'] = 'OK'; strings['manual'] = 'マニュアル'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/ko/strings.js b/tinymce/lang/ko/strings.js index 8fd0006..c69cb22 100644 --- a/tinymce/lang/ko/strings.js +++ b/tinymce/lang/ko/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = '취소'; strings['accept'] = '승ì?¸'; strings['manual'] = '설명서'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/nl/strings.js b/tinymce/lang/nl/strings.js index 01603f6..f05331c 100644 --- a/tinymce/lang/nl/strings.js +++ b/tinymce/lang/nl/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Annuleren'; strings['accept'] = 'OK'; strings['manual'] = 'Handleiding'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/no/strings.js b/tinymce/lang/no/strings.js index c9f44b7..1acc9fb 100644 --- a/tinymce/lang/no/strings.js +++ b/tinymce/lang/no/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Avbryt'; strings['accept'] = 'OK'; strings['manual'] = 'HÃ¥ndbok'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/pl/strings.js b/tinymce/lang/pl/strings.js index a8c521a..c8a00f9 100644 --- a/tinymce/lang/pl/strings.js +++ b/tinymce/lang/pl/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Anuluj'; strings['accept'] = 'OK'; strings['manual'] = 'Instrukcja'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/pt/strings.js b/tinymce/lang/pt/strings.js index b9d2fc8..b35e4ed 100644 --- a/tinymce/lang/pt/strings.js +++ b/tinymce/lang/pt/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancelar'; strings['accept'] = 'OK'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/pt_br/strings.js b/tinymce/lang/pt_br/strings.js index b9d2fc8..b35e4ed 100644 --- a/tinymce/lang/pt_br/strings.js +++ b/tinymce/lang/pt_br/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Cancelar'; strings['accept'] = 'OK'; strings['manual'] = 'Manual'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/ru/strings.js b/tinymce/lang/ru/strings.js index 9625767..3b91d47 100644 --- a/tinymce/lang/ru/strings.js +++ b/tinymce/lang/ru/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'отмена'; strings['accept'] = 'OK'; strings['manual'] = 'вручную'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/sv/strings.js b/tinymce/lang/sv/strings.js index ab050ef..9731721 100644 --- a/tinymce/lang/sv/strings.js +++ b/tinymce/lang/sv/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Avbryt'; strings['accept'] = 'OK'; strings['manual'] = 'Bruksanvisning'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/tr/strings.js b/tinymce/lang/tr/strings.js index 1db809c..b12fdd4 100644 --- a/tinymce/lang/tr/strings.js +++ b/tinymce/lang/tr/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = 'Vazgeç'; strings['accept'] = 'Tamam'; strings['manual'] = 'Kılavuz'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/lang/zh/strings.js b/tinymce/lang/zh/strings.js index fdcb0f5..8dd366c 100644 --- a/tinymce/lang/zh/strings.js +++ b/tinymce/lang/zh/strings.js @@ -3,3 +3,6 @@ strings['cancel'] = ' strings['accept'] = '确定'; strings['manual'] = '手册'; strings['latex'] = 'LaTeX'; +strings['close'] = 'Close'; +strings['minimise'] = 'Minimise'; +strings['fullscreen'] = 'Full-screen'; diff --git a/tinymce/plugin.js b/tinymce/plugin.js index 7e1de53..83f1767 100644 --- a/tinymce/plugin.js +++ b/tinymce/plugin.js @@ -259,7 +259,7 @@ var _wrs_int_langCode = 'en'; if (editor.settings['wirisformulaeditorlang']) { language = editor.settings['wirisformulaeditorlang']; } - + wrs_int_disableCustomEditors(); wrs_int_openNewFormulaEditor(element, language, editor.inline ? false : true); }); diff --git a/tinymce/plugin.min.js b/tinymce/plugin.min.js index 7e1de53..83f1767 100644 --- a/tinymce/plugin.min.js +++ b/tinymce/plugin.min.js @@ -259,7 +259,7 @@ var _wrs_int_langCode = 'en'; if (editor.settings['wirisformulaeditorlang']) { language = editor.settings['wirisformulaeditorlang']; } - + wrs_int_disableCustomEditors(); wrs_int_openNewFormulaEditor(element, language, editor.inline ? false : true); }); diff --git a/tinymce/wirisplugin-generic.js b/tinymce/wirisplugin-generic.js index df0a4ed..73e132b 100644 --- a/tinymce/wirisplugin-generic.js +++ b/tinymce/wirisplugin-generic.js @@ -50,7 +50,7 @@ var _wrs_int_customEditors = {chemistry : {name: 'Chemistry', toolbar : 'chemist if (typeof _wrs_int_langCode == 'undefined') { if (navigator.userLanguage) { - _wrs_int_langCode = navigator.userLanguage; + _wrs_int_langCode = navigator.userLanguage.substring(0, 2); } else if (navigator.language) { _wrs_int_langCode = navigator.language.substring(0, 2); @@ -110,6 +110,7 @@ function wrs_int_init_handler(target,toolbar) { formulaButton.style.cursor = 'pointer'; wrs_addEvent(formulaButton, 'click', function () { + wrs_int_disableCustomEditors(); wrs_int_openNewFormulaEditor(target, _wrs_int_langCode); }); @@ -190,6 +191,7 @@ function wrs_int_openNewCAS(iframe, language) { */ function wrs_int_doubleClickHandler(iframe, element) { if (element.nodeName.toLowerCase() == 'img') { + wrs_int_disableCustomEditors(); if (customEditor = element.getAttribute('data-custom-editor')) { wrs_int_enableCustomEditor(customEditor); } diff --git a/version.php b/version.php index ca17c0f..842380a 100644 --- a/version.php +++ b/version.php @@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017050800; -$plugin->release = '4.3.1.1366'; -$plugin->requires = 2012120300; +$plugin->version = 2017061500; +$plugin->release = '4.4.0.1366'; +$plugin->requires = 2012120300; $plugin->component = 'tinymce_tiny_mce_wiris'; -$plugin->dependencies = array ('filter_wiris' => 2017050800); +$plugin->dependencies = array ('filter_wiris' => 2017061500); $plugin->maturity = MATURITY_STABLE;