Okay/Spec: Difference between revisions
No edit summary |
No edit summary |
||
| Line 32: | Line 32: | ||
== spaces == | == spaces == | ||
A ''' | A '''Space''' is a HTML element providing URIs that clients can send requests to (for example, a [[Okay#rooms|room directory]] or [[Okay#initiation|registration page]]). Conceptually, spaces are isolated containers for rooms and user data. | ||
=== discovery === | === discovery === | ||
For a client to recognise a | For a client to recognise a document as containing a space, it <span class="must">must</span>: | ||
* Respond with 200 OK upon a GET request; | * Respond with 200 OK upon a GET request; | ||
| Line 42: | Line 42: | ||
* Respond with a valid HTML document, -- TODO: define valid; | * Respond with a valid HTML document, -- TODO: define valid; | ||
* Have the Access-Control-Allow-Origin header set to <code>*</code>; | * Have the Access-Control-Allow-Origin header set to <code>*</code>; | ||
* Contain | * Contain valid [[Okay#the element thereof|ok-space]] markup. | ||
If multiple | If a document contains multiple spaces, the client <span class="should">should</span> prompt the user to select which space it should use. | ||
==== | ==== ok-space ==== | ||
Spaces are defined with the '''ok-space''' format. It looks like this: | |||
<syntaxhighlight lang="html"><nav class=“ok- | <syntaxhighlight lang="html"><nav class=“ok-space”> | ||
<h1>This is an Okay space</h1> | |||
<a href=“/rooms/” rel=“ok-rooms”>Rooms</a> | <a href=“/rooms/” rel=“ok-rooms”>Rooms</a> | ||
<a href=“/register/” rel=“ok-register”>Registration</a> | <a href=“/register/” rel=“ok-register”>Registration</a> | ||
| Line 56: | Line 57: | ||
</nav></syntaxhighlight> | </nav></syntaxhighlight> | ||
For an element to be valid <code>ok-space</code> markup, it must be a non-void element (ideally a <code><nav /></code>) and contain anchor elements with valid rel and href attributes. Any invalid anchors or elements not specified in the format <span class="must">must</span> be ignored by the client. The inner text of the anchor elements is not significant and <span class="must">must</span> be ignored by clients. | |||
A list of valid anchor <code>rel</code> attributes and their purposes is described below: | A list of valid anchor <code>rel</code> attributes and their purposes is described below: | ||
| Line 75: | Line 76: | ||
|The space's preferences page. | |The space's preferences page. | ||
|} | |} | ||
==== linking to other spaces ==== | |||
Clients can discover | |||
== initiation == | == initiation == | ||