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

Commit 1eec5f4

Browse files
author
Francois-Xavier Gentilhomme
committed
v1.0.4 Release samples README and Travis update
1 parent 4b6bb04 commit 1eec5f4

File tree

33 files changed

+200
-129
lines changed

33 files changed

+200
-129
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.xml
44
*.idea
55
.tmp
6+
release.sh
67
node_modules
78
bower_components
89
test_results

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ node_js:
33
- '0.10'
44
before_install: npm install -g grunt-cli
55
install: npm install && bower install
6-
before_script: grunt build && grunt compress
6+
before_script: grunt
77
deploy:
88
- provider: npm
99
email: myscriptjs@myscript.com

Gruntfile.js

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,9 @@ module.exports = function (grunt) {
9191
concat: {
9292
default: {
9393
options: {
94-
sourceMap: true
94+
sourceMap: true,
95+
banner: '/*\n <%= pkg.name %> - <%= pkg.description %>\n Version: <%= pkg.version %>\n License: <%= pkg.license %>\n */\n'
9596
},
96-
src: '<%= fileList %>',
97-
dest: '<%= project.tmp %>/<%= pkg.name %>.js'
98-
},
99-
raw: {
10097
src: '<%= fileList %>',
10198
dest: '<%= project.dist %>/<%= pkg.name %>.js'
10299
}
@@ -107,14 +104,15 @@ module.exports = function (grunt) {
107104
mangle: false,
108105
nonull: true,
109106
sourceMap: true,
110-
sourceMapIn: '<%= project.tmp %>/<%= pkg.name %>.js.map',
107+
sourceMapIncludeSources: false,
108+
sourceMapIn: '<%= project.dist %>/<%= pkg.name %>.js.map',
111109
banner: '/*\n <%= pkg.name %> - <%= pkg.description %>\n Version: <%= pkg.version %>\n License: <%= pkg.license %>\n */'
112110
},
113111
default: {
114112
files: [{
115113
expand: true,
116114
flatten: true,
117-
cwd: '<%= project.tmp %>',
115+
cwd: '<%= project.dist %>',
118116
src: '<%= pkg.name %>.js',
119117
dest: '<%= project.dist %>',
120118
ext: '.min.js'
@@ -206,15 +204,16 @@ module.exports = function (grunt) {
206204
'cryptojslib/components/hmac-min.js',
207205
'q/q.js'
208206
]
209-
}]
210-
},
211-
readme: {
212-
files: [{
207+
}, {
213208
expand: true,
214209
dot: true,
215-
cwd: '',
216-
dest: '<%= project.dist %>',
217-
src: ['README.md']
210+
flatten: true,
211+
cwd: '<%= project.dist %>',
212+
dest: '<%= project.dist %>/<%= project.samples %>/lib',
213+
src: [
214+
'myscript.min.js',
215+
'myscript.min.js.map'
216+
]
218217
}]
219218
}
220219
},
@@ -236,13 +235,6 @@ module.exports = function (grunt) {
236235
}
237236
}
238237
},
239-
// Run some tasks in parallel to speed up the build process
240-
concurrent: {
241-
default: [
242-
'build',
243-
'docs'
244-
]
245-
},
246238
compress: {
247239
tgz: {
248240
options: {
@@ -254,6 +246,7 @@ module.exports = function (grunt) {
254246
cwd: '',
255247
src: [
256248
'<%= project.dist %>/<%= pkg.name %>.js',
249+
'<%= project.dist %>/<%= pkg.name %>.js.map',
257250
'<%= project.dist %>/<%= pkg.name %>.min.js',
258251
'<%= project.dist %>/<%= pkg.name %>.min.js.map',
259252
'THIRD _PARTY_SOFTWARE_AND_LICENCES.md',
@@ -272,6 +265,7 @@ module.exports = function (grunt) {
272265
cwd: '',
273266
src: [
274267
'<%= project.dist %>/<%= pkg.name %>.js',
268+
'<%= project.dist %>/<%= pkg.name %>.js.map',
275269
'<%= project.dist %>/<%= pkg.name %>.min.js',
276270
'<%= project.dist %>/<%= pkg.name %>.min.js.map',
277271
'THIRD _PARTY_SOFTWARE_AND_LICENCES.md',
@@ -320,15 +314,30 @@ module.exports = function (grunt) {
320314
dest: '/'
321315
}]
322316
}
317+
},
318+
// Run some tasks in parallel to speed up the build process
319+
concurrent: {
320+
default: [
321+
'build',
322+
'docs',
323+
'samples'
324+
],
325+
release: [
326+
'compress:zip',
327+
'compress:tgz',
328+
'compress:samples_zip',
329+
'compress:samples_tgz'
330+
]
323331
}
324332
});
325333

326334
grunt.registerTask('default', [
327335
'clean:default',
328336
'jshint:default',
329-
'test-unit',
330-
'concurrent',
331-
'copy:readme'
337+
'test',
338+
'build',
339+
'copy:samples',
340+
'concurrent:release'
332341
]);
333342

334343
grunt.registerTask('test', [
@@ -345,21 +354,15 @@ module.exports = function (grunt) {
345354
'clean:tmp',
346355
'concat',
347356
'uglify',
348-
'concat:raw',
349357
'clean:tmp'
350358
]);
351359

352-
grunt.registerTask('release', [
353-
'compress'
354-
]);
355-
356360
grunt.registerTask('docs', [
357361
'clean:tmp',
358362
'copy:template',
359363
'copy:styles',
360364
'copy:conf',
361365
'yuidoc',
362-
'copy:samples',
363366
'clean:tmp'
364367
]);
365368

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# MyScriptJS [![Build Status](https://travis-ci.org/MyScript/MyScriptJS.svg?branch=v0.0.4)](https://travis-ci.org/MyScript/MyScriptJS)
1+
# MyScriptJS
22

33
[MyScriptJS](http://myscript.github.io/MyScriptJS/) is a free and open-source JavaScript library providing an easy way to use [MyScript Cloud]( https://dev.myscript.com/dev-kits/cloud-development-kit/) handwriting recognition in your app.
44

5+
[![Build Status](https://travis-ci.org/MyScript/MyScriptJS.svg?branch=master)](https://travis-ci.org/MyScript/MyScriptJS)
6+
[![GitHub version](https://badge.fury.io/gh/MyScript%2FMyScriptJS.svg)](http://badge.fury.io/gh/MyScript%2FMyScriptJS)
7+
[![Bower version](https://badge.fury.io/bo/myscript.svg)](http://badge.fury.io/bo/myscript)
8+
[![npm version](https://badge.fury.io/js/myscript.svg)](http://badge.fury.io/js/myscript)
9+
510
[MyScriptJS](http://myscript.github.io/MyScriptJS/) speeds up the development of handwriting interfaces with JavaScript, by abstracting and providing default implementations for the common tasks that need to be managed:
611

712
* **Ink management**: Store strokes and benefit from a built-in undo/redo system.

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "myscript",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
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": [
@@ -36,6 +36,6 @@
3636
},
3737
"dependencies": {
3838
"cryptojslib": "3.1.x",
39-
"q": "1.0.x"
39+
"q": "1.2.x"
4040
}
4141
}

dist/myscript.js

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

dist/myscript.js.map

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

dist/myscript.min.js

Lines changed: 6 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.3",
3+
"version": "1.0.4",
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": [

resources/samples/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MyScriptJS
2+
3+
Welcome to the [MyScript](https://www.myscript.com) JavaScript framework.
4+
5+
Learn more in the [Developer Guide](http://myscript.github.io/MyScriptJS/developer-guide/index.html) and the [API Reference](http://myscript.github.io/MyScriptJS/api-reference/index.html).
6+
7+
## Installation
8+
9+
**Browser**: Use our [CDN](https://cdnjs.com/libraries/myscript) or [Download](https://github.com/MyScript/MyScriptJS/releases/latest) the latest `myscript.js`
10+
11+
**Bower**: `bower install myscript`
12+
13+
**Node**: `npm install myscript`
14+
15+
## Getting started
16+
17+
This tutorial shows how to perform the recognition of a digital handwritten
18+
sample with MyScript. It gives the main steps to follow, based on the provided [code samples](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples).
19+
20+
### Generate your keys
21+
22+
A valid MyScript Cloud account is necessary to use MyScriptJS.
23+
To create a MyScript Cloud account, look at [MyScript Developer Portal](https://dev.myscript.com/developer-program/register/).
24+
25+
1. [Login](https://cloud.myscript.com) to your Cloud account
26+
2. Create an application
27+
3. Generate an application and an HMAC key
28+
29+
Store your keys for later use.
30+
31+
__No handwriting recognition can be processed without these keys__.
32+
33+
### Follow the tutorial
34+
35+
- [Analyzer recognition](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples/analyzer#create-your-html5-canvas)
36+
- [Math recognition](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples/math#create-your-html5-canvas)
37+
- [Music recognition](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples/music#create-your-html5-canvas)
38+
- [Shape recognition](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples/shape#create-your-html5-canvas)
39+
- [Text recognition](https://github.com/MyScript/MyScriptJS/tree/master/resources/samples/text#create-your-html5-canvas)

resources/samples/analyzer/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Welcome to the [MyScript](https://www.myscript.com) JavaScript framework.
44

5-
Learn more in the [Developer Guide](http://doc.myscript.com/MyScriptJS/DeveloperGuide/index.html) and the [API Reference](http://doc.myscript.com/MyScriptJS/API_Reference/index.html).
5+
Learn more in the [Developer Guide](http://myscript.github.io/MyScriptJS/developer-guide/index.html) and the [API Reference](http://myscript.github.io/MyScriptJS/api-reference/index.html).
66

77
## Installation
88

9-
**Browser**: Download the latest `myscript.js` from our [Developer Portal](https://dev.myscript.com).
9+
**Browser**: Use our [CDN](https://cdnjs.com/libraries/myscript) or [Download](https://github.com/MyScript/MyScriptJS/releases/latest) the latest `myscript.js`
1010

1111
**Bower**: `bower install myscript`
1212

@@ -107,7 +107,7 @@ Besides, the pointerId variable needs to be added: Its role is make sure that ev
107107
</html>
108108
```
109109

110-
### Create a [Renderer](http://doc.myscript.com/MyScriptJS/API_Reference/classes/AnalyzerRenderer.html)
110+
### Create a [Renderer](http://myscript.github.io/MyScriptJS/api-reference/classes/AnalyzerRenderer.html)
111111

112112
You need to create a renderer to draw strokes on your canvas. To do so, provide the renderer with canvas context (size, background, etc.) and ink coordinates.<br>The renderer that you define depends on the type of recognition you want to achieve.
113113

@@ -157,9 +157,9 @@ You need to create a renderer to draw strokes on your canvas. To do so, provide
157157
```
158158

159159

160-
### Create a [InkManager](http://doc.myscript.com/MyScriptJS/API_Reference/classes/InkManager.html)
160+
### Create a [InkManager](http://myscript.github.io/MyScriptJS/api-reference/classes/InkManager.html)
161161

162-
You need to build a stroker to catch and store the drawn strokes. The stroker will transform them into proper [MyScript Strokes](http://doc.myscript.com/MyScriptJS/API_Reference/classes/Stroke.html) to use them as input components for the recognition process. Note that the undo/redo feature is not possible without a stroker.
162+
You need to build a stroker to catch and store the drawn strokes. The stroker will transform them into proper [MyScript Strokes](http://myscript.github.io/MyScriptJS/api-reference/classes/Stroke.html) to use them as input components for the recognition process. Note that the undo/redo feature is not possible without a stroker.
163163

164164
```javascript
165165
(function() {
@@ -211,7 +211,7 @@ You need to build a stroker to catch and store the drawn strokes. The stroker wi
211211
})();
212212
```
213213

214-
### Create a [Recognizer](http://doc.myscript.com/MyScriptJS/API_Reference/classes/AnalyzerRecognizer.html)
214+
### Create a [Recognizer](http://myscript.github.io/MyScriptJS/api-reference/classes/AnalyzerRecognizer.html)
215215

216216
You need to create the last object, namely the recognizer. Its role is to manage the recognition within MyScript JS by sending requests and receiving responses to and from MyScript Cloud. The recognizer that you define depends on the type of recognition you want to achieve.
217217

@@ -227,7 +227,7 @@ var analyzerRecognizer = new MyScript.AnalyzerRecognizer();
227227

228228
### Launch the recognition
229229

230-
To launch the recognition process, gather your input components and call the method [`doSimpleRecognition`](http://doc.myscript.com/MyScriptJS/API_Reference/classes/AnalyzerRecognizer.html#method_doSimpleRecognition).<br>
230+
To launch the recognition process, gather your input components and call the method [`doSimpleRecognition`](http://myscript.github.io/MyScriptJS/api-reference/classes/AnalyzerRecognizer.html#method_doSimpleRecognition).<br>
231231
Reminder: The `applicationKey` and the `hmacKey` are generated at the very beginning.<br>
232232
The variable `instanceId` is the session identifier: It is used below to check that you are still working on the same session.
233233

@@ -248,10 +248,10 @@ function doRecognition () {
248248

249249
### Get the result
250250

251-
Every [`doSimpleRecognition`](http://doc.myscript.com/MyScriptJS/API_Reference/classes/AnalyzerRecognizer.html#method_doSimpleRecognition) method returns [Promise](https://github.com/domenic/promises-unwrapping/blob/master/README.md), so you can directly access the output using resolve process. For every recognition type, the result contains the `instanceId` and the recognition document, here a [AnalyzerDocument](http://doc.myscript.com/MyScriptJS/API_Reference/classes/AnalyzerDocument.html).
251+
Every [`doSimpleRecognition`](http://myscript.github.io/MyScriptJS/api-reference/classes/AnalyzerRecognizer.html#method_doSimpleRecognition) method returns [Promise](https://github.com/domenic/promises-unwrapping/blob/master/README.md), so you can directly access the output using resolve process. For every recognition type, the result contains the `instanceId` and the recognition document, here a [AnalyzerDocument](http://myscript.github.io/MyScriptJS/api-reference/classes/AnalyzerDocument.html).
252252
For more information on output objects, please refer to the
253-
[API Reference](http://doc.myscript.com/MyScriptJS/API_Reference/index.html) and
254-
[Developer Guide](http://doc.myscript.com/MyScriptJS/DeveloperGuide/index.html).
253+
[API Reference](http://myscript.github.io/MyScriptJS/api-reference/index.html) and
254+
[Developer Guide](http://myscript.github.io/MyScriptJS/developer-guide/index.html).
255255

256256
```javascript
257257
var canvas = document.getElementById("canvas");

resources/samples/analyzer/getting-started/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1>Analyzer - Getting started</h1>
2121
<!-- HandJS import -->
2222
<script type="text/javascript" src="../../lib/hand.minified-1.3.8.js"></script>
2323
<!-- MyScriptJS import -->
24-
<script type="text/javascript" src="../../../myscript.min.js"></script>
24+
<script type="text/javascript" src="../../lib/myscript.min.js"></script>
2525
<script>
2626
(function () {
2727
var canvas = document.getElementById("canvas");

resources/samples/analyzer/rest/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>Analyzer - REST sample</h1>
2626
<script type="text/javascript" src="../../lib/hmac-min.js"></script>
2727
<script type="text/javascript" src="../../lib/q.js"></script>
2828
<script type="text/javascript" src="../../lib/hand.minified-1.3.8.js"></script>
29-
<script type="text/javascript" src="../../../myscript.min.js"></script>
29+
<script type="text/javascript" src="../../lib/myscript.min.js"></script>
3030
<script>
3131
(function () {
3232
var canvas = document.getElementById("canvas");

0 commit comments

Comments
 (0)