Crate WorldInfoKeywordHeaders.html

This commit is contained in:
steve02081504 2024-08-06 11:20:19 +08:00
parent 75bb59b204
commit 02c5a40b98
2 changed files with 10 additions and 21 deletions

View File

@ -0,0 +1,8 @@
<div id="WIEntryHeaderTitlesPC" class="flex-container wide100p spaceBetween justifyCenter textAlignCenter" style="padding:0 4.5em;">
<small class="flex1" data-i18n="Title/Memo">Title/Memo</small>
<small style="width: calc(3.5em + 15px)" data-i18n="Status">Status</small>
<small style="width: calc(3.5em + 30px)" data-i18n="Position">Position</small>
<small style="width: calc(3.5em + 20px)" data-i18n="Depth">Depth</small>
<small style="width: calc(3.5em + 20px)" data-i18n="Order">Order</small>
<small style="width: calc(3.5em + 15px)" data-i18n="Trigger %">Trigger %</small>
</div>

View File

@ -17,6 +17,7 @@ import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCom
import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';
import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js';
import { StructuredCloneMap } from './util/StructuredCloneMap.js';
import { renderTemplateAsync } from './templates.js';
export const world_info_insertion_strategy = {
evenly: 0,
@ -1854,27 +1855,7 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
worldEntriesList.find('*').off();
worldEntriesList.empty();
const keywordHeaders = `
<div id="WIEntryHeaderTitlesPC" class="flex-container wide100p spaceBetween justifyCenter textAlignCenter" style="padding:0 4.5em;">
<small class="flex1">
Title/Memo
</small>
<small style="width: calc(3.5em + 15px)">
Status
</small>
<small style="width: calc(3.5em + 30px)">
Position
</small>
<small style="width: calc(3.5em + 20px)">
Depth
</small>
<small style="width: calc(3.5em + 20px)">
Order
</small>
<small style="width: calc(3.5em + 15px)">
Trigger %
</small>
</div>`;
const keywordHeaders = await renderTemplateAsync('WorldInfoKeywordHeaders');
const blocksPromises = page.map(async (entry) => await getWorldEntry(name, data, entry)).filter(x => x);
const blocks = await Promise.all(blocksPromises);
const isCustomOrder = $('#world_info_sort_order').find(':selected').data('rule') === 'custom';