A small conversation library that happens at hand
JavaScript HTML CSS
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images
lib
src/styles
test
.babelrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
bower.json
bs-config.js
build.js
dev-server.js
package.json
prod.js
rollup.config.js
screenshot.gif
yarn.lock

README.md

 Hai

XO code style Build Status Dependencies Status

A small conversation library that happens at hand

Hai

Install, or Download

npm

$ npm i -S @nju33/hai

yarn

$ yarn add @nju33/hai

bower

$ bower i -S hai

Download

Access to releases page. Then, download the latest version.

Usage

Bandler

(e.g.) webpack, browserify, rollup...

// es
import Hai from '@nju33/hai';
// common
const Hai = require('@nju33/hai');

Browser

<script src="/path/to/hai.js"></script>
<script>// Your JS code.</script>

API

hai = new Hai(talks)

Create an instance of Hai that Contains information about talk elements or callbacks. It can be used by passing it to openWith.

Hai.config

Hai.config.theme

Dark(default) or light.

talk.name

Use for prefix of callback name.

talk.message

What I'd like to talk about here.

talk.convenient

talk.convenient.type

Various types. (e.g. text, input, radio, checkbox)
Note that property values that you have to pass depend on type change

type: text

Please write the text you want displayed in the text property. This is used when you want to display longer text.

type: radio or type: checkbox

Please write the text you want displayed in the items property. Use this if you want to give the client choices.

This is the only difference.

  • radio
    Select only one.
  • checkbox
    Multiple selection.

TODO....

type: input

TODO...

hai.open

TODO...

hai.open.then(answers => ...);

Related

LICENSE

The MIT License (MIT)

Copyright (c) 2016 nju33