Last active
April 14, 2017 06:14
-
-
Save ysyun/6c9667b9ef0120fb9ba00b3b91915cc2 to your computer and use it in GitHub Desktop.
Cordova Plugin Test for L1_angular_firebase_tuotrial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="deviceready" class="blink"> | |
<p class="event listening">Connecting to Device</p> | |
<p class="event received">Device is Ready</p> | |
<p class="device-info"></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.event.device-info { | |
background-color: blue; | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
receivedEvent: function(id) { | |
var parentElement = document.getElementById(id); | |
var listeningElement = parentElement.querySelector('.listening'); | |
var receivedElement = parentElement.querySelector('.received'); | |
listeningElement.setAttribute('style', 'display:none;'); | |
receivedElement.setAttribute('style', 'display:block;'); | |
if (device) { | |
console.log('> device', device); | |
var deviceInfoElement = parentElement.querySelector('.device-info'); | |
deviceInfoElement.setAttribute('style', 'display:block;'); | |
deviceInfoElement.innerHTML = 'Device Name: ' + device.name + '<br />' + | |
'Device Model: ' + device.model + '<br />' + | |
'Device Cordova: ' + device.cordova + '<br />' + | |
'Device Platform: ' + device.platform + '<br />' + | |
'Device UUID: ' + device.uuid + '<br />' + | |
'Device Version: ' + device.version + '<br />'; | |
} | |
console.log('Received Event: ' + id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment