File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed
components/com_media/resources/scripts/app Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ function handleError(error) {
5151 const response = JSON . parse ( error . response ) ;
5252 if ( response . message ) {
5353 notifications . error ( response . message ) ;
54+ // Check for App messages queue
55+ if ( response . messages ) {
56+ Object . keys ( response . messages ) . forEach ( ( type ) => {
57+ response . messages [ type ] . forEach ( ( message ) => {
58+ if ( type === 'error' ) {
59+ notifications . error ( message ) ;
60+ } else {
61+ notifications . notify ( message ) ;
62+ }
63+ } ) ;
64+ } ) ;
65+ }
5466 } else {
5567 switch ( error . status ) {
5668 case 409 :
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function notify(message, options) {
2020}
2121
2222const notifications = {
23- /* Send and success notification */
23+ /* Send a success notification */
2424 success : ( message , options ) => {
2525 notify ( message , {
2626 type : 'message' , // @todo rename it to success
@@ -38,6 +38,15 @@ const notifications = {
3838 } ) ;
3939 } ,
4040
41+ /* Send a general notification */
42+ notify : ( message , options ) => {
43+ notify ( message , {
44+ type : 'message' ,
45+ dismiss : true ,
46+ ...options ,
47+ } ) ;
48+ } ,
49+
4150 /* Ask the user a question */
4251 ask : ( message ) => window . confirm ( message ) ,
4352} ;
Original file line number Diff line number Diff line change @@ -701,7 +701,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file."
701701JLIB_MEDIA_ERROR_WARNFILENAME =" File name must only have alphanumeric characters and no spaces."
702702JLIB_MEDIA_ERROR_WARNFILETOOLARGE =" This file is too large to upload. You can change the limits for your site in the component options."
703703JLIB_MEDIA_ERROR_WARNFILETYPE =" This file type is not supported."
704- JLIB_MEDIA_ERROR_WARNIEXSS =" Possible IE XSS Attack found ."
704+ JLIB_MEDIA_ERROR_WARNIEXSS =" The file looks suspicious, therefore cannot be uploaded ."
705705JLIB_MEDIA_ERROR_WARNINVALID_IMG =" Not a valid image."
706706JLIB_MEDIA_ERROR_WARNINVALID_MIME =" Invalid mime type detected."
707707JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE =" Illegal mime type detected: %s"
Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file."
687687JLIB_MEDIA_ERROR_WARNFILENAME =" File name must only have alphanumeric characters and no spaces."
688688JLIB_MEDIA_ERROR_WARNFILETOOLARGE =" This file is too large to upload."
689689JLIB_MEDIA_ERROR_WARNFILETYPE =" This file type is not supported."
690- JLIB_MEDIA_ERROR_WARNIEXSS =" Possible IE XSS Attack found ."
690+ JLIB_MEDIA_ERROR_WARNIEXSS =" The file looks suspicious, therefore cannot be uploaded ."
691691JLIB_MEDIA_ERROR_WARNINVALID_IMG =" Not a valid image."
692692JLIB_MEDIA_ERROR_WARNINVALID_MIME =" Invalid mime type detected."
693693JLIB_MEDIA_ERROR_WARNINVALID_MIMETYPE =" Illegal mime type detected: %s"
You can’t perform that action at this time.
0 commit comments