Created
December 4, 2011 05:29
-
-
Save Buildstarted/1429285 to your computer and use it in GitHub Desktop.
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 createProfile(profileContainer, profile) { | |
var expand = $("li.user div[data-val-gravatar='" + profile.hash + "']"); | |
var twitter = loadTwitter(profile); | |
var p = { | |
hash: profile.hash, | |
bio: { | |
name: profile.formatted, | |
about: profile.aboutMe, | |
hasTwitter: twitter != null | |
}, | |
twitter: twitter | |
}; | |
$('#profile-template').tmpl(p).appendTo(expand); | |
profileContainer.show("slow"); | |
} | |
function loadTwitter(profile) { | |
for (var index in profile.accounts) { | |
var account = profile.accounts[index]; | |
if (account.domain == 'twitter.com') { | |
return account; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment