Command refactor (#1271)
* Change selectors * Change openHelpPage to openInfoPage
This commit is contained in:
parent
b0f0ecd7df
commit
0420a29d77
@ -93,7 +93,7 @@
|
|||||||
},
|
},
|
||||||
"description": "Toggle text scanning on/off"
|
"description": "Toggle text scanning on/off"
|
||||||
},
|
},
|
||||||
"openHelpPage": {
|
"openInfoPage": {
|
||||||
"description": "Open the help page"
|
"description": "Open the help page"
|
||||||
},
|
},
|
||||||
"openSettingsPage": {
|
"openSettingsPage": {
|
||||||
|
@ -30,9 +30,9 @@
|
|||||||
<optgroup label="Primary Profile" id="profile-select-option-group"></optgroup>
|
<optgroup label="Primary Profile" id="profile-select-option-group"></optgroup>
|
||||||
</select></span>
|
</select></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="nav-button action-open-options" data-icon="cog" title="Options (Middle click to open in new tab)"></a>
|
<a class="nav-button action-open-settings" data-icon="cog" title="Options (Middle click to open in new tab)"></a>
|
||||||
<a class="nav-button action-open-search" data-icon="magnifying-glass" title="Search (Alt + Insert) (Middle click to open in new tab)"></a>
|
<a class="nav-button action-open-search" data-icon="magnifying-glass" title="Search (Alt + Insert) (Middle click to open in new tab)"></a>
|
||||||
<a class="nav-button action-open-help" data-icon="question-mark" title="Information"></a>
|
<a class="nav-button action-open-info" data-icon="question-mark" title="Information"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -41,13 +41,13 @@
|
|||||||
<label class="link-group">
|
<label class="link-group">
|
||||||
<span class="link-group-icon"><input type="checkbox" id="enable-search2"></span><span class="link-group-label">Enable content scanning</span>
|
<span class="link-group-icon"><input type="checkbox" id="enable-search2"></span><span class="link-group-label">Enable content scanning</span>
|
||||||
</label>
|
</label>
|
||||||
<a class="link-group action-open-options">
|
<a class="link-group action-open-settings">
|
||||||
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Options</span>
|
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Options</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="link-group action-open-search">
|
<a class="link-group action-open-search">
|
||||||
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Search</span>
|
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Search</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="link-group action-open-help">
|
<a class="link-group action-open-info">
|
||||||
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Help</span>
|
<span class="link-group-icon" data-icon="chevron"></span><span class="link-group-label">Help</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -132,7 +132,7 @@ class Backend {
|
|||||||
|
|
||||||
this._commandHandlers = new Map([
|
this._commandHandlers = new Map([
|
||||||
['toggleTextScanning', this._onCommandToggleTextScanning.bind(this)],
|
['toggleTextScanning', this._onCommandToggleTextScanning.bind(this)],
|
||||||
['openHelpPage', this._onCommandOpenHelpPage.bind(this)],
|
['openInfoPage', this._onCommandOpenInfoPage.bind(this)],
|
||||||
['openSettingsPage', this._onCommandOpenSettingsPage.bind(this)],
|
['openSettingsPage', this._onCommandOpenSettingsPage.bind(this)],
|
||||||
['openSearchPage', this._onCommandOpenSearchPage.bind(this)],
|
['openSearchPage', this._onCommandOpenSearchPage.bind(this)],
|
||||||
['openPopupWindow', this._onCommandOpenPopupWindow.bind(this)]
|
['openPopupWindow', this._onCommandOpenPopupWindow.bind(this)]
|
||||||
@ -774,7 +774,7 @@ class Backend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onCommandOpenHelpPage() {
|
async _onCommandOpenInfoPage() {
|
||||||
await this._openInfoPage();
|
await this._openInfoPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@ class DisplayController {
|
|||||||
this._showExtensionInfo(manifest);
|
this._showExtensionInfo(manifest);
|
||||||
this._setupEnvironment();
|
this._setupEnvironment();
|
||||||
this._setupButtonEvents('.action-open-search', 'openSearchPage', chrome.runtime.getURL('/bg/search.html'));
|
this._setupButtonEvents('.action-open-search', 'openSearchPage', chrome.runtime.getURL('/bg/search.html'));
|
||||||
this._setupButtonEvents('.action-open-help', 'openHelpPage', chrome.runtime.getURL('/bg/info.html'));
|
this._setupButtonEvents('.action-open-info', 'openInfoPage', chrome.runtime.getURL('/bg/info.html'));
|
||||||
|
|
||||||
const optionsFull = await api.optionsGetFull();
|
const optionsFull = await api.optionsGetFull();
|
||||||
this._optionsFull = optionsFull;
|
this._optionsFull = optionsFull;
|
||||||
|
|
||||||
const optionsPageUrl = optionsFull.global.useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page;
|
const optionsPageUrl = optionsFull.global.useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page;
|
||||||
this._setupButtonEvents('.action-open-options', 'openSettingsPage', chrome.runtime.getURL(optionsPageUrl));
|
this._setupButtonEvents('.action-open-settings', 'openSettingsPage', chrome.runtime.getURL(optionsPageUrl));
|
||||||
|
|
||||||
const {profiles, profileCurrent} = optionsFull;
|
const {profiles, profileCurrent} = optionsFull;
|
||||||
const primaryProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null;
|
const primaryProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null;
|
||||||
|
@ -92,8 +92,8 @@
|
|||||||
},
|
},
|
||||||
"description": "Toggle text scanning on/off"
|
"description": "Toggle text scanning on/off"
|
||||||
},
|
},
|
||||||
"openHelpPage": {
|
"openInfoPage": {
|
||||||
"description": "Open the help page"
|
"description": "Open the info page"
|
||||||
},
|
},
|
||||||
"openSettingsPage": {
|
"openSettingsPage": {
|
||||||
"description": "Open the settings page"
|
"description": "Open the settings page"
|
||||||
|
Loading…
Reference in New Issue
Block a user