Skip to content

Commit

Permalink
Merge remote-tracking branch 'kniLabs/dev'
Browse files Browse the repository at this point in the history
Conflicts:
	index.html
	js/rrssb.js
	js/rrssb.min.js
  • Loading branch information
IanCaunce committed Apr 13, 2015
2 parents 4a3a924 + eb5d799 commit cda94f0
Show file tree
Hide file tree
Showing 29 changed files with 82 additions and 173 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
13 changes: 11 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ RRSSB is built with [**SASS**](http://sass-lang.com/), so you can easily customi
- Only copy the `li`s of the buttons you want (index.html has examples of all available types).

- Adding a class of `popup` to the anchor tag for each share button will make the share dialog open in a popup, rather than a new window. (Good for Facebook, Twitter, Google Plus, etc.)
- Buttons will automatically flow to the size of the ul `rrssb-buttons`. If specifically sized buttons are needed, nest `rrssb-buttons` in a fixed-width container.
- Buttons will automatically flow to the size of the ul `rrssb-buttons`. If fixed sized buttons are needed, nest `rrssb-buttons` in a fixed-width container.
- Each sharing URL requires various parameters that allow you to pass through messaging in the sharing dialog. A useful tool for URI escaping any messaging that needs to pass through the share URL can be found [**here**](http://meyerweb.com/eric/tools/dencoder/).
- Optionally, all share meta and links can be configured in `rrssb.js`


3) Link to javascript files at the bottom of your document before the closing body tag for best results. (jQuery CDN, [**jQuery fallback**](http://css-tricks.com/snippets/jquery/fallback-for-cdn-hosted-jquery/), and `rrssb.min.js`):
Expand Down Expand Up @@ -101,8 +102,16 @@ Requires [**SVG**](http://caniuse.com/svg)


### Version Notes
| Version | Note | Issue | Backwards compatible?
| :--- | :------- | :------- | :------- |
| 1.7 | Javascript Meta attributes as variables thanks @aicarlson| [(#47)](https://github.com/kni-labs/rrssb/issues/47) | ✓ |
| 1.6.5 | Namespace CSS classes - Legacy HTML will be incompatible until class names updated.| [(#42)](https://github.com/kni-labs/rrssb/issues/42) | ✕


### Contributing

Thanks for helping! Please use `dev` branch for all pull requests.

1.6.5 - Namespace CSS classes [(#42)](https://github.com/kni-labs/rrssb/issues/42) - Legacy HTML will be incompatible until class names updated.

### About

Expand Down
4 changes: 2 additions & 2 deletions bower.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RRSSB",
"version": "1.6.5",
"version": "1.7",
"authors": [
"(Joshua Tuscan <hello@joshuatuscan.com>)",
"(Daniel Box <daniel@kurtnoble.com>)"
Expand All @@ -21,4 +21,4 @@
},
"license": "Creative Commons Attribution-ShareAlike 4.0 International",
"homepage": "http://kurtnoble.com/labs/rrssb/"
}
}
Empty file modified config.codekit
100644 → 100755
Empty file.
Empty file modified css/demo.css
100644 → 100755
Empty file.
Empty file modified css/rrssb.css
100644 → 100755
Empty file.
Empty file modified icons/README.md
100644 → 100755
Empty file.
Empty file modified icons/facebook.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/github.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/google_plus.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/instagram.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/linkedin.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/mail.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/pinterest.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/pocket.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/reddit.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/tumblr.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/twitter.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/youtube.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 12 additions & 167 deletions index.html
100644 → 100755

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions js/rrssb.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,48 @@
calc : false
};

/*
* Public Function
*/

jQuery.fn.rrssb = function( options ) {

// Settings that $.rrssb() will accept.
var settings = jQuery.extend({
description: undefined,
emailAddress: undefined,
emailBody: undefined,
emailSubject: undefined,
image: undefined,
title: undefined,
url: undefined
}, options );

// Return the encoded strings if the settings have been changed.
for (var key in settings) {
if (settings.hasOwnProperty(key) && settings[key] !== undefined) {
settings[key] = encodeString(settings[key]);
}
};

if (settings.url !== undefined) {
jQuery(this).find('.rrssb-facebook a').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + settings.url);
jQuery(this).find('.rrssb-tumblr a').attr('href', 'http://tumblr.com/share/link?url=' + settings.url + (settings.title !== undefined ? '&name=' + settings.title : '') + (settings.description !== undefined ? '&description=' + settings.description : ''));
jQuery(this).find('.rrssb-linkedin a').attr('href', 'http://www.linkedin.com/shareArticle?mini=true&url=' + settings.url + (settings.title !== undefined ? '&title=' + settings.title : '') + (settings.description !== undefined ? '&summary=' + settings.description : ''));
jQuery(this).find('.rrssb-twitter a').attr('href', 'http://twitter.com/home?status=' + (settings.description !== undefined ? settings.description : '') + '%20' + settings.url);
jQuery(this).find('.rrssb-reddit a').attr('href', 'http://www.reddit.com/submit?url=' + settings.url + (settings.description !== undefined ? '&text=' + settings.description : '') + (settings.title !== undefined ? '&title=' + settings.title : ''));
jQuery(this).find('.rrssb-googleplus a').attr('href', 'https://plus.google.com/share?url=' + (settings.description !== undefined ? settings.description : '') + '%20' + settings.url);
jQuery(this).find('.rrssb-pinterest a').attr('href', 'http://pinterest.com/pin/create/button/?url=' + settings.url + ((settings.image !== undefined) ? '&amp;media=' + settings.image : '') + (settings.description !== undefined ? '&amp;description=' + settings.description : ''));
jQuery(this).find('.rrssb-pocket a').attr('href', 'https://getpocket.com/save?url=' + settings.url);
jQuery(this).find('.rrssb-github a').attr('href', settings.url);
}

if (settings.emailAddress !== undefined) {
jQuery(this).find('.rrssb-email a').attr('href', 'mailto:' + settings.emailAddress + '?' + (settings.emailSubject !== undefined ? 'subject=' + settings.emailSubject : '') + (settings.emailBody !== undefined ? '&amp;body=' + settings.emailBody : ''));
}

};

/*
* Utility functions
*/
Expand All @@ -49,6 +91,18 @@
el.remove();
};

var encodeString = function(string) {
// Recursively decode string first to ensure we aren't double encoding.
if (string !== undefined && string !== null) {
if (string.match(/%[0-9a-f]{2}/i) !== null) {
string = decodeURIComponent(string);
encodeString(string);
} else {
return encodeURIComponent(string);
}
}
};

var setPercentBtns = function() {
// loop through each instance of buttons
jQuery('.rrssb-buttons').each(function(index) {
Expand Down
5 changes: 3 additions & 2 deletions js/rrssb.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified media/README.md
100644 → 100755
Empty file.
Empty file modified media/facebook-share.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/favicon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/rrssb-preview.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/rrssb-preview.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified scss/demo.scss
100644 → 100755
Empty file.
Empty file modified scss/rrssb.scss
100644 → 100755
Empty file.

0 comments on commit cda94f0

Please sign in to comment.