wirispluginengine 3.62.0.1322 → 7.14.0.1422
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.
- checksums.yaml +4 -4
- data/Rakefile +34 -34
- data/app/assets/javascripts/wirispluginengine/WIRISplugins.js +1040 -64
- data/app/controllers/wirispluginengine/application_controller.rb +84 -75
- data/app/helpers/wirispluginengine/application_helper.rb +4 -4
- data/config/routes.rb +4 -4
- data/lib/com/wiris/common/WInteger.rb +52 -51
- data/lib/com/wiris/plugin/api/Cas.rb +5 -5
- data/lib/com/wiris/plugin/api/CleanCache.rb +5 -5
- data/lib/com/wiris/plugin/api/Configuration.rb +5 -5
- data/lib/com/wiris/plugin/api/ConfigurationKeys.rb +94 -91
- data/lib/com/wiris/plugin/api/Editor.rb +5 -5
- data/lib/com/wiris/plugin/api/Filter.rb +5 -5
- data/lib/com/wiris/plugin/api/ImageFormatController.rb +5 -5
- data/lib/com/wiris/plugin/api/ParamsProvider.rb +5 -5
- data/lib/com/wiris/plugin/api/PluginBuilder.rb +88 -74
- data/lib/com/wiris/plugin/api/Render.rb +5 -5
- data/lib/com/wiris/plugin/api/ServiceResourceLoader.rb +5 -5
- data/lib/com/wiris/plugin/api/Test.rb +5 -5
- data/lib/com/wiris/plugin/api/TextService.rb +5 -5
- data/lib/com/wiris/plugin/configuration/ConfigurationUpdater.rb +5 -5
- data/lib/com/wiris/plugin/impl/CacheFormulaImpl.rb +15 -0
- data/lib/com/wiris/plugin/impl/CacheImpl.rb +124 -0
- data/lib/com/wiris/plugin/impl/CasImpl.rb +140 -138
- data/lib/com/wiris/plugin/impl/CleanCacheImpl.rb +103 -101
- data/lib/com/wiris/plugin/impl/ConfigurationImpl.rb +165 -166
- data/lib/com/wiris/plugin/impl/CustomConfigurationUpdater.rb +32 -30
- data/lib/com/wiris/plugin/impl/DefaultConfigurationUpdater.rb +24 -22
- data/lib/com/wiris/plugin/impl/EditorImpl.rb +80 -78
- data/lib/com/wiris/plugin/impl/FileConfigurationUpdater.rb +29 -27
- data/lib/com/wiris/plugin/impl/FileStorageAndCache.rb +55 -53
- data/lib/com/wiris/plugin/impl/FolderTreeStorageAndCache.rb +65 -134
- data/lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb +50 -48
- data/lib/com/wiris/plugin/impl/HttpImpl.rb +49 -48
- data/lib/com/wiris/plugin/impl/HttpListener.rb +5 -5
- data/lib/com/wiris/plugin/impl/ImageFormatControllerPng.rb +71 -63
- data/lib/com/wiris/plugin/impl/ImageFormatControllerSvg.rb +37 -28
- data/lib/com/wiris/plugin/impl/PluginBuilderImpl.rb +280 -248
- data/lib/com/wiris/plugin/impl/RenderImpl.rb +303 -257
- data/lib/com/wiris/plugin/impl/ServiceResourceLoaderImpl.rb +41 -39
- data/lib/com/wiris/plugin/impl/TestImpl.rb +177 -157
- data/lib/com/wiris/plugin/impl/TextFilter.rb +210 -194
- data/lib/com/wiris/plugin/impl/TextFilterTags.rb +57 -50
- data/lib/com/wiris/plugin/impl/TextServiceImpl.rb +158 -107
- data/lib/com/wiris/plugin/storage/StorageAndCache.rb +5 -5
- data/lib/com/wiris/util/json/JSon.rb +505 -493
- data/lib/com/wiris/util/json/JSonIntegerFormat.rb +17 -16
- data/lib/com/wiris/util/json/JsonAPIResponse.rb +70 -0
- data/lib/com/wiris/util/json/StringParser.rb +57 -56
- data/lib/com/wiris/util/sys/AccessProvider.rb +8 -0
- data/lib/com/wiris/util/sys/Cache.rb +8 -0
- data/lib/com/wiris/util/sys/HttpConnection.rb +14 -13
- data/lib/com/wiris/util/sys/HttpConnectionListener.rb +5 -5
- data/lib/com/wiris/util/sys/HttpSync.rb +28 -0
- data/lib/com/wiris/util/sys/IniFile.rb +132 -131
- data/lib/com/wiris/util/sys/Lock.rb +8 -0
- data/lib/com/wiris/util/sys/LockProvider.rb +8 -0
- data/lib/com/wiris/util/sys/Store.rb +126 -101
- data/lib/com/wiris/util/sys/StoreCache.rb +63 -0
- data/lib/com/wiris/util/sys/TimerProxy.rb +21 -0
- data/lib/com/wiris/util/sys/TimerTask.rb +8 -0
- data/lib/com/wiris/util/type/Arrays.rb +275 -0
- data/lib/com/wiris/util/type/ByteBuffer.rb +69 -0
- data/lib/com/wiris/util/type/Comparator.rb +8 -0
- data/lib/com/wiris/util/type/DataUtils.rb +24 -0
- data/lib/com/wiris/util/type/DoubleTools.rb +14 -0
- data/lib/com/wiris/util/type/HashCache.rb +43 -0
- data/lib/com/wiris/util/type/IntegerTools.rb +32 -0
- data/lib/com/wiris/util/type/Queue.rb +31 -0
- data/lib/com/wiris/util/type/SortArrayByStringLength.rb +26 -0
- data/lib/com/wiris/util/type/SortStringByLength.rb +26 -0
- data/lib/com/wiris/util/type/SortedHash.rb +45 -0
- data/lib/com/wiris/util/type/Stack.rb +31 -0
- data/lib/com/wiris/util/type/StringUtils.rb +56 -0
- data/lib/com/wiris/util/type/Tokenizer.rb +40 -0
- data/lib/com/wiris/util/type/UrlUtils.rb +78 -0
- data/lib/com/wiris/util/xml/ContentHandler.rb +8 -0
- data/lib/com/wiris/util/xml/DefaultHandler.rb +25 -0
- data/lib/com/wiris/util/xml/EntityResolver.rb +8 -0
- data/lib/com/wiris/util/xml/MathMLEntityResolver.rb +19 -0
- data/lib/com/wiris/util/xml/SAXParser.rb +470 -0
- data/lib/com/wiris/util/xml/SerializableImpl.rb +16 -15
- data/lib/com/wiris/util/xml/WCharacterBase.rb +968 -627
- data/lib/com/wiris/util/xml/WEntities.rb +11 -9
- data/lib/com/wiris/util/xml/WXmlUtils.rb +660 -490
- data/lib/com/wiris/util/xml/XmlSerializer.rb +517 -471
- data/lib/com/wiris/util/xml/XmlWriter.rb +260 -262
- data/lib/loader.rb +15 -12
- data/lib/src-generic/Array.rb +22 -22
- data/lib/src-generic/ArrayInt.rb +31 -31
- data/lib/src-generic/Base64.rb +14 -14
- data/lib/src-generic/BaseCode.rb +93 -93
- data/lib/src-generic/Boolean.rb +27 -0
- data/lib/src-generic/Bytes.rb +50 -50
- data/lib/src-generic/BytesInput.rb +37 -37
- data/lib/src-generic/EReg.rb +55 -55
- data/lib/src-generic/File.rb +35 -35
- data/lib/src-generic/FileLock.rb +26 -26
- data/lib/src-generic/FileSystem.rb +37 -37
- data/lib/src-generic/Hash.rb +42 -42
- data/lib/src-generic/Http.rb +111 -107
- data/lib/src-generic/HttpRequest.rb +25 -25
- data/lib/src-generic/HttpResponse.rb +70 -70
- data/lib/src-generic/Iterator.rb +20 -19
- data/lib/src-generic/Math.rb +14 -14
- data/lib/src-generic/Md5.rb +8 -8
- data/lib/src-generic/Md5Tools.rb +11 -11
- data/lib/src-generic/PropertiesTools.rb +32 -32
- data/lib/src-generic/Reflect.rb +16 -16
- data/lib/src-generic/RubyConfigurationUpdater.rb +49 -45
- data/lib/src-generic/Serializer.rb +84 -84
- data/lib/src-generic/Std.rb +74 -74
- data/lib/src-generic/Storage.rb +152 -152
- data/lib/src-generic/StringBuf.rb +40 -40
- data/lib/src-generic/StringTools.rb +44 -46
- data/lib/src-generic/Timer.rb +6 -6
- data/lib/src-generic/Type.rb +18 -18
- data/lib/src-generic/TypeTools.rb +31 -31
- data/lib/src-generic/Unserializer.rb +72 -72
- data/lib/src-generic/Utf8.rb +26 -26
- data/lib/src-generic/Xml.rb +199 -198
- data/lib/src-generic/extended/Integer.rb +5 -5
- data/lib/src-generic/extended/Math.rb +6 -6
- data/lib/src-generic/extended/Properties.rb +11 -11
- data/lib/src-generic/extended/String.rb +38 -38
- data/lib/src-generic/settings/PlatformSettings.rb +18 -18
- data/lib/src-generic/system/HttpProxy.rb +23 -0
- data/lib/src-generic/system/HttpProxyAuth.rb +10 -0
- data/lib/wirispluginengine.rb +5 -5
- data/lib/wirispluginengine/engine.rb +5 -5
- data/lib/wirispluginengine/integration/cleancache.rb +8 -8
- data/lib/wirispluginengine/integration/configurationjs.rb +8 -15
- data/lib/wirispluginengine/integration/configurationjson.rb +6 -6
- data/lib/wirispluginengine/integration/createimage.rb +7 -7
- data/lib/wirispluginengine/integration/getmathml.rb +18 -18
- data/lib/wirispluginengine/integration/resource.rb +8 -8
- data/lib/wirispluginengine/integration/service.rb +5 -5
- data/lib/wirispluginengine/integration/showimage.rb +28 -21
- data/lib/wirispluginengine/integration/test.rb +5 -5
- data/lib/wirispluginengine/integration/testfilter.rb +10 -0
- data/lib/wirispluginengine/version.rb +2 -2
- data/resources/VERSION +1 -1
- data/resources/WEB-INF/web.xml +25 -0
- data/resources/WIRISplugins.js +3809 -0
- data/resources/default-configuration.ini +47 -45
- data/resources/tech.txt +1 -1
- data/resources/wirisplugin.css +43 -42
- metadata +40 -4
- data/configuration.ini.dist +0 -104
@@ -1,5 +1,5 @@
|
|
1
|
-
class Integer
|
2
|
-
def self.valueOf(n)
|
3
|
-
return n.to_i
|
4
|
-
end
|
5
|
-
end
|
1
|
+
class Integer
|
2
|
+
def self.valueOf(n)
|
3
|
+
return n.to_i
|
4
|
+
end
|
5
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module Wiris
|
2
|
-
class Math
|
3
|
-
def self.round(f)
|
4
|
-
return f.round
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module Wiris
|
2
|
+
class Math
|
3
|
+
def self.round(f)
|
4
|
+
return f.round
|
5
|
+
end
|
6
|
+
end
|
7
7
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
# Extending Ruby Hash clash
|
2
|
-
# in order to testing PropertiesTools
|
3
|
-
# and others classes with Properties java clash involved
|
4
|
-
|
5
|
-
class Properties < Hash
|
6
|
-
def initialize
|
7
|
-
# p instance_eval
|
8
|
-
end
|
9
|
-
def put(key, value)
|
10
|
-
self[key]=value
|
11
|
-
end
|
1
|
+
# Extending Ruby Hash clash
|
2
|
+
# in order to testing PropertiesTools
|
3
|
+
# and others classes with Properties java clash involved
|
4
|
+
|
5
|
+
class Properties < Hash
|
6
|
+
def initialize
|
7
|
+
# p instance_eval
|
8
|
+
end
|
9
|
+
def put(key, value)
|
10
|
+
self[key]=value
|
11
|
+
end
|
12
12
|
end
|
@@ -1,39 +1,39 @@
|
|
1
|
-
class String
|
2
|
-
def indexOf(substring, offset=0)
|
3
|
-
if (offset == 0)
|
4
|
-
index = index(substring)
|
5
|
-
else
|
6
|
-
index = index(substring, offset)
|
7
|
-
end
|
8
|
-
|
9
|
-
if (index.nil?)
|
10
|
-
return -1
|
11
|
-
else
|
12
|
-
return index
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def trim()
|
17
|
-
return self.strip()
|
18
|
-
end
|
19
|
-
|
20
|
-
def lastIndexOf(string)
|
21
|
-
if (self.rindex(string).nil?)
|
22
|
-
return 0
|
23
|
-
else
|
24
|
-
return self.rindex(string)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def startsWith(string)
|
29
|
-
return self.start_with?(string)
|
30
|
-
end
|
31
|
-
|
32
|
-
def toUpperCase()
|
33
|
-
return self.upcase
|
34
|
-
end
|
35
|
-
|
36
|
-
def charAt(index)
|
37
|
-
return self[index]
|
38
|
-
end
|
1
|
+
class String
|
2
|
+
def indexOf(substring, offset=0)
|
3
|
+
if (offset == 0)
|
4
|
+
index = index(substring)
|
5
|
+
else
|
6
|
+
index = index(substring, offset)
|
7
|
+
end
|
8
|
+
|
9
|
+
if (index.nil?)
|
10
|
+
return -1
|
11
|
+
else
|
12
|
+
return index
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def trim()
|
17
|
+
return self.strip()
|
18
|
+
end
|
19
|
+
|
20
|
+
def lastIndexOf(string)
|
21
|
+
if (self.rindex(string).nil?)
|
22
|
+
return 0
|
23
|
+
else
|
24
|
+
return self.rindex(string)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def startsWith(string)
|
29
|
+
return self.start_with?(string)
|
30
|
+
end
|
31
|
+
|
32
|
+
def toUpperCase()
|
33
|
+
return self.upcase
|
34
|
+
end
|
35
|
+
|
36
|
+
def charAt(index)
|
37
|
+
return self[index]
|
38
|
+
end
|
39
39
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module Wiris
|
2
|
-
class PlatformSettings
|
3
|
-
PARSE_XML_ENTITIES = false
|
4
|
-
IS_CSHARP = false
|
5
|
-
IS_JAVA = true
|
6
|
-
IS_JAVASCRIPT = false
|
7
|
-
IS_FLASH = false
|
8
|
-
IS_RUBY = true
|
9
|
-
UTF8_CONVERSION = false
|
10
|
-
|
11
|
-
def isWinXP()
|
12
|
-
return false
|
13
|
-
end
|
14
|
-
|
15
|
-
def evenTokensBoxWidth()
|
16
|
-
return false
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module Wiris
|
2
|
+
class PlatformSettings
|
3
|
+
PARSE_XML_ENTITIES = false
|
4
|
+
IS_CSHARP = false
|
5
|
+
IS_JAVA = true
|
6
|
+
IS_JAVASCRIPT = false
|
7
|
+
IS_FLASH = false
|
8
|
+
IS_RUBY = true
|
9
|
+
UTF8_CONVERSION = false
|
10
|
+
|
11
|
+
def isWinXP()
|
12
|
+
return false
|
13
|
+
end
|
14
|
+
|
15
|
+
def evenTokensBoxWidth()
|
16
|
+
return false
|
17
|
+
end
|
18
|
+
end
|
19
19
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Wiris
|
2
|
+
class HttpProxy
|
3
|
+
attr_accessor :port
|
4
|
+
attr_accessor :host
|
5
|
+
attr_accessor :auth
|
6
|
+
|
7
|
+
def initialize(host, port)
|
8
|
+
@port = port
|
9
|
+
@host = host
|
10
|
+
@auth = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.newHttpProxy(host, port, user, pass)
|
14
|
+
proxy = HttpProxy.new(host, port)
|
15
|
+
hpa = HttpProxyAuth.new()
|
16
|
+
hpa.user = user
|
17
|
+
hpa.pass = pass
|
18
|
+
proxy.auth = hpa
|
19
|
+
return proxy
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
data/lib/wirispluginengine.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require "wirispluginengine/engine"
|
2
|
-
require "loader"
|
3
|
-
|
4
|
-
module Wirispluginengine
|
5
|
-
end
|
1
|
+
require "wirispluginengine/engine"
|
2
|
+
require "loader"
|
3
|
+
|
4
|
+
module Wirispluginengine
|
5
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Wirispluginengine
|
2
|
-
class Engine < ::Rails::Engine
|
3
|
-
isolate_namespace Wirispluginengine
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module Wirispluginengine
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace Wirispluginengine
|
4
|
+
end
|
5
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class CleanCache
|
2
|
-
def dispatch(request, response, provider, pb)
|
3
|
-
cleanCache = pb.newCleanCache()
|
4
|
-
cleanCache.init(provider)
|
5
|
-
response.content_type = cleanCache.getContentType();
|
6
|
-
return cleanCache.getCacheOutput()
|
7
|
-
end
|
8
|
-
end
|
1
|
+
class CleanCache
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
cleanCache = pb.newCleanCache()
|
4
|
+
cleanCache.init(provider)
|
5
|
+
response.content_type = cleanCache.getContentType();
|
6
|
+
return cleanCache.getCacheOutput()
|
7
|
+
end
|
8
|
+
end
|
@@ -1,16 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
"var _wrs_conf_createcasimagePath = _wrs_int_path + '/createcasimage'; // Specifies where is createcasimage script" "\r\n" +
|
10
|
-
"var _wrs_conf_getmathmlPath = _wrs_int_path + '/getmathml'; // Specifies where is the getmathml script." "\r\n" +
|
11
|
-
"var _wrs_conf_servicePath = _wrs_int_path + '/service'; // Specifies where is the service script." "\r\n"
|
12
|
-
conf = pb.getConfiguration()
|
13
|
-
response.body = response.body + conf.getJavaScriptConfiguration()
|
14
|
-
|
15
|
-
end
|
1
|
+
# Rails don't load at the begining in production environment the libraries. We need to import it.
|
2
|
+
require_relative '../../com/wiris/plugin/impl/PluginBuilderImpl.rb'
|
3
|
+
class Configurationjs
|
4
|
+
def dispatch (request, response, pb)
|
5
|
+
conf = pb.getConfiguration()
|
6
|
+
response.body = conf.getJavaScriptConfigurationJson()
|
7
|
+
|
8
|
+
end
|
16
9
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
class ConfigurationJson
|
2
|
-
def dispatch (request, response, provider, pb)
|
3
|
-
variableKeys = provider.getRequiredParameter('variablekeys')
|
4
|
-
conf = pb.getConfiguration()
|
5
|
-
response.body = conf.getJsonConfiguration(variableKeys)
|
6
|
-
end
|
1
|
+
class ConfigurationJson
|
2
|
+
def dispatch (request, response, provider, pb)
|
3
|
+
variableKeys = provider.getRequiredParameter('variablekeys')
|
4
|
+
conf = pb.getConfiguration()
|
5
|
+
response.body = conf.getJsonConfiguration(variableKeys)
|
6
|
+
end
|
7
7
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class CreateImage
|
2
|
-
def dispatch(request, response, provider, pb)
|
3
|
-
mml = provider.getRequiredParameter('mml');
|
4
|
-
render = pb.newRender()
|
5
|
-
a = render.createImage(mml, provider, nil)
|
6
|
-
return a
|
7
|
-
end
|
1
|
+
class CreateImage
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
mml = provider.getRequiredParameter('mml');
|
4
|
+
render = pb.newRender()
|
5
|
+
a = render.createImage(mml, provider, nil)
|
6
|
+
return a
|
7
|
+
end
|
8
8
|
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
class GetMathMLDispatcher
|
2
|
-
def dispatch(request, response, provider, pb)
|
3
|
-
digest = nil
|
4
|
-
latex = provider.getParameter("latex", nil)
|
5
|
-
md5Parameter = provider.getParameter("md5", nil)
|
6
|
-
|
7
|
-
if (md5Parameter != nil && md5Parameter.length() == 32) # Support for "generic simple" integration.
|
8
|
-
digest = md5Parameter
|
9
|
-
else
|
10
|
-
String digestParameter = request.getParameter("digest")
|
11
|
-
if (digestParameter != nil) # Support for future integrations (where maybe they aren't using md5 sums).
|
12
|
-
digest = digestParameter
|
13
|
-
end
|
14
|
-
end
|
15
|
-
r = pb.newTextService().getMathML(digest, latex)
|
16
|
-
return r
|
17
|
-
end
|
18
|
-
end
|
1
|
+
class GetMathMLDispatcher
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
digest = nil
|
4
|
+
latex = provider.getParameter("latex", nil)
|
5
|
+
md5Parameter = provider.getParameter("md5", nil)
|
6
|
+
|
7
|
+
if (md5Parameter != nil && md5Parameter.length() == 32) # Support for "generic simple" integration.
|
8
|
+
digest = md5Parameter
|
9
|
+
else
|
10
|
+
String digestParameter = request.getParameter("digest")
|
11
|
+
if (digestParameter != nil) # Support for future integrations (where maybe they aren't using md5 sums).
|
12
|
+
digest = digestParameter
|
13
|
+
end
|
14
|
+
end
|
15
|
+
r = pb.newTextService().getMathML(digest, latex)
|
16
|
+
return r
|
17
|
+
end
|
18
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class Resource
|
2
|
-
def dispatch(response, provider, pb)
|
3
|
-
resource = provider.getRequiredParameter('resourcefile');
|
4
|
-
resourceLoader = pb.newResourceLoader()
|
5
|
-
response.content_type = resourceLoader.getContentType(resource)
|
6
|
-
return resourceLoader.getContent(resource)
|
7
|
-
end
|
8
|
-
end
|
1
|
+
class Resource
|
2
|
+
def dispatch(response, provider, pb)
|
3
|
+
resource = provider.getRequiredParameter('resourcefile');
|
4
|
+
resourceLoader = pb.newResourceLoader()
|
5
|
+
response.content_type = resourceLoader.getContentType(resource)
|
6
|
+
return resourceLoader.getContent(resource)
|
7
|
+
end
|
8
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class Service
|
2
|
-
def dispatch(request, response, provider, pb)
|
3
|
-
r = pb.newTextService().service(provider.getRequiredParameter('service'), provider);
|
4
|
-
return r
|
5
|
-
end
|
1
|
+
class Service
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
r = pb.newTextService().service(provider.getRequiredParameter('service'), provider);
|
4
|
+
return r
|
5
|
+
end
|
6
6
|
end
|
@@ -1,21 +1,28 @@
|
|
1
|
-
class ShowImage
|
2
|
-
def dispatch(request, response, provider, pb)
|
3
|
-
render = pb.newRender()
|
4
|
-
formula = provider.getParameter('formula', nil);
|
5
|
-
mml = provider.getParameter('mml', nil);
|
6
|
-
if (pb.getConfiguration().getProperty('wirispluginperformance', 'false') == 'true')
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
class ShowImage
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
render = pb.newRender()
|
4
|
+
formula = provider.getParameter('formula', nil);
|
5
|
+
mml = provider.getParameter('mml', nil);
|
6
|
+
if (pb.getConfiguration().getProperty('wirispluginperformance', 'false') == 'true')
|
7
|
+
|
8
|
+
useragent = provider.getParameter("useragent", "");
|
9
|
+
if (useragent == "IE")
|
10
|
+
pb.getConfiguration().setProperty("wirisimageformat", "png")
|
11
|
+
else
|
12
|
+
pb.getConfiguration().setProperty("wirisimageformat", "svg")
|
13
|
+
end
|
14
|
+
|
15
|
+
response.content_type = 'application/json'
|
16
|
+
if (formula.nil?)
|
17
|
+
render.showImage(formula, mml, provider);
|
18
|
+
formula = render.computeDigest(mml, provider.getParameters());
|
19
|
+
end
|
20
|
+
r = render.showImageJson(formula, 'en');
|
21
|
+
response.body = r;
|
22
|
+
else
|
23
|
+
r = render.showImage(formula, mml, provider);
|
24
|
+
response.content_type = pb.getImageFormatController().getContentType();
|
25
|
+
return r
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class WirisTest
|
2
|
-
def dispatch(request, pb)
|
3
|
-
r = pb.newTest().getTestPage()
|
4
|
-
return r
|
5
|
-
end
|
1
|
+
class WirisTest
|
2
|
+
def dispatch(request, pb)
|
3
|
+
r = pb.newTest().getTestPage()
|
4
|
+
return r
|
5
|
+
end
|
6
6
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class TestFilter
|
2
|
+
def dispatch(request, response, provider, pb)
|
3
|
+
|
4
|
+
s = "<html><body><b>Formula: </b><math><mfrac><mi>x</mi><mn>1000</mn></mfrac></math></body></html>"
|
5
|
+
p = Hash.new()
|
6
|
+
output = pb.newTextService.filter(s,p)
|
7
|
+
response.content_type = 'text/html'
|
8
|
+
return output;
|
9
|
+
end
|
10
|
+
end
|