Merge pull request #64 from edisonaugusthy/master
Added Copy response Button
This commit is contained in:
@@ -234,6 +234,16 @@ ol li {
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.flex-wrap{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.btn-copy{
|
||||
padding: 6px 14px;
|
||||
font-size: 11px;
|
||||
margin-right: 15px;
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: $responsiveWidth) {
|
||||
ul,
|
||||
@@ -269,4 +279,4 @@ ol li {
|
||||
|
||||
.sv-error-response {
|
||||
background-color: #b71c1c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,9 +146,12 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<li>
|
||||
<div class="flex-wrap">
|
||||
<label for="body">response</label>
|
||||
<textarea name="body" rows="10" readonly>{{response.body || '(waiting to send request)'}}</textarea>
|
||||
<button v-if="response.body" name="action" class="btn-copy" @click="copyResponse">Copy Response</button>
|
||||
</div>
|
||||
<textarea name="body" rows="10" id="response-details" readonly>{{response.body || '(waiting to send request)'}}</textarea>
|
||||
</li>
|
||||
</ul>
|
||||
</pw-section>
|
||||
@@ -403,6 +406,12 @@
|
||||
event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + 2;
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
copyResponse() {
|
||||
var copyText = document.getElementById("response-details");
|
||||
copyText.select();
|
||||
document.execCommand("copy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user