mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
// Called by the common.js module.
|
|
function attachListeners() {
|
|
document.getElementById('startButton').addEventListener('click', startPushed);
|
|
document.getElementById('stopButton').addEventListener('click', stopPushed);
|
|
document.getElementById('pairButton').addEventListener('click', pairPushed);
|
|
document.getElementById('showAppsButton').addEventListener('click', showAppsPushed);
|
|
}
|
|
|
|
function pairPushed() {
|
|
common.naclModule.postMessage('pair:' + document.getElementById('GFEHostIPField').value);
|
|
}
|
|
|
|
function showAppsPushed() {
|
|
common.naclModule.postMessage('showAppsPushed');
|
|
document.getElementById("gameSelectionDiv").style.display = "visible";
|
|
}
|
|
|
|
function startPushed() {
|
|
common.naclModule.postMessage('setGFEHostIPField:' + document.getElementById('GFEHostIPField').value);
|
|
}
|
|
|
|
function stopPushed() {
|
|
common.naclModule.postMessage('stopPushed');
|
|
}
|
|
|
|
// hook from main.cpp into the javascript
|
|
function handleMessage(msg) {
|
|
var logEl = document.getElementById('GFEHostIPField');
|
|
logEl.value = msg.data;
|
|
}
|