annyang 2.6.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +56 -32
- package/dist/annyang.cjs +361 -0
- package/dist/annyang.cjs.map +1 -0
- package/dist/annyang.d.cts +288 -0
- package/dist/annyang.d.ts +288 -0
- package/dist/annyang.iife.min.js +1 -0
- package/dist/annyang.js +303 -670
- package/dist/annyang.js.map +1 -1
- package/package.json +55 -31
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -34
- package/.gitattributes +0 -1
- package/.github/ISSUE_TEMPLATE.md +0 -32
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -29
- package/.jshintrc +0 -31
- package/.travis.yml +0 -20
- package/CONTRIBUTING.md +0 -75
- package/Gruntfile.js +0 -144
- package/bower.json +0 -25
- package/demo/css/main.css +0 -152
- package/demo/css/main.min.css +0 -1
- package/demo/images/flickr.png +0 -0
- package/demo/images/footer_background.jpg +0 -0
- package/demo/images/icon_js.png +0 -0
- package/demo/images/icon_speech.png +0 -0
- package/demo/images/icon_user.png +0 -0
- package/demo/images/mini_icon_say.png +0 -0
- package/demo/images/palette.png +0 -0
- package/demo/images/tpscover.jpg +0 -0
- package/demo/index.html +0 -225
- package/demo/vendor/css/default.css +0 -135
- package/demo/vendor/css/github.css +0 -127
- package/demo/vendor/css/tomorrow.css +0 -49
- package/demo/vendor/html/github-btn.html +0 -243
- package/demo/vendor/js/highlight.pack.js +0 -1
- package/dist/annyang.min.js +0 -12
- package/docs/FAQ.md +0 -223
- package/docs/README.md +0 -336
- package/require.js +0 -36
- package/sites/README.md +0 -6
- package/sites/facebook.js +0 -123
- package/sites/facebook.min.js +0 -17
- package/sites/geektime.js +0 -108
- package/sites/geektime.min.js +0 -17
- package/src/annyang.js +0 -680
- package/test/SpecRunner.html +0 -41
- package/test/init_corti.js +0 -1
- package/test/spec/.jshintrc +0 -40
- package/test/spec/BasicSpec.js +0 -1616
- package/test/spec/IssuesSpec.js +0 -41
- package/test/vendor/corti.js +0 -202
- package/yarn.lock +0 -4190
package/sites/facebook.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
//! annyang - facebook.com
|
|
2
|
-
//! version : 0.1.0
|
|
3
|
-
//! author : Tal Ater @TalAter
|
|
4
|
-
//! license : MIT
|
|
5
|
-
//! https://www.TalAter.com/annyang/
|
|
6
|
-
|
|
7
|
-
(function () {
|
|
8
|
-
/*global annyang,$ */
|
|
9
|
-
"use strict";
|
|
10
|
-
var root = this;
|
|
11
|
-
|
|
12
|
-
if (annyang) {
|
|
13
|
-
var chatToggle = function() {
|
|
14
|
-
root.Chat.toggleSidebar();
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var chatOnline = function() {
|
|
18
|
-
root.ChatVisibility.goOnline();
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var chatOffline = function() {
|
|
22
|
-
root.ChatVisibility.goOffline();
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var searchMore = function(term) {
|
|
26
|
-
root.goURI('/search/more/?q='+term);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var gotoPage = function(term) {
|
|
30
|
-
root.goURI('/'+term.replace(/[^\w]/ig, ''));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var stream = function() {
|
|
34
|
-
root.goURI('/');
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var appcenter = function() {
|
|
38
|
-
root.goURI('/appcenter');
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var messages = function() {
|
|
42
|
-
root.goURI('/messages');
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var friendRequests = function() {
|
|
46
|
-
root.goURI('/friends/requests');
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
var friends = function() {
|
|
50
|
-
root.goURI('/friends');
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var profile = function() {
|
|
54
|
-
root.goURI('/me');
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var events = function() {
|
|
58
|
-
root.goURI('/events/list');
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
var calendar = function() {
|
|
62
|
-
root.goURI('/events/calendar');
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var photos = function(name) {
|
|
66
|
-
root.goURI('/'+(name || 'me').replace(/[^\w]/ig, '')+'/photos');
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
var albums = function(name) {
|
|
70
|
-
root.goURI('/'+(name || 'me').replace(/[^\w]/ig, '')+'/photos_albums');
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
var goBack = function() {
|
|
74
|
-
history.back();
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var pageScroll = function(direction) {
|
|
78
|
-
if (direction === 'up') {
|
|
79
|
-
window.scrollBy(0, -(window.innerHeight-$('pageHead').offsetHeight));
|
|
80
|
-
} else {
|
|
81
|
-
window.scrollBy(0, window.innerHeight-$('pageHead').offsetHeight);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
annyang.addCommands({
|
|
86
|
-
'back': goBack,
|
|
87
|
-
'go back': goBack,
|
|
88
|
-
'go home': stream,
|
|
89
|
-
'home': stream,
|
|
90
|
-
'news': stream,
|
|
91
|
-
'profile': profile,
|
|
92
|
-
'me': profile,
|
|
93
|
-
'games': appcenter,
|
|
94
|
-
'apps': appcenter,
|
|
95
|
-
'messages': messages,
|
|
96
|
-
'inbox': messages,
|
|
97
|
-
'mail': messages,
|
|
98
|
-
'email': messages,
|
|
99
|
-
'events': events,
|
|
100
|
-
'calendar': calendar,
|
|
101
|
-
'photos': photos,
|
|
102
|
-
'photos *page': photos,
|
|
103
|
-
'albums': albums,
|
|
104
|
-
'albums *page': albums,
|
|
105
|
-
'friend requests': friendRequests,
|
|
106
|
-
'friends': friends,
|
|
107
|
-
'chat': chatToggle,
|
|
108
|
-
'chat online': chatOnline,
|
|
109
|
-
'go online': chatOnline,
|
|
110
|
-
'chat offline': chatOffline,
|
|
111
|
-
'go offline': chatOffline,
|
|
112
|
-
'scroll': pageScroll,
|
|
113
|
-
'scroll :direction': pageScroll,
|
|
114
|
-
'find *term': searchMore,
|
|
115
|
-
'search for *term': searchMore,
|
|
116
|
-
'search *term': searchMore,
|
|
117
|
-
'go to *page': gotoPage,
|
|
118
|
-
'go *page': gotoPage,
|
|
119
|
-
});
|
|
120
|
-
annyang.start();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
}).call(this);
|
package/sites/facebook.min.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};
|
|
2
|
-
//! annyang
|
|
3
|
-
//! version : 2.6.1
|
|
4
|
-
//! author : Tal Ater @TalAter
|
|
5
|
-
//! license : MIT
|
|
6
|
-
//! https://www.TalAter.com/annyang/
|
|
7
|
-
//! annyang
|
|
8
|
-
//! version : 2.6.1
|
|
9
|
-
//! author : Tal Ater @TalAter
|
|
10
|
-
//! license : MIT
|
|
11
|
-
//! https://www.TalAter.com/annyang/
|
|
12
|
-
!function(e,n){"function"==typeof define&&define.amd?define([],function(){return e.annyang=n(e)}):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=n(e):e.annyang=n(e)}("undefined"!=typeof window?window:void 0,function(r,i){var t,o=r.SpeechRecognition||r.webkitSpeechRecognition||r.mozSpeechRecognition||r.msSpeechRecognition||r.oSpeechRecognition;if(!o)return null;var a,c,s=[],u={start:[],error:[],end:[],soundstart:[],result:[],resultMatch:[],resultNoMatch:[],errorNetwork:[],errorPermissionBlocked:[],errorPermissionDenied:[]},f=0,l=0,g=!1,d="font-weight: bold; color: #00f;",p=!1,h=!1,m=/\s*\((.*?)\)\s*/g,y=/(\(\?:[^)]+\))\?/g,b=/(\(\?)?:\w+/g,w=/\*\w+/g,v=/[\-{}\[\]+?.,\\\^$|#]/g,R=function(e){for(var n=arguments.length,t=Array(1<n?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];e.forEach(function(e){e.callback.apply(e.context,t)})},e=function(){return a!==i},k=function(e,n){-1!==e.indexOf("%c")||n?console.log(e,n||d):console.log(e)},S=function(){e()||t.init({},!1)},x=function(e,n,t){s.push({command:e,callback:n,originalPhrase:t}),g&&k("Command successfully loaded: %c"+t,d)},I=function(e){var n;R(u.result,e);for(var t=0;t<e.length;t++){n=e[t].trim(),g&&k("Speech recognized: %c"+n,d);for(var o=0,r=s.length;o<r;o++){var i=s[o],a=i.command.exec(n);if(a){var c=a.slice(1);return g&&(k("command matched: %c"+i.originalPhrase,d),c.length&&k("with parameters",c)),i.callback.apply(this,c),void R(u.resultMatch,n,i.originalPhrase,e)}}}R(u.resultNoMatch,e)};return t={init:function(e){var n=!(1<arguments.length&&arguments[1]!==i)||arguments[1];a&&a.abort&&a.abort(),(a=new o).maxAlternatives=5,a.continuous="http:"===r.location.protocol,a.lang="en-US",a.onstart=function(){h=!0,R(u.start)},a.onsoundstart=function(){R(u.soundstart)},a.onerror=function(e){switch(R(u.error,e),e.error){case"network":R(u.errorNetwork,e);break;case"not-allowed":case"service-not-allowed":c=!1,(new Date).getTime()-f<200?R(u.errorPermissionBlocked,e):R(u.errorPermissionDenied,e)}},a.onend=function(){if(h=!1,R(u.end),c){var e=(new Date).getTime()-f;(l+=1)%10==0&&g&&k("Speech Recognition is repeatedly stopping and starting. See http://is.gd/annyang_restarts for tips."),e<1e3?setTimeout(function(){t.start({paused:p})},1e3-e):t.start({paused:p})}},a.onresult=function(e){if(p)return g&&k("Speech heard, but annyang is paused"),!1;for(var n=e.results[e.resultIndex],t=[],o=0;o<n.length;o++)t[o]=n[o].transcript;I(t)},n&&(s=[]),e.length&&this.addCommands(e)},start:function(e){S(),p=(e=e||{}).paused!==i&&!!e.paused,c=e.autoRestart===i||!!e.autoRestart,e.continuous!==i&&(a.continuous=!!e.continuous),f=(new Date).getTime();try{a.start()}catch(e){g&&k(e.message)}},abort:function(){c=!1,l=0,e()&&a.abort()},pause:function(){p=!0},resume:function(){t.start()},debug:function(){var e=!(0<arguments.length&&arguments[0]!==i)||arguments[0];g=!!e},setLanguage:function(e){S(),a.lang=e},addCommands:function(e){var n,t;for(var o in S(),e)if(e.hasOwnProperty(o))if("function"==typeof(n=r[e[o]]||e[o]))x((t=(t=o).replace(v,"\\$&").replace(m,"(?:$1)?").replace(b,function(e,n){return n?e:"([^\\s]+)"}).replace(w,"(.*?)").replace(y,"\\s*$1?\\s*"),new RegExp("^"+t+"$","i")),n,o);else{if(!("object"===(void 0===n?"undefined":_typeof(n))&&n.regexp instanceof RegExp)){g&&k("Can not register command: %c"+o,d);continue}x(new RegExp(n.regexp.source,"i"),n.callback,o)}},removeCommands:function(t){t===i?s=[]:(t=Array.isArray(t)?t:[t],s=s.filter(function(e){for(var n=0;n<t.length;n++)if(t[n]===e.originalPhrase)return!1;return!0}))},addCallback:function(e,n,t){var o=r[n]||n;"function"==typeof o&&u[e]!==i&&u[e].push({callback:o,context:t||this})},removeCallback:function(e,n){var t=function(e){return e.callback!==n};for(var o in u)u.hasOwnProperty(o)&&(e!==i&&e!==o||(u[o]=n===i?[]:u[o].filter(t)))},isListening:function(){return h&&!p},getSpeechRecognizer:function(){return a},trigger:function(e){t.isListening()?(Array.isArray(e)||(e=[e]),I(e)):g&&k(h?"Speech heard, but annyang is paused":"Cannot trigger while annyang is aborted")}}}),//! annyang - facebook.com
|
|
13
|
-
//! version : 0.1.0
|
|
14
|
-
//! author : Tal Ater @TalAter
|
|
15
|
-
//! license : MIT
|
|
16
|
-
//! https://www.TalAter.com/annyang/
|
|
17
|
-
function(){var n=this;if(annyang){var e=function(){n.ChatVisibility.goOnline()},t=function(){n.ChatVisibility.goOffline()},o=function(e){n.goURI("/search/more/?q="+e)},r=function(e){n.goURI("/"+e.replace(/[^\w]/gi,""))},i=function(){n.goURI("/")},a=function(){n.goURI("/appcenter")},c=function(){n.goURI("/messages")},s=function(){n.goURI("/me")},u=function(e){n.goURI("/"+(e||"me").replace(/[^\w]/gi,"")+"/photos")},f=function(e){n.goURI("/"+(e||"me").replace(/[^\w]/gi,"")+"/photos_albums")},l=function(){history.back()},g=function(e){"up"===e?window.scrollBy(0,-(window.innerHeight-$("pageHead").offsetHeight)):window.scrollBy(0,window.innerHeight-$("pageHead").offsetHeight)};annyang.addCommands({back:l,"go back":l,"go home":i,home:i,news:i,profile:s,me:s,games:a,apps:a,messages:c,inbox:c,mail:c,email:c,events:function(){n.goURI("/events/list")},calendar:function(){n.goURI("/events/calendar")},photos:u,"photos *page":u,albums:f,"albums *page":f,"friend requests":function(){n.goURI("/friends/requests")},friends:function(){n.goURI("/friends")},chat:function(){n.Chat.toggleSidebar()},"chat online":e,"go online":e,"chat offline":t,"go offline":t,scroll:g,"scroll :direction":g,"find *term":o,"search for *term":o,"search *term":o,"go to *page":r,"go *page":r}),annyang.start()}}.call(this);
|
package/sites/geektime.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
//! annyang - Geektime.co.il
|
|
2
|
-
//! version : 0.1.0
|
|
3
|
-
//! author : Tal Ater @TalAter
|
|
4
|
-
//! license : MIT
|
|
5
|
-
//! https://www.TalAter.com/annyang/
|
|
6
|
-
|
|
7
|
-
(function () {
|
|
8
|
-
/*global annyang,jQuery */
|
|
9
|
-
"use strict";
|
|
10
|
-
var root = this;
|
|
11
|
-
|
|
12
|
-
if (annyang) {
|
|
13
|
-
annyang.debug();
|
|
14
|
-
annyang.setLanguage('he');
|
|
15
|
-
|
|
16
|
-
var nextPage = function() {
|
|
17
|
-
root.location.href = jQuery('.next-page a').attr("href") || '/';
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var prevPage = function() {
|
|
21
|
-
root.location.href = jQuery('.prev-page a').attr("href") || '/';
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var gotoHome = function() {
|
|
25
|
-
root.location.href = '/';
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var gotoGadgets = function() {
|
|
29
|
-
root.location.href = '/category/gadgets/';
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var gotoStartup = function() {
|
|
33
|
-
root.location.href = '/category/startup/';
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var gotoDevelopment = function() {
|
|
37
|
-
root.location.href = '/category/development/';
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var gotoInternet = function() {
|
|
41
|
-
root.location.href = '/category/internet/';
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var gotoHitech = function() {
|
|
45
|
-
root.location.href = '/category/hi-tech/';
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var gotoGames = function() {
|
|
49
|
-
root.location.href = '/category/games1/';
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var gotoScience = function() {
|
|
53
|
-
root.location.href = '/category/science/';
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var gotoEvents = function() {
|
|
57
|
-
root.location.href = '/eventsboard/';
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var gotoJobs = function() {
|
|
61
|
-
root.location.href = 'http://geekjob.co.il/';
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var gotoSearch = function(search) {
|
|
65
|
-
root.location.href = '/?s='+search;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
var scrollToTop = function() {
|
|
69
|
-
jQuery("html, body").animate({ scrollTop: 0 }, 1500);
|
|
70
|
-
return false;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
annyang.addCommands({
|
|
74
|
-
'(דף) (ה)בית': gotoHome,
|
|
75
|
-
'(דף) הבא': nextPage,
|
|
76
|
-
'(דף) (ה)קודם': prevPage,
|
|
77
|
-
|
|
78
|
-
'גאג׳טים*etc': gotoGadgets,
|
|
79
|
-
'מובייל*etc': gotoGadgets,
|
|
80
|
-
'mobile*etc': gotoGadgets,
|
|
81
|
-
|
|
82
|
-
'סטארט אפ*etc': gotoStartup,
|
|
83
|
-
':etc סיכון': gotoStartup,
|
|
84
|
-
|
|
85
|
-
'פיתוח*etc': gotoDevelopment,
|
|
86
|
-
|
|
87
|
-
'אינטרנט*etc': gotoInternet,
|
|
88
|
-
|
|
89
|
-
'היי טק*etc': gotoHitech,
|
|
90
|
-
|
|
91
|
-
'משחקים*etc': gotoGames,
|
|
92
|
-
|
|
93
|
-
'מדע*etc': gotoScience,
|
|
94
|
-
|
|
95
|
-
'אירוע*etc': gotoEvents,
|
|
96
|
-
|
|
97
|
-
'משרות*etc': gotoJobs,
|
|
98
|
-
'דרושים*etc': gotoJobs,
|
|
99
|
-
|
|
100
|
-
':geek me up scotty': scrollToTop,
|
|
101
|
-
|
|
102
|
-
'חפש *etc': gotoSearch,
|
|
103
|
-
'חפס *etc': gotoSearch,
|
|
104
|
-
});
|
|
105
|
-
annyang.start();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}).call(this);
|
package/sites/geektime.min.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};
|
|
2
|
-
//! annyang
|
|
3
|
-
//! version : 2.6.1
|
|
4
|
-
//! author : Tal Ater @TalAter
|
|
5
|
-
//! license : MIT
|
|
6
|
-
//! https://www.TalAter.com/annyang/
|
|
7
|
-
//! annyang
|
|
8
|
-
//! version : 2.6.1
|
|
9
|
-
//! author : Tal Ater @TalAter
|
|
10
|
-
//! license : MIT
|
|
11
|
-
//! https://www.TalAter.com/annyang/
|
|
12
|
-
!function(e,n){"function"==typeof define&&define.amd?define([],function(){return e.annyang=n(e)}):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=n(e):e.annyang=n(e)}("undefined"!=typeof window?window:void 0,function(r,a){var t,o=r.SpeechRecognition||r.webkitSpeechRecognition||r.mozSpeechRecognition||r.msSpeechRecognition||r.oSpeechRecognition;if(!o)return null;var i,c,u=[],s={start:[],error:[],end:[],soundstart:[],result:[],resultMatch:[],resultNoMatch:[],errorNetwork:[],errorPermissionBlocked:[],errorPermissionDenied:[]},f=0,l=0,g=!1,d="font-weight: bold; color: #00f;",p=!1,h=!1,y=/\s*\((.*?)\)\s*/g,m=/(\(\?:[^)]+\))\?/g,b=/(\(\?)?:\w+/g,v=/\*\w+/g,w=/[\-{}\[\]+?.,\\\^$|#]/g,k=function(e){for(var n=arguments.length,t=Array(1<n?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];e.forEach(function(e){e.callback.apply(e.context,t)})},e=function(){return i!==a},S=function(e,n){-1!==e.indexOf("%c")||n?console.log(e,n||d):console.log(e)},x=function(){e()||t.init({},!1)},R=function(e,n,t){u.push({command:e,callback:n,originalPhrase:t}),g&&S("Command successfully loaded: %c"+t,d)},P=function(e){var n;k(s.result,e);for(var t=0;t<e.length;t++){n=e[t].trim(),g&&S("Speech recognized: %c"+n,d);for(var o=0,r=u.length;o<r;o++){var a=u[o],i=a.command.exec(n);if(i){var c=i.slice(1);return g&&(S("command matched: %c"+a.originalPhrase,d),c.length&&S("with parameters",c)),a.callback.apply(this,c),void k(s.resultMatch,n,a.originalPhrase,e)}}}k(s.resultNoMatch,e)};return t={init:function(e){var n=!(1<arguments.length&&arguments[1]!==a)||arguments[1];i&&i.abort&&i.abort(),(i=new o).maxAlternatives=5,i.continuous="http:"===r.location.protocol,i.lang="en-US",i.onstart=function(){h=!0,k(s.start)},i.onsoundstart=function(){k(s.soundstart)},i.onerror=function(e){switch(k(s.error,e),e.error){case"network":k(s.errorNetwork,e);break;case"not-allowed":case"service-not-allowed":c=!1,(new Date).getTime()-f<200?k(s.errorPermissionBlocked,e):k(s.errorPermissionDenied,e)}},i.onend=function(){if(h=!1,k(s.end),c){var e=(new Date).getTime()-f;(l+=1)%10==0&&g&&S("Speech Recognition is repeatedly stopping and starting. See http://is.gd/annyang_restarts for tips."),e<1e3?setTimeout(function(){t.start({paused:p})},1e3-e):t.start({paused:p})}},i.onresult=function(e){if(p)return g&&S("Speech heard, but annyang is paused"),!1;for(var n=e.results[e.resultIndex],t=[],o=0;o<n.length;o++)t[o]=n[o].transcript;P(t)},n&&(u=[]),e.length&&this.addCommands(e)},start:function(e){x(),p=(e=e||{}).paused!==a&&!!e.paused,c=e.autoRestart===a||!!e.autoRestart,e.continuous!==a&&(i.continuous=!!e.continuous),f=(new Date).getTime();try{i.start()}catch(e){g&&S(e.message)}},abort:function(){c=!1,l=0,e()&&i.abort()},pause:function(){p=!0},resume:function(){t.start()},debug:function(){var e=!(0<arguments.length&&arguments[0]!==a)||arguments[0];g=!!e},setLanguage:function(e){x(),i.lang=e},addCommands:function(e){var n,t;for(var o in x(),e)if(e.hasOwnProperty(o))if("function"==typeof(n=r[e[o]]||e[o]))R((t=(t=o).replace(w,"\\$&").replace(y,"(?:$1)?").replace(b,function(e,n){return n?e:"([^\\s]+)"}).replace(v,"(.*?)").replace(m,"\\s*$1?\\s*"),new RegExp("^"+t+"$","i")),n,o);else{if(!("object"===(void 0===n?"undefined":_typeof(n))&&n.regexp instanceof RegExp)){g&&S("Can not register command: %c"+o,d);continue}R(new RegExp(n.regexp.source,"i"),n.callback,o)}},removeCommands:function(t){t===a?u=[]:(t=Array.isArray(t)?t:[t],u=u.filter(function(e){for(var n=0;n<t.length;n++)if(t[n]===e.originalPhrase)return!1;return!0}))},addCallback:function(e,n,t){var o=r[n]||n;"function"==typeof o&&s[e]!==a&&s[e].push({callback:o,context:t||this})},removeCallback:function(e,n){var t=function(e){return e.callback!==n};for(var o in s)s.hasOwnProperty(o)&&(e!==a&&e!==o||(s[o]=n===a?[]:s[o].filter(t)))},isListening:function(){return h&&!p},getSpeechRecognizer:function(){return i},trigger:function(e){t.isListening()?(Array.isArray(e)||(e=[e]),P(e)):g&&S(h?"Speech heard, but annyang is paused":"Cannot trigger while annyang is aborted")}}}),//! annyang - Geektime.co.il
|
|
13
|
-
//! version : 0.1.0
|
|
14
|
-
//! author : Tal Ater @TalAter
|
|
15
|
-
//! license : MIT
|
|
16
|
-
//! https://www.TalAter.com/annyang/
|
|
17
|
-
function(){var n=this;if(annyang){annyang.debug(),annyang.setLanguage("he");var e=function(){n.location.href="/category/gadgets/"},t=function(){n.location.href="/category/startup/"},o=function(){n.location.href="http://geekjob.co.il/"},r=function(e){n.location.href="/?s="+e};annyang.addCommands({"(דף) (ה)בית":function(){n.location.href="/"},"(דף) הבא":function(){n.location.href=jQuery(".next-page a").attr("href")||"/"},"(דף) (ה)קודם":function(){n.location.href=jQuery(".prev-page a").attr("href")||"/"},"גאג׳טים*etc":e,"מובייל*etc":e,"mobile*etc":e,"סטארט אפ*etc":t,":etc סיכון":t,"פיתוח*etc":function(){n.location.href="/category/development/"},"אינטרנט*etc":function(){n.location.href="/category/internet/"},"היי טק*etc":function(){n.location.href="/category/hi-tech/"},"משחקים*etc":function(){n.location.href="/category/games1/"},"מדע*etc":function(){n.location.href="/category/science/"},"אירוע*etc":function(){n.location.href="/eventsboard/"},"משרות*etc":o,"דרושים*etc":o,":geek me up scotty":function(){return jQuery("html, body").animate({scrollTop:0},1500),!1},"חפש *etc":r,"חפס *etc":r}),annyang.start()}}.call(this);
|