update spell.js + add 3 spells to debug purpose
This commit is contained in:
parent
84f547e3d4
commit
b8fa191734
5 changed files with 124 additions and 26 deletions
|
@ -76,6 +76,44 @@
|
|||
"savingThrow": [""],
|
||||
"miscTags": ["", ""],
|
||||
"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": ["", ""]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -76,6 +76,44 @@
|
|||
"savingThrow": ["Constitution"],
|
||||
"miscTags": ["", ""],
|
||||
"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 d’acide. "
|
||||
],
|
||||
"damageInflict": ["acid"],
|
||||
"savingThrow": ["Dexterity"],
|
||||
"miscTags": ["", ""],
|
||||
"areaTags": ["", ""]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
59
js/spells.js
59
js/spells.js
|
@ -30,14 +30,20 @@ fetch(jsonsource)
|
|||
fixedBody: false,
|
||||
records: alldata,
|
||||
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",
|
||||
text: "Description",
|
||||
size: "500%",
|
||||
style: "test",
|
||||
resizable: true,
|
||||
searchable: { operator: 'contains' },
|
||||
searchable: { operator: "contains" },
|
||||
render(record, extra) {
|
||||
return (
|
||||
'<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: "level", text: "Level", sortable: true, size: 65 },
|
||||
{ field: "school", text: "School", sortable: true },
|
||||
{
|
||||
field: "components", text: "Components", render(record) {
|
||||
var v = (record.components.v) ? '<span data-localize="verbal">V</span>' : ''
|
||||
var s = (record.components.s) ? 'S' : ''
|
||||
var m = (record.components.m) ? record.components.m : ''
|
||||
return v.concat()
|
||||
if (record.components.v = true) {
|
||||
console.log(record.components)
|
||||
field: "components",
|
||||
text: '<span data-localize="gridColumns.components">Components</span>',
|
||||
render(record) {
|
||||
var v = record.components.v
|
||||
? '<span data-localize="verbal">V</span>'
|
||||
: "";
|
||||
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" },
|
||||
],
|
||||
|
@ -79,17 +97,12 @@ fetch(jsonsource)
|
|||
])*/
|
||||
console.log(record);
|
||||
},
|
||||
onRender(event) {
|
||||
// TODO: find the event after grid generate the html end signal and apply loc
|
||||
event.done(function(){
|
||||
console.log('object '+ this.name + ' is rendered');
|
||||
$("[data-localize]").localize("main", { pathPrefix: "lang" });
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
async onRefresh(event) {
|
||||
await event.complete;
|
||||
console.log("Le tableau est généré et le DOM est modifié.");
|
||||
$("[data-localize]").localize("main", { pathPrefix: "lang" }); // mettre votre script ici
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
|
|
@ -9,5 +9,10 @@
|
|||
"btn-items": "Magic Items",
|
||||
"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>",
|
||||
"verbal": "Verbal"
|
||||
"verbal": "Verbal",
|
||||
"somatic": "Somatic",
|
||||
"gridColumns":{
|
||||
"components": "Components"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,5 +9,9 @@
|
|||
"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 l’aimable 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>",
|
||||
"verbal": "Verbale"
|
||||
"verbal": "Verbale",
|
||||
"somatic": "Gestuelle",
|
||||
"gridColumns":{
|
||||
"components": "Composants"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue