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

Commit 14e10eb

Browse files
committed
added jiix import example
1 parent ecd3307 commit 14e10eb

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

src/demo-app/examples/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ <h1>Examples</h1>
8282
</svg>
8383
Get source code</a>
8484
</div>
85+
<p><strong>Handle Jiix import</strong></p>
86+
<div class="center">
87+
<a href="non-version-specific/handle_exports.html" class="btn">
88+
<svg class="icn">
89+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icn-play"></use>
90+
</svg>
91+
View example</a>
92+
<a href="https://github.com/MyScript/myscript-math-web/blob/master/examples/v4/import_jiix_content.html"
93+
target="_blank" class="btn">
94+
<svg class="icn">
95+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icn-github"></use>
96+
</svg>
97+
Get source code</a>
98+
</div>
8599
<p><strong>Customize the style</strong></p>
86100
<div class="center">
87101
<a href="non-version-specific/customize_style.html" class="btn">
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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

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