Permalink
Browse files

v0.8

Added google+
  • Loading branch information...
Steve Mckellar
Steve Mckellar committed Feb 24, 2012
1 parent c3618e4 commit f230323b37f9563e63189ba9dd5551d60cb75e9d
Showing with 28 additions and 15 deletions.
  1. +9 −7 lightshare-0.7.min.js → lightshare-0.8.min.js
  2. +19 −8 lightshare.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -10,13 +10,15 @@ lightshare.init = function() {
$('body').prepend(
'<style>'+
- '#lightshare { width:170px; height:53px; font-family: Tahoma, sans-serif; font-size: 13px; color:#999; position:absolute;top:-100px;border-radius:6px;padding:3px;background:#fff; border: 1px solid #e0e0e0;-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1);}'+
- '#lightshare .title, #lightshare .service { display:inline; float: left; width: 56px; vertical-align: top; height: 20px; padding-right: 12px; }'+
- '#lightshare .row { display: block; clear: both; height: 20px; padding: 3px; }'+
+ '#lightshare { width:205px; height:66px; font-family: Tahoma, sans-serif; font-size: 13px; color:#999; position:absolute;top:-100px;border-radius:6px;padding:3px;background:#fff; border: 1px solid #e0e0e0;-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.1);}'+
+ '#lightshare .title, #lightshare .service { padding: 3px; display:inline; float: left; vertical-align: top; height: 20px; }'+
+ '#lightshare .row { display: block; clear: both; height: 26px; padding: 3px; }'+
'#lightshare-twitter { cursor:pointer; display:block; position: relative; height: 18px; width: 56px; font-weight: bold; color: #333; text-decoration: none; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); white-space: nowrap; vertical-align: top; background-color: white; background-image: -moz-linear-gradient(top, #ffffff, #dedede); background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#dedede)); background-image: -ms-linear-gradient(top, #ffffff, #dedede); background-image: linear-gradient(top, #ffffff, #dedede); background-image: -o-linear-gradient(top, #ffffff, #dedede); border: #CCC solid 1px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; outline: none; filter: progid:dximagetransform.microsoft.gradient(startColorstr="#ffffff", endColorstr="#dedede"); }'+
'#lightshare-twitter span { display: inline-block; padding: 0 3px 0 19px; zoom: 1; font: normal normal normal 11px/1.7 "Helvetica Neue", Arial, sans-serif; font-weight:bold; }'+
'#lightshare-twitter i { position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; background: transparent url(data:image/gif;base64,R0lGODlhEAAQAOZIAAGXzi6Mrvv7+/Dw8AGZ0AGMvgGWzQGSxgGYz+/v7+bu8d/m6QGHuPj4+BCJtvPz8wGTyQGVy7PQ28fg6bPO2Lrc6ECr0gGPwlugukuZtaTG0wGZ0azY6DyTtNDe45jE1G/A3W++2262z9/m6MHW3QGArwGOwhGe0ZW/zgF7qAF6pjCkzgGNwPr6+pzQ4gGMvxCFsNvt8tDf5AGY0JW+zfHx8XezyAGBrxGf0qTH1fLy8j6ZugGWzFunwwGGt9vs8k2rzQF/rhCLuJzS5vb29l+73RGbzgGa0u7u7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmU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MfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAEgALAAAAAAQABAAAAeFgEiCg4SFhoeIhhQ0hySECwEqH4cBASiCNj4vDjmGIgxBHTIOEAAXMAuFEwcHDEImM0cABT0ZhAMWBDylR70RBSWFFQZHG729CCA/giOCNSEEx71GCgOCGBoeEkDExwgcCYMKOyk3LADHJ0M6hAkNLisR0ThFMQ+HDw0C+y1E1okAAxoKBAA7) 0 0 no-repeat; }'+
'#lightshare-facebook { border:none; overflow:hidden; width:100px; height:20px; }'+
+ '#lightshare-gplus { cursor:pointer; overflow:hidden; width:20px; height:20px; background: url(http://www.gstatic.com/images/icons/gplus-16.png) 50% 50% no-repeat; text-indent: -100px; overflow: hidden; }'+
+
'</style>'
);
$('body').append(
@@ -25,20 +27,22 @@ lightshare.init = function() {
' <div class="title">Share</div>'+
' </div>'+
' <div class="row">'+
- ' <div class="service"><a href="#" id="lightshare-twitter" title="Share on Twitter"><i></i><span>Tweet</span></a></div>'+
+ ' <div class="service"><div id="lightshare-twitter" title="Share on Twitter"><i></i><span>Tweet</span></div></div>'+
+ ' <div class="service"><div id="lightshare-gplus" title="Share on Google+">G+</div></div>'+
' <div class="service"><iframe id="lightshare-facebook" scrolling="no" frameborder="0" allowTransparency="true"></iframe></div>'+
' </div>'+
'</div>'
);
self.lightshareDO = $('#lightshare');
- self.facebook = $('#lightshare-facebook');
- self.twitter = $('#lightshare-twitter');
+ self.facebook = $('#lightshare-facebook');
+ self.twitter = $('#lightshare-twitter');
+ self.gplus = $('#lightshare-gplus');
self.width = self.lightshareDO.width();
self.height = self.lightshareDO.height();
self.lightshareDO.bind('mouseleave',function(e) {
- self.closeHandler();
+ //self.closeHandler();
});
$('.lightshare').each(function(i){
@@ -73,7 +77,14 @@ lightshare.prototype.openHandler = function(obj) {
if(url.length > 0) { tweetUrl += "&url="+encodeURIComponent(url); }
if(via.length > 0) { tweetUrl += "&via="+encodeURIComponent(via); }
window.open(tweetUrl,"_blank","status=0,toolbar=0,location=1,menubar=0,directories=0,resizable=0,scrollbars=0,height=240,width=640");
- });
+ });
+ self.gplus.bind('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var gplusUrl = "https://plus.google.com/share?source=lightshare";
+ if(url.length > 0) { gplusUrl += "&url="+encodeURIComponent(url); }
+ window.open(gplusUrl,"_blank","status=0,toolbar=0,location=1,menubar=0,directories=0,resizable=0,scrollbars=0,height=240,width=640");
+ });
var likeUrl = "https://www.facebook.com/plugins/like.php?href="+url+"&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&height=21&appId=258645120881596";
self.facebook.css({'display':'none'});
self.facebook.bind('load',function() {

0 comments on commit f230323

Please sign in to comment.