social sharing buttons

This commit is contained in:
Athou
2013-05-01 18:06:18 +02:00
parent 451979589c
commit 07fb0e712b
9 changed files with 79 additions and 6 deletions

View File

@@ -1,5 +1,16 @@
var module = angular.module('commafeed.directives', []);
module.directive('popup', function() {
return {
link : function(scope, elm, attrs) {
elm.bind('click', function(event) {
window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');
event.preventDefault();
});
}
};
});
module.directive('favicon', function() {
return {
restrict : 'E',

View File

@@ -7,9 +7,13 @@ module.filter('entryDate', function() {
var formatted;
if (d.date() === now.date() && Math.abs(d.diff(now)) < 86400000) {
formatted = d.fromNow();
} else {
formatted = d.format('YYYY-MM-DD HH:mm');
}
return formatted;
} else {
formatted = d.format('YYYY-MM-DD HH:mm');
}
return formatted;
};
});
module.filter('escape', function() {
return encodeURIComponent;
});