11var abp = abp || { } ;
2- ( ( ) => {
2+
3+ ( function ( ) {
34 if ( ! Swal ) {
45 return ;
56 }
6-
77 /* MESSAGE **************************************************/
88
9- let showMessage = ( type , message , title , isHtml , options ) => {
9+
10+ var showMessage = function showMessage ( type , message , title , isHtml , options ) {
1011 if ( ! title ) {
1112 title = message ;
1213 message = undefined ;
@@ -15,8 +16,7 @@ var abp = abp || {};
1516 options = options || { } ;
1617 options . title = title ;
1718 options . icon = type ;
18- options . confirmButtonText =
19- options . confirmButtonText || abp . localization . abpWeb ( "Ok" ) ;
19+ options . confirmButtonText = options . confirmButtonText || abp . localization . abpWeb ( "Ok" ) ;
2020
2121 if ( isHtml ) {
2222 options . html = message ;
@@ -27,30 +27,24 @@ var abp = abp || {};
2727 return Swal . fire ( options ) ;
2828 } ;
2929
30- abp . message . info = ( message , title , isHtml , options ) => {
30+ abp . message . info = function ( message , title , isHtml , options ) {
3131 return showMessage ( "info" , message , title , isHtml , options ) ;
3232 } ;
3333
34- abp . message . success = ( message , title , isHtml , options ) => {
34+ abp . message . success = function ( message , title , isHtml , options ) {
3535 return showMessage ( "success" , message , title , isHtml , options ) ;
3636 } ;
3737
38- abp . message . warn = ( message , title , isHtml , options ) => {
38+ abp . message . warn = function ( message , title , isHtml , options ) {
3939 return showMessage ( "warning" , message , title , isHtml , options ) ;
4040 } ;
4141
42- abp . message . error = ( message , title , isHtml , options ) => {
42+ abp . message . error = function ( message , title , isHtml , options ) {
4343 return showMessage ( "error" , message , title , isHtml , options ) ;
4444 } ;
4545
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 ;
5448
5549 if ( typeof titleOrCallback === "function" ) {
5650 callback = titleOrCallback ;
@@ -61,11 +55,8 @@ var abp = abp || {};
6155 options = options || { } ;
6256 options . title = title ? title : abp . localization . abpWeb ( "AreYouSure" ) ;
6357 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" ) ;
6960 options . showCancelButton = true ;
7061
7162 if ( isHtml ) {
@@ -78,96 +69,60 @@ var abp = abp || {};
7869 callback && callback ( result . value ) ;
7970 } ) ;
8071 } ;
81-
8272 /* NOTIFICATION *********************************************/
8373
84- const Toast = Swal . mixin ( {
74+
75+ var Toast = Swal . mixin ( {
8576 toast : true ,
8677 position : "bottom-end" ,
8778 showConfirmButton : false ,
88- timer : 3000 ,
79+ timer : 3000
8980 } ) ;
9081
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>" ) : "" ;
9584
9685 if ( title ) {
97- options . title = ` ${ icon } <span class="text-light"> ${ title } </span>` ;
86+ options . title = "" . concat ( icon , " <span class=\ "text-light\">" ) . concat ( title , " </span>" ) ;
9887 }
9988
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>" ) ;
10390 Toast . fire ( options ) ;
10491 } ;
10592
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 ) ) ;
121100 } ;
122101
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 ) ) ;
138109 } ;
139110
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 ) ) ;
155118 } ;
156119
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 ) ) ;
172127 } ;
173- } ) ( ) ;
128+ } ) ( ) ;
0 commit comments