Compare commits

..

6 Commits

Author SHA1 Message Date
681358238d Merge branch 2023-02-01 10:11:33 +01:00
5511acc876 Merge pull request 'Alignement description en haut' (#619) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#619
2023-02-01 10:10:42 +01:00
2e144851d4 Alignement description en haut 2023-01-31 21:40:35 +01:00
9f24aee1f3 Merge pull request 'Recherche par nom' (#618) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#618
2023-01-31 07:32:09 +01:00
e605ab405a Version 10.6.8 2023-01-30 22:08:11 +01:00
86f69566a6 Recherche par nom
Dans la fenêtre de recherche, possibilité de chercher sur le nom
des objets en plus des autres critères
2023-01-30 22:08:11 +01:00
7 changed files with 65 additions and 25 deletions

View File

@@ -202,7 +202,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/enum-periode.html',
'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-effet.html',
// Partials
'systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats.hbs',
'systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats-recherche.hbs',
'systems/foundryvtt-reve-de-dragon/templates/common/timestamp.hbs',
'systems/foundryvtt-reve-de-dragon/templates/common/periodicite.hbs',
'systems/foundryvtt-reve-de-dragon/templates/common/enum-duree.hbs',

View File

@@ -3,6 +3,7 @@ import { HtmlUtility } from '../html-utility.js';
import { Misc } from "../misc.js";
import { CompendiumTableHelpers } from '../settings/system-compendiums.js';
import { RdDRaretes } from '../item/raretes.js';
import { Grammar } from '../grammar.js';
const FILTER_GROUPS = [
{ group: 'type', label: "Type d'objet" },
@@ -188,6 +189,30 @@ export class FenetreRechercheTirage extends Application {
const row = await CompendiumTableHelpers.getRandom(table, 'Item')
await CompendiumTableHelpers.tableRowToChatMessage(row, 'Item');
})
// this.html.find('.recherche')
// .each((index, field) => {
// if (this.options.recherche) {
// field.focus();
// field.setSelectionRange(this.options.recherche.start, this.options.recherche.end);
// }
// })
// .keyup(async event => {
// const nouvelleRecherche = this._optionRecherche(event.currentTarget);
// if (this.options.recherche?.text != nouvelleRecherche?.text) {
// this.options.recherche = nouvelleRecherche;
// if (this.timerRecherche) {
// clearTimeout(this.timerRecherche);
// }
// this.timerRecherche = setTimeout(() => {
// this.timerRecherche = undefined;
// this.render(true);
// }, 500);
// }
// })
// .change(async event =>
// this.options.recherche = this._optionRecherche(event.currentTarget)
// );
}
showFilterGroup(groupDiv, show) {
@@ -200,14 +225,14 @@ export class FenetreRechercheTirage extends Application {
supprimerFiltres() {
this.html.find('input:is(.activate-filter-group,.activate-filter-milieu)').prop("checked", false);
this.html.find('div.liste-resultats').html('');
this.changeListeFiltresActifs();
this.html.find('div.liste-resultats-recherche').html('');
this.html.find('.section-filters-text input.recherche').val('');
}
async recherche() {
const table = await this.buildTable();
const htmlResultats = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats.hbs`, { resultats: table });
this.html.find('div.liste-resultats').html(htmlResultats);
const htmlResultats = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats-recherche.hbs`, { resultats: table });
this.html.find('div.liste-resultats-recherche').html(htmlResultats);
this._dragDrop.forEach(dragDropHandler => dragDropHandler.bind(this.element[0]))
}
@@ -225,13 +250,19 @@ export class FenetreRechercheTirage extends Application {
}
return (it, mi) => true;
}
buildFilterRechercheName() {
const recherche = this.html.find('.section-filters-text input.recherche').val();
if (recherche) {
return (it, mi) => Grammar.includesLowerCaseNoAccent(it.name, recherche);
}
return (it, mi) => true;
}
buildCheckedGroupFilter(milieux) {
const filtersList = this.getGroupCheckedFilters()
.map(gf => this.buildOrFilter(gf.filters.map(f => f.check)));
if (milieux) {
filtersList.push(this.buildMilieuxFilter(milieux));
}
filtersList.push(this.buildMilieuxFilter(milieux));
filtersList.push(this.buildFilterRechercheName());
return this.buildAndFilter(filtersList)
}

View File

@@ -633,6 +633,7 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
border: 2;
min-height: 8rem;
padding: 0 3px;
align-items: top;
}
.small-editor {
@@ -641,6 +642,10 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
padding: 0 3px;
}
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor){
align-items: start;
}
.foundryvtt-reve-de-dragon .tox .tox-editor-container {
background: #fff;
}
@@ -988,7 +993,7 @@ ul, li {
margin: 0;
padding: 0;
}
.sheet input.recherche {
:is(.sheet, div.fenetre-recherche div.section-filters-text) input.recherche {
background-image: url("img/ui/icon-search.svg");
background-position: 0.1rem 0.1rem;
background-size: 1rem;
@@ -1962,26 +1967,26 @@ div.vl {
width: 1px;
flex-grow: 0;
}
div.fenetre-recherche div.recherche {
div.fenetre-recherche div.zone-recherche {
display: flex;
}
div.fenetre-recherche div.recherche div.filtres {
div.fenetre-recherche div.zone-recherche div.filtres {
width: fit-content;
min-width: 200px;
float: left;
}
div.fenetre-recherche div.titre-fenetre-recherche {
div.fenetre-recherche div.titre-resultats-recherche {
flex-basis: 0;
max-height: fit-content;
}
div.fenetre-recherche div.liste-resultats {
div.fenetre-recherche div.liste-resultats-recherche {
display: flex;
flex: auto;
flex-flow: row wrap;
flex-direction: row;
align-content: flex-start ;
}
div.fenetre-recherche div.liste-resultats div.resultat {
div.fenetre-recherche div.liste-resultats-recherche div.resultat {
width: fit-content;
margin: 0.2rem 0.5rem;
}

View File

@@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "10.6.7",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.7.zip",
"version": "10.6.9",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.9.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
"compatibility": {
"minimum": "10",
@@ -379,4 +379,4 @@
"flags": {}
}
]
}
}

View File

@@ -1,11 +1,11 @@
<div class="flexcol">
<div>
<span><label>Description : </label></span>
<div class="form-group large-editor">
{{editor description target="system.description" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}
</div>
</div>
{{#if options.isGM}}
<div class="flexcol">
<div>
<span><label>Description (MJ seulement): </label></span>
<div class="form-group large-editor">
{{editor descriptionmj target="system.descriptionmj" button=true owner=options.isOwner editable=options.editable engine="prosemirror"}}

View File

@@ -7,12 +7,16 @@
<span class="liste-filtres-actifs"></span>
</div>
<hr>
<div class="recherche">
<div class="zone-recherche">
<div class="filtres">
<div class="titre-fenetre-recherche">
<div class="titre-resultats-recherche">
<h3>Filtres</h3>
</div>
<div class="section-filters-text">
<h4>
<input class="recherche flex-grow" type="text" value="{{options.recherche.text}}" name="recherche" size="8" data-dtype="String" placeholder=""/>
</h4>
</div>
<div class="section-filters-root">
<h4>
<a class="section-filters-toggle">Milieux
@@ -56,10 +60,10 @@
</div>
<div class="vl"></div>
<div class="resultats">
<div class="titre-fenetre-recherche">
<h3>Résultat de recherche</h3>
<div class="titre-resultats-recherche">
<h3>Résultat de recherche</h3>
</div>
<div class="liste-resultats">
<div class="liste-resultats-recherche">
</div>
</div>