Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hikouki/qitalk

qimessaging.js framework.
https://github.com/hikouki/qitalk

Last synced: 12 days ago
JSON representation

qimessaging.js framework.

Awesome Lists containing this project

README

        

# qitalk
qimessaging.js framework on Pepper

## Dependencies

- qimessaging.js v2.0+
- jQuery

## Features

- cache services
- view html templete
- switch html templete on single page

## Usage

### Example

- index.html
```html

$(function() {
Qitalk.init({
host : '', // pepper host. default => localhost
root : '#qitalk',
tplDir : './tpl',
preload : {
tpl : ['home', 'profile'],
service : ['ALMemory', 'ALTextToSpeech']
},
handle : {
start : function() {
Qitalk.presentView('home'); // switch html templete.
}
}
});
});


```

- ./tpl/home.tpl

```html

$(function() {
$("#nextpage").on('click', function() {
var username = $("input['name=username']").val();
Qitalk.presentView('profile', username); // send value for next page.
});
});

```

- ./tpl/profile.tpl

```html

var params = Qitalk.params; // get value for prev page.
$(function() {
$("#username").text(params);
});


```

### How to call services

It must cache service.
```javascript
///
preload : {
tpl : ['home', 'profile'],
service : ['ALMemory', 'ALTextToSpeech']
},
///
```

Service is called from Qitalk.proxy property.
```javascript
Qitalk.proxy.ALTextToSpeech.say('I am pepper');
```

### Wrap qimessaging APIs

- Qitalk.on(name, function, id) // Recive signal to tablet from pepper.
- Qitalk.send(name, value) // Send signal to pepper from tablet.

## License

MIT