mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 946601 - Show an "Other" button in the requests footer, r=me
This commit is contained in:
parent
a80a62db7e
commit
fb573a5c9b
@ -471,27 +471,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new custom request form populated with the data from
|
|
||||||
* the currently selected request.
|
|
||||||
*/
|
|
||||||
cloneSelectedRequest: function() {
|
|
||||||
let selected = this.selectedItem.attachment;
|
|
||||||
|
|
||||||
// Create the element node for the network request item.
|
|
||||||
let menuView = this._createMenuView(selected.method, selected.url);
|
|
||||||
|
|
||||||
// Append a network request item to this container.
|
|
||||||
let newItem = this.push([menuView], {
|
|
||||||
attachment: Object.create(selected, {
|
|
||||||
isCustom: { value: true }
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
// Immediately switch to new request pane.
|
|
||||||
this.selectedItem = newItem;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens selected item in a new tab.
|
* Opens selected item in a new tab.
|
||||||
*/
|
*/
|
||||||
@ -521,16 +500,37 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new custom request form populated with the data from
|
||||||
|
* the currently selected request.
|
||||||
|
*/
|
||||||
|
cloneSelectedRequest: function() {
|
||||||
|
let selected = this.selectedItem.attachment;
|
||||||
|
|
||||||
|
// Create the element node for the network request item.
|
||||||
|
let menuView = this._createMenuView(selected.method, selected.url);
|
||||||
|
|
||||||
|
// Append a network request item to this container.
|
||||||
|
let newItem = this.push([menuView], {
|
||||||
|
attachment: Object.create(selected, {
|
||||||
|
isCustom: { value: true }
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
// Immediately switch to new request pane.
|
||||||
|
this.selectedItem = newItem;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a new HTTP request using the data in the custom request form.
|
* Send a new HTTP request using the data in the custom request form.
|
||||||
*/
|
*/
|
||||||
sendCustomRequest: function() {
|
sendCustomRequest: function() {
|
||||||
let selected = this.selectedItem.attachment;
|
let selected = this.selectedItem.attachment;
|
||||||
|
let data = Object.create(selected);
|
||||||
|
|
||||||
let data = Object.create(selected, {
|
if (selected.requestHeaders) {
|
||||||
headers: { value: selected.requestHeaders.headers }
|
data.headers = selected.requestHeaders.headers;
|
||||||
});
|
}
|
||||||
|
|
||||||
if (selected.requestPostData) {
|
if (selected.requestPostData) {
|
||||||
data.body = selected.requestPostData.postData.text;
|
data.body = selected.requestPostData.postData.text;
|
||||||
}
|
}
|
||||||
@ -548,7 +548,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
|
|||||||
*/
|
*/
|
||||||
closeCustomRequest: function() {
|
closeCustomRequest: function() {
|
||||||
this.remove(this.selectedItem);
|
this.remove(this.selectedItem);
|
||||||
|
|
||||||
NetMonitorView.Sidebar.toggle(false);
|
NetMonitorView.Sidebar.toggle(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -215,6 +215,11 @@
|
|||||||
data-key="flash"
|
data-key="flash"
|
||||||
label="&netmonitorUI.footer.filterFlash;">
|
label="&netmonitorUI.footer.filterFlash;">
|
||||||
</button>
|
</button>
|
||||||
|
<button id="requests-menu-filter-other-button"
|
||||||
|
class="requests-menu-filter-button requests-menu-footer-button"
|
||||||
|
data-key="other"
|
||||||
|
label="&netmonitorUI.footer.filterOther;">
|
||||||
|
</button>
|
||||||
<spacer id="requests-menu-spacer"
|
<spacer id="requests-menu-spacer"
|
||||||
class="requests-menu-footer-spacer"
|
class="requests-menu-footer-spacer"
|
||||||
flex="100"/>
|
flex="100"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user