@ascua/gravatar 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { arg } from '@ascua/decorators';
|
|
2
5
|
import avatar from '../utils/avatar';
|
|
3
6
|
import md5 from "../utils/md5";
|
|
4
7
|
|
|
5
8
|
export default class extends Component {
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
return md5(this.args.email);
|
|
9
|
-
}
|
|
10
|
+
@tracked failed = null;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
@arg size = 80;
|
|
13
|
+
|
|
14
|
+
@arg gender = 'm';
|
|
14
15
|
|
|
15
|
-
get
|
|
16
|
-
return this.args.
|
|
16
|
+
get md5() {
|
|
17
|
+
return md5(this.args.email);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
get err() {
|
|
@@ -24,8 +25,12 @@ export default class extends Component {
|
|
|
24
25
|
return `https://secure.gravatar.com/avatar/${this.md5}?s=${this.size}&d=404`;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
get
|
|
28
|
-
return
|
|
28
|
+
get current() {
|
|
29
|
+
return this.failed === this.args.email ? this.err : this.src;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@action handleError() {
|
|
33
|
+
this.failed = this.args.email;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
}
|
package/addon/styles/addon.css
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
<app-gravatar {{style width=this.size height=this.size
|
|
1
|
+
<app-gravatar {{style width=this.size height=this.size}} circular={{@circular}} ...attributes>
|
|
2
|
+
<img src={{this.current}} width={{this.size}} height={{this.size}} {{on "error" this.handleError}} />
|
|
3
|
+
</app-gravatar>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ascua/gravatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Small description for @ascua/gravatar goes here",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "https://surrealdb.com"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@ascua/modifiers": "^0.
|
|
18
|
+
"@ascua/modifiers": "^0.14.0",
|
|
19
19
|
"ember-cli-babel": "^8.2.0",
|
|
20
20
|
"ember-cli-htmlbars": "^6.3.0"
|
|
21
21
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "e9440da123a861e13175cbfa7947f129e5a69759"
|
|
30
30
|
}
|