Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Update README for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jun 30, 2016
1 parent 72b886d commit b71ac87
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,64 +23,49 @@ Development section below.

## Documentation

For now ocumentation for widgets API is present in JSDoc comments,
For now documentation for widgets API is present in JSDoc comments,
but not generated into more readable format.

Configuration options:
- `window.grtpAPI` - Where to look for the grtp.co API
- defaults to `//grtp.co/v1/`
- defaults to `//grtp.co/v2/`
- `window.gratipayURI` - Where to look for Gratipay
- defaults to `https://gratipay.com/`


## Examples

In the following examples, just switch out `rummik` with your Gratipay username.
In the following examples, just switch out `my-team` with your Gratipay Team slug.

### Standard Widgets
![](https://cloud.githubusercontent.com/assets/134455/4095888/3e6d7758-2fba-11e4-935f-14e30c32ac1e.png)
![](https://cloud.githubusercontent.com/assets/3729038/16357975/9584b358-3acb-11e6-821c-ece9d855dca1.png)
```html
<script data-gratipay-username="rummik"
src="//grtp.co/v1.js" async></script>
```

![](https://cloud.githubusercontent.com/assets/134455/4095889/3fb3b5f0-2fba-11e4-8adb-250a0dc4e9cf.png)
```html
<script data-gratipay-username="rummik"
data-gratipay-widget="button"
src="//grtp.co/v1.js" async></script>
```

![](https://cloud.githubusercontent.com/assets/134455/4095908/997bc05a-2fba-11e4-99cb-56ad9cbad392.png)
```html
<script data-gratipay-username="rummik"
data-gratipay-widget="giving"
src="//grtp.co/v1.js" async></script>
<script data-gratipay-teamslug="my-team"
src="//grtp.co/v2.js" async></script>
```

### Custom Widgets
You can create your own widgets by adding `data-gratipay-widget="custom"` to your
widget's HTML, and the following classes:

- Text
- `gratipay-teamslug` - the Team's slug
- `gratipay-receiving` - dollar-sign prefixed value of `receiving`
- `gratipay-username` - the user's username
- `gratipay-giving` - dollar-sign prefixed value of `giving`
- Links
- `gratipay-profile-link` - sets the `href` attribute to the user's profile
- `gratipay-profile-link` - sets the `href` attribute to the Team's profile
link
- `gratipay-link` - sets the `href` attribute to https://gratipay.com/
- Misc styling


```html
<div data-gratipay-username="rummik" data-gratipay-widget="custom">
<div data-gratipay-teamslug="my-team" data-gratipay-widget="custom">
I receive <a class="gratipay-profile-link">
<span class="gratipay-receiving">$0.00</span> / wk
</a>
on <a class="gratipay-link">Gratipay</a>.
</div>
<script src="//grtp.co/v1.js"></script>
<script src="//grtp.co/v2.js"></script>
```


Expand All @@ -91,7 +76,7 @@ widget's HTML, and the following classes:
<img src="http://img.shields.io/gratipay/Gratipay.svg">
```

[Google Gadget](lib/v1/blogger) for Blogger.
[Google Gadget](lib/v2/blogger) for Blogger.


## Development
Expand Down

0 comments on commit b71ac87

Please sign in to comment.