Your SlideShare is downloading. ×
Li conn
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Li conn

19
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
19
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. function LIConnect(config){ this.config = config; if(this.config.login_source == ""){ this.config.login_source = "li-connect"; } this.config.connectRoute = config.connectRoute === undefined ? "connect" : config.connectRoute; this.config.connectUrl = window.location.protocol + "//" + window.location.host + "/liconnect/" + this.config.connectRoute + "? login_source=" + this.config.login_source; this.bindEvents(); }; LIConnect.prototype.openAuthDialog = function() { window.open("https://www.linkedin.com/uas/oauth2/authorization? response_type=code&client_id=y4wa9oe4c6nu&scope=&state="+ this.config.state + "&redirect_uri=" + this.config.connectUrl,null,"height=400,width=600,status=yes,toolbar=no,menubar= no,location=no"); }; LIConnect.prototype.bindEvents = function(){ var that = this; $(this.config.connectButtonClass).live("click",function(e){ that.openAuthDialog(); }) }; LIConnect.prototype.onAuthSuccess = function(){ window._gaq = _gaq || []; if(typeof $().modal == 'function' && $("#j- linkedinConnectedMessage").length){ $("#j-linkedinConnectedMessage").removeClass("hide").modal("show"); } else { var isIFrame = (window.location != window.parent.location); if(isIFrame){ _gaq.push(["_trackEvent", "Login", "linkedin", "modal_" + this.config.login_source + "_successful"]); $.postMessage('modalLoginSubmit', $('#target_url').val(), parent); } else if(this.config.connectRoute == "bind_account"){ _gaq.push(["_trackEvent", "Login", "linkedin", "modal_" + this.config.login_source + "_successful"]); document.location.reload(); } else { _gaq.push(["_trackEvent", "Login", "linkedin", this.config.login_source + "_successful" ]); var fromSource = getUrlVar('from_source') || '/login?nf_redirect=true', fromType = getUrlVar('from') || "login"; if ( isInternalRedirect(fromSource) ) { document.location.href = decodeURIComponent(fromSource); } else { document.location.reload(); } } } };

×