mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Implemented notification system
This commit is contained in:
		@@ -10,7 +10,7 @@ ComunicWeb.common.notificationSystem = {
 | 
				
			|||||||
	 * Display a notification
 | 
						 * Display a notification
 | 
				
			||||||
	 * 
 | 
						 * 
 | 
				
			||||||
	 * @param {String} message The message to show on the screen
 | 
						 * @param {String} message The message to show on the screen
 | 
				
			||||||
     * @param {String} notifType Specify the notification type (info, error, success)
 | 
						 * @param {String} notifType Specify the notification type (info, danger, success, warning)
 | 
				
			||||||
	 * @param {Integer} notifDuration Optionnal, specify how much time the message will appear in seconds
 | 
						 * @param {Integer} notifDuration Optionnal, specify how much time the message will appear in seconds
 | 
				
			||||||
	 * @param {String} notifTitle The title of the notification
 | 
						 * @param {String} notifTitle The title of the notification
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
@@ -26,13 +26,21 @@ ComunicWeb.common.notificationSystem = {
 | 
				
			|||||||
			notifDuration = 4;
 | 
								notifDuration = 4;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Check if a notification title was specified
 | 
							//Prepare options
 | 
				
			||||||
        if(!notifTitle){
 | 
							var options = {
 | 
				
			||||||
            notifTitle = "";
 | 
								message: message,
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Check if any notification title was specified
 | 
				
			||||||
 | 
							if(notifTitle){
 | 
				
			||||||
 | 
								options.title = notifTitle;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
        //DEV - show an alert while no notif system is implemented
 | 
							$.notify(options,{
 | 
				
			||||||
        alert("notif " + notifType + ": " + message);
 | 
								// settings
 | 
				
			||||||
 | 
								type: notifType,
 | 
				
			||||||
 | 
								timer: notifDuration*1000,
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user