Skip to content

Commit

Permalink
Added some os being automatically detected. Switched to the longer os…
Browse files Browse the repository at this point in the history
… names.
  • Loading branch information
WyvernIXTL committed Jun 29, 2024
1 parent df748f9 commit 50f10ac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@

Take a look at [web-installation-instruction-action](https://github.com/instructions-d-installation/web-installation-instruction-action).

## Automatic Defaults

You must have such property in your schema and have some of the options below (take those that you actually support):

```yaml
__os__:
- android
- ios
- windows
- linux
- macos
- openbsd
- freebsd
```
## Example
[![example](./pictures/example.png)](https://instructions-d-installation.github.io/web-installation-instruction)
16 changes: 13 additions & 3 deletions install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,30 @@ schema:
default: landed
__os__:
title: OS
description: Your operating system. (Only Windows, MacOS and Linux are detectable.)
description: Your operating system (TempleOS is not being detected).
enum:
- win
- windows
- linux
- macos
- openbsd
- freebsd
- android
- ios
- templeos

pretty:
flying: Flying
landed: Landed
distant: Distant
hidden: Hidden
win: Windows 10+
windows: Windows 10+
linux: GNU/Linux
openbsd: OpenBSD
macos: MacOS
freebsd: FreeBSD
android: Android
ios: IOS
templeos: TempleOS

description:
flying: The helicopter will be flying.
Expand Down
8 changes: 6 additions & 2 deletions src/web_installation_instruction/template/index.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@
function getOS(availableOS) {
let userAgent = navigator.userAgent.toLowerCase();
let supportedOS = {
win: /.*windows.*/g,
android: /.*android.*/g,
ios: /.*iphone.*/g,
windows: /.*windows.*/g,
linux: /.*linux.*/g,
mac: /.*macintosh.*/g
macos: /.*macintosh.*/g,
openbsd: /.*openbsd.*/g,
freebsd: /.*freebsd.*/g
};
for (const os in supportedOS) {
Expand Down

0 comments on commit 50f10ac

Please sign in to comment.