diff options
author | David Lawrence <dkl@mozilla.com> | 2016-06-30 19:38:42 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2016-06-30 19:38:42 +0200 |
commit | 7c42dc6972e69b31411fbfac7e2ef0ea9242e9d4 (patch) | |
tree | 4d7c3e845609634b78c1602d7601c21f827850bc /extensions/BugModal/web | |
parent | 8b6c60262ddfa26af57a9e175059f37162288f89 (diff) | |
download | bugzilla-7c42dc6972e69b31411fbfac7e2ef0ea9242e9d4.tar.gz bugzilla-7c42dc6972e69b31411fbfac7e2ef0ea9242e9d4.tar.xz |
Bug 1283233 - Add JSON link to bug nav bar
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r-- | extensions/BugModal/web/bug_modal.js | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index 0dd9305c4..e7a182580 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -1027,29 +1027,39 @@ $(function() { }, ] }); + + var format_items = [ + { + name: 'For Printing', + callback: function() { + window.location.href = 'show_bug.cgi?format=multiple&id=' + BUGZILLA.bug_id; + } + }, + { + name: 'XML', + callback: function() { + window.location.href = 'show_bug.cgi?ctype=xml&id=' + BUGZILLA.bug_id; + } + }, + { + name: 'Legacy', + callback: function() { + window.location.href = 'show_bug.cgi?format=default&id=' + BUGZILLA.bug_id; + } + } + ]; + if (!BUGZILLA.bug_secure) { + format_items.push({ + name: 'JSON', + callback: function() { + window.location.href = 'rest/bug/' + BUGZILLA.bug_id; + } + }); + } $.contextMenu({ selector: '#format-btn', trigger: 'left', - items: [ - { - name: 'For Printing', - callback: function() { - window.location.href = 'show_bug.cgi?format=multiple&id=' + BUGZILLA.bug_id; - } - }, - { - name: 'XML', - callback: function() { - window.location.href = 'show_bug.cgi?ctype=xml&id=' + BUGZILLA.bug_id; - } - }, - { - name: 'Legacy', - callback: function() { - window.location.href = 'show_bug.cgi?format=default&id=' + BUGZILLA.bug_id; - } - } - ] + items: format_items }); // "reset to default" checkboxes |