-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Preferences out of content to the Add-ons Manager
- Loading branch information
1 parent
4dc2063
commit f98e090
Showing
7 changed files
with
83 additions
and
226 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,58 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>BugzillaJS Options</title> | ||
</head> | ||
<body> | ||
<div id="prefs"> | ||
<p>Changes take effect on the next load of a Bugzilla page.</p> | ||
<!-- | ||
See legacy/bugzilla-keyboard.js | ||
<h3>Keyboard Shortcuts</h3> | ||
<p>To view all keyboard shortcuts, type "?" on any page.</p> | ||
<div></div> | ||
--> | ||
|
||
<h3>Improve Comments</h3> | ||
<p>Make the comments on bugs more readable.</p> | ||
<div> | ||
<div><label><input id="reporter_assignee" type="checkbox">Highlight reporter and assignee comments</label></div> | ||
<div><label><input id="commentoverflow" type="checkbox">Add scrollbar to overflowing comments</label></div> | ||
<div><label><input id="hidefirst" type="checkbox">Hide the first comment if empty</label></div> | ||
</div> | ||
|
||
<h3>Show inline media</h3> | ||
<p>Show images and other types of content right in the comments.</p> | ||
<div> | ||
<div><label><input id="gallery" type="checkbox">Display images and attachments as an inline gallery</label></div> | ||
<div><label><input id="lightbox" type="checkbox">Use lightbox for images</label></div> | ||
<div><label><input id="gravatar" type="checkbox">Show gravatars in comments</label></div> | ||
</div> | ||
|
||
<h3>Improve Bugs</h3> | ||
<p>These pertain to editing bugs.</p> | ||
<div> | ||
<div><label><input id="gitcomments" type="checkbox">Style the comments like Github</label></div> | ||
<div><label><input id="removeflags" type="checkbox">Remove flags, status and blocking fields</label></div> | ||
<div><label><input id="removeaccesskeys" type="checkbox">Remove access keys</label></div> | ||
<div><label><input id="dontguess" type="checkbox">Don't guess OS and hardware</label></div> | ||
<div><label><input id="relatedbug" type="checkbox">Add a "new" link for dependent and blocking fields</label></div> | ||
<div><label><input id="browseComponent" type="checkbox">Add a "browse" link for component fields</label></div> | ||
</div> | ||
|
||
<h3>Listing Pages</h3> | ||
<p>These modify parts of the pages with lists of bugs.</p> | ||
<div> | ||
<div><label><input id="openall" type="checkbox">Option to open all bugs in tabs</label></div> | ||
</div> | ||
|
||
<h3>Miscellaneous</h3> | ||
<p>These are other tidbits that do not fit into other categories.</p> | ||
<div> | ||
<div><label><input id="savedSearchDropDown" type="checkbox">Makes saved searches into a dropdown (requires Mozilla skin)</label></div> | ||
</div> | ||
</div> | ||
<script src="options.js" defer></script> | ||
</body> | ||
</html> |
This file contains 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,20 @@ | ||
browser.storage.sync.get().then((result) => { | ||
for (let [setting, value] of Object.entries(result)) { | ||
if (!setting.startsWith("settings_")) { | ||
continue; | ||
} | ||
let checkbox = document.getElementById(setting.replace(/^settings_/, "")); | ||
if (!checkbox) { | ||
continue; | ||
} | ||
checkbox.checked = value; | ||
} | ||
console.log(result); | ||
}); | ||
|
||
document.getElementById("prefs").addEventListener("change", function onChange(event) { | ||
let setting_name = 'settings_' + event.target.id; | ||
browser.storage.sync.set({ | ||
[setting_name]: event.target.checked, | ||
}); | ||
}); |