update spell.js + add 3 spells to debug purpose

This commit is contained in:
Lucas 2023-03-07 21:40:23 +01:00
parent 84f547e3d4
commit b8fa191734
5 changed files with 124 additions and 26 deletions

View file

@ -76,6 +76,44 @@
"savingThrow": [""], "savingThrow": [""],
"miscTags": ["", ""], "miscTags": ["", ""],
"areaTags": ["", ""] "areaTags": ["", ""]
},
{
"recid": 2,
"name": "Acid Splash",
"source": "GRI",
"page": 126,
"srd": true,
"level": 1,
"school": "I",
"time": [
{
"number": 1,
"unit": "action"
}
],
"range": {
"type": "point",
"distance": {
"type": "feet",
"amount": 60
}
},
"components": {
"v": true,
"s": true
},
"duration": [
{
"type": "instant"
}
],
"desc": [
"You hurl a bubble of acid. "
],
"damageInflict": ["acid"],
"savingThrow": ["Dexterity"],
"miscTags": ["", ""],
"areaTags": ["", ""]
} }
] ]
} }

View file

@ -76,6 +76,44 @@
"savingThrow": ["Constitution"], "savingThrow": ["Constitution"],
"miscTags": ["", ""], "miscTags": ["", ""],
"areaTags": ["", ""] "areaTags": ["", ""]
},
{
"recid": 2,
"name": "Aspersion acide",
"source": "GRI",
"page": 126,
"srd": true,
"level": 1,
"school": "I",
"time": [
{
"number": 1,
"unit": "action"
}
],
"range": {
"type": "point",
"distance": {
"type": "m",
"amount": 18
}
},
"components": {
"v": true,
"s": true
},
"duration": [
{
"type": "instant"
}
],
"desc": [
"Vous lancez une bulle dacide. "
],
"damageInflict": ["acid"],
"savingThrow": ["Dexterity"],
"miscTags": ["", ""],
"areaTags": ["", ""]
} }
] ]
} }

View file

@ -30,14 +30,20 @@ fetch(jsonsource)
fixedBody: false, fixedBody: false,
records: alldata, records: alldata,
columns: [ columns: [
{ field: "name", text: "Name", sortable: true, resizable: true,searchable: { operator: 'contains' }, }, {
field: "name",
text: "Name",
sortable: true,
resizable: true,
searchable: { operator: "contains" },
},
{ {
field: "desc", field: "desc",
text: "Description", text: "Description",
size: "500%", size: "500%",
style: "test", style: "test",
resizable: true, resizable: true,
searchable: { operator: 'contains' }, searchable: { operator: "contains" },
render(record, extra) { render(record, extra) {
return ( return (
'<a href="http://w2ui.com" target="_blank" title="Click Me!"><u>' + '<a href="http://w2ui.com" target="_blank" title="Click Me!"><u>' +
@ -46,20 +52,32 @@ fetch(jsonsource)
); );
}, },
}, },
{ field: "source", text: "Source", sortable: true, tooltip: 'Which book is this from ?',searchable: { operator: 'contains' } }, {
field: "source",
text: "Source",
sortable: true,
tooltip: "Which book is this from ?",
searchable: { operator: "contains" },
},
{ field: "page", text: "Page", sortable: true }, { field: "page", text: "Page", sortable: true },
{ field: "level", text: "Level", sortable: true, size: 65 }, { field: "level", text: "Level", sortable: true, size: 65 },
{ field: "school", text: "School", sortable: true }, { field: "school", text: "School", sortable: true },
{ {
field: "components", text: "Components", render(record) { field: "components",
var v = (record.components.v) ? '<span data-localize="verbal">V</span>' : '' text: '<span data-localize="gridColumns.components">Components</span>',
var s = (record.components.s) ? 'S' : '' render(record) {
var m = (record.components.m) ? record.components.m : '' var v = record.components.v
return v.concat() ? '<span data-localize="verbal">V</span>'
if (record.components.v = true) { : "";
console.log(record.components) var s = record.components.s ? '<span data-localize="somatic">S</span>' : "";
var m = record.components.m ? '<span data-localize="material">M</span>' : "";
//var m = record.components.m ? record.components.m : "";
var vs=v.concat(', ',s);
return vs.concat(', ',m);
if ((record.components.v = true)) {
console.log(record.components);
} }
} },
}, },
{ field: "duration", text: "Duration" }, { field: "duration", text: "Duration" },
], ],
@ -79,17 +97,12 @@ fetch(jsonsource)
])*/ ])*/
console.log(record); console.log(record);
}, },
onRender(event) { async onRefresh(event) {
// TODO: find the event after grid generate the html end signal and apply loc await event.complete;
event.done(function(){ console.log("Le tableau est généré et le DOM est modifié.");
console.log('object '+ this.name + ' is rendered'); $("[data-localize]").localize("main", { pathPrefix: "lang" }); // mettre votre script ici
$("[data-localize]").localize("main", { pathPrefix: "lang" }); }
})
} })
});
})
});

View file

@ -9,5 +9,10 @@
"btn-items": "Magic Items", "btn-items": "Magic Items",
"CUVD": "Unofficial site for Fateforge RPG. Uses copyrighted content © Agate RPG, courtesy of the publisher under the CUVD license.", "CUVD": "Unofficial site for Fateforge RPG. Uses copyrighted content © Agate RPG, courtesy of the publisher under the CUVD license.",
"link": "Join the community: <a href='https://fateforge.org/en'>https://fateforge.org/en</a>", "link": "Join the community: <a href='https://fateforge.org/en'>https://fateforge.org/en</a>",
"verbal": "Verbal" "verbal": "Verbal",
"somatic": "Somatic",
"gridColumns":{
"components": "Components"
}
} }

View file

@ -9,5 +9,9 @@
"btn-items": "Objets Magiques", "btn-items": "Objets Magiques",
"CUVD": "Site non-officiel pour Dragons créé(e). Utilise des contenus protégés par la propriété intellectuelle © Agate RPG, avec laimable permission de léditeur dans le cadre de la licence CUVD.", "CUVD": "Site non-officiel pour Dragons créé(e). Utilise des contenus protégés par la propriété intellectuelle © Agate RPG, avec laimable permission de léditeur dans le cadre de la licence CUVD.",
"link": "Rejoignez la communauté : <a href='www.dragons-rpg.com'>www.dragons-rpg.com</a>", "link": "Rejoignez la communauté : <a href='www.dragons-rpg.com'>www.dragons-rpg.com</a>",
"verbal": "Verbale" "verbal": "Verbale",
} "somatic": "Gestuelle",
"gridColumns":{
"components": "Composants"
}
}