mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
// Called by the common.js module.
|
|
function attachListeners() {
|
|
document.getElementById('startButton').addEventListener('click', startPushed);
|
|
document.getElementById('stopButton').addEventListener('click', stopPushed);
|
|
document.getElementById('GFEHostIPField').addEventListener('change', changeGFEHostIPField);
|
|
}
|
|
|
|
// Called by the common.js module.
|
|
function moduleDidLoad() {
|
|
// The module is not hidden by default so we can easily see if the plugin
|
|
// failed to load.
|
|
common.hideModule();
|
|
}
|
|
|
|
function getGFEHostIPField() {
|
|
return document.getElementById('GFEHostIPField');
|
|
}
|
|
|
|
function startPushed() {
|
|
common.naclModule.postMessage('setGFEHostIPField:' + getGFEHostIPField().value);
|
|
common.naclModule.postMessage('startPushed');
|
|
}
|
|
|
|
function stopPushed() {
|
|
common.naclModule.postMessage('stopPushed');
|
|
}
|
|
|
|
function changeGFEHostIPField() {
|
|
common.naclModule.postMessage('setGFEHostIPField:' + getGFEHostIPField().value);
|
|
}
|
|
|
|
// Called by the common.js module.
|
|
function handleMessage(msg) {
|
|
var logEl = document.getElementById('GFEHostIPField');
|
|
logEl.value = msg.data;
|
|
}
|
|
|
|
chrome.app.window.current().fullscreen(); |