Skip to content

Commit

Permalink
4.3.0.1365
Browse files Browse the repository at this point in the history
 Stable version
  • Loading branch information
mcagigas-at-wiris committed May 8, 2017
1 parent 69f3a2c commit 79bf157
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 39 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0.1364
4.3.0.1365
2 changes: 1 addition & 1 deletion tinymce/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0.1364
4.3.0.1365
1 change: 1 addition & 0 deletions tinymce/configuration.ini.dist
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#wiriseditorwindowattributes = width=570, height=450, scroll=no, resizable=yes
#wiriseditorsetsize = false
#wiriseditormodalwindow = false
#wiriseditormodalwindowfullscreen = true
#wirischemeditorenabled = true
#wirisimageformat = png

Expand Down
99 changes: 69 additions & 30 deletions tinymce/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2184,7 +2184,7 @@ function wrs_openEditorWindow(language, target, isIframe) {
}

var title = wrs_int_getCustomEditorEnabled() != null ? wrs_int_getCustomEditorEnabled().title : 'WIRIS EDITOR math';
if (!_wrs_conf_modalWindow) {
if (_wrs_conf_modalWindow != 'undefined' && _wrs_conf_modalWindow === false) {
_wrs_popupWindow = window.open(path, title, _wrs_conf_editorAttributes);
return _wrs_popupWindow;
}
Expand All @@ -2196,7 +2196,7 @@ function wrs_openEditorWindow(language, target, isIframe) {
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", wrs_concatenateUrl(window.parent._wrs_conf_path, '/core/modal.css'));
fileref.setAttribute("href", wrs_concatenateUrl(_wrs_conf_path, '/core/modal.css'));
document.getElementsByTagName("head")[0].appendChild(fileref);
_wrs_css_loaded = true;
}
Expand Down Expand Up @@ -2700,7 +2700,7 @@ function wrs_createModalWindow() {
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", wrs_concatenateUrl(window.parent._wrs_conf_path, '/core/modal.css'));
fileref.setAttribute("href", wrs_concatenateUrl(_wrs_conf_path, '/core/modal.css'));
document.getElementsByTagName("head")[0].appendChild(fileref);
_wrs_css_loaded = true;
}
Expand Down Expand Up @@ -3223,15 +3223,17 @@ function getMetricsFromSvgString(svgString) {
*/
function wrs_int_getCustomEditorEnabled() {
var customEditorEnabled = null;
Object.keys(_wrs_int_customEditors).forEach(function(key) {
for (var key in _wrs_int_customEditors) {
if (_wrs_int_customEditors[key].enabled) {
customEditorEnabled = _wrs_int_customEditors[key]
customEditorEnabled = _wrs_int_customEditors[key];
break;
}
});
}

return customEditorEnabled;
}


/**
* Disable all custom editors
* @ignore
Expand Down Expand Up @@ -4122,50 +4124,84 @@ ModalWindow.prototype.create = function() {
_wrs_popupWindow = this.iframe.contentWindow;
this.properties.open = true;
this.properties.created = true;

if (typeof _wrs_conf_modalWindow != "undefined" && _wrs_conf_modalWindow && _wrs_conf_modalWindowFullScreen) {
this.maximizeModalWindow();
}

}

ModalWindow.prototype.open = function() {

this.hideKeyboard();

if (this.properties.open == true) {
this.iframe.contentWindow._wrs_modalWindowProperties.editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml')));
} else if (this.properties.created) {

this.containerDiv.style.visibility = '';
this.overlayDiv.style.visibility = '';
this.containerDiv.style.display = '';
this.overlayDiv.style.display = '';
if (this.properties.open == true || this.properties.created) {

var editor = this.iframe.contentWindow._wrs_modalWindowProperties.editor;
var update_toolbar = function() {
if (customEditor = wrs_int_getCustomEditorEnabled()) {
toolbar = customEditor.toolbar ? customEditor.toolbar : wrs_attributes['toolbar'];
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'});
_wrs_modalWindow.setTitle('WIRIS EDITOR math');
}
};

this.properties.open = true;
if (customEditor = wrs_int_getCustomEditorEnabled()) {
toolbar = customEditor.toolbar ? customEditor.toolbar : wrs_attributes['toolbar'];
if (typeof editor.params.toolbar == 'undefined' || editor.params.toolbar != toolbar) {
editor.setParams({'toolbar' : toolbar});
if (this.properties.open == true) {
var customEditorClass = _wrs_temporalImage.getAttribute('data-custom-editor');
if (customEditorClass) {
wrs_int_enableCustomEditor(customEditorClass);
}
else {
wrs_int_disableCustomEditors();
}
} else if (typeof editor.params.toolbar != 'undefined' && editor.params.toolbar != 'general') {
editor.setParams({'toolbar' : 'general'});
update_toolbar();
this.iframe.contentWindow._wrs_modalWindowProperties.editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml')));
}
else {
this.containerDiv.style.visibility = '';
this.overlayDiv.style.visibility = '';
this.containerDiv.style.display = '';
this.overlayDiv.style.display = '';

if (_wrs_isNewElement) {
if (this.properties.deviceProperties.isAndroid || this.properties.deviceProperties.isIOS) {
editor.setMathML('<math><semantics><annotation encoding="application/json">[]</annotation></semantics></math>"');
this.properties.open = true;

if (_wrs_isNewElement) {
if (this.properties.deviceProperties.isAndroid || this.properties.deviceProperties.isIOS) {
editor.setMathML('<math><semantics><annotation encoding="application/json">[]</annotation></semantics></math>"');
} else {
editor.setMathML('<math/>');
}
update_toolbar();
} else {
editor.setMathML('<math/>');
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')));
}

editor.focus();
if (!this.properties.deviceProperties.isAndroid && !this.properties.deviceProperties.isIOS) {
this.stackModalWindow();
}
} else {
editor.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml')));
}

editor.focus();
if (!this.properties.deviceProperties.isAndroid && !this.properties.deviceProperties.isIOS) {
this.stackModalWindow();
if (typeof _wrs_conf_modalWindow != "undefined" && _wrs_conf_modalWindow && _wrs_conf_modalWindowFullScreen) {
this.maximizeModalWindow();
}
} else {
this.create();
}

}

/**
Expand Down Expand Up @@ -4497,5 +4533,8 @@ ModalWindow.prototype.hideKeyboard = function() {

}, 200);
};
// ...focus function changes scroll value, so we need to restore it.
var keepScroll = scrollY;
field.focus();
window.scrollTo(0, keepScroll);
}
2 changes: 1 addition & 1 deletion tinymce/editor_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _wrs_int_langCode = 'en';
// the content doesn't need to be filtered.
if (!editor.getParam('fullscreen_is_enabled') && editor.getContent() !== ""){

editor.setContent(wrs_initParse(content, language));
editor.setContent(wrs_initParse(content, language), {format: "raw"});
// Init parsing OK. If a setContent method is called
// wrs_initParse is called again.
// Now if source code is edited the returned code is parsed.
Expand Down
2 changes: 1 addition & 1 deletion tinymce/editor_plugin_src.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _wrs_int_langCode = 'en';
// the content doesn't need to be filtered.
if (!editor.getParam('fullscreen_is_enabled') && editor.getContent() !== ""){

editor.setContent(wrs_initParse(content, language));
editor.setContent(wrs_initParse(content, language), {format: "raw"});
// Init parsing OK. If a setContent method is called
// wrs_initParse is called again.
// Now if source code is edited the returned code is parsed.
Expand Down
2 changes: 1 addition & 1 deletion tinymce/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _wrs_int_langCode = 'en';
// the content doesn't need to be filtered.
if (!editor.getParam('fullscreen_is_enabled') && editor.getContent() !== ""){

editor.setContent(wrs_initParse(content, language));
editor.setContent(wrs_initParse(content, language), {format: "raw"});
// Init parsing OK. If a setContent method is called
// wrs_initParse is called again.
// Now if source code is edited the returned code is parsed.
Expand Down
2 changes: 1 addition & 1 deletion tinymce/plugin.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _wrs_int_langCode = 'en';
// the content doesn't need to be filtered.
if (!editor.getParam('fullscreen_is_enabled') && editor.getContent() !== ""){

editor.setContent(wrs_initParse(content, language));
editor.setContent(wrs_initParse(content, language), {format: "raw"});
// Init parsing OK. If a setContent method is called
// wrs_initParse is called again.
// Now if source code is edited the returned code is parsed.
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017040600;
$plugin->release = '4.2.0.1364';
$plugin->version = 2017050800;
$plugin->release = '4.3.0.1365';
$plugin->requires = 2012120300;
$plugin->component = 'tinymce_tiny_mce_wiris';
$plugin->dependencies = array ('filter_wiris' => 2017040600);
$plugin->dependencies = array ('filter_wiris' => 2017050800);
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 79bf157

Please sign in to comment.