SlideShare une entreprise Scribd logo
1  sur  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();
}
}
}
};

Contenu connexe

En vedette

Indicador de educacion
Indicador de educacionIndicador de educacion
Indicador de educacionBanesa Ruiz
 
Certified Scrum Developer brochure
Certified Scrum Developer brochureCertified Scrum Developer brochure
Certified Scrum Developer brochureKnowledgehut
 
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...Orbit Media Studios
 
Jack Ryger: Brooklyn, New York
Jack Ryger: Brooklyn, New YorkJack Ryger: Brooklyn, New York
Jack Ryger: Brooklyn, New YorkJack D. Ryger
 
Double Offset High Performance Butterfly Valves
Double Offset High Performance Butterfly ValvesDouble Offset High Performance Butterfly Valves
Double Offset High Performance Butterfly ValvesIves Equipment
 
You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)Mark Barber
 
Final versions august 11
Final versions august 11Final versions august 11
Final versions august 11Lorraine Ball
 
Entornos naturales protegidos (y accesibles).
Entornos naturales protegidos (y accesibles).Entornos naturales protegidos (y accesibles).
Entornos naturales protegidos (y accesibles).José María
 
120112 socmed-whitehall-for-blog-slides
120112 socmed-whitehall-for-blog-slides120112 socmed-whitehall-for-blog-slides
120112 socmed-whitehall-for-blog-slidesCraig Thomler
 
Sign of a bad leader by crowdinvest
Sign of a bad leader by crowdinvestSign of a bad leader by crowdinvest
Sign of a bad leader by crowdinvestCrowdinvest
 
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...HAMSproject
 
PGB HR Zaawansowane Wyszukiwanie
PGB HR Zaawansowane WyszukiwaniePGB HR Zaawansowane Wyszukiwanie
PGB HR Zaawansowane WyszukiwanieMaciej Mazurek
 

En vedette (20)

Indicador de educacion
Indicador de educacionIndicador de educacion
Indicador de educacion
 
Certified Scrum Developer brochure
Certified Scrum Developer brochureCertified Scrum Developer brochure
Certified Scrum Developer brochure
 
Marketing de afiliación
Marketing de afiliaciónMarketing de afiliación
Marketing de afiliación
 
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...
Content Jam 2015: How to Start (and maintain!) a Blog That Doesn't Stink by K...
 
Jack Ryger: Brooklyn, New York
Jack Ryger: Brooklyn, New YorkJack Ryger: Brooklyn, New York
Jack Ryger: Brooklyn, New York
 
8° encontro
8° encontro8° encontro
8° encontro
 
Bunty bhagat
Bunty bhagatBunty bhagat
Bunty bhagat
 
 
Double Offset High Performance Butterfly Valves
Double Offset High Performance Butterfly ValvesDouble Offset High Performance Butterfly Valves
Double Offset High Performance Butterfly Valves
 
You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)
 
Final versions august 11
Final versions august 11Final versions august 11
Final versions august 11
 
Entornos naturales protegidos (y accesibles).
Entornos naturales protegidos (y accesibles).Entornos naturales protegidos (y accesibles).
Entornos naturales protegidos (y accesibles).
 
120112 socmed-whitehall-for-blog-slides
120112 socmed-whitehall-for-blog-slides120112 socmed-whitehall-for-blog-slides
120112 socmed-whitehall-for-blog-slides
 
Virusni hepatitis, Hrvatska konsenzus konferencija 2013
Virusni hepatitis, Hrvatska konsenzus konferencija 2013Virusni hepatitis, Hrvatska konsenzus konferencija 2013
Virusni hepatitis, Hrvatska konsenzus konferencija 2013
 
Sign of a bad leader by crowdinvest
Sign of a bad leader by crowdinvestSign of a bad leader by crowdinvest
Sign of a bad leader by crowdinvest
 
位置情報特集
位置情報特集位置情報特集
位置情報特集
 
K+p seminar MAN
K+p seminar MANK+p seminar MAN
K+p seminar MAN
 
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...
Hardware Acceleration of Computional Fluid Dynamics Simulations in an Oxygena...
 
The final accounts
The final accountsThe final accounts
The final accounts
 
PGB HR Zaawansowane Wyszukiwanie
PGB HR Zaawansowane WyszukiwaniePGB HR Zaawansowane Wyszukiwanie
PGB HR Zaawansowane Wyszukiwanie
 

Similaire à Https set up

WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsRobert Nyman
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentationValdis Iljuconoks
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranRobert Nyman
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tsArif Alexi
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMichael Dawson
 
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Frédéric Harper
 
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...Francois Marier
 
Building Persona: federated and privacy-sensitive identity for the Web (Open ...
Building Persona: federated and privacy-sensitive identity for the Web (Open ...Building Persona: federated and privacy-sensitive identity for the Web (Open ...
Building Persona: federated and privacy-sensitive identity for the Web (Open ...Francois Marier
 
Mashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsMashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsBastian Hofmann
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
 
Authenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIsAuthenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIsJimmy Guerrero
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Build Secure Cloud-Hosted Apps for SharePoint 2013
Build Secure Cloud-Hosted Apps for SharePoint 2013Build Secure Cloud-Hosted Apps for SharePoint 2013
Build Secure Cloud-Hosted Apps for SharePoint 2013Danny Jessee
 

Similaire à Https set up (20)

WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
meet.js - QooXDoo
meet.js - QooXDoomeet.js - QooXDoo
meet.js - QooXDoo
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - Altran
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=ts
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
 
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
Firefox OS, une plateforme à découvrir - IO Saglac - 2014-09-09
 
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...
Building Persona: federated and privacy-sensitive identity for the Web (LCA 2...
 
Discontinuing Reader Matches
Discontinuing Reader MatchesDiscontinuing Reader Matches
Discontinuing Reader Matches
 
Mashing up JavaScript
Mashing up JavaScriptMashing up JavaScript
Mashing up JavaScript
 
mobl
moblmobl
mobl
 
Building Persona: federated and privacy-sensitive identity for the Web (Open ...
Building Persona: federated and privacy-sensitive identity for the Web (Open ...Building Persona: federated and privacy-sensitive identity for the Web (Open ...
Building Persona: federated and privacy-sensitive identity for the Web (Open ...
 
Mashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsMashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web Apps
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Authenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIsAuthenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIs
 
Dojo and Adobe AIR
Dojo and Adobe AIRDojo and Adobe AIR
Dojo and Adobe AIR
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Pyramid REST
Pyramid RESTPyramid REST
Pyramid REST
 
Build Secure Cloud-Hosted Apps for SharePoint 2013
Build Secure Cloud-Hosted Apps for SharePoint 2013Build Secure Cloud-Hosted Apps for SharePoint 2013
Build Secure Cloud-Hosted Apps for SharePoint 2013
 

Plus de <svg> \">

4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02
4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp024thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02
4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02<svg> \">
 
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01Studiodrad designhubworkshop-tokyo-140316055155-phpapp01
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01<svg> \">
 
Pptwithlinks
PptwithlinksPptwithlinks
Pptwithlinks<svg> \">
 

Plus de <svg> \"> (7)

111111
111111111111
111111
 
4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02
4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp024thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02
4thingsyouradagencyissecretlydyingtotellyou-140122041940-phpapp02
 
Li conn
Li connLi conn
Li conn
 
Xmas 2012
Xmas 2012Xmas 2012
Xmas 2012
 
Empty
EmptyEmpty
Empty
 
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01Studiodrad designhubworkshop-tokyo-140316055155-phpapp01
Studiodrad designhubworkshop-tokyo-140316055155-phpapp01
 
Pptwithlinks
PptwithlinksPptwithlinks
Pptwithlinks
 

Https set up

  • 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(); } } } };