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

Commit 83b0c5e

Browse files
author
Francois-Xavier Gentilhomme
committed
[DEV] Refactor importContent interface
1 parent d1d2ed0 commit 83b0c5e

File tree

16 files changed

+116
-86
lines changed

16 files changed

+116
-86
lines changed

analysis.json

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5762,11 +5762,11 @@
57625762
"privacy": "public",
57635763
"sourceRange": {
57645764
"start": {
5765-
"line": 926,
5765+
"line": 927,
57665766
"column": 12
57675767
},
57685768
"end": {
5769-
"line": 929,
5769+
"line": 930,
57705770
"column": 13
57715771
}
57725772
},
@@ -5779,11 +5779,11 @@
57795779
"privacy": "public",
57805780
"sourceRange": {
57815781
"start": {
5782-
"line": 931,
5782+
"line": 932,
57835783
"column": 12
57845784
},
57855785
"end": {
5786-
"line": 934,
5786+
"line": 935,
57875787
"column": 13
57885788
}
57895789
},
@@ -6011,11 +6011,11 @@
60116011
"privacy": "public",
60126012
"sourceRange": {
60136013
"start": {
6014-
"line": 879,
6014+
"line": 880,
60156015
"column": 12
60166016
},
60176017
"end": {
6018-
"line": 883,
6018+
"line": 884,
60196019
"column": 13
60206020
}
60216021
},
@@ -6028,7 +6028,11 @@
60286028
},
60296029
{
60306030
"name": "data",
6031-
"type": "Blob"
6031+
"type": "(Blob|*)",
6032+
"description": "Data to import"
6033+
},
6034+
{
6035+
"name": "mimetype"
60326036
}
60336037
]
60346038
},
@@ -6038,11 +6042,11 @@
60386042
"privacy": "public",
60396043
"sourceRange": {
60406044
"start": {
6041-
"line": 889,
6045+
"line": 890,
60426046
"column": 12
60436047
},
60446048
"end": {
6045-
"line": 893,
6049+
"line": 894,
60466050
"column": 13
60476051
}
60486052
},
@@ -6060,11 +6064,11 @@
60606064
"privacy": "public",
60616065
"sourceRange": {
60626066
"start": {
6063-
"line": 898,
6067+
"line": 899,
60646068
"column": 12
60656069
},
60666070
"end": {
6067-
"line": 902,
6071+
"line": 903,
60686072
"column": 13
60696073
}
60706074
},
@@ -6077,11 +6081,11 @@
60776081
"privacy": "public",
60786082
"sourceRange": {
60796083
"start": {
6080-
"line": 908,
6084+
"line": 909,
60816085
"column": 12
60826086
},
60836087
"end": {
6084-
"line": 912,
6088+
"line": 913,
60856089
"column": 13
60866090
}
60876091
},
@@ -6094,11 +6098,11 @@
60946098
"privacy": "protected",
60956099
"sourceRange": {
60966100
"start": {
6097-
"line": 914,
6101+
"line": 915,
60986102
"column": 12
60996103
},
61006104
"end": {
6101-
"line": 920,
6105+
"line": 921,
61026106
"column": 13
61036107
}
61046108
},
@@ -6115,11 +6119,11 @@
61156119
"privacy": "protected",
61166120
"sourceRange": {
61176121
"start": {
6118-
"line": 922,
6122+
"line": 923,
61196123
"column": 12
61206124
},
61216125
"end": {
6122-
"line": 924,
6126+
"line": 925,
61236127
"column": 13
61246128
}
61256129
},
@@ -6142,11 +6146,11 @@
61426146
"privacy": "protected",
61436147
"sourceRange": {
61446148
"start": {
6145-
"line": 936,
6149+
"line": 937,
61466150
"column": 12
61476151
},
61486152
"end": {
6149-
"line": 953,
6153+
"line": 954,
61506154
"column": 13
61516155
}
61526156
},
@@ -6163,11 +6167,11 @@
61636167
"privacy": "protected",
61646168
"sourceRange": {
61656169
"start": {
6166-
"line": 955,
6170+
"line": 956,
61676171
"column": 12
61686172
},
61696173
"end": {
6170-
"line": 958,
6174+
"line": 959,
61716175
"column": 13
61726176
}
61736177
},
@@ -6919,7 +6923,7 @@
69196923
"column": 8
69206924
},
69216925
"end": {
6922-
"line": 959,
6926+
"line": 960,
69236927
"column": 9
69246928
}
69256929
},

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": "c8683a09ad",
49+
"_release": "9b6d86048f",
5050
"_resolution": {
5151
"type": "branch",
5252
"branch": "2.0.0-alpha1",
53-
"commit": "c8683a09ad944307cff5d500083d8fa2cbe8139c"
53+
"commit": "9b6d86048fe435ef7e15af3c162568969942f74a"
5454
},
5555
"_source": "https://github.com/MyScript/myscript-common-element.git",
5656
"_target": "2.0.0-alpha1",

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

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -920,11 +920,11 @@
920920
"privacy": "public",
921921
"sourceRange": {
922922
"start": {
923-
"line": 716,
923+
"line": 717,
924924
"column": 12
925925
},
926926
"end": {
927-
"line": 720,
927+
"line": 721,
928928
"column": 13
929929
}
930930
},
@@ -937,7 +937,11 @@
937937
},
938938
{
939939
"name": "data",
940-
"type": "Blob"
940+
"type": "(Blob|*)",
941+
"description": "Data to import"
942+
},
943+
{
944+
"name": "mimetype"
941945
}
942946
]
943947
},
@@ -947,11 +951,11 @@
947951
"privacy": "public",
948952
"sourceRange": {
949953
"start": {
950-
"line": 726,
954+
"line": 727,
951955
"column": 12
952956
},
953957
"end": {
954-
"line": 730,
958+
"line": 731,
955959
"column": 13
956960
}
957961
},
@@ -969,11 +973,11 @@
969973
"privacy": "public",
970974
"sourceRange": {
971975
"start": {
972-
"line": 735,
976+
"line": 736,
973977
"column": 12
974978
},
975979
"end": {
976-
"line": 739,
980+
"line": 740,
977981
"column": 13
978982
}
979983
},
@@ -986,11 +990,11 @@
986990
"privacy": "public",
987991
"sourceRange": {
988992
"start": {
989-
"line": 745,
993+
"line": 746,
990994
"column": 12
991995
},
992996
"end": {
993-
"line": 749,
997+
"line": 750,
994998
"column": 13
995999
}
9961000
},
@@ -1003,11 +1007,11 @@
10031007
"privacy": "protected",
10041008
"sourceRange": {
10051009
"start": {
1006-
"line": 751,
1010+
"line": 752,
10071011
"column": 12
10081012
},
10091013
"end": {
1010-
"line": 756,
1014+
"line": 757,
10111015
"column": 13
10121016
}
10131017
},
@@ -1033,11 +1037,11 @@
10331037
"privacy": "protected",
10341038
"sourceRange": {
10351039
"start": {
1036-
"line": 758,
1040+
"line": 759,
10371041
"column": 12
10381042
},
10391043
"end": {
1040-
"line": 763,
1044+
"line": 764,
10411045
"column": 13
10421046
}
10431047
},
@@ -1063,11 +1067,11 @@
10631067
"privacy": "protected",
10641068
"sourceRange": {
10651069
"start": {
1066-
"line": 765,
1070+
"line": 766,
10671071
"column": 12
10681072
},
10691073
"end": {
1070-
"line": 769,
1074+
"line": 770,
10711075
"column": 13
10721076
}
10731077
},
@@ -1084,11 +1088,11 @@
10841088
"privacy": "protected",
10851089
"sourceRange": {
10861090
"start": {
1087-
"line": 771,
1091+
"line": 772,
10881092
"column": 12
10891093
},
10901094
"end": {
1091-
"line": 786,
1095+
"line": 787,
10921096
"column": 13
10931097
}
10941098
},
@@ -1138,7 +1142,7 @@
11381142
"column": 8
11391143
},
11401144
"end": {
1141-
"line": 787,
1145+
"line": 788,
11421146
"column": 9
11431147
}
11441148
},

docs/components/myscript-common-element/examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h2>Non version specific features</h2>
5050
<h2>V4 - iink SDK web</h2>
5151
<ul>
5252
<li>
53-
<a href="v4/import_content.html">Configuring import</a>
53+
<a href="v4/import_content.html">Import content</a>
5454
</li>
5555
</ul>
5656
<h2>V3 - CDK v3.2</h2>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919

2020
nav span {
2121
display: flex;
22+
width: 100%;
23+
}
24+
25+
input {
26+
width: 100%;
2227
}
2328

2429
myscript-common-element {
@@ -51,7 +56,7 @@
5156
const importContent = document.getElementById('importContentField');
5257

5358
document.getElementById('importContent').addEventListener('click', function () {
54-
component.importContent({ x: 0, y: 0 }, new Blob([importContent.value], { type: importContent.dataset.type }));
59+
component.importContent({ x: 0, y: 0 }, importContent.value, importContent.dataset.type);
5560
});
5661
</script>
5762
</body>

docs/components/myscript-common-element/myscript-common-element.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,12 @@
712712
/**
713713
* Import content
714714
* @param {{x: Number, y: Number}} point Insert point coordinates
715-
* @param {Blob} data
715+
* @param {Blob|*} data Data to import
716+
* @param {String} [mimetype] Mimetype of the data, needed if data is not a Blob
716717
*/
717-
importContent(point, data) {
718+
importContent(point, data, mimetype) {
718719
if (this.editor) {
719-
this.editor.importContent(point, data);
720+
this.editor.importContent(point, data, mimetype);
720721
}
721722
}
722723

0 commit comments

Comments
 (0)