annyang_rails 0.2.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/annyang.js +21 -8
- data/lib/annyang_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGExMzcxZDZhYzJlNmYxZjM0YmVhNDRiYjIxNjY0NzkwNmEzZWE1MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGRhN2Y5ZWNiMGExZmU1ZDk3MTQzODFhYjIzMzUyODlkNTI1MDMwNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDZlZjIwMTkyNjI5NTMwODIxOWM5Y2IzMDE3Njk5ZTZjZWQ5Y2JmMGYxNWY4
|
10
|
+
MWViZWMxYjBmNmE1ZDdlNTc5ZGI4ODUyMDVjODE5NmM4OTdhNzYzZTNhNzVl
|
11
|
+
YjM2MjE5YWY3MGViZTY3Zjk2MjZkY2E0MmQxOTQ2OGUwNDFlMjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODBjOWYyMDhiYzVkNmI5N2E5NzAzMTYyNjc4OWYyMTg4ZDdlNzA1ODAyNDcz
|
14
|
+
ZmJjYTY3Zjg1MGIzNjBiMjA3ODc2YTM2MmQ0OGMyYjVlYzQwZWRiYWRmMjA5
|
15
|
+
MTcyOWM1NTYyNDdjZDg0NTMyOWM1MjQ3YmQ3Zjg4ZmQzN2FmNjU=
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//! annyang
|
2
|
-
//! version : 0.
|
2
|
+
//! version : 1.0.0
|
3
3
|
//! author : Tal Ater @TalAter
|
4
4
|
//! license : MIT
|
5
5
|
//! https://www.TalAter.com/annyang/
|
@@ -10,15 +10,15 @@
|
|
10
10
|
var root = this;
|
11
11
|
|
12
12
|
// Get the SpeechRecognition object, while handling browser prefixes
|
13
|
-
var SpeechRecognition = root.
|
13
|
+
var SpeechRecognition = root.SpeechRecognition ||
|
14
|
+
root.webkitSpeechRecognition ||
|
14
15
|
root.mozSpeechRecognition ||
|
15
16
|
root.msSpeechRecognition ||
|
16
|
-
root.oSpeechRecognition
|
17
|
-
root.SpeechRecognition;
|
17
|
+
root.oSpeechRecognition;
|
18
18
|
|
19
19
|
// Check browser support
|
20
20
|
// This is done as early as possible, to make it as fast as possible for unsupported browsers
|
21
|
-
if (
|
21
|
+
if (!SpeechRecognition) {
|
22
22
|
root.annyang = null;
|
23
23
|
return null;
|
24
24
|
}
|
@@ -51,9 +51,9 @@
|
|
51
51
|
|
52
52
|
// This method receives an array of callbacks to iterate over, and invokes each of them
|
53
53
|
var invokeCallbacks = function(callbacks) {
|
54
|
-
|
55
|
-
|
56
|
-
}
|
54
|
+
callbacks.forEach(function(callback) {
|
55
|
+
callback.callback.apply(callback.context);
|
56
|
+
});
|
57
57
|
};
|
58
58
|
|
59
59
|
root.annyang = {
|
@@ -211,6 +211,19 @@
|
|
211
211
|
}
|
212
212
|
},
|
213
213
|
|
214
|
+
// Remove existing commands. Called with a single phrase or an array of phrases
|
215
|
+
removeCommands: function(commandsToRemove) {
|
216
|
+
commandsToRemove = Array.isArray(commandsToRemove) ? commandsToRemove : [commandsToRemove];
|
217
|
+
commandsList = commandsList.filter(function(command) {
|
218
|
+
for (var i = 0; i<commandsToRemove.length; i++) {
|
219
|
+
if (commandsToRemove[i] === command.originalPhrase) {
|
220
|
+
return false;
|
221
|
+
}
|
222
|
+
}
|
223
|
+
return true;
|
224
|
+
});
|
225
|
+
},
|
226
|
+
|
214
227
|
// Lets the user add a callback of one of 9 types:
|
215
228
|
// start, error, end, result, resultMatch, resultNoMatch, errorNetwork, errorPermissionBlocked, errorPermissionDenied
|
216
229
|
// Can also optionally receive a context for the callback function as the third argument
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: annyang_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Israeli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|