woodpecker/cmd/drone-server/static/scripts/filters/gravatar.js
2015-05-17 14:25:04 -07:00

32 lines
705 B
JavaScript

'use strict';
(function () {
/**
* gravatar is a helper function that return the user's gravatar
* image URL given an email hash.
*/
function gravatar() {
return function(hash) {
if (hash === undefined) { return ""; }
return "https://secure.gravatar.com/avatar/"+hash+"?s=48&d=mm";
}
}
/**
* gravatarLarge is a helper function that return the user's gravatar
* image URL given an email hash.
*/
function gravatarLarge() {
return function(hash) {
if (hash === undefined) { return ""; }
return "https://secure.gravatar.com/avatar/"+hash+"?s=128&d=mm";
}
}
angular
.module('drone')
.filter('gravatar', gravatar)
.filter('gravatarLarge', gravatarLarge)
})();