aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-proxy-host.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-16 21:36:10 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-17 18:40:43 -0400
commit598cd32946c8e10e5aa3fcec26e3fc40af44bddf (patch)
treecd030ed1d5f60aaba15c3a1c2bec284154bfc038 /ext/fg/js/popup-proxy-host.js
parent779b4af590b7a9030de9da1005bb3d8f79c3c5d0 (diff)
Update *show* APIs to unified showContent and setContent
Diffstat (limited to 'ext/fg/js/popup-proxy-host.js')
-rw-r--r--ext/fg/js/popup-proxy-host.js23
1 files changed, 4 insertions, 19 deletions
diff --git a/ext/fg/js/popup-proxy-host.js b/ext/fg/js/popup-proxy-host.js
index f97d44ac..dcdce604 100644
--- a/ext/fg/js/popup-proxy-host.js
+++ b/ext/fg/js/popup-proxy-host.js
@@ -39,12 +39,10 @@ class PopupProxyHost {
this.apiReceiver = new FrontendApiReceiver(`popup-proxy-host#${frameId}`, {
createNestedPopup: ({parentId}) => this.createNestedPopup(parentId),
setOptions: ({id, options}) => this.setOptions(id, options),
- showOrphaned: ({id, elementRect}) => this.showOrphaned(id, elementRect),
hide: ({id, changeFocus}) => this.hide(id, changeFocus),
setVisibleOverride: ({id, visible}) => this.setVisibleOverride(id, visible),
containsPoint: ({id, x, y}) => this.containsPoint(id, x, y),
- termsShow: ({id, elementRect, writingMode, definitions, context}) => this.termsShow(id, elementRect, writingMode, definitions, context),
- kanjiShow: ({id, elementRect, writingMode, definitions, context}) => this.kanjiShow(id, elementRect, writingMode, definitions, context),
+ showContent: ({id, elementRect, writingMode, type, details}) => this.showContent(id, elementRect, writingMode, type, details),
setCustomCss: ({id, css}) => this.setCustomCss(id, css),
clearAutoPlayTimer: ({id}) => this.clearAutoPlayTimer(id)
});
@@ -94,12 +92,6 @@ class PopupProxyHost {
return await popup.setOptions(options);
}
- async showOrphaned(id, elementRect) {
- const popup = this.getPopup(id);
- elementRect = this.jsonRectToDOMRect(popup, elementRect);
- return await popup.showOrphaned(elementRect);
- }
-
async hide(id, changeFocus) {
const popup = this.getPopup(id);
return popup.hide(changeFocus);
@@ -115,18 +107,11 @@ class PopupProxyHost {
return await popup.containsPoint(x, y);
}
- async termsShow(id, elementRect, writingMode, definitions, context) {
- const popup = this.getPopup(id);
- elementRect = this.jsonRectToDOMRect(popup, elementRect);
- if (!PopupProxyHost.popupCanShow(popup)) { return false; }
- return await popup.termsShow(elementRect, writingMode, definitions, context);
- }
-
- async kanjiShow(id, elementRect, writingMode, definitions, context) {
+ async showContent(id, elementRect, writingMode, type, details) {
const popup = this.getPopup(id);
elementRect = this.jsonRectToDOMRect(popup, elementRect);
- if (!PopupProxyHost.popupCanShow(popup)) { return false; }
- return await popup.kanjiShow(elementRect, writingMode, definitions, context);
+ if (!PopupProxyHost.popupCanShow(popup)) { return Promise.resolve(false); }
+ return await popup.showContent(elementRect, writingMode, type, details);
}
async setCustomCss(id, css) {