Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
|
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
window.onload = function() {
|
||||
var systemPort = null;
|
||||
navigator.mozApps.getSelf().onsuccess = function() {
|
||||
var app = this.result;
|
||||
app.connect('findmydevice-test').then(function(ports) {
|
||||
if (ports.length !== 1) {
|
||||
console.error('got more than one connection?');
|
||||
return;
|
||||
}
|
||||
|
||||
systemPort = ports[0];
|
||||
}, function(err) {
|
||||
console.error('failed to connect: ' + err);
|
||||
});
|
||||
};
|
||||
|
||||
var buttons = document.getElementById('buttons');
|
||||
buttons.addEventListener('click', function(event) {
|
||||
var cmdobj = {};
|
||||
var command = event.target.id[0];
|
||||
cmdobj[command] = {};
|
||||
|
||||
var options = document.getElementsByTagName('input');
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
cmdobj[command][options[i].name[0]] = options[i].value;
|
||||
}
|
||||
|
||||
systemPort.postMessage(cmdobj);
|
||||
});
|
||||
};
|
||||
Loading…
Reference in a new issue