summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r--extensions/BugModal/web/bug_modal.js50
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