Removed unused code
This commit is contained in:
parent
f1d23f9e3b
commit
91edc810a7
@ -51,7 +51,6 @@ HttpHeadersDialog.generateWidgetHtml = function() {
|
||||
var html = DOM.loadHTML("core", "scripts/dialogs/http-headers-dialog.html");
|
||||
var httpheaderOptions = [];
|
||||
|
||||
var httpHeaders = [];
|
||||
for (var headerLabel in theProject.httpHeaders) {
|
||||
if (theProject.httpHeaders.hasOwnProperty(headerLabel)) {
|
||||
var info = theProject.httpHeaders[headerLabel];
|
||||
@ -72,46 +71,3 @@ HttpHeadersDialog.generateWidgetHtml = function() {
|
||||
return html.replace("$HTTP_HEADER_OPTIONS$", httpheaderOptions.join(""));
|
||||
};
|
||||
|
||||
HttpHeadersDialog.Widget = function(elmts) {
|
||||
this._elmts = elmts;
|
||||
|
||||
var self = this;
|
||||
self._getSupportedHeaders();
|
||||
};
|
||||
|
||||
HttpHeadersDialog.Widget.prototype._getSupportedHeaders = function() {
|
||||
var self = this;
|
||||
$.getJSON(
|
||||
"command/core/get-http-headers",
|
||||
null,
|
||||
function(data) {
|
||||
self._renderSetHttpHeaders(data);
|
||||
},
|
||||
"json"
|
||||
);
|
||||
};
|
||||
|
||||
HttpHeadersDialog.Widget.prototype._renderSetHttpHeaders = function(data) {
|
||||
var self = this;
|
||||
var elmt = this._elmts.setHttpHeadersContainer.empty();
|
||||
|
||||
var table = $(
|
||||
'<table cols="4">' +
|
||||
'<tr><th colspan="2">'+$.i18n._('core-dialogs')["http-header-key"]+'</th><th colspan="2">'+$.i18n._('core-dialogs')["http-header-value"]+'</th></tr>' +
|
||||
'</table>'
|
||||
).appendTo($('<div>').addClass("set-httpheaders-table-wrapper").appendTo(elmt))[0];
|
||||
|
||||
var renderHeadersList = function(self,tr,header) {
|
||||
$(tr).empty();
|
||||
$("<span>"+header+"</span>").appendTo(tr.insertCell(0));
|
||||
$("<input bind=\""+header+"\" />").appendTo(tr.insertCell(2));
|
||||
};
|
||||
|
||||
for (var i = 0; i < data["http-headers"].length; i++) {
|
||||
var tr = table.insertRow(table.rows.length);
|
||||
var header = data["http-headers"][i];
|
||||
renderHeadersList(self,tr,header);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user