diff --git a/client/src/modules/DeckStateManager.js b/client/src/modules/DeckStateManager.js index 12235cd..773a0b9 100644 --- a/client/src/modules/DeckStateManager.js +++ b/client/src/modules/DeckStateManager.js @@ -1,6 +1,6 @@ import { globals } from '../config/globals.js'; import { toast } from './Toast.js'; -import { ModalManager } from './ModalManager'; +import { ModalManager } from './ModalManager.js'; export class DeckStateManager { constructor () { diff --git a/client/src/modules/GameCreationStepManager.js b/client/src/modules/GameCreationStepManager.js index eb6884f..2dda6bc 100644 --- a/client/src/modules/GameCreationStepManager.js +++ b/client/src/modules/GameCreationStepManager.js @@ -3,9 +3,9 @@ import { cancelCurrentToast, toast } from './Toast.js'; import { ModalManager } from './ModalManager.js'; import { XHRUtility } from './XHRUtility.js'; import { globals } from '../config/globals.js'; -import { templates } from './Templates.js'; -import { defaultCards } from '../config/defaultCards'; -import { UserUtility } from './UserUtility'; +import { HTMLFragments } from './HTMLFragments.js'; +import { defaultCards } from '../config/defaultCards.js'; +import { UserUtility } from './UserUtility.js'; export class GameCreationStepManager { constructor (deckManager) { @@ -192,7 +192,7 @@ function renderNameStep (containerId, step, game, steps) { const stepContainer = document.createElement('div'); setAttributes(stepContainer, { id: 'step-' + step, class: 'flex-row-container step' }); - stepContainer.innerHTML = templates.ENTER_NAME_STEP; + stepContainer.innerHTML = HTMLFragments.ENTER_NAME_STEP; document.getElementById(containerId).appendChild(stepContainer); const nameInput = document.querySelector('#moderator-name'); nameInput.value = game.moderatorName; @@ -246,9 +246,9 @@ function renderRoleSelectionStep (game, containerId, step, deckManager) { const stepContainer = document.createElement('div'); setAttributes(stepContainer, { id: 'step-' + step, class: 'flex-row-container-left-align step' }); - stepContainer.innerHTML = templates.CREATE_GAME_CUSTOM_ROLES; - stepContainer.innerHTML += templates.CREATE_GAME_DECK_STATUS; - stepContainer.innerHTML += templates.CREATE_GAME_DECK; + stepContainer.innerHTML = HTMLFragments.CREATE_GAME_CUSTOM_ROLES; + stepContainer.innerHTML += HTMLFragments.CREATE_GAME_DECK_STATUS; + stepContainer.innerHTML += HTMLFragments.CREATE_GAME_DECK; const exportHandler = (e) => { if (e.type === 'click' || e.code === 'Enter') { @@ -633,7 +633,7 @@ function addOptionsToList (deckManager, selectEl) { }); for (let i = 0; i < options.length; i++) { const optionEl = document.createElement('div'); - optionEl.innerHTML = templates.DECK_SELECT_ROLE; + optionEl.innerHTML = HTMLFragments.DECK_SELECT_ROLE; optionEl.classList.add('deck-select-role'); const alignmentClass = options[i].team === globals.ALIGNMENT.GOOD ? globals.ALIGNMENT.GOOD : globals.ALIGNMENT.EVIL; optionEl.classList.add(alignmentClass); diff --git a/client/src/modules/GameStateRenderer.js b/client/src/modules/GameStateRenderer.js index b27c1b5..fdc6c7a 100644 --- a/client/src/modules/GameStateRenderer.js +++ b/client/src/modules/GameStateRenderer.js @@ -1,6 +1,6 @@ import { globals } from '../config/globals.js'; import { toast } from './Toast.js'; -import { templates } from './Templates.js'; +import { HTMLFragments } from './HTMLFragments.js'; import { ModalManager } from './ModalManager.js'; export class GameStateRenderer { @@ -343,9 +343,9 @@ function renderGroupOfPlayers ( container.classList.add('game-player'); if (moderatorType) { container.dataset.pointer = player.id; - container.innerHTML = templates.MODERATOR_PLAYER; + container.innerHTML = HTMLFragments.MODERATOR_PLAYER; } else { - container.innerHTML = templates.GAME_PLAYER; + container.innerHTML = HTMLFragments.GAME_PLAYER; } container.querySelector('.game-player-name').innerText = player.name; const roleElement = container.querySelector('.game-player-role'); @@ -492,7 +492,7 @@ function removeExistingPlayerElements (killPlayerHandlers, revealRoleHandlers) { function createEndGamePromptComponent (socket, stateBucket) { if (document.querySelector('#end-game-prompt') === null) { const div = document.createElement('div'); - div.innerHTML = templates.END_GAME_PROMPT; + div.innerHTML = HTMLFragments.END_GAME_PROMPT; div.querySelector('#end-game-button').addEventListener('click', (e) => { e.preventDefault(); if (confirm('End the game?')) { diff --git a/client/src/modules/Templates.js b/client/src/modules/HTMLFragments.js similarity index 99% rename from client/src/modules/Templates.js rename to client/src/modules/HTMLFragments.js index 40dce19..3c4a8ab 100644 --- a/client/src/modules/Templates.js +++ b/client/src/modules/HTMLFragments.js @@ -1,4 +1,4 @@ -export const templates = { +export const HTMLFragments = { LOBBY: `