show/hide this revision's text 5 another version

Update: A bulk-hiding button has been added to the bottom of the admin notifications page. It will be available in FogBugz 8.6.

Here's another BugMonkey script that builds on Rich's idea. This one can be stored permanently since it requires that you click the "hide all" link for the action to occur.

name:          Hide all admin notifications
description:   Adds a link to the notifications page to let you dismiss all in one go
author:        Rob Sobers, Adam Wishneusky
version:       1.0.0.0

1.1.0.0

js:

if (window.location.href.indexOf("pg=pgNotifications") >= 0 && $("p:contains('There are no notifications.')").size() == 0) {
  $('.editInstructions').after('<p>Click to <a id="hideall" href="veryblank.html">hide all notifications</a>.</p>')
}
$('#hideall').click( function() {
  var links = $("a").each( ("a");
  var linksremaining = links.length;
  links.each( function () {
    if ($(this).text() == "Hide Notification"){
      $.get($(this).attr("href"));
    .get($(this).attr("href"),function(){
        linksremaining--;
      });
    }
  });
  if (linksremaining < 1) {
    window.location.reload();
  //you may need to comment out the reload
                            //since it could fire before the loop
                            //is complete. It's a dirty hack of a 
                            //fix, but it will work.
  }
  return false;
});
show/hide this revision's text 4 updated...fixed!

Update: A bulk-hiding button has been added to the bottom of the admin notifications page. It will be available in FogBugz 8.6.

Here's another BugMonkey script that builds on Rich's idea. This one can be stored permanently since it requires that you click the "hide all" link for the action to occur.

name:          Hide all admin notifications
description:   Adds a link to the notifications page to let you dismiss all in one go
author:        Rob Sobers
version:       1.0.0.0

js:

if (window.location.href.indexOf("pg=pgNotifications") >= 0 && $("p:contains('There are no notifications.')").size() == 0) {
  $('.editInstructions').after('<p>Click to <a id="hideall" href="veryblank.html">hide all notifications</a>.</p>')
}
$('#hideall').click( function() {
  $("a").each( function () {
    if ($(this).text() == "Hide Notification"){
      $.get($(this).attr("href"));
    }
  });
  window.location.reload(); //you may need to comment out the reload
                            //since it could fire before the loop
                            //is complete. It's a dirty hack of a 
                            //fix, but it will work.
  return false;
});
show/hide this revision's text 3 bugmonkey 2 format

Here's another BugMonkey script that builds on Rich's idea. This one can be stored permanently since it requires that you click the "hide all" link for the action to occur.

name:          Hide all admin notifications
description:   Adds a link to the notifications page to let you dismiss all in one go
author:        Rob Sobers
version:       1.0.0.0

js:

if (window.location.href.indexOf("pg=pgNotifications") >= 0 && $("p:contains('There are no notifications.')").size() == 0) {
  $('.editInstructions').after('<p>Click to <a id="hideall" href="veryblank.html">hide all notifications</a>.</p>')
}
$('#hideall').click( function() {
  $("a").each( function () {
    if ($(this).text() == "Hide Notification"){
      $.get($(this).attr("href"));
    }
  });
  window.location.reload(); //you may need to comment out the reload
                            //since it could fire before the loop
                            //is complete. It's a dirty hack of a 
                            //fix, but it will work.
  return false;
});
show/hide this revision's text 2 added comment about the reload function.
show/hide this revision's text 1