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

Commit 4b6bb04

Browse files
author
Francois-Xavier Gentilhomme
committed
v1.0.3 Release JS samples to GitHub
1 parent 693b615 commit 4b6bb04

File tree

10 files changed

+66
-15
lines changed

10 files changed

+66
-15
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ deploy:
1818
file:
1919
- dist/myscript.zip
2020
- dist/myscript.tar.gz
21+
- dist/samples.zip
22+
- dist/samples.tar.gz
2123
skip_cleanup: true
2224
on:
2325
tags: true

Gruntfile.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,46 @@ module.exports = function (grunt) {
279279
'LICENSE.txt'
280280
],
281281
dest: '/'
282+
},
283+
samples_tgz: {
284+
options: {
285+
mode: 'tgz',
286+
archive: '<%= project.dist %>/<%= project.samples %>.tar.gz'
287+
},
288+
files: [{
289+
expand: true,
290+
cwd: '<%= project.dist %>/<%= project.samples %>/',
291+
src: ['**'],
292+
dest: '<%= project.samples %>/'
293+
}, {
294+
cwd: '',
295+
src: [
296+
'THIRD _PARTY_SOFTWARE_AND_LICENCES.md',
297+
'CONTRIBUTING.md',
298+
'LICENSE.txt'
299+
],
300+
dest: '/'
301+
}]
302+
},
303+
samples_zip: {
304+
options: {
305+
mode: 'zip',
306+
archive: '<%= project.dist %>/<%= project.samples %>.zip'
307+
},
308+
files: [{
309+
expand: true,
310+
cwd: '<%= project.dist %>/<%= project.samples %>/',
311+
src: ['**'],
312+
dest: '<%= project.samples %>/'
313+
}, {
314+
cwd: '',
315+
src: [
316+
'THIRD _PARTY_SOFTWARE_AND_LICENCES.md',
317+
'CONTRIBUTING.md',
318+
'LICENSE.txt'
319+
],
320+
dest: '/'
321+
}]
282322
}
283323
}
284324
});

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ You are free to use MyScriptJS in any of your personal or commercial project, as
3434

3535
## Examples
3636

37-
Checking the [codes samples](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples) is a good way to start implementing MyScriptJS in your project and to get familiar with the concepts.
37+
Checking the [code samples](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples) is a good way to start implementing MyScriptJS in your project and to get familiar with the concepts.
3838

3939

4040
## Contribute

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myscript",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"main": "./dist/myscript.js",
55
"description": "MyScriptJS is a free and open-source JavaScript library providing the easiest way to use MyScript Cloud handwriting recognition in your web app",
66
"keywords": [

dist/myscript.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ MyScript = {};
861861
* @param {Number} x
862862
*/
863863
Stroke.prototype.addX = function (x) {
864-
if (x) {
864+
if ((x !== null) && (x !== undefined)) {
865865
this.x.push(x);
866866
}
867867
};
@@ -893,7 +893,7 @@ MyScript = {};
893893
* @param {Number} y
894894
*/
895895
Stroke.prototype.addY = function (y) {
896-
if (y) {
896+
if ((y !== null) && (y !== undefined)) {
897897
this.y.push(y);
898898
}
899899
};
@@ -925,7 +925,7 @@ MyScript = {};
925925
* @param {Number} t
926926
*/
927927
Stroke.prototype.addT = function (t) {
928-
if (t) {
928+
if ((t !== null) && (t !== undefined)) {
929929
this.t.push(t);
930930
}
931931
};

dist/myscript.min.js

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/myscript.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myscript",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"main": "./dist/myscript.js",
55
"description": "MyScriptJS is a free and open-source JavaScript library providing the easiest way to use MyScript Cloud handwriting recognition in your web app",
66
"keywords": [

src/input/generic/components/stroke.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* @param {Number} x
5353
*/
5454
Stroke.prototype.addX = function (x) {
55-
if (x) {
55+
if ((x !== null) && (x !== undefined)) {
5656
this.x.push(x);
5757
}
5858
};
@@ -84,7 +84,7 @@
8484
* @param {Number} y
8585
*/
8686
Stroke.prototype.addY = function (y) {
87-
if (y) {
87+
if ((y !== null) && (y !== undefined)) {
8888
this.y.push(y);
8989
}
9090
};
@@ -116,7 +116,7 @@
116116
* @param {Number} t
117117
*/
118118
Stroke.prototype.addT = function (t) {
119-
if (t) {
119+
if ((t !== null) && (t !== undefined)) {
120120
this.t.push(t);
121121
}
122122
};

test/unit/common/inkManager.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,14 @@ describe('MyScriptJS: common/inkManager.js', function () {
168168

169169
expect(inkManager.getStrokes()).to.deep.equal(copyStrokes);
170170
});
171+
172+
it('test if stroke is properly filled', function () {
173+
// add one stroke
174+
inkManager.startInkCapture(0, 0, 1428064394);
175+
inkManager.continueInkCapture(0, 1, 1428064395);
176+
inkManager.endInkCapture();
177+
178+
expect(inkManager.getCurrentStroke().getX().length).to.equal(inkManager.getCurrentStroke().getY().length);
179+
});
180+
171181
});

0 commit comments

Comments
 (0)