diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 1add1170d..bdc3da7e3 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -1,6 +1,6 @@ import { callPopup, eventSource, event_types, getRequestHeaders, saveSettingsDebounced } from "../../../script.js"; import { dragElement, isMobile } from "../../RossAscends-mods.js"; -import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch } from "../../extensions.js"; +import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplate } from "../../extensions.js"; import { loadMovingUIState, power_user } from "../../power-user.js"; import { onlyUnique, debounce, getCharaFilename } from "../../utils.js"; export { MODULE_NAME }; @@ -800,20 +800,7 @@ function drawSpritesList(character, labels, sprites) { } function getListItem(item, imageSrc, textClass) { - return ` -
-
- - -
- ${item} - -
- `; + return renderExtensionTemplate(MODULE_NAME, 'list-item', { item, imageSrc, textClass }); } async function getSpritesList(name) { @@ -991,7 +978,7 @@ async function setExpression(character, expression, force) { } }); - + } } @@ -1240,54 +1227,7 @@ function setExpressionOverrideHtml(forceClear = false) { $('body').append(element); } function addSettings() { - const html = ` -
-
-
- Character Expressions -
-
- -
- -
- -
-
- You are in offline mode. Click on the image below to set the expression. -
-
- - -
-
-
- - -
-

Hint: Create new folder in the public/characters/ folder and name it as the name of the character. - Put images with expressions there. File names should follow the pattern: [expression_label].[image_format]

- -
-
-
- - -
-
- `; - - $('#extensions_settings').append(html); + $('#extensions_settings').append(renderExtensionTemplate(MODULE_NAME, 'settings')); $('#expression_override_button').on('click', onClickExpressionOverrideButton); $('#expressions_show_default').on('input', onExpressionsShowDefaultInput); $('#expression_upload_pack_button').on('click', onClickExpressionUploadPackButton); diff --git a/public/scripts/extensions/expressions/list-item.html b/public/scripts/extensions/expressions/list-item.html new file mode 100644 index 000000000..ecd2d14b8 --- /dev/null +++ b/public/scripts/extensions/expressions/list-item.html @@ -0,0 +1,12 @@ +
+
+ + +
+ {{item}} + +
diff --git a/public/scripts/extensions/expressions/settings.html b/public/scripts/extensions/expressions/settings.html new file mode 100644 index 000000000..27779cce2 --- /dev/null +++ b/public/scripts/extensions/expressions/settings.html @@ -0,0 +1,44 @@ +
+
+
+ Character Expressions +
+
+ +
+ +
+ +
+
+ You are in offline mode. Click on the image below to set the expression. +
+
+ + +
+
+
+ + +
+

Hint: Create new folder in the public/characters/ folder and name it as the name of the character. + Put images with expressions there. File names should follow the pattern: [expression_label].[image_format]

+ +
+
+
+ + +
+