lint: Use 4 space indent

This commit is contained in:
Cohee
2023-12-02 21:56:16 +02:00
parent c63cd87cc0
commit 08fedf3a96
12 changed files with 74 additions and 78 deletions

View File

@ -54,6 +54,7 @@ module.exports = {
'require-yield': 'off',
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'indent': ['error', 4, { SwitchCase: 1, FunctionDeclaration: { parameters: 'first' } }],
// These rules should eventually be enabled.
'no-async-promise-executor': 'off',

View File

@ -1379,6 +1379,11 @@ PromptManagerModule.prototype.renderPromptManager = function () {
footerDiv.querySelector('.menu_button:last-child').addEventListener('click', this.handleNewPrompt);
// Add prompt export dialogue and options
const exportForCharacter =`
<div class="row">
<a class="export-promptmanager-prompts-character list-group-item" data-i18n="Export for character">Export for character</a>
<span class="tooltip fa-solid fa-info-circle" title="Export prompts for this character, including their order."></span>
</div>`;
const exportPopup = `
<div id="prompt-manager-export-format-popup" class="list-group">
<div class="prompt-manager-export-format-popup-flex">
@ -1386,14 +1391,7 @@ PromptManagerModule.prototype.renderPromptManager = function () {
<a class="export-promptmanager-prompts-full list-group-item" data-i18n="Export all">Export all</a>
<span class="tooltip fa-solid fa-info-circle" title="Export all your prompts to a file"></span>
</div>
${'global' === this.configuration.promptOrder.strategy
? ''
: `<div class="row">
<a class="export-promptmanager-prompts-character list-group-item" data-i18n="Export for character">Export
for character</a>
<span class="tooltip fa-solid fa-info-circle"
title="Export prompts for this character, including their order."></span>
</div>` }
${'global' === this.configuration.promptOrder.strategy ? '' : exportForCharacter }
</div>
</div>
`;

View File

@ -358,8 +358,7 @@ export function stringFormat(format) {
return format.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
: match;
});
}

View File

@ -2098,17 +2098,15 @@ export function checkEmbeddedWorld(chid) {
localStorage.setItem(checkKey, 1);
if (power_user.world_import_dialog) {
callPopup(`<h3>This character has an embedded World/Lorebook.</h3>
const html = `<h3>This character has an embedded World/Lorebook.</h3>
<h3>Would you like to import it now?</h3>
<div class="m-b-1">If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.</div>`,
'confirm',
'',
{ okButton: 'Yes', })
.then((result) => {
<div class="m-b-1">If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.</div>`;
const checkResult = (result) => {
if (result) {
importEmbeddedWorldInfo(true);
}
});
};
callPopup(html, 'confirm', '', { okButton: 'Yes', }).then(checkResult);
}
else {
toastr.info(