diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-11-21 15:54:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 15:54:58 -0500 |
commit | 005f9658d98143ea1189482ae627405c8bf5a566 (patch) | |
tree | 712732685dd3300ad9403f17d2937486e3835661 /ext/js/display | |
parent | 06e70c1cd8a6e23b54ba9081caf82902820ceccd (diff) |
Action handler name disambiguation (#2018)
* Disambiguate PopupFactory action handlers
* Update HotkeyHandler action names
* Disambiguate Frontend action handlers
* Disambiguate Display action handlers
* Disambiguate PopupPreviewFrame action handlers
* Disambiguate Yomichan action handlers
* Disambiguate Frontend action handlers
* Disambiguate Display action handlers
* Disambiguate SearchDisplayController action handlers
Diffstat (limited to 'ext/js/display')
-rw-r--r-- | ext/js/display/display-audio.js | 2 | ||||
-rw-r--r-- | ext/js/display/display-resizer.js | 4 | ||||
-rw-r--r-- | ext/js/display/display.js | 20 | ||||
-rw-r--r-- | ext/js/display/search-display-controller.js | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js index 7b481034..c75423b3 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -64,7 +64,7 @@ class DisplayAudio { ['playAudioFromSource', this._onHotkeyActionPlayAudioFromSource.bind(this)] ]); this._display.registerDirectMessageHandlers([ - ['clearAutoPlayTimer', {async: false, handler: this._onMessageClearAutoPlayTimer.bind(this)}] + ['Display.clearAutoPlayTimer', {async: false, handler: this._onMessageClearAutoPlayTimer.bind(this)}] ]); this._display.on('optionsUpdated', this._onOptionsUpdated.bind(this)); this._display.on('contentClear', this._onContentClear.bind(this)); diff --git a/ext/js/display/display-resizer.js b/ext/js/display/display-resizer.js index 9fd56045..5512317a 100644 --- a/ext/js/display/display-resizer.js +++ b/ext/js/display/display-resizer.js @@ -128,7 +128,7 @@ class DisplayResizer { const {parentPopupId} = this._display; if (parentPopupId === null) { return; } - const size = await this._display.invokeParentFrame('popup.getFrameSize', {id: parentPopupId}); + const size = await this._display.invokeParentFrame('PopupFactory.getFrameSize', {id: parentPopupId}); if (this._token !== token) { return; } this._startSize = size; } @@ -158,7 +158,7 @@ class DisplayResizer { height += y - this._startOffset.y; width = Math.max(Math.max(0, handleSize.width), width); height = Math.max(Math.max(0, handleSize.height), height); - await this._display.invokeParentFrame('popup.setFrameSize', {id: parentPopupId, width, height}); + await this._display.invokeParentFrame('PopupFactory.setFrameSize', {id: parentPopupId, width, height}); } _getTouch(touchList, identifier) { diff --git a/ext/js/display/display.js b/ext/js/display/display.js index caa1ce10..697e735f 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -128,15 +128,15 @@ class Display extends EventDispatcher { ['previousEntryDifferentDictionary', () => { this._focusEntryWithDifferentDictionary(-1, true); }] ]); this.registerDirectMessageHandlers([ - ['setOptionsContext', {async: false, handler: this._onMessageSetOptionsContext.bind(this)}], - ['setContent', {async: false, handler: this._onMessageSetContent.bind(this)}], - ['setCustomCss', {async: false, handler: this._onMessageSetCustomCss.bind(this)}], - ['setContentScale', {async: false, handler: this._onMessageSetContentScale.bind(this)}], - ['configure', {async: true, handler: this._onMessageConfigure.bind(this)}], - ['visibilityChanged', {async: false, handler: this._onMessageVisibilityChanged.bind(this)}] + ['Display.setOptionsContext', {async: false, handler: this._onMessageSetOptionsContext.bind(this)}], + ['Display.setContent', {async: false, handler: this._onMessageSetContent.bind(this)}], + ['Display.setCustomCss', {async: false, handler: this._onMessageSetCustomCss.bind(this)}], + ['Display.setContentScale', {async: false, handler: this._onMessageSetContentScale.bind(this)}], + ['Display.configure', {async: true, handler: this._onMessageConfigure.bind(this)}], + ['Display.visibilityChanged', {async: false, handler: this._onMessageVisibilityChanged.bind(this)}] ]); this.registerWindowMessageHandlers([ - ['extensionUnloaded', {async: false, handler: this._onMessageExtensionUnloaded.bind(this)}] + ['Display.extensionUnloaded', {async: false, handler: this._onMessageExtensionUnloaded.bind(this)}] ]); } @@ -393,7 +393,7 @@ class Display extends EventDispatcher { close() { switch (this._pageType) { case 'popup': - this.invokeContentOrigin('closePopup'); + this.invokeContentOrigin('Frontend.closePopup'); break; case 'search': this._closeTab(); @@ -1359,7 +1359,7 @@ class Display extends EventDispatcher { { let text; try { - text = await this.invokeContentOrigin('getSelectionText'); + text = await this.invokeContentOrigin('Frontend.getSelectionText'); } catch (e) { break; } @@ -1367,7 +1367,7 @@ class Display extends EventDispatcher { } break; default: - await this.invokeContentOrigin('copySelection'); + await this.invokeContentOrigin('Frontend.copySelection'); break; } } diff --git a/ext/js/display/search-display-controller.js b/ext/js/display/search-display-controller.js index c929ceaa..10373597 100644 --- a/ext/js/display/search-display-controller.js +++ b/ext/js/display/search-display-controller.js @@ -64,9 +64,9 @@ class SearchDisplayController { ['focusSearchBox', this._onActionFocusSearchBox.bind(this)] ]); this._registerMessageHandlers([ - ['getMode', {async: false, handler: this._onMessageGetMode.bind(this)}], - ['setMode', {async: false, handler: this._onMessageSetMode.bind(this)}], - ['updateSearchQuery', {async: false, handler: this._onExternalSearchUpdate.bind(this)}] + ['SearchDisplayController.getMode', {async: false, handler: this._onMessageGetMode.bind(this)}], + ['SearchDisplayController.setMode', {async: false, handler: this._onMessageSetMode.bind(this)}], + ['SearchDisplayController.updateSearchQuery', {async: false, handler: this._onExternalSearchUpdate.bind(this)}] ]); this._updateClipboardMonitorEnabled(); |