Skip to content

Commit

Permalink
Artyom 1.0.4
Browse files Browse the repository at this point in the history
New event that triggers when not any command was matched.
  • Loading branch information
sdkcarlos committed Feb 7, 2017
1 parent 7f2b2d9 commit 7a1240e
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.vscode
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
development
nbproject
node_modules
public
.gitignore
.gitignore
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ The most known features of artyom are:
- onStart and onEnd callbacks **will be always executed independently of the text length**.
- Works both in desktop browser and mobile device.

Read [the changelog to be informed about changes and additions in Artyom.js](http://docs.ourcodeworld.com/projects/artyom-js/documentation/getting-started/official-changelog)

# Installation

#### NPM
Expand Down
10 changes: 7 additions & 3 deletions build-vanilla/artyom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Artyom.js requires webkitSpeechRecognition and speechSynthesis APIs
*
* @license MIT
* @version 1.0.3
* @version 1.0.4
* @copyright 2017 Our Code World All Rights Reserved.
* @author Carlos Delgado - www.ourcodeworld.com
* @param {Object} window
Expand Down Expand Up @@ -93,7 +93,8 @@
TEXT_RECOGNIZED: "TEXT_RECOGNIZED",
COMMAND_RECOGNITION_START : "COMMAND_RECOGNITION_START",
COMMAND_RECOGNITION_END: "COMMAND_RECOGNITION_END",
COMMAND_MATCHED: "COMMAND_MATCHED"
COMMAND_MATCHED: "COMMAND_MATCHED",
NOT_COMMAND_MATCHED: "NOT_COMMAND_MATCHED"
};

/**
Expand Down Expand Up @@ -1243,6 +1244,9 @@
}
}

artyom.debug("Event reached : " + artyom_global_events.NOT_COMMAND_MATCHED);
artyom_triggerEvent(artyom_global_events.NOT_COMMAND_MATCHED);

return false;
};

Expand Down Expand Up @@ -1610,7 +1614,7 @@
* @returns {String}
*/
artyom.getVersion = function () {
return "1.0.3";
return "1.0.4";
};

/**
Expand Down
4 changes: 2 additions & 2 deletions build-vanilla/artyom.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions development/artyom-source/artyom.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
TEXT_RECOGNIZED: "TEXT_RECOGNIZED",
COMMAND_RECOGNITION_START : "COMMAND_RECOGNITION_START",
COMMAND_RECOGNITION_END: "COMMAND_RECOGNITION_END",
COMMAND_MATCHED: "COMMAND_MATCHED"
COMMAND_MATCHED: "COMMAND_MATCHED",
NOT_COMMAND_MATCHED: "NOT_COMMAND_MATCHED"
};

/**
Expand Down Expand Up @@ -1236,6 +1237,9 @@
}
}

artyom.debug("Event reached : " + artyom_global_events.NOT_COMMAND_MATCHED);
artyom_triggerEvent(artyom_global_events.NOT_COMMAND_MATCHED);

return false;
};

Expand Down Expand Up @@ -1603,7 +1607,7 @@
* @returns {String}
*/
artyom.getVersion = function () {
return "1.0.2";
return "1.0.4";
};

/**
Expand Down
3 changes: 1 addition & 2 deletions development/artyom-source/sandbox-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
SANDBOX.loadCommands();

if(status){
/*
artyom.initialize({
lang:"en-GB",
continuous:true,
Expand All @@ -72,7 +71,7 @@
console.log("Artyom succesfully initialized");
}).catch((err) => {
console.error("Artyom couldn't be initialized: ", err);
});*/
});
}

$("#btn-speak").click(() => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artyom.js",
"version": "1.0.3",
"version": "1.0.4",
"description": "Artyom is a Robust Wrapper of the Google Chrome SpeechSynthesis and SpeechRecognition that allows you to create a virtual assistent",
"main": "ts/artyom.js",
"typings": "ts/index.d.ts",
Expand Down
Binary file modified public/artyom-source.zip
Binary file not shown.
8 changes: 5 additions & 3 deletions ts/artyom.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ var ArtyomGlobalEvents = {
TEXT_RECOGNIZED: "TEXT_RECOGNIZED",
COMMAND_RECOGNITION_START: "COMMAND_RECOGNITION_START",
COMMAND_RECOGNITION_END: "COMMAND_RECOGNITION_END",
COMMAND_MATCHED: "COMMAND_MATCHED"
COMMAND_MATCHED: "COMMAND_MATCHED",
NOT_COMMAND_MATCHED: "NOT_COMMAND_MATCHED"
};
var ArtyomLanguages = {
german: ["Google Deutsch", "de-DE", "de_DE"],
Expand Down Expand Up @@ -362,7 +363,6 @@ var ArtyomJsImpl = (function () {
else {
msg.voice = availableVoice;
}
console.log("Usando voz ", availableVoice);
}
else {
console.warn("Using default voice because no voice was selected during the initialization probably because there were no voices available. Initialize artyom after the onload event of the window.");
Expand Down Expand Up @@ -697,6 +697,8 @@ var ArtyomJsImpl = (function () {
}
}
}
_this.debug("Event reached : " + ArtyomGlobalEvents.NOT_COMMAND_MATCHED);
ArtyomHelpers.artyomTriggerEvent(ArtyomGlobalEvents.NOT_COMMAND_MATCHED);
return {
result: false,
indice: null,
Expand Down Expand Up @@ -1129,7 +1131,7 @@ var ArtyomJsImpl = (function () {
return !!_this.artyomProperties.obeying;
};
this.getVersion = function () {
return "1.0.3";
return "1.0.4";
};
this.on = function (indexes, smart) {
return {
Expand Down
13 changes: 8 additions & 5 deletions ts/artyom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ const ArtyomGlobalEvents = {
TEXT_RECOGNIZED: "TEXT_RECOGNIZED",
COMMAND_RECOGNITION_START : "COMMAND_RECOGNITION_START",
COMMAND_RECOGNITION_END: "COMMAND_RECOGNITION_END",
COMMAND_MATCHED: "COMMAND_MATCHED"
COMMAND_MATCHED: "COMMAND_MATCHED",
NOT_COMMAND_MATCHED: "NOT_COMMAND_MATCHED"
};

const ArtyomLanguages = {
Expand Down Expand Up @@ -1021,7 +1022,6 @@ export class ArtyomJsImpl implements ArtyomJS {
msg.voice = availableVoice;
}

console.log("Usando voz ", availableVoice);
}else{
console.warn("Using default voice because no voice was selected during the initialization probably because there were no voices available. Initialize artyom after the onload event of the window.");
}
Expand Down Expand Up @@ -1382,6 +1382,9 @@ export class ArtyomJsImpl implements ArtyomJS {
}
}

this.debug("Event reached : " + ArtyomGlobalEvents.NOT_COMMAND_MATCHED);
ArtyomHelpers.artyomTriggerEvent(ArtyomGlobalEvents.NOT_COMMAND_MATCHED);

return {
result: false,
indice: null,
Expand Down Expand Up @@ -1862,7 +1865,7 @@ export class ArtyomJsImpl implements ArtyomJS {
};

getVersion = () => {
return "1.0.3";
return "1.0.4";
};

on = (indexes: any, smart: boolean): any => {
Expand Down Expand Up @@ -1896,9 +1899,9 @@ export class ArtyomJsImpl implements ArtyomJS {
* Artyom.js requires webkitSpeechRecognition and speechSynthesis APIs
*
* @license MIT
* @version 1.0.3
* @version 1.0.4
* @copyright 2017 Our Code World All Rights Reserved.
* @author semagarcia - https://github.com/semagarcia
* @author semagarcia (TypeScript version) - https://github.com/semagarcia
* @see https://sdkcarlos.github.io/sites/artyom.html
* @see http://docs.ourcodeworld.com/projects/artyom-js
*/
Expand Down

0 comments on commit 7a1240e

Please sign in to comment.