Skip to content

Commit

Permalink
Merge pull request #278 from Julienh/2.0.0
Browse files Browse the repository at this point in the history
2.0.0 - Release
  • Loading branch information
Martin Smeeckaert committed Feb 22, 2016
2 parents dd553e5 + 68aa99c commit f750f7f
Show file tree
Hide file tree
Showing 30 changed files with 1,664 additions and 745 deletions.
30 changes: 30 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Contribution guide

If you want to contribute, here are some tips:

There is a grunt file, so use it anytime you add a feature.

```
# npm install
# grunt &
```

## Adding a platform

If you want to add a platform, just copy an existing one and adapt it.

The base options of a platform are as follow:

* url : The url use to share the plugin, it can be overrident globally or by platform
* urlCount: Override the url method
* count: If set to false, will not call any API to get the count of shares
* popup: {width/height}: the size of the popup

These methods must be implemented:

* settings : Return the platform configuration
* url : The url used to get the share count if available
* trackingAction : {site, action} : Datas sent to analytics
* load : Will be called when displaying the button without template
* tracking: Will be called to track sharing
* popup : Will be called to open a popup when using a template
58 changes: 58 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = function (grunt) {

grunt.initConfig({
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'dist/style.css': 'src/sass/style.scss',
'dist/test.css': 'src/sass/test.scss'
}
}
},
uglify: {
options: {
"separator": ";",
"preserveComments": function (node, comment) {
// preserve comments that start with a bang
return /^!/.test(comment.value);
}
},
my_target: {
files: {
"dist/jquery.sharrre.min.js": [
"src/js/platform/platform.js",
"src/js/platform/*.js",
"src/js/**/*.js"
]
}
}
},
copy: {
main: {
files: [
{src: ['dist/jquery.sharrre.min.js'], dest: 'jquery.sharrre.min.js', filter: 'isFile'}
]
}
},
watch: {
sass: {
files: ['src/**/*.scss'],
tasks: ['sass']
},
uglify: {
files: ['src/**/*.js'],
tasks: ['uglify', 'copy']
}
}
});
grunt.loadNpmTasks("grunt-sass");
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('default', ['watch']);

};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) Sharrre

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
35 changes: 32 additions & 3 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
# jQuery Sharrre Plugin
Make your sharing widget! Sharrre is a jQuery plugin that allows you to create nice widgets sharing for Facebook, Twitter, Google Plus (with PHP script) and more. More information on [Sharrre](http://sharrre.com/#demos)

# Supported platforms
* Delicious
* Facebook
* Google+
* LinkedIn
* Pinterest
* Stumbleupon
* Twitter Share + Follow (no counter since Twitter disabled it in Nov. 2015)
* Reddit
* Tumblr

# Installing

You can use the jquery.sharrre.min.js file, all platforms are included in it.

If you want a smaller file and only use a limited number of social network, you can use these files from the src/js folder :
* jquery.sharre.js
* platform/platform.js

After that you can choose which platform you need and load them in your project.

# Usage

```
```javascript
$('#sharrre').sharrre({
share: {
googlePlus: true,
Expand All @@ -17,13 +38,13 @@ $('#sharrre').sharrre({
# Example
**HTML**

```
```html
<div id="demo1" data-title="sharrre" data-url="http://sharrre.com" ></div>
```

**JS**

```
```javascript
$(document).ready(function(){
$('#demo1').sharrre({
share: {
Expand Down Expand Up @@ -58,3 +79,11 @@ See example on [official website](http://sharrre.com/#demos)
- [Julien Hany](http://hany.fr)
- [Twitter (@_JulienH)](http://twitter.com/_JulienH)
- [Google+](http://plus.google.com/111637545317893682325)

# Contributing

Any help is welcome, if you want some infos on how contribute, see the [CONTRIBUTORS.md](CONTRIBUTORS.md) file.

# License

The project is distributed under the MIT License
Loading

0 comments on commit f750f7f

Please sign in to comment.