Update Loading bar

2.0
Matheus Clemente 2023-11-08 16:36:04 -03:00
parent eeffb9cba6
commit 7983150350
8 changed files with 152 additions and 110 deletions

View File

@ -31,6 +31,7 @@
}
.compendium-browser .window-content .parent .content .tab .browser ul {
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.compendium-browser .window-content .parent .content .tab .settings {
@ -57,7 +58,7 @@
width: 350px;
height: 100%;
padding-right: 5px;
overflow: scroll;
overflow: auto;
}
.compendium-browser .list-area {
position: sticky;
@ -67,7 +68,10 @@
width: 400px;
height: 100%;
padding-right: 5px;
overflow-y: scroll;
}
.compendium-browser .list-area .loading {
flex: 0;
text-align: center;
}
.compendium-browser .control-area button {
background: rgba(0, 0, 0, 0.05);

View File

@ -3,18 +3,15 @@ const NOT_MIGRATED = "NotMigratedException";
class CompendiumBrowser extends Application {
static get defaultOptions() {
const options = super.defaultOptions;
mergeObject(options, {
return mergeObject(super.defaultOptions, {
title: "CMPBrowser.compendiumBrowser",
tabs: [{ navSelector: ".tabs", contentSelector: ".content", initial: "spell" }],
classes: options.classes.concat("compendium-browser"),
classes: ["compendium-browser"],
template: "modules/compendium-browser/template/template.html",
width: 800,
height: 700,
height: 730,
resizable: true,
minimizable: true,
});
return options;
}
get maxLoad() {

View File

@ -1,60 +1,75 @@
{
"CMPBrowser.compendiumBrowser": "Compendium Browser",
"CMPBrowser.sortBy": "Sort by",
"CMPBrowser.generalSettings": "General Settings",
"CMPBrowser.allowSpellAcc": "Allow Players Access to the spell browser",
"CMPBrowser.allowFeatAcc": "Allow Players Access to the feat browser",
"CMPBrowser.allowItemAcc": "Allow Players Access to the item browser",
"CMPBrowser.allowNpcAcc": "Allow Players Access to the npc browser",
"CMPBrowser.compSettingsSpell": "Item Compendium Settings",
"CMPBrowser.compSettingsNpc": "NPC Compendium Settings",
"CMPBrowser.load": "Load",
"CMPBrowser.castingTime": "Casting Time",
"CMPBrowser.spellType": "Spell Type",
"CMPBrowser.damageType": "Damage Type",
"CMPBrowser.UsesResources": "Uses Resources",
"CMPBrowser.GameMechanics": "Game Mechanics",
"CMPBrowser.ItemSubtype": "Item Subtype",
"CMPBrowser.MagicItems": "Magic Items",
"CMPBrowser.ItemsPacks": "Packs",
"CMPBrowser.ItemsPacksBurglar": "Burglar's Pack",
"CMPBrowser.ItemsPacksDiplomat": "Diplomat's Pack",
"CMPBrowser.ItemsPacksDungeoneer": "Dungeoneer's Pack",
"CMPBrowser.ItemsPacksEntertainer": "Entertainer's Pack",
"CMPBrowser.ItemsPacksExplorer": "Explorer's Pack",
"CMPBrowser.ItemsPacksMonsterHunter": "Monster Hunter's Pack",
"CMPBrowser.ItemsPacksPriest": "Priest's Pack",
"CMPBrowser.ItemsPacksScholar": "Scholar's Pack",
"CMPBrowser.artificer": "Artificer",
"CMPBrowser.barbarian": "Barbarian",
"CMPBrowser.bard": "Bard",
"CMPBrowser.cleric": "Cleric",
"CMPBrowser.druid": "Druid",
"CMPBrowser.fighter": "Fighter",
"CMPBrowser.monk": "Monk",
"CMPBrowser.paladin": "Paladin",
"CMPBrowser.ranger": "Ranger",
"CMPBrowser.rogue": "Rogue",
"CMPBrowser.sorcerer": "Sorcerer",
"CMPBrowser.warlock": "Warlock",
"CMPBrowser.wizard": "Wizard",
"CMPBrowser.general": "General",
"CMPBrowser.overall": "Overall Type",
"CMPBrowser.subfeature": "Subfeature Type",
"CMPBrowser.hasSpells": "Has Spells",
"CMPBrowser.hasLegAct": "Has Legendary Actions",
"CMPBrowser.hasLegRes": "Has Legendary Resistance",
"CMPBrowser.dmgInteraction": "Damage Interaction",
"CMPBrowser.dmgDealt": "Damage Dealt",
"CMPBrowser.Tab.SpellBrowser": "Spell Browser",
"CMPBrowser.Tab.FeatBrowser": "Feat Browser",
"CMPBrowser.Tab.ItemBrowser": "Item Browser",
"CMPBrowser.Tab.NPCBrowser": "NPC Browser",
"CMPBrowser.Tab.Settings": "Settings",
"CMPBrowser.SETTING.Maxload.NAME": "Maximum load",
"CMPBrowser.SETTING.Maxload.HINT": "Maximum number of spells, feats, items, or NPCs to display; to see more use the filters. This setting is to allow manageing memory and server load.",
"CMPBrowser.LOADING.Message": "Loading...{numLoaded} {itemType}s",
"CMPBrowser.LOADED.Message": "Loaded {numLoaded} {itemType}s",
"CMPBrowser.LOADED.MaxLoaded": "(maximum displayed; to see more, use the filters)",
"CMPBrowser.Filters.ResetFilters": "Reset Filters"
"CMPBrowser": {
"compendiumBrowser": "Compendium Browser",
"sortBy": "Sort by",
"generalSettings": "General Settings",
"allowSpellAcc": "Allow Players Access to the spell browser",
"allowFeatAcc": "Allow Players Access to the feat browser",
"allowItemAcc": "Allow Players Access to the item browser",
"allowNpcAcc": "Allow Players Access to the npc browser",
"compSettingsSpell": "Item Compendium Settings",
"compSettingsNpc": "NPC Compendium Settings",
"load": "Load",
"castingTime": "Casting Time",
"spellType": "Spell Type",
"damageType": "Damage Type",
"UsesResources": "Uses Resources",
"GameMechanics": "Game Mechanics",
"ItemSubtype": "Item Subtype",
"MagicItems": "Magic Items",
"ItemsPacks": "Packs",
"ItemsPacksBurglar": "Burglar's Pack",
"ItemsPacksDiplomat": "Diplomat's Pack",
"ItemsPacksDungeoneer": "Dungeoneer's Pack",
"ItemsPacksEntertainer": "Entertainer's Pack",
"ItemsPacksExplorer": "Explorer's Pack",
"ItemsPacksMonsterHunter": "Monster Hunter's Pack",
"ItemsPacksPriest": "Priest's Pack",
"ItemsPacksScholar": "Scholar's Pack",
"artificer": "Artificer",
"barbarian": "Barbarian",
"bard": "Bard",
"cleric": "Cleric",
"druid": "Druid",
"fighter": "Fighter",
"monk": "Monk",
"paladin": "Paladin",
"ranger": "Ranger",
"rogue": "Rogue",
"sorcerer": "Sorcerer",
"warlock": "Warlock",
"wizard": "Wizard",
"general": "General",
"overall": "Overall Type",
"subfeature": "Subfeature Type",
"hasSpells": "Has Spells",
"hasLegAct": "Has Legendary Actions",
"hasLegRes": "Has Legendary Resistance",
"dmgInteraction": "Damage Interaction",
"dmgDealt": "Damage Dealt",
"Tab": {
"SpellBrowser": "Spell Browser",
"FeatBrowser": "Feat Browser",
"ItemBrowser": "Item Browser",
"NPCBrowser": "NPC Browser",
"Settings": "Settings"
},
"SETTING": {
"Maxload.NAME": "Maximum load",
"Maxload.HINT": "Maximum number of spells, feats, items, or NPCs to display; to see more use the filters. This setting is to allow manageing memory and server load."
},
"LOADING": {
"Message": "Loading...{numLoaded} {itemType}s"
},
"LOADED": {
"Message": {
"feat": "Loaded {numLoaded} feats",
"item": "Loaded {numLoaded} items",
"npc": "Loaded {numLoaded} npcs",
"spell": "Loaded {numLoaded} spells"
},
"MaxLoaded": "(maximum displayed; to see more, use the filters)"
},
"Filters.ResetFilters": "Reset Filters"
}
}

View File

@ -2,8 +2,15 @@
<div class="control-area">
<div class="filtercontainer" id="tagfilter">
<div class="filter" data-type="text" data-path="name">
<input class="" name="textFilter" type="text" value="" data-dtype="String" placeholder="{{localize
"Name"}}"/>
<input
class=""
name="textFilter"
type="text"
value=""
data-dtype="String"
placeholder="{{localize
'Name'}}"
/>
</div>
<dl id="sorter">
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
@ -20,9 +27,9 @@
{{> "modules/compendium-browser/template/filter-container.html" filters=featFilters}}
</div>
<div class="list-area flexcol">
<span id="CBFeatsMessage" style="flex: 0"></span>
<ul id="CBFeats">
{{> "modules/compendium-browser/template/feat-browser-list.html" feats=items}}
</ul>
<span class="loading" id="CBFeatsMessage" style="flex: 0"></span>
</div>
</div>

View File

@ -2,8 +2,15 @@
<div class="control-area">
<div class="filtercontainer" id="tagfilter">
<div class="filter" data-type="text" data-path="name">
<input class="" name="textFilter" type="text" value="" data-dtype="String" placeholder="{{localize
"Name"}}"/>
<input
class=""
name="textFilter"
type="text"
value=""
data-dtype="String"
placeholder="{{localize
'Name'}}"
/>
</div>
<dl id="sorter">
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
@ -20,9 +27,9 @@
{{> "modules/compendium-browser/template/filter-container.html" filters=itemFilters}}
</div>
<div class="list-area flexcol">
<span id="CBItemsMessage" style="flex: 0"></span>
<ul id="CBItems">
{{> "modules/compendium-browser/template/item-browser-list.html" items=items}}
</ul>
<span class="loading" id="CBItemsMessage" style="flex: 0"></span>
</div>
</div>

View File

@ -1,13 +1,15 @@
<img
<!-- <img
class=""
src="icons/sundries/books/book-open-turquoise.webp"
data-tooltip="Loading book"
data-tooltip-direction="UP"
width="32"
height="32"
/>
/> -->
<span class="item-edit">
{{#if doneLoading}} {{localize "CMPBrowser.LOADED.Message" numLoaded=numLoaded itemType=itemType}} {{else}}
{{localize "CMPBrowser.LOADING.Message" numLoaded=numLoaded itemType=itemType}} {{/if}} {{#if maxLoaded}}{{localize
"CMPBrowser.LOADED.MaxLoaded"}}{{/if}}
{{#if doneLoading}} {{localize (concat "CMPBrowser.LOADED.Message." itemType) numLoaded=numLoaded}}
<!-- -->
{{else}} {{localize "CMPBrowser.LOADING.Message" numLoaded=numLoaded itemType=itemType}} {{/if}}
<!-- -->
{{#if maxLoaded}}{{localize "CMPBrowser.LOADED.MaxLoaded"}}{{/if}}
</span>

View File

@ -2,8 +2,15 @@
<div class="control-area">
<div class="filtercontainer" id="tagfilter">
<div class="filter" data-type="text" data-path="name">
<input class="" name="textFilter" type="text" value="" data-dtype="String" placeholder="{{localize
"Name"}}"/>
<input
class=""
name="textFilter"
type="text"
value=""
data-dtype="String"
placeholder="{{localize
'Name'}}"
/>
</div>
<dl id="sorter">
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
@ -21,9 +28,9 @@
{{> "modules/compendium-browser/template/filter-container.html" filters=npcFilters}}
</div>
<div class="list-area flexcol">
<span id="CBNpcsMessage" style="flex: 0"></span>
<ul id="CBNPCs">
{{> "modules/compendium-browser/template/npc-browser-list.html" npcs=npcs}}
</ul>
<span class="loading" id="CBNpcsMessage" style="flex: 0"></span>
</div>
</div>

View File

@ -1,32 +1,35 @@
<div class="spell-browser browser flexrow">
<div class="control-area">
<div class="filtercontainer" id="tagfilter">
<div class="filter" data-type="text" data-path="name">
<input class="" name="textFilter" type="text" value=""
data-dtype="String" placeholder="{{localize "Name"}}"/>
</div>
<dl id="sorter">
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
<dd>
<select class="null" name="sortorder">
<option value="true" selected>{{localize "Name"}}</option>
<option value="false">{{localize "DND5E.Level"}}</option>
</select>
</dd>
</dl>
<button id="reset-spell-filter">
{{localize "CMPBrowser.Filters.ResetFilters"}}
</button>
<!-- <button id="copy-search-spell">Export to <i class="fa-brands fa-square-js"></i></button> -->
</div>
{{> "modules/compendium-browser/template/filter-container.html"
filters=spellFilters}}
</div>
<div class="list-area flexcol">
<span id="CBSpellsMessage" style="flex: 0"></span>
<ul id="CBSpells">
{{> "modules/compendium-browser/template/spell-browser-list.html"
spells=items}}
</ul>
</div>
<div class="control-area">
<div class="filtercontainer" id="tagfilter">
<div class="filter" data-type="text" data-path="name">
<input
class=""
name="textFilter"
type="text"
value=""
data-dtype="String"
placeholder="{{localize
'Name'}}"
/>
</div>
<dl id="sorter">
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
<dd>
<select class="null" name="sortorder">
<option value="true" selected>{{localize "Name"}}</option>
<option value="false">{{localize "DND5E.Level"}}</option>
</select>
</dd>
</dl>
<button id="reset-spell-filter">{{localize "CMPBrowser.Filters.ResetFilters"}}</button>
<!-- <button id="copy-search-spell">Export to <i class="fa-brands fa-square-js"></i></button> -->
</div>
{{> "modules/compendium-browser/template/filter-container.html" filters=spellFilters}}
</div>
<div class="list-area flexcol">
<ul id="CBSpells">
{{> "modules/compendium-browser/template/spell-browser-list.html" spells=items}}
</ul>
<span class="loading" id="CBSpellsMessage" style="flex: 0"></span>
</div>
</div>