Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hikouki/qitalk
qimessaging.js framework.
https://github.com/hikouki/qitalk
Last synced: 12 days ago
JSON representation
qimessaging.js framework.
- Host: GitHub
- URL: https://github.com/hikouki/qitalk
- Owner: hikouki
- Created: 2016-01-21T07:29:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-30T02:04:12.000Z (over 8 years ago)
- Last Synced: 2024-11-10T16:53:07.587Z (about 1 month ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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