-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e126b1
commit 723d6ec
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` |