summaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-05-24 13:30:40 -0400
committerGitHub <noreply@github.com>2020-05-24 13:30:40 -0400
commitc61a87b152b91bdebe01eefdbc3fa00670a3071d (patch)
tree63a94eacdc437da1e166a72a9b4d4794df294f22 /ext/fg/js/float.js
parent83a577fa569e5a6d468e3b304313106bba3e1e49 (diff)
API refactor (#532)
* Convert api.js into a class instance * Use new api.* functions * Fix missing binds * Group functions with progress callbacks together * Change style * Fix API override not working
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 845bf7f6..12d27a9f 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -17,8 +17,7 @@
/* global
* Display
- * apiBroadcastTab
- * apiSendMessageToFrame
+ * api
* popupNestedInitialize
*/
@@ -61,7 +60,7 @@ class DisplayFloat extends Display {
yomichan.on('orphaned', this.onOrphaned.bind(this));
window.addEventListener('message', this.onMessage.bind(this), false);
- apiBroadcastTab('popupPrepared', {secret: this._secret});
+ api.broadcastTab('popupPrepared', {secret: this._secret});
}
onError(error) {
@@ -153,7 +152,7 @@ class DisplayFloat extends Display {
},
2000
);
- apiBroadcastTab('requestDocumentInformationBroadcast', {uniqueId});
+ api.broadcastTab('requestDocumentInformationBroadcast', {uniqueId});
const {title} = await promise;
return title;
@@ -176,7 +175,7 @@ class DisplayFloat extends Display {
const {token, frameId} = params;
this._token = token;
- apiSendMessageToFrame(frameId, 'popupInitialized', {secret, token});
+ api.sendMessageToFrame(frameId, 'popupInitialized', {secret, token});
}
async _configure({messageId, frameId, popupId, optionsContext, childrenSupported, scale}) {
@@ -192,7 +191,7 @@ class DisplayFloat extends Display {
this.setContentScale(scale);
- apiSendMessageToFrame(frameId, 'popupConfigured', {messageId});
+ api.sendMessageToFrame(frameId, 'popupConfigured', {messageId});
}
_isMessageAuthenticated(message) {