UI updates. Not done, or hooked up.

This commit is contained in:
Aidan Campbell 2016-02-13 15:50:11 -05:00
parent f77979d904
commit 6a963f3e6d
2 changed files with 44 additions and 15 deletions

View File

@ -9,17 +9,42 @@
</head> </head>
<body data-name="moonlight-chrome" data-width="1280" data-height="720" data-tools="pnacl" data-configs="Debug Release" data-path="{tc}/{config}"> <body data-name="moonlight-chrome" data-width="1280" data-height="720" data-tools="pnacl" data-configs="Debug Release" data-path="{tc}/{config}">
<h1>Moonlight</h1> <div id="title">
<h2>Status: <code id="statusField">NO-STATUS</code></h2> <h1>Moonlight Streaming</h1>
<p>Moonlight Streaming extension for Chrome</p> <h2>Chrome App Status: <code id="statusField">NO-STATUS</code></h2>
</div>
<p>Click the buttons. Click them.</p> <p>Enter the IP/hostname of the GFE streaming computer, or select one from the history:</p>
<button id="startButton">Start</button>
<button id="stopButton">Stop</button>
<p>Enter the IP or Hostname of the GFE streaming computer, then hit enter:</p>
<input type="text" size="15" id="GFEHostIPField" value="127.0.0.1"> <input type="text" size="15" id="GFEHostIPField" value="127.0.0.1">
<select>
<option value="">No history available</option>
</select>
<p></p>
<button id="pairButton">Pair</button>
<button id="showAppsButton">Retrieve App List</button>
<p></p>
<div id="testingDiv" style="border:3px solid red">
<button id="startButton">Start Testing Stuff</button>
<button id="stopButton">Stop Testing Stuff</button>
</div>
<div hidden id="gameSelectionDiv">
<p>Select a game to run</p>
<select>
<option value="game_id_1">Game Name 1</option>
<option value="game_id_2">Game Name 2</option>
<option value="game_id_3">Game Name 3</option>
</select>
<button id="startGameButton">Run Game</button>
<button id="quitGameButton">Quit Current Game</button>
</div>
<!-- The NaCl plugin will be embedded inside the element with id "listener". <!-- The NaCl plugin will be embedded inside the element with id "listener".
See common.js. --> See common.js. -->
<div id="listener"></div> <div id="listener"></div>

View File

@ -2,25 +2,29 @@
function attachListeners() { function attachListeners() {
document.getElementById('startButton').addEventListener('click', startPushed); document.getElementById('startButton').addEventListener('click', startPushed);
document.getElementById('stopButton').addEventListener('click', stopPushed); document.getElementById('stopButton').addEventListener('click', stopPushed);
document.getElementById('pairButton').addEventListener('click', pairPushed);
document.getElementById('showAppsButton').addEventListener('click', showAppsPushed);
} }
function getGFEHostIPField() { function pairPushed() {
return document.getElementById('GFEHostIPField'); common.naclModule.postMessage('pair:' + document.getElementById('GFEHostIPField').value);
}
function showAppsPushed() {
common.naclModule.postMessage('showAppsPushed');
document.getElementById("gameSelectionDiv").style.display = "visible";
} }
function startPushed() { function startPushed() {
common.naclModule.postMessage('setGFEHostIPField:' + getGFEHostIPField().value); common.naclModule.postMessage('setGFEHostIPField:' + document.getElementById('GFEHostIPField').value);
//common.naclModule.postMessage('startPushed');
} }
function stopPushed() { function stopPushed() {
common.naclModule.postMessage('stopPushed'); common.naclModule.postMessage('stopPushed');
} }
// Called by the common.js module. // hook from main.cpp into the javascript
function handleMessage(msg) { function handleMessage(msg) {
var logEl = document.getElementById('GFEHostIPField'); var logEl = document.getElementById('GFEHostIPField');
logEl.value = msg.data; logEl.value = msg.data;
} }
// chrome.app.window.current().fullscreen();