Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jokinkuang/jquery.duoshuo.js
a jQuery plugin to load duoshuo comments、likes、reposts、views and so on
https://github.com/jokinkuang/jquery.duoshuo.js
Last synced: 18 days ago
JSON representation
a jQuery plugin to load duoshuo comments、likes、reposts、views and so on
- Host: GitHub
- URL: https://github.com/jokinkuang/jquery.duoshuo.js
- Owner: jokinkuang
- Created: 2016-08-24T09:12:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-29T15:45:30.000Z (over 8 years ago)
- Last Synced: 2024-11-12T07:04:05.930Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jquery.duoshuo.js
a jQuery plugin to load duoshuo comments、likes、reposts、views and so on## Dependence
* [jquery.js](https://jquery.com/)
* [pagecache.js](https://github.com/jokinkuang/pagecache.js)## Usage
### use data-attr
\ · 评论 0\
\ · 转发 0\\\
\\
\\
```javascript$(".post-data").duoshuo();
```
### use settings
\ · 评论 0\
\ · 转发 0\\\
\\
\\
```javascript$.Duoshuo.settings = { shortName: "jokin", threadKey: "index"};
$(".post-comments").duoshuo("comments", " · 评论 %s");
$(".post-reposts").duoshuo("reposts", " · 转发 %s");```
### use parameter
\ · 评论 0\
\ · 转发 0\\\
\\
\\
```javascript$(".post-comments").duoshuo("comments", " · 评论 %s", "index", "jokin");
$(".post-reposts").duoshuo("reposts", " · 转发 %s", "index", "jokin");```
### priority
data-attr < settings < parameter
> parameter override the settings, settings override the data-attr### default settings object
```javascript
{
attrText: "data-text",
attrKey: "data-thread-key",
attrName: "data-short-name",
defaultSymbol: "%s",
domain: "http://api.duoshuo.com",
shortName: "",
}
```
> you can override the settings by `$.Duoshuo.settings = {}`### function call
> $(selector).duoshuo([[[["method"], "text"], "thread_key"], "short_name"])## License
Under The [MIT](https://tldrlegal.com/license/mit-license) License