From 00b5195a1f06006751dfda813cf2440cde3e4dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Wed, 1 Mar 2023 17:56:34 +0100 Subject: [PATCH] Draft reordering of object keys --- js/.ds.js.swp | Bin 12288 -> 0 bytes js/ds.js | 8 +++++++- js/views/report.js | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 js/.ds.js.swp diff --git a/js/.ds.js.swp b/js/.ds.js.swp deleted file mode 100644 index 37c9de526a387600a4c7ce0f7ef828619439f15f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O^g&p6vqn`zfq$xF`f$8I6dob_v{)KSO!?wB`od-?Cuy7LYSWJ8m8BtuBNI+ z*h~gaekC4^Q7;~hXH8Iy2Te55gLe*Y?NP?W_t%1_Uig&#Fm^XfqCm!y9^AU6G98ur)??`DxqLzI zRAfd|C09gXv={2prjm&nH9{M2g*x1o+gR-Hx3eRx0#<>(0v*#F-MO{)?D$xPx^`^e z#vgyI)_-cRRspMkRlq7>6|f3e1*`&A0jt3OKmn6(V&~!K=EBz_#dXuVYjJBYRspMk zRlq7>6|f3e1*`&A0jq#jz$#!BunPPK74SpGR_|r(oBLoq{{P?q`~T`AjQtM20`G(O zz&qe&Fa)kW%-EmcTkth_6TA*igXh5$;4ZKk{I->`&%p)o3HSii!5Fym5M#fBOW;TF zG583a2eaTsFa~~k5dGk7a1D{0uIF&%lS^4X_J53GM+~z?J(M z`w3hEUxF{d1@JC-3%mx7fjO`XJO{RbP2e)L`VNq0=fDcE%_?9OunJfOtO8bnjTGR+ z9^=DY2`xJ+5Ijn>*{IJ?@X)NL!gXDmaI7QLDyF4U86HQ;E1Db0Lt%vahtu0pBA7Qk z%sfw=&6fA|Y7+2fCkad>6W$aiXdQ}TaUhlrr-?5$6_qDoRp!cmB}_*pyek{@TgDz) zOYBd5<+piP8x59S#eO1e2j`({IV13Po);KJe( z_E=%N|$IkfC07{WKLxc(4`4p%WR=UZXk9-{bjv>(|3TUDSrUQ~|E;H1gzf zvfJ3#W(H!OU1&NbuTn7e5_E#nJ9#q)6$}Akq z;+_l2P0Kf2w`3;{`+oCS=F$`=()#)?5(l{g(@`(HHp>xk@{=~carp5Qz2X$hjsvQ6 zK|2+vA}Np^2nRE{ilK3&&6+eTDw}$bm*Ozp4fTwV1GRL*&5GI?t5imK+doU0P^lC` z|GUNCj~HsU%5U=&C@TF9S2*#2zoz!*{dlF7R{mK{8q0odjAZj zX0N<`S&&&S?b`DbK9|I&t(rMrZiE<-TnqaKd(SlR5 H2Xy-vNkFWg diff --git a/js/ds.js b/js/ds.js index 2d33795..ddd69ef 100644 --- a/js/ds.js +++ b/js/ds.js @@ -5,13 +5,19 @@ const RES_ENDPOINT = '/resources/'; /** * @todo Report shapes?? */ -/* export const OBJECT_ORDER = { "Object Type" : null, "Object ID" : null, + "Object Excavation code" : null, "Object Chronology" : null, "Object Era" : null, + "Object Geographical Context of Discovery" : null, + "Object Description" : null, + "Object Conservation State" : null, + "Object Dimensions" : null, + "Object Material" : null, }; +/* export const SAMPLE_ORDER = { }; diff --git a/js/views/report.js b/js/views/report.js index 960fc09..8ec4dc7 100644 --- a/js/views/report.js +++ b/js/views/report.js @@ -4,19 +4,19 @@ import { BASE_URL, fetchReport, printReport, - getImageSrc + getImageSrc, + OBJECT_ORDER } from "../ds.js"; document.addEventListener('readystatechange', async () => { const report = await fetchReport(location.search.replace("?id=", '')); - const resource = report.resource; const archesJson = await fetchReport(location.search.replace("?id=", ''), 'arches-json'); - - // DEBUG const files = getImageSrc(archesJson); printReport(); + const resource = Object.assign(OBJECT_ORDER, report.resource); + let resKeys = Object.keys(resource); // Default value... let resType = 'Object';