Skip to content

Commit

Permalink
4.7.0 Stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagigas-at-wiris authored Sep 6, 2017
1 parent 225396a commit a47e12f
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 77 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.0.1373
4.7.0.1374
211 changes: 154 additions & 57 deletions configuration.ini.dist
Original file line number Diff line number Diff line change
@@ -1,90 +1,185 @@
#
# This is a sample configuration file
# You can uncomment any line and rename this file to configuration.ini
#
#################################################################################################
# This is a sample configuration file #
# You can uncomment any line and rename this file to configuration.ini #
# For further information go to http://www.wiris.com/plugins/docs/resources/configuration-table #
#################################################################################################

#wirisdebug = false
#wirisimageserviceversion = 3.0
#########################
# Connection properties #
#########################

## Specifies formula image server host.

#
# Connection properties
#
#wirisimageservicehost = www.wiris.net

## Specifies formula image server path.

#wirisimageservicepath = /demo/editor/render

## Specifies formula image server port. If left blank, it is computed automatically.

#wirisimageserviceport = 80

## Specifies formula image server protocol. If left blank, it is computed automatically.

#wirisimageserviceprotocol = http
# Proxy configuration

#######################
# Proxy configuration #
#######################

## Specifies if your server is using a proxy connection or not. false by default.

#wirisproxy = false

## If wirisproxy is true, this value specifies the proxy host..

#wirisproxy_host =

## If wirisproxy is true, this value specifies the proxy port.

#wirisproxy_port =
# Basic authentication proxy configuration

############################################
# Basic authentication proxy configuration #
############################################

#wirisproxy_user =
#wirisproxy_password =

#
# Folder properties
#
# Place to store the cached images.
#####################
# Folder properties #
#####################

## Place to store the cached images.

#wiriscachedirectory = /var/cache
# Place to store the formulas.

## Place to store the formulas.

#wirisformuladirectory = /var/formulas

#
# Class overridables
#
######################
# Class overridables #
######################

## Name of the class that manages the storage of formulas.

#wirisstorageclass = com.wiris.plugin.storage.FileStorageAndCache
#wirisconfigurationclass =
#wirisconfigurationrefreshtime = 10000

#
# Editor behaviour
#
## Name of the class that updates the loaded configuration.

#wirisconfigurationclass =


####################
# Editor behaviour #
####################

## Specifies if WIRIS Editor is enabled.

#wiriseditorenabled = true

## Specifies the image attribute to store mathml content.

#wiriseditormathmlattribute = data-mathml

## Specifies how formulas are stored in the database. MathML by default. http://www.wiris.com/en/plugins/docs/full-mathml-mode

#wiriseditorsavemode = xml

## Specifies if in base64 save mode, images should be stored as a base64 string or as an image.

#wiriseditoreditmode = default

## Specifies if LaTeX content generated with WIRIS Editor should be shown as an image outside editing areas.

#wiriseditorparselatex = true

## Specifies if mathml should be parsed on non-mathml modes (image or base64).

#wiriseditorparsexml = false

## Specifies WIRIS Editor size attributes.

#wiriseditorwindowattributes = width=570, height=450, scroll=no, resizable=yes

## On image mode specifies if the vertical align of the image should be calculated instead of add extra space to vertically center the image.

#wiriseditorsetsize = false
#wiriseditormodalwindow = false
#wiriseditormodalwindowfullscreen = true

## Specifies if WIRIS Editor should be opened on a modal window or in a pop-up window. true by default.

#wiriseditormodalwindow = true

## Specifies if the modal window should be opened in full-screen mode. false by default.

#wiriseditormodalwindowfullscreen = false

## Specifies if chemistry editor is enabled. true by default.

#wirischemeditorenabled = true
#wirisimageformat = png

#
# Editor inherit parameters
#
## Specifies image format (svg or png). svg by default.

#wirisimageformat = svg

###############################################################################################
# Editor inherit parameters #
# The format is a JSON containing WIRIS Editor parameters defined on the following page: #
# http://www.wiris.com/editor/docs/reference/parameters #
# Editor parameter key should be the JSON key and the corresponnding value is the JSON value. #
###############################################################################################

#wiriseditorparameters = {}

#
# Accessibility
#
#################
# Accessibility #
#################

## Specifies if the accesibility should be included in generated images as "alt" attribute. true by default.

#wirisaccessibilityenabled = true

#
# WIRIS cas
#
#wiriscascodebase = http://www.wiris.net/demo/wiris/wiris-codebase
#wiriscasarchive = wrs_net_%LANG.jar
#wiriscasclass = WirisApplet_net_%LANG
#wiriscaslanguages = en, es, fr, it, nl, et, ca, eu, pt, de
#CAS_width = 450
#CAS_height = 400

#
# External plugin
#
#########################
# Cross-Domain policies #
#########################

## Enables CORS domains policies. false by default.
wiriscorsenabled = false

###################
# External plugin #
###################

## Specifies if the plugin is an external plugin. false by default.

#wirisexternalplugin = false

#
# Experimental settings.
#
#wirispluginperformance = false
########################
# Performance settings #
########################

## Specifies if the response should be a JSON instead of a binary which allows requests be cached. true by default.

#wirispluginperformance = true

##############################################################################################################################
# Clean cache service parameters. For further information go to http://www.wiris.com/en/plugins/docs/resources/clean-backup #
##############################################################################################################################

## Specifies if the delete cache gui is enabled. false by default.

# wiriscleancachegui = false

## Token needed to delete cache.

# wiriscleancachetoken = token

##############################################################################################
# Deprecated. Editor parameters should be parsed as a Json on wiriseditorparameters variale. #
##############################################################################################

#
# Deprecated. Editor parameters should be parsed as a Json on wiriseditorparameters variale.
#
#wiristransparency = true
#wirisfontfamily = Arial
#wirisimagecolor = #000000
Expand All @@ -98,8 +193,10 @@
#wiriseasternarabicindiclanguages = fa, ps, ur
#wiriseuropeanlanguages =

# Delete cache parameters.
# wiriscleancachegui = false
# wiriscleancachetoken = token
###############################################################################################
# Debug mode to show extra information on test page. Don't enable in production environments. #
###############################################################################################

#wirisdebug = false

# End of file
## End of file
15 changes: 8 additions & 7 deletions core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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.targetpassName.indexOf(_wrs_conf_imageClassName) == -1 ) {
if (mutation.oldValue == _wrs_conf_imageClassName && mutation.attributeName == 'class' && mutation.target.className.indexOf(_wrs_conf_imageClassName) == -1 ) {
mutation.target.className = _wrs_conf_imageClassName;
}
});
Expand Down Expand Up @@ -1855,6 +1855,7 @@ function wrs_mathmlToAccessible(mathml, language, data) {
}
else {
data['service'] = 'mathml2accessible';
data['lang'] = _wrs_int_langCode;
var accesibleJsonResponse = JSON.parse(wrs_getContent(_wrs_conf_servicePath, data));
if (accesibleJsonResponse.status != 'error') {
accessibleText = accesibleJsonResponse.result.text;
Expand Down Expand Up @@ -2227,7 +2228,7 @@ function wrs_openEditorWindow(language, target, isIframe) {
}

var title = wrs_int_getCustomEditorEnabled() != null ? wrs_int_getCustomEditorEnabled().title : 'WIRIS EDITOR math';
if (_wrs_conf_modalWindow != 'undefined' && _wrs_conf_modalWindow === false) {
if (typeof _wrs_conf_modalWindow != 'undefined' && _wrs_conf_modalWindow === false) {
_wrs_popupWindow = window.open(path, title, _wrs_conf_editorAttributes);
return _wrs_popupWindow;
}
Expand Down Expand Up @@ -2702,9 +2703,9 @@ function wrs_loadConfiguration() {

// JSON structure: {{jsVariableName, jsVariableValue}}.

variables = Object.keys(jsonConfiguration);
var variables = Object.keys(jsonConfiguration);

for (variable in variables) {
for (var variable in variables) {
window[variables[variable]] = jsonConfiguration[variables[variable]];
}

Expand Down Expand Up @@ -2734,7 +2735,7 @@ _wrs_conf_plugin_loaded = true;
function wrs_getCorePath() {
var scriptName = "core/core.js";
var col = document.getElementsByTagName("script");
for (i = 0; i < col.length; i++) {
for (var i = 0; i < col.length; i++) {
var d;
var src;
d = col[i];
Expand Down Expand Up @@ -4331,7 +4332,7 @@ ModalWindow.prototype.open = function() {
self.lastImageWasNew = true;
}
else {
this.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml')));
this.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute(_wrs_conf_imageMathmlAttribute)));
this.lastImageWasNew = false;
}
}
Expand All @@ -4349,7 +4350,7 @@ ModalWindow.prototype.open = function() {
updateMathMLContent();
self.lastImageWasNew = true;
} else {
this.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute('data-mathml')));
this.setMathML(wrs_mathmlDecode(_wrs_temporalImage.getAttribute(_wrs_conf_imageMathmlAttribute)));
this.lastImageWasNew = false;
}
this.focus();
Expand Down
28 changes: 20 additions & 8 deletions core/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl
*
* @param {String} objectName object name (null to call a wrs_int_opener method).
* @param {String} methodName method name.
* @param {Array} arguments method arguments ([arg1,..,argn])
* @param {Array} argumentss method arguments ([arg1,..,argn])
* @param {Function} callback callback function.
*/
function getMethod(objectName, methodName, arguments, callback) {
function getMethod(objectName, methodName, argumentss, callback) {
_wrs_callbacks.push({
'id': _wrs_callId,
'callback': callback
});
try {
wrs_int_opener.postMessage({'id': _wrs_callId++, 'objectName': objectName, 'methodName' : methodName, 'arguments': arguments}, '*');
wrs_int_opener.postMessage({'id': _wrs_callId++, 'objectName': objectName, 'methodName' : methodName, 'arguments': argumentss}, '*');
}
catch (err) { // Method postMessage not defined (I.E 7 & 8 ) or not competible with window object (I.E 9).
var object = (objectName == null) ? wrs_int_opener : wrs_int_opener[objectName];
if (objectName == null) {
callback(object[methodName].apply(object, arguments));
callback(object[methodName].apply(object, argumentss));
} else { // Can't call apply method from some objects on old I.E.
var argumentsStrings = arguments.join(',');
var argumentsStrings = argumentss.join(',');
var result = object[methodName](argumentsStrings);
callback(result);
}
Expand Down Expand Up @@ -175,18 +175,30 @@ var _wrs_isNewElement; // Unfortunately we need this variabels as global variabl
}

// Editor stats.

statEditor = _wrs_conf_editor;
statSaveMode = _wrs_conf_saveMode;
statVersion = _wrs_conf_version;

script.src = editorUrl + "?lang=" + _wrs_int_langCode + '&stats-editor=' + statEditor + '&stats-mode=' + statSaveMode + '&stats-version=' + statVersion;
document.getElementsByTagName('head')[0].appendChild(script);

// Insert strings.
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "../lang/" + _wrs_int_langCode + "/strings.js";
script.src = "../";
// Get lang path
var webScripts = document.getElementsByTagName("script");
var scriptName = "strings.js";
var found = false;
var i = 0;
while (!found && i < webScripts.length) {
if (webScripts[i].src.indexOf(scriptName) != -1) {
var pathArray = webScripts[i].src.split("/");
// We need to get the lang folder name of "../[lang_folder]/[lang_code]/strings.js"
script.src += pathArray[pathArray.length - 3 ] + "/" + _wrs_int_langCode + "/strings.js";
found = true;
}
i++
}
document.getElementsByTagName('head')[0].appendChild(script);
} else {
setTimeout(wrs_waitForCore, 200);
Expand Down
Loading

0 comments on commit a47e12f

Please sign in to comment.