move content and symlink

This commit is contained in:
unknown
2015-03-28 08:26:47 -04:00
parent e7b205ef3b
commit 24ce3861b2
7 changed files with 21 additions and 63 deletions

42
jquery.UntappedWidget.js Normal file
View File

@@ -0,0 +1,42 @@
(function ($) {
//I would love to use handlebars, but I am trying to limit the required packages
var buildProfileTemplate = function (data, badges) {
return "<div class=\"profile\" style=\"background-image: Url(" + data.headerBackgroundUrl + ")\"><div class=\"user-info\">\
<div class=\"user-avatar\">\
<div class=\"avatar-holder\">\
<img src=\""+ data.avatarUrl + "\" alt=\"User Avatar\" />\
</div>\
</div>\
<div class=\"info\">\
<h1>"+ data.info + "</h1>\
<span class=\"username\">"+ data.username + "</span>\
</div>\
</div>\
<div class=\"stats-bar\">\
<span class=\"badges\">"+ badges + "\
</span>\
</div>\
</div>";
}
var buildBadges = function (data) {
var badges = "";
$.each(data.badges, function (index, value) {
badges = badges + "<a href=\"" + value.linkUrl + "\" ><span><img src=\"" + value.imageUrl + "\" /></span></a>";
});
return badges;
}
$.fn.untappd = function (username) {
this.each(function () {
var that = this;
$.get("http://untappdwidget.azurewebsites.net/" + username, function(data) { $(that).html(buildProfileTemplate(data, buildBadges(data))); }, "jsonp");
});
};
})(jQuery);