Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use uglifyjs

Added package.json so that people can just run `npm install` to grab all
the dependencies.
  • Loading branch information...
commit 983169e016f432dfec6df4490d3d2256038d0bbb 1 parent d4fd49a
Owen Coutts tallowen authored
2  compress.sh
View
@@ -4,6 +4,6 @@ RESOURCE_FOLDER="./media/"
mkdir -p ${RESOURCE_FOLDER}
lessc src/style.less --yui-compress > ${RESOURCE_FOLDER}socialshare.min.css
-java -jar lib/yuicompressor-2.4.7.jar src/socialshare.js > ${RESOURCE_FOLDER}socialshare.min.js
+uglifyjs src/socialshare.js > ${RESOURCE_FOLDER}socialshare.min.js
cp -r src/img/ ${RESOURCE_FOLDER}img/
cp src/OpenSans-Light.ttf ${RESOURCE_FOLDER}
BIN  lib/yuicompressor-2.4.7.jar
View
Binary file not shown
2  media/socialshare.min.js
View
@@ -1 +1 @@
-(function(c){var f='[data-toggle="dropdown"]';var k=".socialshare";var e='.socialshare.open[data-type="small-bubbles"] .share-options div.fb-like iframe';var a;var g='<div class="dropdown-toggle" data-toggle="dropdown"> <div class="share-link"><div> <div class="heart"></div> <p class="text">Share This</p> <div class="caret"><div></div></div></div> </div><div class="clear"></div><div class="share-options"> <ul> <li><div class="fb-like"></div></li> <li><div class="g-plusone"></div></li> <li><a href="https://twitter.com/share" class="twitter-share-button"></a></li> </ul></div><div id="fb-root"></div>';var i;var d={facebook:{id:"facebook-jssdk",src:"//connect.facebook.net/en_US/all.js#xfbml=1&appId=255566051148260",selector:".fb-like","small-bubbles":{"data-send":"false","data-layout":"button_count","data-width":"105","data-show-face":"false"},bubbles:{"data-send":"false","data-layout":"box_count","data-width":"12","data-show-faces":"false"},small:{"data-send":"false","data-width":"85","data-show-face":"false"}},googleplus:{id:"gplus-api",src:"https://apis.google.com/js/plusone.js",selector:".g-plusone","small-bubbles":{},bubbles:{"data-size":"tall"},small:{"data-size":"small","data-annotation":"none"}},twitter:{id:"twitter-wjs",src:"//platform.twitter.com/widgets.js",selector:".twitter-share-button","small-bubbles":{"data-via":"firefox","data-related":"firefox"},bubbles:{"data-via":"firefox","data-count":"vertical","data-related":"firefox"},small:{"data-via":"firefox","data-count":"none","data-related":"firefox"}}};var b=function(){c(f).parent().removeClass("open")};var j=function(m){var l=c(m).on("click.dropdown.data-api",this.toggle);c("html").on("click.dropdown.data-api",function(){l.parent().removeClass("open")})};j.prototype={constructor:j,scripts_loaded:false,toggle:function(n){var m=c(this).parent();var l=m.hasClass("open");b();if(!l){m.toggleClass("open")}a=c(e).css("width",d.facebook["small-bubbles"]["data-width"]);j.prototype.load_sharing();return false},load_sharing:function(){if(!this.scripts_loaded){for(var l in d){this.load_script(d[l].src,d[l].id)}this.scripts_loaded=true}},load_script:function(n,o){var l=document.getElementsByTagName("script")[0];var m=document.getElementById(o);if(!m){m=document.createElement("script");m.id=o;l.parentNode.insertBefore(m,l)}m.src=n}};c.fn.dropdown=function(l){return this.each(function(){var n=c(this);var m=n.data("dropdown");if(!m){n.data("dropdown",(m=new j(this)))}if(typeof l==="string"){m[l].call(n)}})};c.fn.dropdown.Constructor=j;var h=function(m,l){d.twitter["small-bubbles"][m]=l;d.twitter.bubbles[m]=l};c(function(){c("html").on("click.dropdown.data-api",b);c("body").on("click.dropdown.data-api",f,j.prototype.toggle);a=c(k);var m=a.attr("data-tweet-at");if(m){h("data-via",m)}var l=c('meta[property="og:title"]');if(l){h("data-text",l.attr("content"))}var o=c('meta[property="og:url"]');if(o){h("data-url",o.attr("content"))}a.append(g);for(var n in d){a.find(d[n].selector).attr(d[n][a.attr("data-type")])}})})(window.jQuery);
+(function(a){"use strict";var b='[data-toggle="dropdown"]',c=".socialshare",d='.socialshare.open[data-type="small-bubbles"] .share-options div.fb-like iframe',e,f='<div class="dropdown-toggle" data-toggle="dropdown"> <div class="share-link"><div> <div class="heart"></div> <p class="text">Share This</p> <div class="caret"><div></div></div></div> </div><div class="clear"></div><div class="share-options"> <ul> <li><div class="fb-like"></div></li> <li><div class="g-plusone"></div></li> <li><a href="https://twitter.com/share" class="twitter-share-button"></a></li> </ul></div><div id="fb-root"></div>',g,h={facebook:{id:"facebook-jssdk",src:"//connect.facebook.net/en_US/all.js#xfbml=1&appId=255566051148260",selector:".fb-like","small-bubbles":{"data-send":"false","data-layout":"button_count","data-width":"105","data-show-face":"false"},bubbles:{"data-send":"false","data-layout":"box_count","data-width":"12","data-show-faces":"false"},small:{"data-send":"false","data-width":"85","data-show-face":"false"}},googleplus:{id:"gplus-api",src:"https://apis.google.com/js/plusone.js",selector:".g-plusone","small-bubbles":{},bubbles:{"data-size":"tall"},small:{"data-size":"small","data-annotation":"none"}},twitter:{id:"twitter-wjs",src:"//platform.twitter.com/widgets.js",selector:".twitter-share-button","small-bubbles":{"data-via":"firefox","data-related":"firefox"},bubbles:{"data-via":"firefox","data-count":"vertical","data-related":"firefox"},small:{"data-via":"firefox","data-count":"none","data-related":"firefox"}}},i=function(){a(b).parent().removeClass("open")},j=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};j.prototype={constructor:j,scripts_loaded:!1,toggle:function(b){var c=a(this).parent(),f=c.hasClass("open");return i(),f||c.toggleClass("open"),e=a(d).css("width",h.facebook["small-bubbles"]["data-width"]),j.prototype.load_sharing(),!1},load_sharing:function(){if(!this.scripts_loaded){for(var a in h)this.load_script(h[a].src,h[a].id);this.scripts_loaded=!0}},load_script:function(a,b){var c=document.getElementsByTagName("script")[0],d=document.getElementById(b);d||(d=document.createElement("script"),d.id=b,c.parentNode.insertBefore(d,c)),d.src=a}},a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new j(this)),typeof b=="string"&&d[b].call(c)})},a.fn.dropdown.Constructor=j;var k=function(a,b){h.twitter["small-bubbles"][a]=b,h.twitter.bubbles[a]=b};a(function(){a("html").on("click.dropdown.data-api",i),a("body").on("click.dropdown.data-api",b,j.prototype.toggle),e=a(c);var d=e.attr("data-tweet-at");d&&k("data-via",d);var g=a('meta[property="og:title"]');g&&k("data-text",g.attr("content"));var l=a('meta[property="og:url"]');l&&k("data-url",l.attr("content")),e.append(f);for(var m in h)e.find(h[m].selector).attr(h[m][e.attr("data-type")])})})(window.jQuery);
9 package.json
View
@@ -0,0 +1,9 @@
+{
+ "name": "SocialShare",
+ "version": "0.0.1",
+ "private": true,
+ "dependencies": {
+ "less": "1.3.0",
+ "uglify-js": "1.2.6"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.