Skip to content

Commit

Permalink
Merge pull request #21 from estevanmaito/remove-mobile
Browse files Browse the repository at this point in the history
Remove mobile tooltip
  • Loading branch information
estevanmaito authored Feb 5, 2020
2 parents 9e126b1 + 2035f0d commit 63d5146
Show file tree
Hide file tree
Showing 16 changed files with 11,180 additions and 154 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@

<p align="center">
<a href="https://www.npmjs.com/package/sharect"><img src="https://img.shields.io/npm/v/sharect.svg?style=flat-square"></a>
<a href="https://github.com/estevanmaito/sharect/releases/download/v1.1.0/sharect.min.js"><img src="https://img.shields.io/github/downloads/estevanmaito/sharect/total.svg?style=flat-square"></a>
<a href="https://github.com/estevanmaito/sharect/releases/download/v2.0.0/sharect.js"><img src="https://img.shields.io/github/downloads/estevanmaito/sharect/total.svg?style=flat-square"></a>
<a href="https://github.com/estevanmaito/sharect"><img src="https://img.shields.io/npm/l/sharect.svg?style=flat-square"></a>
<a href="http://twitter.com/home?status=Sharect%20is%20a%20JavaScript%20library%20to%20let%20people%20share%20their%20text%20selections%20to%20social%20networks%20%23Sharect%20via%20%40estevanmaito"><img src="https://img.shields.io/twitter/url/https/shields.io.svg?style=social"></a>
</p>

A **lightweight** (8kb, 1.7kb gziped) JavaScript library to let people share their text selections to social networks. (Yes, like Medium, but on mobile too)
A **lightweight** (8kb, 2.9kb gziped) JavaScript library to let people share their text selections to social networks. (Yes, like Medium)

[Watch it live.](https://estevanmaito.github.io/sharect)

### Get started with 2 lines

```javascript
<script src="https://unpkg.com/sharect@2.0.0/dist/sharect.js"></script>
<script>Sharect.init()</script>
```

## Table of contents

- [Demo](https://estevanmaito.github.io/sharect)
Expand All @@ -29,8 +36,8 @@ A **lightweight** (8kb, 1.7kb gziped) JavaScript library to let people share the
### Install (choose one)

- `npm install sharect`
- [Download from Github](https://github.com/estevanmaito/sharect/releases/download/v1.1.0/sharect.min.js)
- CDN `<script src="https://unpkg.com/sharect@1.1.0/dist/sharect.min.js"></script>`
- [Download from Github](https://github.com/estevanmaito/sharect/releases/download/v2.0.0/sharect.js)
- CDN `<script src="https://unpkg.com/sharect@2.0.0/dist/sharect.js"></script>`

### Initialize

Expand Down Expand Up @@ -84,7 +91,7 @@ Result

### .appendCustomShareButtons

**DISCLAIMER: If you don't plan to share on any social media other than Facebook and Twitter (covered by the `.config` method above) you can safely ignore this method.**
**⚠️DISCLAIMER⚠️: If you don't plan to share on any social media other than Facebook and Twitter (covered by the `.config` method above) you can safely ignore this method.**

**Optional**. Extends the core social buttons. Expects an array of object(s) as argument containing an `icon` and a `url`.

Expand Down
49 changes: 49 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Upgrading guide

From 1.x to 2.x

If you're coming from 1.x, there are a couple things that changed and will be presented here in the format OLD vs NEW.

## Initializing

```javascript
// OLD
var sharect = new Sharect()
sharect.init()

// NEW
Sharect.init()
```

## Facebook SDK

There is no need to add the Facebook SDK anymore, neither create an `appId`. Because of this, Facebook sharing option is visible by default. You can change this behaviour (simulating the old one) by setting it to `false`:

```javascript
Sharect.config({
facebook: false
}).init()
```

## Selectable Elements

You can now choose what elements can be selected and shared. [Read more in .config documention](/README.md#config).

By default, it is `body`, the same behaviour as before.

## Twitter username

You don't need to include the `@` anymore, as we are now using the default Twitter API, which includes it.

```javascript
// OLD
var sharect = new Sharect()
sharect.config({
twitterUsername: '@estevanmaito'
}).init()

// NEW
Sharect.config({
twitterUsername: 'estevanmaito'
}).init()
```
2 changes: 1 addition & 1 deletion dist/sharect.js

Large diffs are not rendered by default.

Loading

0 comments on commit 63d5146

Please sign in to comment.