Skip to content

Instantly share code, notes, and snippets.

@jflores1
Forked from BigAl/social share
Last active August 29, 2015 14:05
Show Gist options
  • Save jflores1/0e5096ccef7f079e7bf1 to your computer and use it in GitHub Desktop.
Save jflores1/0e5096ccef7f079e7bf1 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
window.onload = function(){
var blogDomain = encodeURIComponent("{{ site.url }}");
var pageTitleSpaces = encodeURIComponent("{{ page.title }}") + "&amp;";
var pageID = "{{ page.id }}";
var pageURL = encodeURIComponent(pageID) + "&amp;";
var twitterPartOne = "https://twitter.com/intent/tweet?original_referer=";
var twitterPartTwo = "text=";
var twitterPartThree = "tw_p=tweetbutton&amp;url=";
var twitterPartFour = "via=bigal";
var twitterUrl = twitterPartOne + blogDomain + pageURL + twitterPartTwo + pageTitleSpaces + twitterPartThree + blogDomain + pageURL + twitterPartFour;
var twitterLink = document.getElementById("twitter-link");
twitterLink.onclick = function() {popUp=window.open(twitterUrl, 'popupwindow', 'scrollbars=yes,width=600,height=400');popUp.focus();return false };
var linkedinPartOne = "http://www.linkedin.com/shareArticle?mini=true&url=";
var linkedinPartTwo = "&title=";
var linkedinPartThree = "&summary=";
var linkedinPartFour = "&source=";
var linkedinUrl = linkedinPartOne + blogDomain + pageURL + linkedinPartTwo + pageTitleSpaces + linkedinPartFour + "@bigal";
var linkedInLink = document.getElementById("linkedin-link");
linkedInLink.onclick = function() {popUp=window.open(linkedinUrl, 'popupwindow', 'scrollbars=yes,width=600,height=400');popUp.focus();return false };
var googlePlusPartOne = "https://plus.google.com/share?url=";
var googlePlusUrl = googlePlusPartOne + blogDomain + pageID;
var googlePlusLink = document.getElementById("googleplus-link");
googlePlusLink.onclick = function() {popUp=window.open(googlePlusUrl, 'popupwindow', 'scrollbars=yes,width=600,height=400');popUp.focus();return false };
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment