+ {{/if}}
+
+
+
+
+
diff --git a/packages/meteor-avatar/.versions b/packages/meteor-avatar/.versions
deleted file mode 100644
index 2395dce81cfe..000000000000
--- a/packages/meteor-avatar/.versions
+++ /dev/null
@@ -1,27 +0,0 @@
-base64@1.0.3
-blaze@2.1.2
-blaze-tools@1.0.3
-deps@1.0.7
-ejson@1.0.6
-geojson-utils@1.0.3
-html-tools@1.0.4
-htmljs@1.0.4
-id-map@1.0.3
-jparker:crypto-core@0.1.0
-jparker:crypto-md5@0.1.1
-jparker:gravatar@0.3.1
-jquery@1.11.3_2
-json@1.0.3
-meteor@1.1.6
-minifiers@1.1.5
-minimongo@1.0.8
-observe-sequence@1.0.6
-ordered-dict@1.0.3
-random@1.0.3
-reactive-var@1.0.5
-spacebars-compiler@1.0.6
-stylus@1.0.7
-templating@1.1.1
-tracker@1.0.7
-underscore@1.0.3
-utilities:avatar@0.7.8
diff --git a/packages/meteor-avatar/History.md b/packages/meteor-avatar/History.md
deleted file mode 100644
index 303f4a42866b..000000000000
--- a/packages/meteor-avatar/History.md
+++ /dev/null
@@ -1,8 +0,0 @@
-### 0.7.9
-
-- Adding `customImageProperty` option for storing avatars on a custom user property.
-- Refactored `getServices`.
-- Started using `getDescendantProp` instead of assuming properties are stored on the `user.profile` object.
-- Added roadmap.
-- Changed package name to `utilities:avatar`.
-- Changed logo to the only “Avatar” that matters.
\ No newline at end of file
diff --git a/packages/meteor-avatar/README.md b/packages/meteor-avatar/README.md
deleted file mode 100644
index 9069d7173035..000000000000
--- a/packages/meteor-avatar/README.md
+++ /dev/null
@@ -1,159 +0,0 @@
-![logo](https://s3.amazonaws.com/f.cl.ly/items/1u233B1J332D393D2m2j/avatar-logo.png)
-================================================================================
-
-Consolidated Avatar Template Package for Meteor
------------------------------------------------
-
-ANNOUNCEMENT
-------------
-
-I've forked @bengott's Avatar package to take over maintenance until he has time to come back to it. -Sacha
-
-BREAKING CHANGES
-----------------
-The template parameters were overhauled in version 0.5.0. The `Avatar.options` object changed quite a bit in version 0.6.0 too. And make sure you note the `defaultType`/`fallbackType` changes in version 0.7.0. Basically, things are still in a state of flux (pre-1.0.0), so check for breaking changes and read the rest of the README carefully when you update the package.
-
-
-Installation
-------------
-In your Meteor project directory, run:
-```shell
-$ meteor add utilities:avatar
-```
-Of course, you also need to add the accounts- packages for the services you're using (e.g. accounts-twitter) and accounts-ui or something similar in order to add login functionality to your app.
-
-Usage
------
-In an HTML file:
-```handlebars
-{{> avatar (user= || userId=)
- (size="large" || "small" || "extra-small")
- (shape="rounded" || "circle")
- (class="some custom classes")
- (initials="") (bgColor="") (txtColor="") }}
-```
-
-That may look like a lot of options, but they are all optional. Most of the time, your HTML will look more like this:
-```handlebars
-{{> avatar user=this shape="circle"}}
-```
-
-Optional template parameters:
- - `user` or `userId`: Either a user object or userId string, default avatar if omitted
- - `size`: Size of the avatar, either "large" (80px), "small" (30px), or "extra-small" (20px), medium/normal (50px) if omitted
- - `shape`: Used for CSS border-radius property, either "rounded" or "circle", square if omitted
- - `class`: Any custom CSS classes you'd like to define on the avatar container. The string is passed straight through to the `class` attribute on the `div` container element.
- - `initials`: Specify the initials to show for the initials avatar. The package automatically tries to determine the user's initials from profile data, but if defined, this param will override that.
- - `bgColor` and `txtColor`: Override the default colors for the initials avatar (color name or hex value string). The default colors are white (`"#FFF"`) text on a gray (`"#AAA"`) background. You could also override these default colors in your CSS if you wanted to, but this param allows you to do it directly from the template call.
-
-Global Configuration Options
-----------------------------
-The package exports a global `Avatar` object which has a property named `options` (also an object). If defined (e.g. from a config file in your app), these options override default functionality.
-
- - `fallbackType`: Determines the type of fallback to use when no image can be found via linked services (Gravatar included):
- - "default image" (the default option, which will show either the image specified by defaultImageUrl, the package's default image, or a Gravatar default image).
- OR
- - "initials" (show the user's initials)
- - `defaultImageUrl`: This will replace the included package default image URL ("packages/bengott_avatar/default.png"). It can be a relative path (e.g. "images/defaultAvatar.png").
- - `gravatarDefault`: Gravatar default option to use (overrides defaultImageUrl option and included package default image URL). Options are available [here](https://secure.gravatar.com/site/implement/images/#default-image).
- - `emailHashProperty`: This property on the user object will be used for retrieving gravatars (useful when user emails are not published).
- - `customImageProperty`: If you're storing images URLs in a property on the user object, you can specify it here.
-
-Example usage:
-- To show initials when no avatar image can be found via linked services:
-```javascript
-Avatar.options = {
- fallbackType: "initials"
-};
-```
-
-- To show the included package default image, you don't need to specify any options because this is the default functionality. However, you could specify it explicitly like so:
-```javascript
-Avatar.options = {
- fallbackType: "default image"
-};
-```
-- To show a custom default image:
-```javascript
-Avatar.options = {
- defaultImageUrl: "img/default-avatar.png" OR "http://example.com/default-avatar.png"
-};
-```
- ***Note that Gravatar's default option requires a publicly accessible URL, so it won't work when your app is running on localhost and you're using either the included package default image or a custom defaultImageUrl that is a relative path. It will work fine once deployed though.***
-
-- To show one of Gravatar's default options (e.g. "identicon"):
-```javascript
-Avatar.options = {
- gravatarDefault: "identicon"
-};
-```
- ***Note that gravatarDefault overrides defaultImageUrl and the included package default image.***
-
-- And if your app does not publish the user.emails object/property but publishes an email hash property instead, you can specify it like this (the Gravatar package generates a hash internally when you give it an email too; this just allows you to decouple those two steps so as not to make all your users' emails public):
-```javascript
-Avatar.options = {
- emailHashProperty: "email_hash"
-};
-```
-
-Test App
---------
-The app I use to test Avatar is available here:
-https://github.com/bengott/avatar-tester
-
-How the package chooses an avatar
----------------------------------
-Given a user object or userId string, Avatar will retrieve the user's image with the following priority:
- 1. Twitter
- 2. Facebook
- 3. Google
- 4. GitHub
- 5. Instagram
- 6. Gravatar, which will try to return an avatar matching the user's email address/hash. If it can't find one, then:
- - If `Avatar.options.fallbackType` is "initials", Gravatar returns a 404 (Not Found) response.
- - Else,
- - If `Avatar.options.gravatarDefault` is valid, Gravatar will return a default image (e.g. an identicon).
- - If `Avatar.options.gravatarDefault` is invalid or undefined, Gravatar will return either the image referenced by `Avatar.options.defaultImageUrl` or the included default image.
- 7. If no image can be retrieved, the user's initials will be shown.
- 8. More to come...
-
-**Required Fields/Properties on the User Object**
-
-Since fields in `user.services` contain security info, it's often wise to restrict access to those in publications, e.g.:
-```javascript
-UsersCollection.find({ /* query */ }, {
- fields: {
- //...
- "services.facebook.id" : true
- //...
- }
-});
-```
-
-Fields used to get avatar image (one per service):
-```javascript
-"services.twitter.profile_image_url_https"
-"services.facebook.id"
-"services.google.picture"
-"services.github.username"
-"services.instagram.profile_picture"
-```
-
-Fields used to form initials (if needed):
-```javascript
- "profile.firstName"
- "profile.lastName"
- "profile.familyName"
- "profile.secondName"
- "profile.name"
-```
-
-**Linked Services/Accounts:**
-By default, the Meteor accounts system creates a separate user account for each service you login with. In order to merge those accounts together, you'd need to use a package like [accounts-meld](https://atmospherejs.com/splendido/accounts-meld) or [link-accounts](https://atmospherejs.com/bozhao/link-accounts). In the future, the plan is to add UI to allow the user to select which avatar they want to use ([Issue #10](https://github.com/bengott/meteor-avatar/issues/10)) and/or upload their own image ([Issue #9](https://github.com/bengott/meteor-avatar/issues/9)).
-
-Credits
--------
-- [Sacha Greif](https://github.com/SachaG), for [suggesting the idea on crater.io](http://crater.io/posts/BfMsgzs5AzEdp6Byu)
-- [Shai Alon](https://github.com/shaialon), for [contributing the Gravatar functionality to Telescope](https://github.com/TelescopeJS/Telescope/pull/436) that [I later modified](https://github.com/TelescopeJS/Telescope/pull/438)
-- [Jérémie Parker](https://github.com/p-j), for providing the [gravatar package](https://github.com/p-j/meteor-gravatar)
-- [Everyone who has contributed](https://github.com/bengott/meteor-avatar/graphs/contributors) to this project. :)
diff --git a/packages/meteor-avatar/Roadmap.md b/packages/meteor-avatar/Roadmap.md
deleted file mode 100644
index 638cb72e3db5..000000000000
--- a/packages/meteor-avatar/Roadmap.md
+++ /dev/null
@@ -1,4 +0,0 @@
-### Roadmap
-
-- Make `getInitials` code more flexible (accept options to specify where to look for initials).
-- Make every CSS class prefixable with a custom prefix.
\ No newline at end of file
diff --git a/packages/meteor-avatar/default.png b/packages/meteor-avatar/default.png
deleted file mode 100644
index 1695c1157d27..000000000000
Binary files a/packages/meteor-avatar/default.png and /dev/null differ
diff --git a/packages/meteor-avatar/export.js b/packages/meteor-avatar/export.js
deleted file mode 100644
index 6acba8aa1687..000000000000
--- a/packages/meteor-avatar/export.js
+++ /dev/null
@@ -1,121 +0,0 @@
-// Avatar object to be exported
-Avatar = {
-
- // If defined (e.g. from a startup config file in your app), these options
- // override default functionality
- options: {
-
- // Determines the type of fallback to use when no image can be found via
- // linked services (Gravatar included):
- // "default image" (the default option, which will show either the image
- // specified by defaultImageUrl, the package's default image, or a Gravatar
- // default image)
- // OR
- // "initials" (show the user's initials).
- fallbackType: '',
-
- // This will replace the included default avatar image's URL
- // ('packages/bengott_avatar/default.png'). It can be a relative path
- // (relative to website's base URL, e.g. 'images/defaultAvatar.png').
- defaultImageUrl: '',
-
- // This property name will be used to fetch an avatar url from the user's profile
- // (e.g. 'avatar'). If this property is set and a property of that name exists
- // on the user's profile (e.g. user.profile.avatar) that property will be used
- // as the avatar url.
- customImageProperty: '',
-
- // Gravatar default option to use (overrides default image URL)
- // Options are available at:
- // https://secure.gravatar.com/site/implement/images/#default-image
- gravatarDefault: '',
-
- // This property on the user object will be used for retrieving gravatars
- // (useful when user emails are not published).
- emailHashProperty: ''
- },
-
- // Get the initials of the user
- getInitials: function (user) {
-
- var initials = '';
- var name = '';
- var parts = [];
-
- if (user && user.profile && user.profile.firstName) {
- initials = user.profile.firstName.charAt(0).toUpperCase();
-
- if (user.profile.lastName) {
- initials += user.profile.lastName.charAt(0).toUpperCase();
- }
- else if (user.profile.familyName) {
- initials += user.profile.familyName.charAt(0).toUpperCase();
- }
- else if (user.profile.secondName) {
- initials += user.profile.secondName.charAt(0).toUpperCase();
- }
- }
- else {
- if (user && user.profile && user.profile.name) {
- name = user.profile.name;
- }
- else if (user && user.username) {
- name = user.username;
- }
-
- parts = name.split(' ');
- // Limit getInitials to first and last initial to avoid problems with
- // very long multi-part names (e.g. "Jose Manuel Garcia Galvez")
- initials = _.first(parts).charAt(0).toUpperCase();
- if (parts.length > 1) {
- initials += _.last(parts).charAt(0).toUpperCase();
- }
- }
-
- return initials;
- },
-
- // Get the url of the user's avatar
- getUrl: function (user) {
-
- var url = '';
- var defaultUrl, svc;
-
- if (user) {
- svc = getService(user);
- if (svc === 'twitter') {
- // use larger image (200x200 is smallest custom option)
- url = user.services.twitter.profile_image_url_https.replace('_normal.', '_200x200.');
- }
- else if (svc === 'facebook') {
- // use larger image (~200x200)
- url = 'https://graph.facebook.com/' + user.services.facebook.id + '/picture?type=large';
- }
- else if (svc === 'google') {
- url = user.services.google.picture;
- }
- else if (svc === 'github') {
- url = 'https://avatars.githubusercontent.com/' + user.services.github.username + '?s=200';
- }
- else if (svc === 'instagram') {
- url = user.services.instagram.profile_picture;
- }
- else if (svc === "custom") {
- url = getDescendantProp(user, Avatar.options.customImageProperty);
- }
- else if (svc === 'none') {
- defaultUrl = Avatar.options.defaultImageUrl || 'packages/bengott_avatar/default.png';
- // If it's a relative path (no '//' anywhere), complete the URL
- if (defaultUrl.indexOf('//') === -1) {
- // Strip starting slash if it exists
- if (defaultUrl.charAt(0) === '/') defaultUrl = defaultUrl.slice(1);
- // Then add the relative path to the server's base URL
- defaultUrl = Meteor.absoluteUrl() + defaultUrl;
- }
- url = getGravatarUrl(user, defaultUrl);
- }
- }
-
- return url;
- }
-};
diff --git a/packages/meteor-avatar/helpers.js b/packages/meteor-avatar/helpers.js
deleted file mode 100644
index dfc9488bbc93..000000000000
--- a/packages/meteor-avatar/helpers.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Get the account service to use for the user's avatar
-// Priority: Twitter > Facebook > Google > GitHub > Instagram
-getService = function (user) {
- var services = user && user.services;
- var customProp = user && Avatar.options.customImageProperty;
- if (customProp && getDescendantProp(user, customProp)) { return 'custom'; }
- else if (services && services.twitter) { return 'twitter'; }
- else if (services && services.facebook) { return 'facebook'; }
- else if (services && services.google) { return 'google'; }
- else if (services && services.github) { return 'github'; }
- else if (services && services.instagram) { return 'instagram'; }
- else { return 'none'; }
-};
-
-getGravatarUrl = function (user, defaultUrl) {
- var gravatarDefault;
- var validGravatars = ['404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'blank'];
-
- // Initials are shown when Gravatar returns 404.
- if (Avatar.options.fallbackType !== 'initials') {
- var valid = _.contains(validGravatars, Avatar.options.gravatarDefault);
- gravatarDefault = valid ? Avatar.options.gravatarDefault : defaultUrl;
- }
- else {
- gravatarDefault = '404';
- }
-
- var options = {
- // NOTE: Gravatar's default option requires a publicly accessible URL,
- // so it won't work when your app is running on localhost and you're
- // using an image with either the standard default image URL or a custom
- // defaultImageUrl that is a relative path (e.g. 'images/defaultAvatar.png').
- default: gravatarDefault,
- size: 200, // use 200x200 like twitter and facebook above (might be useful later)
- secure: true
- };
-
- var emailOrHash = getEmailOrHash(user);
- return Gravatar.imageUrl(emailOrHash, options);
-};
-
-// Get the user's email address or (if the emailHashProperty is defined) hash
-getEmailOrHash = function (user) {
- var emailOrHash;
- if (user && Avatar.options.emailHashProperty && !!getDescendantProp(user, Avatar.options.emailHashProperty)) {
- emailOrHash = getDescendantProp(user, Avatar.options.emailHashProperty);
- }
- else if (user && user.emails) {
- emailOrHash = user.emails[0].address; // TODO: try all emails
- }
- else {
- // If all else fails, return 32 zeros (trash hash, hehe) so that Gravatar
- // has something to build a URL with at least.
- emailOrHash = '00000000000000000000000000000000';
- }
- return emailOrHash;
-};
diff --git a/packages/meteor-avatar/package.js b/packages/meteor-avatar/package.js
deleted file mode 100644
index b1de2ccf5166..000000000000
--- a/packages/meteor-avatar/package.js
+++ /dev/null
@@ -1,30 +0,0 @@
-Package.describe({
- name: "utilities:avatar",
- summary: "Consolidated user avatar template (twitter, facebook, gravatar, etc.)",
- version: "0.7.10",
- git: "https://github.com/bengott/meteor-avatar"
-});
-
-Package.onUse(function(api) {
- api.versionsFrom(['METEOR@0.9.4.1', 'METEOR@1.1.0.1']);
- api.use(['templating', 'stylus', 'reactive-var'], ['client']);
- api.use(['underscore', 'jparker:gravatar@0.3.1'], ['client', 'server']);
- api.addFiles(
- [
- 'template/avatar.html',
- 'template/avatar.js',
- 'template/avatar.styl'
- ],
- ['client']
- );
- api.addFiles(
- [
- 'utils.js',
- 'export.js',
- 'helpers.js',
- 'default.png'
- ],
- ['client', 'server']
- );
- api.export('Avatar');
-});
diff --git a/packages/meteor-avatar/template/avatar.html b/packages/meteor-avatar/template/avatar.html
deleted file mode 100644
index 593063a1ca90..000000000000
--- a/packages/meteor-avatar/template/avatar.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-