-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add options panel #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnsahMohammad
wants to merge
7
commits into
whimboo:master
Choose a base branch
from
AnsahMohammad:sidebar-top-left
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a36de15
feat: add options pane for update-interval and rename popup -> options
AnsahMohammad cd72601
feat: add options for enable / disable of transfer of pages and tran…
AnsahMohammad de25d5d
chore: rename settings to options for consistency
AnsahMohammad 88e3f41
feat: auto close the options pane upon clicking outside
AnsahMohammad 3c1b011
chore: updated the UI of options panel
AnsahMohammad 1fffc81
fix: update MAX_BUFFER_ENTRIES when interval is updated
AnsahMohammad fcdbe85
fix: resolve MAX_BUFFER_ENTRIES bug
AnsahMohammad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="options.css" /> | ||
</head> | ||
|
||
<body> | ||
<div class="options-container"> | ||
<div class="option-row"> | ||
<label>Update Interval (s):</label> | ||
<input id="update-interval-slider" type="range" min="1" max="5" value="5"/> | ||
<input id="update-interval-value" type="text" readonly/> | ||
</div> | ||
|
||
<div class="option-row"> | ||
<label class="checkbox-label"> | ||
Transfer Pages (Windows) | ||
<input id="transfer-pages" type="checkbox" checked/> | ||
</label> | ||
</div> | ||
|
||
<div class="option-row"> | ||
<label class="checkbox-label"> | ||
Transfer Threads | ||
<input id="transfer-threads" type="checkbox" checked/> | ||
</label> | ||
</div> | ||
</div> | ||
<script src="options.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const updateIntervalSlider = document.getElementById("update-interval-slider"); | ||
const updateIntervalValue = document.getElementById("update-interval-value"); | ||
const transferThreadsCheckbox = document.getElementById("transfer-threads"); | ||
const transferWindowsCheckbox = document.getElementById("transfer-pages"); | ||
|
||
function updateInterval(ev) { | ||
browser.runtime.sendMessage({ | ||
name: "set-update-interval", | ||
interval: parseInt(ev.target.value), | ||
}) | ||
} | ||
|
||
function updateThreadsTransfer() { | ||
browser.runtime.sendMessage({ | ||
name: "set-include-threads" | ||
}); | ||
console.log("updateThreadsTransfer"); | ||
} | ||
|
||
function updateWindowsTransfer() { | ||
browser.runtime.sendMessage({ | ||
name: "set-include-windows" | ||
}); | ||
console.log("updateWindowsTransfer"); | ||
} | ||
|
||
updateIntervalSlider.addEventListener("change", updateInterval); | ||
updateIntervalSlider.addEventListener("input", ev => { | ||
updateIntervalValue.value = ev.target.value; | ||
}); | ||
updateIntervalValue.value = updateIntervalSlider.value; | ||
|
||
transferThreadsCheckbox.addEventListener("change", updateThreadsTransfer); | ||
transferWindowsCheckbox.addEventListener("change", updateWindowsTransfer); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep those comments that are not addressed with your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed these comments referred to the boolean buttons we added here:

Since we're handling this logic in
option.js
, I thought they were no longer needed.