|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + |
| 4 | + <head> |
| 5 | + <!-- Those meta make the capture of handwriting inputs easier on mobile devices --> |
| 6 | + <meta charset="UTF-8"> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> |
| 8 | + <meta name="apple-mobile-web-app-capable" content="yes"> |
| 9 | + <meta name="mobile-web-app-capable" content="yes"> |
| 10 | + <meta name="HandheldFriendly" content="true"/> |
| 11 | + |
| 12 | + <title>Import Jiix content</title> |
| 13 | + |
| 14 | + <link rel="stylesheet" href="../examples.css"> |
| 15 | + <style> |
| 16 | + input { |
| 17 | + margin: 6px; |
| 18 | + } |
| 19 | + |
| 20 | + myscript-math-web { |
| 21 | + height: calc(100% - 60px); |
| 22 | + } |
| 23 | + </style> |
| 24 | + |
| 25 | + <!-- As web components are not fully support --> |
| 26 | + <script src="../../../../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> |
| 27 | + <!-- myscript-common-element is import to be used later --> |
| 28 | + <script type="module" src="../../../../myscript-math-web.js"></script> |
| 29 | + </head> |
| 30 | + |
| 31 | + <body> |
| 32 | + <nav> |
| 33 | + <span> |
| 34 | + <input type="text" class="input-field" id="importContentField" data-type="application/vnd.myscript.jiix" |
| 35 | + placeholder="e.g. \sqrt {\dfrac {2} {3}}"/> |
| 36 | + <button class="classic-btn" id="importContent">Import</button> |
| 37 | + </span> |
| 38 | + </nav> |
| 39 | + <!-- Please change applicationkey and hmackey below with those send by mail during your registration. You can re-access them by connecting to your dashboard at developer.myscript.com with your myscript account --> |
| 40 | + <myscript-math-web scheme="https" |
| 41 | + host="webdemoapi.myscript.com" |
| 42 | + applicationkey="515131ab-35fa-411c-bb4d-3917e00faf60" |
| 43 | + hmackey="54b2ca8a-6752-469d-87dd-553bb450e9ad" |
| 44 | + mimetypes='["application/x-latex", "application/vnd.myscript.jiix"]' |
| 45 | + touch-action="none"> |
| 46 | + </myscript-math-web> |
| 47 | + <script> |
| 48 | +const component = document.querySelector('myscript-math-web'); |
| 49 | +const importContent = document.getElementById('importContentField'); |
| 50 | + |
| 51 | +document.getElementById('importContent').addEventListener('click', function () { |
| 52 | + component.import_(importContent.value, importContent.dataset.type); |
| 53 | +}); |
| 54 | +</script> |
| 55 | + </body> |
| 56 | + |
| 57 | +</html> |
0 commit comments