Skip to content

Commit

Permalink
Merge pull request mcallegari#1566 from Binary-Vanguard-12138/webapi_…
Browse files Browse the repository at this point in the history
…test_animation

Animation widget in Web API test page.
  • Loading branch information
mcallegari authored May 18, 2024
2 parents 8378b8f + 6a66af8 commit 31a9aa5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions webaccess/res/Test_Web_API.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@
}
}

function vcAnimationWidgetControl(animIDObjName, controlIDObjName)
{
var animObj = document.getElementById(animIDObjName);
var controlIDObj = document.getElementById(controlIDObjName);

if (animObj && controlIDObj)
{
if (isConnected === true)
{
websocket.send(animObj.value + "|MATRIX_PUSHBUTTON|" + controlIDObj.value);
}
else
alert("You must connect to QLC+ WebSocket first!");
}
}

function connectToWebSocket(host) {
var url = 'ws://' + host + '/qlcplusWS';
websocket = new WebSocket(url);
Expand Down Expand Up @@ -496,6 +512,20 @@ <h2>Q Light Controller+ Web API test page</h2>
</td>
</tr>

<tr>
<td>
<div class="apiButton" onclick="javascript:vcAnimationWidgetControl('animWidgetID', 'animControlID');">Animation widget control</div><br>
Animation widget ID: <input id="animWidgetID" type="text" value="0" size="6"><br>
Control ID: <input id="animControlID" type="text" value="0" size="6">
</td>
<td colspan="2">
This API demonstrates how to control Virtual Console Animation widget.
The parameters to be used are:<br>
<b>Animation widget ID</b>: The Animation widget ID as retrieved with the 'getWidgetsList' API<br>
<b>Control ID</b>: The Animation control ID of preset buttons.
</td>
</tr>

</table>

</body>
Expand Down

0 comments on commit 31a9aa5

Please sign in to comment.