Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Set the default behavior.
* text=lf

*.handlebars text eol=lf
21 changes: 21 additions & 0 deletions chrome/js/modules/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ pm.layout = {
pm.request.loadRequestFromLink(link, headers);
});

$('#response-headers').on("mousedown", ".cm-link", function () {
var link = $(this).text();
var headers = $('#headers-keyvaleditor').keyvalueeditor('getValues');
pm.request.loadRequestFromLink(link, headers);
});

$('.response-tabs').on("click", "li", function () {
var section = $(this).attr('data-section');
if (section === "body") {
Expand All @@ -285,6 +291,21 @@ pm.layout = {
$('.request-meta-actions').css("display", "none");
});

var linkRegex = /(\s*<\s*)([^>]*)(\s*>[^,]*,?)/g;

var linkFunc = function (all, pre_uri, uri, post_uri) {
return Handlebars.Utils.escapeExpression(pre_uri)
+ "<span class=\"cm-link\">"
+ uri
+ "</span>"
+ Handlebars.Utils.escapeExpression(post_uri);
};

Handlebars.registerHelper('link_to_hyperlink', function(linkValue) {
var output = linkValue.replace(linkRegex, linkFunc);
return new Handlebars.SafeString(output);
});

this.attachModalHandlers();
this.setLayout();
},
Expand Down
6 changes: 6 additions & 0 deletions chrome/js/modules/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,8 @@ pm.request = {
}

this.refreshLayout();
var newRows = getUrlVars($('#url').val(), false);
$('#url-keyvaleditor').keyvalueeditor('reset', newRows);
},

isMethodWithBody:function (method) {
Expand Down Expand Up @@ -1468,6 +1470,10 @@ pm.request = {
"description":headerDetails[name.toLowerCase()]
};

if (name.toLowerCase() === "link") {
header.isLink = true;
}

vars.push(header);
}
}
Expand Down
Loading