Skip to content
This repository was archived by the owner on Nov 4, 2019. It is now read-only.

Commit d418348

Browse files
Merge pull request #19 from prakhar1989/proxying
Added tick icon for feedback on filter value - https://github.com/a85/Po...
2 parents bfa9b21 + ecab6e8 commit d418348

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

extension/assets/tick.png

1.65 KB
Loading

extension/css/main.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,20 @@ ol li {
9999
white-space: pre; /* CSS 2.0 */
100100
white-space: pre-wrap; /* CSS 2.1 */
101101
white-space: pre-line; /* CSS 3.0 */
102-
white-space: -pre-wrap; /* Opera 4-6 */
103-
white-space: -o-pre-wrap; /* Opera 7 */
104-
white-space: -moz-pre-wrap; /* Mozilla */
105-
word-wrap: break-word; /* IE 5+ */
102+
word-wrap: break-word;
106103
}
107104

108105
#delete-log {
109106
float: right;
110107
margin-right: 10px;
111108
margin-top: 52px;
112109
}
110+
111+
#tick-icon {
112+
-webkit-transition: opacity 0.3s ease-in-out;
113+
transition: opacity 0.3s ease-in-out;
114+
}
115+
116+
.show { opacity: 1; }
117+
118+
.hide { opacity: 0; }

extension/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ <h5>Request capture</h5>
1919
</label>
2020
<h5>Filter requests</h5>
2121
<input type="text" id="filterRequest" placeholder="filter by domain">
22+
<img src="assets/tick.png" id="tick-icon" width="20px" class="hide" />
2223
<a href="#" id="delete-log" title="clear logs"><img src="assets/delete.png" /></a>
2324
<div class="logger-area">
2425
<h5>Last 10 requests</h5>

extension/js/index_page.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
var toggleSwitch = document.getElementById('postManSwitch');
33
var filterUrlInput = document.getElementById('filterRequest');
44
var deleteBtn = document.getElementById('delete-log');
5+
var tickIcon = document.getElementById('tick-icon');
56

67
// this port is available as soon as popup is opened
78
var popupPort = chrome.runtime.connect({name: 'POPUPCHANNEL'});
@@ -46,6 +47,15 @@ function showLogs(items, container) {
4647
}
4748
}
4849

50+
function setTickIconVisibility(){
51+
var domain = filterUrlInput.value;
52+
if (domain.length && domain != ".*") {
53+
tickIcon.className = "show";
54+
} else {
55+
tickIcon.className = "hide";
56+
}
57+
}
58+
4959
function setOptions(options) {
5060
if (options.isCaptureStateEnabled !== appOptions.toggleSwitchState) {
5161
toggleSwitch.checked = appOptions.toggleSwitchState = options.isCaptureStateEnabled;
@@ -62,7 +72,9 @@ toggleSwitch.addEventListener('click', function() {
6272
}, false);
6373

6474
filterUrlInput.addEventListener('input', function() {
75+
var domain = filterUrlInput.value;
6576
appOptions.filterRequestUrl = filterUrlInput.value;
77+
setTickIconVisibility();
6678
popupPort.postMessage({options: appOptions});
6779
}, false);
6880

0 commit comments

Comments
 (0)