From 6cf38229b54efbbc3ae7bc174c3999f9dfa7b1d2 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Feb 2024 08:10:09 -0500 Subject: Html templates update (#707) * Simplify display template loading * Add helper * Rename file * Rename for simplicity * Create templates file * Load * Remove templates * Move permissions templates * Remove "templates" from comments * Fix prepare --- ext/js/display/display-generator.js | 9 +++------ ext/js/display/display.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'ext/js/display') diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js index 621ea833..65736759 100644 --- a/ext/js/display/display-generator.js +++ b/ext/js/display/display-generator.js @@ -39,12 +39,9 @@ export class DisplayGenerator { this._structuredContentGenerator = new StructuredContentGenerator(this._contentManager, document); } - /** - * @param {import('../comm/api.js').API} api - */ - async prepare(api) { - const html = await api.getDisplayTemplatesHtml(); - this._templates.load(html); + /** */ + async prepare() { + await this._templates.loadFromFiles(['/templates-display.html']); this.updateHotkeys(); } diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 4cd2d611..588508b5 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -318,7 +318,7 @@ export class Display extends EventDispatcher { // Prepare await this._hotkeyHelpController.prepare(this._application.api); - await this._displayGenerator.prepare(this._application.api); + await this._displayGenerator.prepare(); this._queryParser.prepare(); this._history.prepare(); this._optionToggleHotkeyHandler.prepare(); -- cgit v1.2.3