1
1
var abp = abp || { } ;
2
- ( ( ) => {
2
+
3
+ ( function ( ) {
3
4
if ( ! Swal ) {
4
5
return ;
5
6
}
6
-
7
7
/* MESSAGE **************************************************/
8
8
9
- let showMessage = ( type , message , title , isHtml , options ) => {
9
+
10
+ var showMessage = function showMessage ( type , message , title , isHtml , options ) {
10
11
if ( ! title ) {
11
12
title = message ;
12
13
message = undefined ;
@@ -15,8 +16,7 @@ var abp = abp || {};
15
16
options = options || { } ;
16
17
options . title = title ;
17
18
options . icon = type ;
18
- options . confirmButtonText =
19
- options . confirmButtonText || abp . localization . abpWeb ( "Ok" ) ;
19
+ options . confirmButtonText = options . confirmButtonText || abp . localization . abpWeb ( "Ok" ) ;
20
20
21
21
if ( isHtml ) {
22
22
options . html = message ;
@@ -27,30 +27,24 @@ var abp = abp || {};
27
27
return Swal . fire ( options ) ;
28
28
} ;
29
29
30
- abp . message . info = ( message , title , isHtml , options ) => {
30
+ abp . message . info = function ( message , title , isHtml , options ) {
31
31
return showMessage ( "info" , message , title , isHtml , options ) ;
32
32
} ;
33
33
34
- abp . message . success = ( message , title , isHtml , options ) => {
34
+ abp . message . success = function ( message , title , isHtml , options ) {
35
35
return showMessage ( "success" , message , title , isHtml , options ) ;
36
36
} ;
37
37
38
- abp . message . warn = ( message , title , isHtml , options ) => {
38
+ abp . message . warn = function ( message , title , isHtml , options ) {
39
39
return showMessage ( "warning" , message , title , isHtml , options ) ;
40
40
} ;
41
41
42
- abp . message . error = ( message , title , isHtml , options ) => {
42
+ abp . message . error = function ( message , title , isHtml , options ) {
43
43
return showMessage ( "error" , message , title , isHtml , options ) ;
44
44
} ;
45
45
46
- abp . message . confirm = (
47
- message ,
48
- titleOrCallback ,
49
- callback ,
50
- isHtml ,
51
- options
52
- ) => {
53
- let title = undefined ;
46
+ abp . message . confirm = function ( message , titleOrCallback , callback , isHtml , options ) {
47
+ var title = undefined ;
54
48
55
49
if ( typeof titleOrCallback === "function" ) {
56
50
callback = titleOrCallback ;
@@ -61,11 +55,8 @@ var abp = abp || {};
61
55
options = options || { } ;
62
56
options . title = title ? title : abp . localization . abpWeb ( "AreYouSure" ) ;
63
57
options . icon = "warning" ;
64
-
65
- options . confirmButtonText =
66
- options . confirmButtonText || abp . localization . abpWeb ( "Yes" ) ;
67
- options . cancelButtonText =
68
- options . cancelButtonText || abp . localization . abpWeb ( "Cancel" ) ;
58
+ options . confirmButtonText = options . confirmButtonText || abp . localization . abpWeb ( "Yes" ) ;
59
+ options . cancelButtonText = options . cancelButtonText || abp . localization . abpWeb ( "Cancel" ) ;
69
60
options . showCancelButton = true ;
70
61
71
62
if ( isHtml ) {
@@ -78,96 +69,60 @@ var abp = abp || {};
78
69
callback && callback ( result . value ) ;
79
70
} ) ;
80
71
} ;
81
-
82
72
/* NOTIFICATION *********************************************/
83
73
84
- const Toast = Swal . mixin ( {
74
+
75
+ var Toast = Swal . mixin ( {
85
76
toast : true ,
86
77
position : "bottom-end" ,
87
78
showConfirmButton : false ,
88
- timer : 3000 ,
79
+ timer : 3000
89
80
} ) ;
90
81
91
- let showNotification = ( type , message , title , options ) => {
92
- const icon = options . customClass . icon
93
- ? `<i class="mr-2 text-light ${ options . customClass . icon } "></i>`
94
- : "" ;
82
+ var showNotification = function showNotification ( type , message , title , options ) {
83
+ var icon = options . customClass . icon ? "<i class=\"mr-2 text-light " . concat ( options . customClass . icon , "\"></i>" ) : "" ;
95
84
96
85
if ( title ) {
97
- options . title = ` ${ icon } <span class="text-light"> ${ title } </span>` ;
86
+ options . title = "" . concat ( icon , " <span class=\ "text-light\">" ) . concat ( title , " </span>" ) ;
98
87
}
99
88
100
- options . html = `${ title ? "" : icon }
101
- <span class="text-light">${ message } </span>` ;
102
-
89
+ options . html = "" . concat ( title ? "" : icon , "\n <span class=\"text-light\">" ) . concat ( message , "</span>" ) ;
103
90
Toast . fire ( options ) ;
104
91
} ;
105
92
106
- abp . notify . success = ( message , title , options ) => {
107
- showNotification (
108
- "success" ,
109
- message ,
110
- title ,
111
- Object . assign (
112
- {
113
- background : "#34bfa3" ,
114
- customClass : {
115
- icon : "fas fa-check-circle" ,
116
- } ,
117
- } ,
118
- options
119
- )
120
- ) ;
93
+ abp . notify . success = function ( message , title , options ) {
94
+ showNotification ( "success" , message , title , Object . assign ( {
95
+ background : "#34bfa3" ,
96
+ customClass : {
97
+ icon : "fas fa-check-circle"
98
+ }
99
+ } , options ) ) ;
121
100
} ;
122
101
123
- abp . notify . info = ( message , title , options ) => {
124
- showNotification (
125
- "info" ,
126
- message ,
127
- title ,
128
- Object . assign (
129
- {
130
- background : "#36a3f7" ,
131
- customClass : {
132
- icon : "fas fa-info-circle" ,
133
- } ,
134
- } ,
135
- options
136
- )
137
- ) ;
102
+ abp . notify . info = function ( message , title , options ) {
103
+ showNotification ( "info" , message , title , Object . assign ( {
104
+ background : "#36a3f7" ,
105
+ customClass : {
106
+ icon : "fas fa-info-circle"
107
+ }
108
+ } , options ) ) ;
138
109
} ;
139
110
140
- abp . notify . warn = ( message , title , options ) => {
141
- showNotification (
142
- "warning" ,
143
- message ,
144
- title ,
145
- Object . assign (
146
- {
147
- background : "#ffb822" ,
148
- customClass : {
149
- icon : "fas fa-exclamation-triangle" ,
150
- } ,
151
- } ,
152
- options
153
- )
154
- ) ;
111
+ abp . notify . warn = function ( message , title , options ) {
112
+ showNotification ( "warning" , message , title , Object . assign ( {
113
+ background : "#ffb822" ,
114
+ customClass : {
115
+ icon : "fas fa-exclamation-triangle"
116
+ }
117
+ } , options ) ) ;
155
118
} ;
156
119
157
- abp . notify . error = ( message , title , options ) => {
158
- showNotification (
159
- "error" ,
160
- message ,
161
- title ,
162
- Object . assign (
163
- {
164
- background : "#f4516c" ,
165
- customClass : {
166
- icon : "fas fa-exclamation-circle" ,
167
- } ,
168
- } ,
169
- options
170
- )
171
- ) ;
120
+ abp . notify . error = function ( message , title , options ) {
121
+ showNotification ( "error" , message , title , Object . assign ( {
122
+ background : "#f4516c" ,
123
+ customClass : {
124
+ icon : "fas fa-exclamation-circle"
125
+ }
126
+ } , options ) ) ;
172
127
} ;
173
- } ) ( ) ;
128
+ } ) ( ) ;
0 commit comments