File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -358,3 +358,21 @@ Blockly.Toolbox.TreeNode.prototype.onClick_ = function(_e) {
358
358
}
359
359
this . updateRow ( ) ;
360
360
} ;
361
+
362
+ /**
363
+ * Preload all the audio files so that they play quickly when asked for.
364
+ * @package
365
+ */
366
+ Blockly . WorkspaceAudio . prototype . preload = function ( ) {
367
+ for ( var name in this . SOUNDS_ ) {
368
+ var sound = this . SOUNDS_ [ name ] ;
369
+ sound . volume = 0.01 ;
370
+ sound . play ( ) . catch ( function ( ) { } ) ;
371
+ sound . pause ( ) ;
372
+ // iOS can only process one sound at a time. Trying to load more than one
373
+ // corrupts the earlier ones. Just load one and leave the others uncached.
374
+ if ( goog . userAgent . IPAD || goog . userAgent . IPHONE ) {
375
+ break ;
376
+ }
377
+ }
378
+ } ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import View from './View';
5
5
import '../../common/binary-ui/dropdown' ;
6
6
import Elevio from '../../common/elevio' ;
7
7
import GTM from '../../common/gtm' ;
8
+ import { isProduction } from '../../common/utils/tools' ;
8
9
9
10
$ . ajaxSetup ( {
10
11
cache : false ,
@@ -14,7 +15,7 @@ $.ajaxSetup({
14
15
window . _trackJs = {
15
16
token : '346262e7ffef497d85874322fff3bbf8' ,
16
17
application : 'binary-bot' ,
17
- enabled : window . location . hostname !== 'localhost' ,
18
+ enabled : isProduction ( ) ,
18
19
console : {
19
20
display : false ,
20
21
} ,
You can’t perform that action at this time.
0 commit comments