Kneedeck

Write a module

For Kneedeck 0.32.0 and later.

A module is a web page shown in a tab of the tablet, on the PC and on the phone. It is written in HTML, CSS and JavaScript.

Your first module accepted in the catalogue gets you the supporter licence, free. The catalogue takes modules that are really useful in game: test pages and copies of an example or of another module are refused.

1. The module's folder

File types recognised: .html, .js, .mjs, .css, .json, .txt, .svg, .png, .jpg, .webp, .gif, .woff2, .woff, .mp3, .ogg, .wav. Any other file is passed as it is, as plain data the module's script may read.

At most 500 files and 20 MB.

2. The card: kneedeck-module.json

{
  "id": "dupont.fuel",
  "name": { "en": "Fuel", "fr": "Carburant" },
  "description": { "en": "The fuel on board, from SimBrief.", "fr": "Le carburant à bord, d'après SimBrief." },
  "version": "1.0.0",
  "author": "Dupont",
  "languages": ["en", "fr"],
  "games": ["DCS World"],
  "permissions": {
    "storage": true,
    "internet": ["www.simbrief.com"],
    "gameData": ["dcs"]
  }
}
FieldWhat it holds
idIts identifier for Kneedeck: lowercase letters, digits, dots and dashes, such as dupont.fuel. Names starting with kneedeck. are reserved. A module with the same id replaces the old one.
nameIts name, as one text or by language.
descriptionOptional. What it does, as one text or by language.
versionIts version, 20 characters at most.
authorIts author, 60 characters at most.
entryOptional. Its first page, index.html when the field is not given.
languagesOptional. The languages of its texts, by code: en, fr, pt-BR.
gamesOptional. The games it is made for.
permissions.storageIt keeps its data, for each profile (1 MB at most).
permissions.internetThe sites it contacts, by name, 10 at most. No other site answers it.
permissions.gameDataThe games' data it reads: starcitizen, elite, dcs.

Kneedeck shows the player what the module asks for before installing it.

3. The page

The page loads Kneedeck's helper, which gives it the Kneedeck object:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="fuel.css">
<script src="../kneedeck-module.js"></script>
<script src="fuel.js" defer></script>
</head>
<body>…</body>
</html>
The Kneedeck objectWhat it does
Kneedeck.ready((k) => …)Called once the module is ready: k.language, k.data (its kept data), k.preview (true in the Tabs screen's preview).
Kneedeck.text({ en: "Start", fr: "Démarrer" })The text in the player's language, or else in English.
Kneedeck.save(data)Keeps a JSON value for the profile shown. Needs storage.
Kneedeck.on("data", (data) => …)Its data changed in the other window, or the profile shown changed.
Kneedeck.on("language", (code) => …)The player picked another language.
Kneedeck.on("page", (step) => …)The player's "next page" (1) or "previous page" (-1) control.
Kneedeck.games, Kneedeck.on("games", …)The games' data asked for in the card, and each change.
Kneedeck.keyboard(true or false)Takes the keyboard from the game, or gives it back, while the tab shows. A text field takes it by itself when touched, and Escape gives it back.
Kneedeck.now()The time in milliseconds, the PC's on every device: for a timer that must read the same on the PC and the phone.

The tablet's colours come as CSS variables: --kd-paper, --kd-ink, --kd-rule, --kd-under, --kd-accent.

4. The games' data

Kneedeck.games.starcitizen: found, running, environment, version, handle, shard, location (the game's code), place (the readable name, or null), contracts (with their objectives), notifications.

Kneedeck.games.elite: found, running, commander, ship, shipName, shipIdent, system, body, station, docked, landed, fuel, fuelCapacity, cargo, cargoCapacity, cargoItems, credits, missions.

Kneedeck.games.dcs: flying, paused, aircraft, coalition (1 red, 2 blue), mission (name, map, date, briefings, weather), model (the mission's time), toldAt, messages. The player must have linked Kneedeck to DCS, in the Tabs screen.

5. What a module cannot do

6. Trying it

In Kneedeck: Modules, then "Add a module from a folder…" or "… from a zip…". Then "Add as a tab". For a new version, add it again: it replaces the old one.

7. Examples to download

8. Sharing it

Submit it to the modules catalogue: sign in to My account with your email address, then "Submit a module" with its zip, its languages, its games and up to 4 pictures.

What gets a module accepted:

When a module is refused, the email gives the reason. A refused module can be submitted again, improved.

You can also give its zip: the other player adds it from a zip.