Skip to content

Commit

Permalink
Merge pull request #56 from carrot/optimized-fonts
Browse files Browse the repository at this point in the history
Use Optimized Font Files
  • Loading branch information
Tom Milewski committed Feb 26, 2014
2 parents 2a40ab1 + 1b9389d commit 6ee5fba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ $.fn.share = function(opts) {
config.app_id = config.app_id.toString();
}
config.protocol = opts.protocol || (['http', 'https'].indexOf(window.location.href.split(':')[0]) === -1 ? 'https://' : '//');
if (!$('link[href="https://www.sharebutton.co/fonts/entypo.min.css"]').length) {
if (!$('link[href="https://www.sharebutton.co/fonts/v2/entypo.min.css"]').length) {
$("<link />").attr({
rel: "stylesheet",
href: "https://www.sharebutton.co/fonts/entypo.min.css"
href: "https://www.sharebutton.co/fonts/v2/entypo.min.css"
}).appendTo($("head"));
}
if (!$('link[href="' + config.protocol + 'fonts.googleapis.com/css?family=Lato:900"]').length) {
Expand Down
2 changes: 1 addition & 1 deletion build/share.min.js

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

17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ share.self; // returns an instance of the jquery object it was called on (fo

This will likely become more powerful down the line as this project continues to be developed - open an issue if there's anything you wish the api would have.

### Fonts ###

#### Entypo ###

[Version 1](https://www.sharebutton.co/fonts/entypo.zip)

Includes:
- full font set
- full css file containing all font mappings
- minimized css file containing only necessary font mappings

[Version 2](https://www.sharebutton.co/fonts/v2/entypo.zip)

Includes:
- minimized font set containing only necessary font glyphs
- minimized css file containing only necessary font mappings

### Inspiration

This project was inspired by [this dribbble shot](http://dribbble.com/shots/1072278) and [this cssdeck experiment](http://cssdeck.com/labs/css-social-share-button) - huge props to these two guys for some incredible ideas and work.
Expand Down
6 changes: 3 additions & 3 deletions src/share.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ $.fn.share = (opts) ->
# Notes
# - Must be https:// due to CDN CORS caching issues
# - To include the full entypo set, change URL to: https://www.sharebutton.co/fonts/entypo.css
unless $('link[href="https://www.sharebutton.co/fonts/entypo.min.css"]').length
unless $('link[href="https://www.sharebutton.co/fonts/v2/entypo.min.css"]').length
$("<link />").attr(
rel: "stylesheet"
href: "https://www.sharebutton.co/fonts/entypo.min.css" #
href: "https://www.sharebutton.co/fonts/v2/entypo.min.css"
).appendTo $("head")


Expand Down Expand Up @@ -179,7 +179,7 @@ $.fn.share = (opts) ->
caption: config.fb_caption
description: config.fb_text
else
popup =
popup =
width: 500
height: 350

Expand Down

0 comments on commit 6ee5fba

Please sign in to comment.