mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
33 lines
808 B
Plaintext
33 lines
808 B
Plaintext
/* global twitterFetcher */
|
|
|
|
/**
|
|
* This directive will allow show latest tweet.
|
|
* Usage: <twitter profile="{{twitterName}}"/>
|
|
*/
|
|
Application.Directives.directive('twitter', [ function () {
|
|
return ({
|
|
restrict: 'E',
|
|
scope: {
|
|
profile: '@'
|
|
},
|
|
templateUrl: '<%= asset_path "shared/_twitter.html" %>',
|
|
link ($scope, element, attributes) {
|
|
var configProfile = {
|
|
'profile': { 'screenName': $scope.profile },
|
|
'domId': 'twitter',
|
|
'maxTweets': 1,
|
|
'enableLinks': true,
|
|
'showUser': false,
|
|
'showTime': true,
|
|
'showImages': false,
|
|
'showRetweet': true,
|
|
'showInteraction': false,
|
|
'lang': Fablab.locale
|
|
};
|
|
if ($scope.profile) {
|
|
twitterFetcher.fetch(configProfile);
|
|
}
|
|
}
|
|
});
|
|
}]);
|