diff --git a/css/style.css b/css/style.css index 20afad1..8c04fc4 100644 --- a/css/style.css +++ b/css/style.css @@ -1,26 +1,39 @@ .container { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - align-items: stretch; - } - - .list-col, .view-col { - flex-basis: 100%; - } - - @media screen and (min-width: 768px) { - .list-col, .view-col { - flex-basis: calc(50% - 10px); /* Réduire de 10px pour ajouter une marge entre les deux div */ - } - } - - .w2ui-grid-data { - color:black; - word-wrap: break-word; - } + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: stretch; +} - .w2ui-grid .w2ui-grid-body table td.w2ui-grid-data>div{ - overflow: visible; - white-space:break-spaces; - } \ No newline at end of file +.list-col{ + flex-grow: 2; + min-width: 600px; +} +.view-col { + flex-grow: 1; + +} + +@media screen and (min-width: 768px) { + .list-col { + + margin-right: 1%; + } + .view-col { + + max-width: 600px; + } +} + +.w2ui-grid-data { + color: black; + word-wrap: normal; +} + +.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data > div { + overflow: visible; + white-space: break-spaces; +} + +.w2ui-grid .w2ui-grid-body table { +} diff --git a/js/spells.js b/js/spells.js index 21f5a70..6c06782 100644 --- a/js/spells.js +++ b/js/spells.js @@ -15,37 +15,60 @@ fetch(jsonsource) console.log(alldata); //document.getElementById("spell-list") - $("#spell-list").w2grid({ + var grid = $("#spell-list").w2grid({ name: "Spells", box: "#spellgrid", show: { - header:false, + header: false, toolbar: true, footer: false, - selectColumn: true - }, - multiSelect: true, - liveSearch: true, - multiSearch: true, - fixedBody: false, + selectColumn: true, + }, + multiSelect: true, + liveSearch: true, + multiSearch: true, + fixedBody: false, records: alldata, columns: [ - { field: "name", text: "Name",sortable: true, }, - { field: "desc", text: "Description",size:"500%",style:"test" }, - { field: "source", text: "Source",sortable: true, }, - { field: "page", text: "Page",sortable: true, }, - { field: "level", text: "Level",sortable: true, }, - { field: "school", text: "School",sortable: true, }, - { field: "components", text: "Components", }, - { field: "duration", text: "Duration", }, - + { field: "name", text: "Name", sortable: true, resizable: true,searchable: { operator: 'contains' }, }, + { + field: "desc", + text: "Description", + size: "500%", + style: "test", + resizable: true, + searchable: { operator: 'contains' }, + render(record, extra) { + return ( + '' + + extra.value + + "" + ); + }, + }, + { 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) ? 'V' : '' + 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: "duration", text: "Duration" }, ], async onSelect(event) { - await event.complete - console.log('select', event.detail, this.getSelection()) - }, - onClick(event) { - let record = this.get(event.detail.recid) + await event.complete; + console.log("select", event.detail, this.getSelection()); + }, + onClick(event) { + let record = this.get(event.detail.recid); //grid2.clear() /*grid2.add([ { recid: 0, name: 'ID:', value: record.recid }, @@ -54,19 +77,19 @@ fetch(jsonsource) { recid: 3, name: 'Email:', value: record.email }, { recid: 4, name: 'Date:', value: record.sdate } ])*/ - console.log(record) + 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" }); + }) + } - }); + + }) + }); - window.multi = function(el) { - grid.multiSelect = el.checked - grid.selectNone() - grid.refresh() -} - -window.selColumn = function(flag) { - grid.show.selectColumn = flag - grid.refresh() -} \ No newline at end of file diff --git a/lang/main-en.json b/lang/main-en.json index 45ff352..f2add12 100644 --- a/lang/main-en.json +++ b/lang/main-en.json @@ -8,5 +8,6 @@ "btn-monsters": "Creatures", "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: https://fateforge.org/en" + "link": "Join the community: https://fateforge.org/en", + "verbal": "Verbal" } diff --git a/lang/main-fr.json b/lang/main-fr.json index b61e8a3..078a737 100644 --- a/lang/main-fr.json +++ b/lang/main-fr.json @@ -8,5 +8,6 @@ "btn-monsters": "Créatures", "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é : www.dragons-rpg.com" + "link": "Rejoignez la communauté : www.dragons-rpg.com", + "verbal": "Verbale" } diff --git a/lib/w2ui/w2ui.js b/lib/w2ui/w2ui.js index 1caceea..a0cdf35 100644 --- a/lib/w2ui/w2ui.js +++ b/lib/w2ui/w2ui.js @@ -17818,7 +17818,8 @@ class w2grid extends w2base { // value, attr, style, className, divAttr let { value, style, className, attr, divAttr } = this.getCellValue(ind, col_ind, summary, true) let edit = (ind !== -1 ? this.getCellEditable(ind, col_ind) : '') - let divStyle = 'max-height: '+ parseInt(this.recordHeight) +'px;' + (col.clipboardCopy ? 'margin-right: 20px' : '') + //let divStyle = 'max-height: '+ parseInt(this.recordHeight) +'px;' + (col.clipboardCopy ? 'margin-right: 20px' : '') + let divStyle = '' //no need to constraint height let isChanged = !summary && record?.w2ui?.changes && record.w2ui.changes[col.field] != null let sel = this.last.selection let isRowSelected = false diff --git a/spells.html b/spells.html index 6b1062c..9bb1c1c 100644 --- a/spells.html +++ b/spells.html @@ -8,7 +8,7 @@ - + @@ -32,7 +32,7 @@