Skip to content

Instantly share code, notes, and snippets.

@micahnyc
micahnyc / openspacebuttons.html
Last active May 12, 2022 17:20
Openspace html/js button example
<html>
<head>
<script src="http://hub.openspaceproject.com/openspace-api.js"></script>
<title>OpenSpace javascript demo</title>
</head>
<body>
<div id="text">connecting</div>
<ul id="buttons"></ul>
<script>
//function to create buttons that send commands to openspace
{
"projectName": "Who is gonna win?"
"members": [
"?????",
"?????",
"?????",
"?????",
"?????"
]
}
var startScript = "var http = new XMLHttpRequest();"
startScript += "var url = 'http://192.168.1.43:8080/liveControl';var params = 'action=LivePreviewCtl&control=true';http.open('POST', url, true);"
startScript += "http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');"
startScript += "http.onreadystatechange = function() {"
startScript += "http.onreadystatechange = function() {"
startScript += "if(http.readyState == 4 && http.status == 204) {"
startScript += "console.log(http.responseText);"
startScript += "} else { console.log('error with preview', http.status); }"
Feature: Finding photos
In order to select photos to share
As a User
I want to see that the app found whiteboard photos
Scenario: Whiteboard photos were found
Given I am on the library screen
Then I should see "Whiteboards found:"
When I touch "scan"
Then I wait see a number of photos that were found