Skip to content

Instantly share code, notes, and snippets.

@marcosfreitas
Created March 31, 2016 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcosfreitas/aa11fbbad326db7cd76d51ff65b62c5a to your computer and use it in GitHub Desktop.
Save marcosfreitas/aa11fbbad326db7cd76d51ff65b62c5a to your computer and use it in GitHub Desktop.
function gpShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('https://plus.google.com/share?url=' + url + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + title + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
function twShare(url, title, descr, image, winWidth, winHeight) {
var winTop = ($(window).height() / 2 - 225);
var winLeft = ($(window).width() / 2);
window.open('http://twitter.com/share?url=' + url + '&text=' + title + '&', 'twitterwindow', 'height=' + winHeight + ', width=' + winWidth + ', top=' + winTop + ', left=' + winLeft + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
}
function liShare(url, title, descr, image, winWidth, winHeight) {
var winTop = ($(window).height() / 2 - 225);
var winLeft = ($(window).width() / 2);
window.open('https://www.linkedin.com/cws/share?url=' + url + '&text=' + title + '&', 'twitterwindow', 'height=' + winHeight + ', width=' + winWidth + ', top=' + winTop + ', left=' + winLeft + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
}
function toggleModalReferFriendClick() {
$("#toggle-modal-refer-friend").slideToggle();
$("#toggle-modal-refer-friend-i").toggleClass("icon-angle-up icon-angle-down");
return false;
}
$(function () {
$('#earncredict').popover({
trigger: 'click',
content: function () { return $('#content-wrap-earncredits').html(); },
placement: 'bottom',
template: '<div id="popover-refer-friend" class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content pad-no"></div></div>',
html: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment