1.7.0 • Published 10 months ago

confbridge v1.7.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

CONFBridge

CONFBridge is an communication libary between an CONFApp and CONFStation. It also provides debugging utils for develop an CONFApp.

Usage

Create CONFApp from template

npx confbridge create-app <app-name>

And follow the instructions.

Run conf app dev Server

npx confbridge dev

Install as package in your browser application

NPM

npm i confbridge

yarn

yarn add confbridge

Embedding

as JS Module from compiled lib

<script type="module">
    import {CONFStation, CONFApp} from "confbridge.js"; 
</script>

TypeScript

import { CONFStation, CONFApp } from "confbridge";

CONFStation

Schnittstelle für CONFApp zur CONFStation.

MethodeBeschreibung
.onReady( action:function )wird ausgeführt, wenn eine erfolgreiche Verbindung aufgebaut wurde.
.levelUp( meta:any, score:number, user:object )triggert ein LevelUp für den Spieler
.appFinished( meta:any, score: number, user:object)meldet, dass die CONFApp beendet werden soll
.onLanguageChange( action:function )wird ausgeführt, wenn die Sprache in der CONFStation geändert wird. Beim Ausführen dieser Funktion wird erwartet, dass eine CONFApp zur entsprechenden Sprache wechselt.
static .connected( action:function )Komfortfunktion, welche das Initialisieren der CONFStation-Instanz übernimmt und onReady ausführt
Komfort-Beispiel
<button id="level-up">Level UP!</button>
<script type="module">
    import {CONFStation} from "conf-bridge.js";
    CONFStation.connected((station, config, language, theme, profile) => {
        document.getElementById('level-up')
                .addEventListener('click', _ => station.levelUp())
    })
</script>
Example
<button id="level-up">Level UP!</button>
<script type="module">
    import {CONFStation} from "conf-bridge.js";
    const confStation = new CONFStation();
    confStation.onReady((config, language, theme, profile) => {
        document.getElementById('level-up')
                .addEventListener('click', _ => confStation.levelUp())
    })
</script>

CONFApp

Schnittstelle der CONFStation zur CONFApp.

MethodeBeschreibung
.onLevelUp( action:function )wird ausgeführt, wenn von der CONFApp ".levelUp" ausgeführt wird
.onAppFinished( action:function )wird ausgeführt, wenn von der CONFApp ".appFinished" ausgeführt wird
.setLanguage( language:string )ändert die Sprache einer CONFApp
Example
<iframe id="conf-app" src="whereever.nowhere.uni"></iframe>
<script type="module">
    import {CONFApp} from "conf-bridge.js";
    const config = {
        "options": []
    }
    const theme = {
        "borderColor": "#990000"
    }
    const profile = {
        firstName: 'Username',
        lastName: 'Hui',
        email: 'username@hui.lol'
    }
    const confApp = new CONFApp(config, document.getElementById('conf-app'), 'de', theme, profile)
    confApp.onLevelUp((meta, score, user) => {
        console.log({ meta, score, user })
    })
</script>

FAQ

veraltete Version mit npx

Benutze das "@latest" Tag, damit npx die aktuellste Version nutzt.

npx confbridge@latest dev
1.8.2

7 months ago

1.8.1

7 months ago

1.8.0

7 months ago

1.8.6

7 months ago

1.8.5

7 months ago

1.8.4

7 months ago

1.8.3

7 months ago

1.7.0

10 months ago

1.6.4

10 months ago

1.6.3

10 months ago

1.6.2

10 months ago

1.6.1

10 months ago

1.6.0

10 months ago

1.5.0

11 months ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.2.0

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.3.10

3 years ago

1.3.13

3 years ago

1.3.14

3 years ago

1.3.11

3 years ago

1.3.12

3 years ago

1.3.17

3 years ago

1.3.15

3 years ago

1.3.16

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

1.0.0

3 years ago