This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LinkedInClient(keys, tokens) { | |
// ... | |
}; | |
LinkedInClient.prototype.getRequestToken = function(redirectUrl, callback) { | |
// ... | |
}; | |
LinkedInClient.prototype.getAccessToken = function(oauthVerifier, callback) { | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LinkedInClient.prototype = new BaseClient(); | |
LinkedInClient.prototype.constructor = LinkedInClient; | |
function LinkedInClient(keys, tokens) { | |
// ... | |
}; | |
LinkedInClient.prototype.getRequestToken = function(redirectUrl, callback) { | |
LinkedInClient.prototype.getRequestToken.call(this, redirectUrl, callback); // call method of "super" class | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinkedInClient extends BaseClient | |
constructor: (keys, tokens) -> | |
# ... | |
getRequestToken: (redirectUrl, callback) -> | |
super(redirectUrl, callback) # call method of "super" class | |
getAccessToken: (oauthVerifier, callback) -> | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getRequestToken = (redirectUrl, callback) -> | |
# Do something |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor: (@keys, @tokens) -> | |
# Do something else - this.keys and this.tokens are automatically set! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.foo = 'bar'; | |
console.log(this.foo); // prints 'bar' | |
$('#myButton').click(function(event) { | |
console.log(this.foo); // prints 'undefined' since it's not the same 'this' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.foo = 'bar'; | |
console.log(this.foo); // prints 'bar' | |
var that = this; // save a reference | |
$('#myButton').click(function(event) { | |
console.log(this.foo); // prints 'undefined' since it's not the same 'this' | |
console.log(that.foo); // prints 'bar' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foo = 'bar' | |
console.log(@foo) # prints 'bar' | |
$('#myButton').click (event) => | |
console.log(@foo) # prints 'bar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = LinkedInClient.baseUrl + "/v1/groups/" + id + "/posts:(" + LinkedInClient.groupFields.join(',') + ")?count=10"; | |
this.oauth.getProtectedResource(url, 'GET', this.tokens.oauthAccessToken, this.tokens.oauthAccessTokenSecret, function(error, data, response) { | |
// ... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = "#{LinkedInClient.baseUrl}/v1/groups/#{id}/posts:(#{LinkedInClient.groupFields.join(',')})?count=10" | |
@oauth.getProtectedResource url, 'GET', @tokens.oauthAccessToken, @tokens.oauthAccessTokenSecret, (error, data, response) => | |
# ... |
OlderNewer