11var deviceReady = false ;
22
3- var log = function ( message ) {
3+ var log = function ( message ) {
44 message = message . replace ( / \n / g, "<br/>" ) ;
55 console . log ( message ) ;
66 info . innerHTML += message + "<br/>" ;
@@ -19,16 +19,16 @@ var isEnabled = function() {
1919} ;
2020
2121var showSettings = function ( ) {
22-
23- if ( cordova . platformId === 'android ') {
22+
23+ if ( cordova . platformId !== 'ios ') {
2424 ble . showBluetoothSettings ( ) ;
2525 } else {
2626 log ( "Show Bluetooth Settings is not available on " + cordova . platformId ) ;
2727 }
2828} ;
2929
3030var enable = function ( ) {
31-
31+
3232 if ( cordova . platformId === 'android' ) {
3333 ble . enable (
3434 function ( ) {
@@ -41,7 +41,7 @@ var enable = function() {
4141 } else {
4242 log ( "Enable Bluetooth is not available on " + cordova . platformId ) ;
4343 }
44-
44+
4545} ;
4646
4747var scan = function ( ) {
@@ -73,15 +73,15 @@ function init() {
7373 alert ( "Error: Apache Cordova did not initialize. Demo will not run correctly." ) ;
7474 }
7575 } , 1000 ) ;
76-
76+
7777}
7878
7979window . onload = function ( ) {
8080 addListenerToClass ( 'isEnabled' , isEnabled ) ;
8181 addListenerToClass ( 'settings' , showSettings ) ;
8282 addListenerToClass ( 'enable' , enable ) ;
8383 addListenerToClass ( 'scan' , scan ) ;
84-
84+
8585 addListenerToClass ( 'backBtn' , backHome ) ;
8686 init ( ) ;
8787} ;
0 commit comments