summaryrefslogtreecommitdiff
path: root/ext/bg/context.html
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-11 18:55:09 -0500
committerGitHub <noreply@github.com>2021-02-11 18:55:09 -0500
commit94db6c69fa4aa25231e213c6d0e185197bfe3418 (patch)
tree711696bc44954c7e480ac7ed6d528f11dd2ac580 /ext/bg/context.html
parent07cd006127c23c17e5c750122a4ac6916994bc76 (diff)
Permissions button in browser action popup (#1368)
* Add key icon * Update context icon styles * Add permissions links * Show warning badge if permissions are insufficient for certain settings * Create PermissionsUtil * Use PermissionsUtil in Backend * Update SettingsController to use PermissionsUtil * Update AnkiController to use getRequiredPermissionsForAnkiFieldValue * Show the permissions buttons/links on the context page when necessary * Update MV3 compatibility
Diffstat (limited to 'ext/bg/context.html')
-rw-r--r--ext/bg/context.html30
1 files changed, 26 insertions, 4 deletions
diff --git a/ext/bg/context.html b/ext/bg/context.html
index 76e4db2a..785570d8 100644
--- a/ext/bg/context.html
+++ b/ext/bg/context.html
@@ -25,19 +25,32 @@
</div>
</label>
<div class="nav-button-container">
- <button class="nav-button action-select-profile" data-icon="profile" title="Change primary profile" hidden>
+ <button class="nav-button action-select-profile" title="Change primary profile" hidden>
+ <span class="icon" data-icon="profile"></span>
<span class="profile-select-container"><select class="profile-select" id="profile-select">
<optgroup label="Primary Profile" id="profile-select-option-group"></optgroup>
</select></span>
</button>
- <a class="nav-button action-open-settings" data-icon="cog" title="Settings" data-hotkey='["global:openSettingsPage","title","Settings ({0})"]'>
+ <a class="nav-button action-open-settings" title="Settings" data-hotkey='["global:openSettingsPage","title","Settings ({0})"]'>
+ <span class="icon" data-icon="cog"></span>
<div class="nav-button-warning-badge no-dictionaries-enabled-warning" hidden>
<div class="nav-button-warning-badge-outer"></div>
<div class="nav-button-warning-badge-inner"></div>
</div>
</a>
- <a class="nav-button action-open-search" data-icon="magnifying-glass" title="Search" data-hotkey='["global:openSearchPage","title","Search ({0})"]'></a>
- <a class="nav-button action-open-info" data-icon="question-mark" title="Information" data-hotkey='["global:openInfoPage","title","Information ({0})"]'></a>
+ <a class="nav-button action-open-permissions" title="Permissions" hidden>
+ <span class="icon" data-icon="key"></span>
+ <div class="nav-button-warning-badge permissions-required-warning" hidden>
+ <div class="nav-button-warning-badge-outer"></div>
+ <div class="nav-button-warning-badge-inner"></div>
+ </div>
+ </a>
+ <a class="nav-button action-open-search" title="Search" data-hotkey='["global:openSearchPage","title","Search ({0})"]'>
+ <span class="icon" data-icon="magnifying-glass"></span>
+ </a>
+ <a class="nav-button action-open-info" title="Information" data-hotkey='["global:openInfoPage","title","Information ({0})"]'>
+ <span class="icon" data-icon="question-mark-circle"></span>
+ </a>
</div>
</div>
@@ -53,6 +66,13 @@
<div class="flex-margin-left warning-badge no-dictionaries-enabled-warning" hidden><span class="icon" data-icon="exclamation-point-short"></span></div>
</span>
</a>
+ <a class="link-group action-open-permissions" hidden>
+ <span class="link-group-icon" data-icon="chevron"></span>
+ <span class="link-group-label">Permissions</span>
+ <span class="link-group-badge">
+ <div class="flex-margin-left warning-badge permissions-required-warning" hidden><span class="icon" data-icon="exclamation-point-short"></span></div>
+ </span>
+ </a>
<a class="link-group action-open-search">
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Search</span>
</a>
@@ -69,6 +89,8 @@
<script src="/mixed/js/hotkey-help-controller.js"></script>
<script src="/mixed/js/hotkey-util.js"></script>
+<script src="/bg/js/permissions-util.js"></script>
+
<script src="/bg/js/context-main.js"></script>
</body>