Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit e341b79

Browse files
author
Steven Roulleau
committed
Merge pull request #32 in WS/myscriptjs from fix-examples to master
* commit '5ac29d466593e6702a0866cdf6d8b17c9cfdede3': fix(examples): import button not visible, math export with one number
2 parents c69a46a + 5ac29d4 commit e341b79

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

examples/examples.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ nav {
5858
margin: 0 12px;
5959
}
6060

61+
#importContent {
62+
margin: 5px;
63+
}
64+
6165
#lexicon {
6266
margin: 0 12px;
6367
width: 500px;
@@ -300,6 +304,9 @@ select:focus {
300304

301305
nav {
302306
padding: 12px 6px;
307+
justify-content: center;
308+
flex-wrap: wrap;
309+
flex-direction: column;
303310
}
304311
}
305312

@@ -522,4 +529,5 @@ select:focus {
522529

523530
.button-div {
524531
display: flex;
532+
margin: 5px;
525533
}

examples/non-version-specific/change_language.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
</nav>
2424
<div id="editor"></div>
2525
<script>
26-
var languageElement = document.getElementById('language');
27-
var editorElement = document.getElementById('editor');
26+
const languageElement = document.getElementById('language');
27+
const editorElement = document.getElementById('editor');
2828

2929
languageElement.addEventListener('change', function (e) {
30-
var configuration = editorElement.editor.configuration;
30+
const configuration = editorElement.editor.configuration;
3131
//The path to the language depend of the version of API you are using.
3232
configuration.recognitionParams.v4.lang = e.target.value;
3333
editorElement.editor.configuration = configuration;
3434
});
3535

36-
var configuration = {
36+
const configuration = {
3737
recognitionParams: {
3838
type: 'TEXT',
3939
protocol: 'WEBSOCKET',
@@ -43,11 +43,6 @@
4343
host: 'webdemoapi.myscript.com',
4444
applicationKey: '515131ab-35fa-411c-bb4d-3917e00faf60',
4545
hmacKey: '54b2ca8a-6752-469d-87dd-553bb450e9ad'
46-
},
47-
v4: {
48-
text: {
49-
mimeTypes: ['text/plain']
50-
},
5146
}
5247
}
5348
};
@@ -56,12 +51,12 @@
5651
* Retrieve the list of available recognition languages using local json file
5752
* @param {Object} The editor recognition parameters
5853
*/
59-
var currentLanguage = 'en_US';
60-
var res = MyScript.getAvailableLanguageList();
54+
const currentLanguage = 'en_US';
55+
const res = MyScript.getAvailableLanguageList();
6156

6257
if (languageElement.options.length === 0) {
6358
Object.keys(res.result).forEach(function (key) {
64-
var selected = currentLanguage === key;
59+
const selected = currentLanguage === key;
6560
languageElement.options[languageElement.options.length] = new Option(res.result[key], key, selected, selected);
6661
});
6762
}

examples/v4/rest/rest_math_iink.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
});
5151

5252
function cleanLatex(latexExport) {
53+
if(typeof latexExport === 'number') {
54+
latexExport = latexExport.toString();
55+
}
5356
if (latexExport.includes('\\\\')) {
5457
const steps = '\\begin{align*}' + latexExport + '\\end{align*}';
5558
return steps.replace("\\overrightarrow", "\\vec")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy