File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed
eform-client/src/app/plugins/modules/shared/services Expand file tree Collapse file tree 3 files changed +57
-1
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 146146 </ItemGroup >
147147 <ItemGroup >
148148 <Compile Include =" Consts\EformRoles.cs" />
149- <Compile Include =" Helpers\LocaleHelper.cs" />
149+ <Compile Include =" Infrastructure\ Helpers\LocaleHelper.cs" />
150150 <Compile Include =" Infrastructure\Data\BaseDbContext.cs" />
151151 <Compile Include =" Infrastructure\Data\Base\BaseEntity.cs" />
152152 <Compile Include =" Infrastructure\Data\Entities\EformRole.cs" />
Original file line number Diff line number Diff line change 1+ import { Injectable } from '@angular/core' ;
2+ // import PNotify from 'pnotify';
3+ import 'pnotify/dist/pnotify.css' ;
4+ import 'pnotify/dist/pnotify.buttons.js' ;
5+ import 'pnotify/dist/pnotify.buttons.css' ;
6+
7+ declare const PNotify : any ;
8+
9+ @Injectable ( )
10+ export class NotifyPnService {
11+ pnotifySettings : any ;
12+ isDesktop = false ;
13+
14+ constructor ( ) {
15+ this . pnotifySettings = Object . assign ( { styling : 'bootstrap3' } , { } ) ;
16+
17+ if ( typeof this . pnotifySettings . styling === 'undefined' ) {
18+ throw new Error ( 'pnotifySettings.styling must be a string' ) ;
19+ }
20+ }
21+
22+ private desktop ( ) {
23+ PNotify . desktop . permission ( ) ;
24+ this . isDesktop = true ;
25+ }
26+
27+ private pnotify ( opts ) {
28+ opts . styling = this . pnotifySettings . styling ;
29+ PNotify . prototype . options . delay = 2000 ;
30+ if ( this . isDesktop ) {
31+ opts . desktop = opts . desktop || { } ;
32+ opts . desktop . desktop = true ;
33+ }
34+ return new PNotify ( opts ) ;
35+ }
36+
37+ success ( opts ) {
38+ opts . type = 'success' ;
39+ return this . pnotify ( opts ) ;
40+ }
41+
42+ notice ( opts ) {
43+ opts . type = 'notice' ;
44+ return this . pnotify ( opts ) ;
45+ }
46+
47+ error ( opts ) {
48+ opts . type = 'error' ;
49+ return this . pnotify ( opts ) ;
50+ }
51+
52+ info ( opts ) {
53+ opts . type = 'info' ;
54+ return this . pnotify ( opts ) ;
55+ }
56+ }
You can’t perform that action at this time.
0 commit comments