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

Commit 69f7cb6

Browse files
author
Francois-Xavier Gentilhomme
committed
[FIX] fixes import example
1 parent 6788198 commit 69f7cb6

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

docs/components/myscript-common-element/.bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
"paper-toggle-button": "^2.0.0",
4747
"paper-slider": "^2.0.2"
4848
},
49-
"_release": "0837f35082",
49+
"_release": "16e6aad405",
5050
"_resolution": {
5151
"type": "branch",
5252
"branch": "2.0.0-alpha1",
53-
"commit": "0837f35082184a0f2a5eae280f6943725384a3f0"
53+
"commit": "16e6aad405ea1130530a6c7c1067aab0ec890c7c"
5454
},
5555
"_source": "https://github.com/MyScript/myscript-common-element.git",
5656
"_target": "2.0.0-alpha1",

docs/components/myscript-common-element/examples/v4/latex_import.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<body>
3737
<nav>
3838
<span>
39-
<input type="text" id="latex" placeholder="e.g. \sqrt {\dfrac {2} {3}}"/>
40-
<button id="importLatex">Import</button>
39+
<input type="text" id="importContentField" data-type="application/x-latex" placeholder="e.g. \sqrt {\dfrac {2} {3}}"/>
40+
<button id="importContent">Import</button>
4141
</span>
4242
</nav>
4343
<!-- 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 -->
@@ -51,10 +51,10 @@
5151
</myscript-common-element>
5252
<script>
5353
const component = document.querySelector('myscript-common-element');
54-
const latexInput = document.getElementById('latex');
54+
const latexInput = document.getElementById('importContentField');
5555

56-
document.getElementById('importLatex').addEventListener('click', function () {
57-
component.importContent({ x: 0, y: 0 }, new Blob([latexInput.value], { type: 'application/x-latex' }));
56+
document.getElementById('importContent').addEventListener('click', function () {
57+
component.importContent({ x: 0, y: 0 }, new Blob([latexInput.value], { type: latexInput.dataset.type }));
5858
});
5959
</script>
6060
</body>

docs/components/myscript-text-web/examples/v4/text_import.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<body>
3636
<nav>
3737
<span>
38-
<input type="text" id="text" placeholder="e.g. hello world">
39-
<button id="importText">Import</button>
38+
<input type="text" id="importContentField" data-type="text/plain" placeholder="e.g. hello world">
39+
<button id="importContent">Import</button>
4040
</span>
4141
</nav>
4242
<paper-toast class="fit-top"></paper-toast>
@@ -50,10 +50,10 @@
5050
</myscript-text-web>
5151
<script>
5252
const component = document.querySelector('myscript-text-web');
53-
const textInput = document.getElementById('text');
53+
const textInput = document.getElementById('importContentField');
5454

55-
document.getElementById('importText').addEventListener('click', function () {
56-
component.importContent({ x: 0, y: 0 }, new Blob([textInput.value], { type: 'text/plain' }));
55+
document.getElementById('importContent').addEventListener('click', function () {
56+
component.importContent({ x: 0, y: 0 }, new Blob([textInput.value], { type: textInput.dataset.type }));
5757
});
5858
</script>
5959
</body>

docs/components/myscript/.bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"dependencies": {
2727
"pepjs": "^0.4.3"
2828
},
29-
"_release": "f557404b4d",
29+
"_release": "1db1c97b7f",
3030
"_resolution": {
3131
"type": "branch",
3232
"branch": "2.0.0-alpha1",
33-
"commit": "f557404b4d0c8653d091421b722308c54c5c5712"
33+
"commit": "1db1c97b7f74de764bc79fc25b9d33ef6916c250"
3434
},
3535
"_source": "https://github.com/MyScript/MyScriptJS.git",
3636
"_target": "2.0.0-alpha1",

examples/v4/text_import.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<body>
3636
<nav>
3737
<span>
38-
<input type="text" id="text" placeholder="e.g. hello world">
39-
<button id="importText">Import</button>
38+
<input type="text" id="importContentField" data-type="text/plain" placeholder="e.g. hello world">
39+
<button id="importContent">Import</button>
4040
</span>
4141
</nav>
4242
<paper-toast class="fit-top"></paper-toast>
@@ -50,10 +50,10 @@
5050
</myscript-text-web>
5151
<script>
5252
const component = document.querySelector('myscript-text-web');
53-
const textInput = document.getElementById('text');
53+
const textInput = document.getElementById('importContentField');
5454

55-
document.getElementById('importText').addEventListener('click', function () {
56-
component.importContent({ x: 0, y: 0 }, new Blob([textInput.value], { type: 'text/plain' }));
55+
document.getElementById('importContent').addEventListener('click', function () {
56+
component.importContent({ x: 0, y: 0 }, new Blob([textInput.value], { type: textInput.dataset.type }));
5757
});
5858
</script>
5959
</body>

0 commit comments

Comments
 (0)