diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-03-14 21:42:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 21:42:33 -0400 |
commit | 4e15f923297599869e9d695940c9c56d81b0307d (patch) | |
tree | 4d509d89b638518fd123da229798dc163a082984 /ext/js | |
parent | 59ae55252e69f844ab914c1eb516ac851f08ac89 (diff) |
Rename MediaLoader to DisplayContentManager (#2087)
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/display/display-content-manager.js (renamed from ext/js/media/media-loader.js) | 2 | ||||
-rw-r--r-- | ext/js/display/display-generator.js | 6 | ||||
-rw-r--r-- | ext/js/display/display.js | 8 | ||||
-rw-r--r-- | ext/js/display/sandbox/structured-content-generator.js | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/ext/js/media/media-loader.js b/ext/js/display/display-content-manager.js index d7f6b347..a0dd7dd6 100644 --- a/ext/js/media/media-loader.js +++ b/ext/js/display/display-content-manager.js @@ -19,7 +19,7 @@ * StringUtil */ -class MediaLoader { +class DisplayContentManager { constructor() { this._token = {}; this._mediaCache = new Map(); diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js index a28a00a2..1f485a4f 100644 --- a/ext/js/display/display-generator.js +++ b/ext/js/display/display-generator.js @@ -23,12 +23,12 @@ */ class DisplayGenerator { - constructor({japaneseUtil, mediaLoader, hotkeyHelpController=null}) { + constructor({japaneseUtil, contentManager, hotkeyHelpController=null}) { this._japaneseUtil = japaneseUtil; - this._mediaLoader = mediaLoader; + this._contentManager = contentManager; this._hotkeyHelpController = hotkeyHelpController; this._templates = null; - this._structuredContentGenerator = new StructuredContentGenerator(this._mediaLoader, document); + this._structuredContentGenerator = new StructuredContentGenerator(this._contentManager, document); this._pronunciationGenerator = new PronunciationGenerator(japaneseUtil); } diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 5bebe0ed..a89008b4 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -16,6 +16,7 @@ */ /* global + * DisplayContentManager * DisplayGenerator * DisplayHistory * DisplayNotification @@ -24,7 +25,6 @@ * FrameEndpoint * Frontend * HotkeyHelpController - * MediaLoader * OptionToggleHotkeyHandler * PopupFactory * PopupMenu @@ -52,11 +52,11 @@ class Display extends EventDispatcher { this._styleNode = null; this._eventListeners = new EventListenerCollection(); this._setContentToken = null; - this._mediaLoader = new MediaLoader(); + this._contentManager = new DisplayContentManager(); this._hotkeyHelpController = new HotkeyHelpController(); this._displayGenerator = new DisplayGenerator({ japaneseUtil, - mediaLoader: this._mediaLoader, + contentManager: this._contentManager, hotkeyHelpController: this._hotkeyHelpController }); this._messageHandlers = new Map(); @@ -543,7 +543,7 @@ class Display extends EventDispatcher { this._closePopups(); this._closeAllPopupMenus(); this._eventListeners.removeAllEventListeners(); - this._mediaLoader.unloadAll(); + this._contentManager.unloadAll(); this._hideTagNotification(false); this._triggerContentClear(); this._dictionaryEntries = []; diff --git a/ext/js/display/sandbox/structured-content-generator.js b/ext/js/display/sandbox/structured-content-generator.js index e45713e7..799da586 100644 --- a/ext/js/display/sandbox/structured-content-generator.js +++ b/ext/js/display/sandbox/structured-content-generator.js @@ -16,8 +16,8 @@ */ class StructuredContentGenerator { - constructor(mediaLoader, document) { - this._mediaLoader = mediaLoader; + constructor(contentManager, document) { + this._contentManager = contentManager; this._document = document; } @@ -141,8 +141,8 @@ class StructuredContentGenerator { aspectRatioSizer.style.paddingTop = `${invAspectRatio * 100.0}%`; - if (this._mediaLoader !== null) { - this._mediaLoader.loadMedia( + if (this._contentManager !== null) { + this._contentManager.loadMedia( path, dictionary, (url) => this._setImageData(node, image, imageBackground, url, false), |