@@ -10,19 +10,22 @@ function checked_devices() {
1010}
1111
1212$ ( function ( ) {
13- chrome . storage . sync . get ( {
14- api_key : '' ,
15- devices :[ ] ,
16- refresh_interval :1000
17- } , function ( items ) {
18- $ ( "#api_key" ) . val ( items . api_key ) ;
19- $ ( "#refresh_interval" ) . val ( items . refresh_interval ) ;
20- PushBullet . APIKey = items . api_key ;
21-
22- console . log ( 'Loaded ' + items . devices . length + ' saved devices.' ) ;
23-
24- load_devices ( items . devices , true ) ;
25- } )
13+ chrome . storage . sync . get (
14+ {
15+ api_key : '' ,
16+ devices : [ ] ,
17+ refresh_interval : 1000
18+ } ,
19+ function ( items ) {
20+ $ ( "#api_key" ) . val ( items . api_key ) ;
21+ $ ( "#refresh_interval" ) . val ( items . refresh_interval ) ;
22+ PushBullet . APIKey = items . api_key ;
23+
24+ console . log ( 'Loaded ' + items . devices . length + ' saved devices.' ) ;
25+
26+ load_devices ( items . devices , true ) ;
27+ }
28+ ) ;
2629} ) ;
2730
2831function load_devices ( saved_devices , removeInvalidIds )
@@ -42,8 +45,7 @@ function load_devices(saved_devices, removeInvalidIds)
4245 if ( non_chrome_devices . length > 0 ) {
4346 non_chrome_devices . sort ( sortByDeviceNickname ) ;
4447
45- $ . each ( non_chrome_devices , function ( index , device )
46- {
48+ $ . each ( non_chrome_devices , function ( index , device ) {
4749 if ( device . kind === 'chrome' ) {
4850 return ;
4951 }
@@ -119,7 +121,7 @@ $("#save").click(function(e) {
119121 load_devices ( devices , false ) ;
120122} ) ;
121123
122- $ ( "#test" ) . click ( function ( e ) {
124+ $ ( "#test" ) . click ( function ( e ) {
123125 $ . each ( checked_devices ( ) , function ( index , device_iden ) {
124126 PushBullet . push ( "link" , device_iden , null , { title : "I got you a Nexus 6" , url : "https://www.google.com/" } ) ;
125127 } ) ;
0 commit comments