ng2-avatar
Advanced tools
Comparing version 2.0.6 to 2.1.1
@@ -1,2 +0,2 @@ | ||
import { OnChanges, OnInit } from "@angular/core"; | ||
import { OnChanges, OnInit } from '@angular/core'; | ||
export declare class AvatarComponent implements OnInit, OnChanges { | ||
@@ -9,2 +9,3 @@ email: string; | ||
letter: string; | ||
defaultProtocol: string; | ||
gravatarUrl: string; | ||
@@ -11,0 +12,0 @@ displayImage: boolean; |
@@ -5,2 +5,3 @@ import { Component, Input, NgModule } from '@angular/core'; | ||
/* tslint:disable component-selector */ | ||
var AvatarComponent = (function () { | ||
@@ -12,2 +13,3 @@ function AvatarComponent() { | ||
this.letter = '?'; | ||
this.defaultProtocol = null; | ||
this.displayImage = true; | ||
@@ -55,3 +57,4 @@ this.fontSize = 49; | ||
.end(); | ||
this.gravatarUrl = "//www.gravatar.com/avatar/" + hash + "?s=" + this.size + "&d=404"; | ||
var /** @type {?} */ protocol = this.defaultProtocol ? this.defaultProtocol + ':' : ''; | ||
this.gravatarUrl = protocol + "//www.gravatar.com/avatar/" + hash + "?s=" + this.size + "&d=404"; | ||
this.displayImage = true; | ||
@@ -100,3 +103,3 @@ } | ||
selector: 'avatar', | ||
template: "\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\" *ngIf=\"displayImage\" [src]=\"gravatarUrl\" (error)=\"displayImage = false;\" alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>", | ||
template: "\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\"\n *ngIf=\"displayImage\"\n [src]=\"gravatarUrl\"\n (error)=\"displayImage = false;\"\n alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>", | ||
styles: ['.avatar {text-align : center;overflow : auto;}'] | ||
@@ -116,2 +119,3 @@ },] }, | ||
'letter': [{ type: Input, args: ['letter',] },], | ||
'defaultProtocol': [{ type: Input, args: ['defaultProtocol',] },], | ||
}; | ||
@@ -118,0 +122,0 @@ |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"metadata":{"AvatarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","name":"AvatarComponent"}],"exports":[{"__symbolic":"reference","name":"AvatarComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"AvatarModule"},"providers":[]}}}},"AvatarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"avatar","template":"\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\" *ngIf=\"displayImage\" [src]=\"gravatarUrl\" (error)=\"displayImage = false;\" alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>","styles":[".avatar {text-align : center;overflow : auto;}"]}]}],"members":{"email":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["email"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["name"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["size"]}]}],"background":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["background"]}]}],"displayType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["displayType"]}]}],"letter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["letter"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"getRandomColor":[{"__symbolic":"method"}],"getLetter":[{"__symbolic":"method"}],"getAvatar":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}]}}},"origins":{"AvatarModule":"./index","AvatarComponent":"./avatar.component"},"importAs":"ng2-avatar"} | ||
{"__symbolic":"module","version":3,"metadata":{"AvatarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","name":"AvatarComponent"}],"exports":[{"__symbolic":"reference","name":"AvatarComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"AvatarModule"},"providers":[]}}}},"AvatarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"avatar","template":"\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\"\n *ngIf=\"displayImage\"\n [src]=\"gravatarUrl\"\n (error)=\"displayImage = false;\"\n alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>","styles":[".avatar {text-align : center;overflow : auto;}"]}]}],"members":{"email":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["email"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["name"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["size"]}]}],"background":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["background"]}]}],"displayType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["displayType"]}]}],"letter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["letter"]}]}],"defaultProtocol":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["defaultProtocol"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"getRandomColor":[{"__symbolic":"method"}],"getLetter":[{"__symbolic":"method"}],"getAvatar":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}]}}},"origins":{"AvatarModule":"./index","AvatarComponent":"./avatar.component"},"importAs":"ng2-avatar"} |
@@ -7,2 +7,3 @@ (function (global, factory) { | ||
/* tslint:disable component-selector */ | ||
var AvatarComponent = (function () { | ||
@@ -14,2 +15,3 @@ function AvatarComponent() { | ||
this.letter = '?'; | ||
this.defaultProtocol = null; | ||
this.displayImage = true; | ||
@@ -57,3 +59,4 @@ this.fontSize = 49; | ||
.end(); | ||
this.gravatarUrl = "//www.gravatar.com/avatar/" + hash + "?s=" + this.size + "&d=404"; | ||
var /** @type {?} */ protocol = this.defaultProtocol ? this.defaultProtocol + ':' : ''; | ||
this.gravatarUrl = protocol + "//www.gravatar.com/avatar/" + hash + "?s=" + this.size + "&d=404"; | ||
this.displayImage = true; | ||
@@ -102,3 +105,3 @@ } | ||
selector: 'avatar', | ||
template: "\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\" *ngIf=\"displayImage\" [src]=\"gravatarUrl\" (error)=\"displayImage = false;\" alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>", | ||
template: "\n <div class=\"avatar\" *ngIf=\"props\"\n [style.background-color]=\"props.background\"\n [style.width]=\"props.size\"\n [style.line-height]='props.lineheight'\n [style.height]='props.size'\n [style.font-size]='props.fontSize'\n [style.border-radius]='props.borderradius'\n [style.text-align]=\"props.textalign\">\n <img style=\"vertical-align: top;\"\n *ngIf=\"displayImage\"\n [src]=\"gravatarUrl\"\n (error)=\"displayImage = false;\"\n alt=\"{{name}} | {{letter}}\"/>\n <span *ngIf=\"!displayImage\" [style.color]='fontColor'>{{letter}}</span>\n </div>", | ||
styles: ['.avatar {text-align : center;overflow : auto;}'] | ||
@@ -118,2 +121,3 @@ },] }, | ||
'letter': [{ type: _angular_core.Input, args: ['letter',] },], | ||
'defaultProtocol': [{ type: _angular_core.Input, args: ['defaultProtocol',] },], | ||
}; | ||
@@ -120,0 +124,0 @@ |
{ | ||
"name": "ng2-avatar", | ||
"version": "2.0.6", | ||
"version": "2.1.1", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -58,2 +58,3 @@ # ng2-avatar | ||
| letter | string | ? | These are the default letter | | ||
| defaultProtocol | string | null | specifies a protocol or uses protocol-agnostic gravatar url when empty | | ||
@@ -60,0 +61,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20617
333
74