aboutsummaryrefslogtreecommitdiffstats
path: root/skip-process-bug.js
blob: 3972893f708a29439d110c239f1663e9102556cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
jetpack.tabs.onReady(function(doc){
  var root = 'https://bugzilla.mozilla.org/',
      pages = ['attachment', 'post_bug', 'process_bug'],
      paths = pages.map(function(p) root + p + '.cgi'),
      collision = 'Mid-air collision!';
  if (paths.some(function(p) doc.location == p) && doc.title != collision) {
    var $doc = $(doc),
        mail = $doc.find('#bugzilla-body > dl').text(),
        bug = $($doc.find('.bz_alias_short_desc_container > a'));
    /* Bail if we sense a disturbance. */
    if (bug.size() != 0) {
      jetpack.notifications.show({title: 'Mail sent for ' + bug.text(), body: mail});
      doc.location = root + bug.attr('href');
    }
  }
});