Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
modified readme, updated test.html to use the current button-path
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskbx committed Sep 16, 2014
1 parent 319f4bd commit 0b9eb35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
# WhatsApp sharing button

This is the buttons source code of this awesome webservice: http://whatsapp-sharing.com
## Installation

### Get started
### 1. Download

`git clone https://github.com/kriskbx/whatsapp-sharing.git whatsapp-sharing`
Download the current [release](https://github.com/kriskbx/whatsapp-sharing/releases) or clone the repo and upload `dist/whatsapp-button.js` somewhere on your webserver.

`cd whatsapp-sharing`
### 2. Integrate the buttons source

`npm install`
Use this code right before the `</body>`, replace `http://your-domain.tld/path/whatsapp-button.js` with the url to the just uploaded file.

### Build the button
<script type="text/javascript"> if(typeof wabtn4fg==="undefined") {wabtn4fg=1;h=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript";s.src="http://your-domain.tld/path/whatsapp-button.js";h.appendChild(s)}</script>

Just run `grunt` and look into "dist".
### 3. Place it on your website

### Use the button

If you want to use the button yourself, just use this code:
Place this code somewhere on your website to display the button:

<a href="whatsapp://send" data-text="Take a look at this awesome website:" data-href="" class="wa_btn wa_btn_s" style="display:none">Share</a>

and

<script type="text/javascript"> if(typeof wabtn4fg==="undefined") {wabtn4fg=1;h=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript";s.src="http://your-domain.tld/path/button";h.appendChild(s)}</script>

If you want to customize the size, style, url or the sharing text, feel free to visit [whatsapp-sharing.com](http://www.whatsapp-sharing.com) for a code generator.
2 changes: 1 addition & 1 deletion test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WABTN Tester</title>
<script type="text/javascript" src="../dist/button"></script>
<script type="text/javascript" src="../dist/whatsapp-button.js"></script>
</head>
<body>

Expand Down

0 comments on commit 0b9eb35

Please sign in to comment.