GET .../do/recognition
textInput = {
"textParameter":{
"language":"en_US",
"textInputMode":"CURSIVE"},
"inputUnits":[{
"textInputType":"MULTI_LINE_TEXT",
"components":[{
"type":"stroke",
"x":[438,439,439,...],
"y":[319.5,313.5,312.5,...]
},{...}]}]}
var paper = new MyScript.InkPaper(inkPaper, options, function (data, error) {
result.innerHTML = '';
if (error) { result.innerHTML = error;}
if (data) {
// Display the selected text candidate
result.innerHTML = data.getTextDocument().getTextSegment().getSelectedCandidate().getLabel();
}});
document.getElementById('trash').addEventListener('click',
function () {paper.clear();}, false);
// ... undo, redo ...
var languages = document.getElementById('languages');
...
<link rel="import" href="bow../mon-web-components/components.html">
<script type="text/javascript" src="../q/q.js"></script>
<script type="text/javascript" src="../pepjs/dist/pep.min.js"></script>
<script type="text/javascript" src="./dist/monjs.min.js"></script>
<template id="mytemplate">
<img src="" alt="great image">
<div class="comment"></div>
</template>
Shadow DOM provides encapsulation for the JavaScript, CSS, and templating in a Web Component. Shadow DOM makes it so these things remain separate from the DOM of the main document...
Source : Mozilla Developer Network
<mon-super-element>
<un-sous-element/>
</mon-super-element>
var solvingZoneElement
= document.getElementByTagName("myscript-math-web")[0];
solvingZoneElement.classList.add("visible");
solvingZoneElement.addEventListener("myscript-math-web-result",
function () {
var result = solvingZoneElement.result["LATEX"];
if (result === "\\dfrac {x^{2}} {2}") {
hideElementAndShowBravo();
}
}
);