Sha256: 87318f4f3b00086d38db875ac639da55cc19f7e529875ed8d6729f2d2b69f5a5

Contents?: true

Size: 913 Bytes

Versions: 6

Compression:

Stored size: 913 Bytes

Contents

// Get notifications
function display_notifications(){
  jQuery.getJSON('/admin/notifications',function(data){
    if (data.notice != null) {
      display_notification_message('success',data.notice, 5000)
    }
    if (data.error != null) {
      display_notification_message('error',data.error)
    }
    if (data.warning != null) {
      display_notification_message('warning',data.warning)
    }
  });
}

function display_notification_message(type,message, delay){
  var notification_dom = '<div class="notification '+type+'"><span class="small-icons message">'+message+'</span><a href="#" class="big-icons gray-destroy"></a></div>';
  if (jQuery('#notifications').children(notification_dom).length == 0) {
    jQuery('#notifications').append(notification_dom);
    if (typeof(delay) != 'undefined')
      setTimeout("jQuery('#notifications').children('.notification."+type+":first').remove();",delay);
  }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
forgeos_core-1.9.5.rc2 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js
forgeos_core-1.9.5.rc1 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js
forgeos_core-1.9.4 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js
forgeos_core-1.9.3 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js
forgeos_core-1.9.2 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js
forgeos_core-1.9.1 app/assets/javascripts/forgeos/admin/functions/forgeos_core/notifications.js