File tree Expand file tree Collapse file tree 3 files changed +28
-22
lines changed
Expand file tree Collapse file tree 3 files changed +28
-22
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import './components/alt-bits-participant.js'
44import './components/alt-bits-participant-detail.js'
55import './components/alt-bits-participation.js'
66import './components/ui-modal.js'
7- import SETTINGS from './settings.js'
7+ // import SETTINGS from './settings.js'
88
9- if ( SETTINGS == undefined ) throw "Missing configuration settings" ;
9+ // if(SETTINGS == undefined) throw "Missing configuration settings";
1010
11- async function load ( ) {
11+ async function AltBits ( SETTINGS ) {
1212 let raw = await fetch ( SETTINGS . baseURL ) ;
1313 let json = await raw . json ( ) ;
1414 let members = Object . values ( json . members ) . sort ( ( a , b ) => ( b ?. _participations ?. total || 0 ) - ( a ?. _participations . total || 0 ) ) ;
@@ -40,4 +40,7 @@ async function load(){
4040 } )
4141 } )
4242}
43- load ( ) ;
43+
44+ window . AltBits = AltBits ;
45+ export default AltBits ;
46+ // load();
Original file line number Diff line number Diff line change @@ -46,6 +46,26 @@ <h1>Acerca de</h1>
4646 < p > Made with ❤️ by < a href ="https://ctrl-alt-tec.hackclub.com "> Ctrl Alt Tec</ a > </ p >
4747 </ footer >
4848
49- < script src ="./alt-bits.js " type ="module "> </ script >
49+ <!-- <script src="./alt-bits.js" type="module"></script> -->
50+ < script type ="module ">
51+ import AltBits from './alt-bits.js'
52+ AltBits ( {
53+ columnNames : {
54+ member : {
55+ name : member => `${ member [ 'Nombre(s)' ] } ${ member [ 'Apellido Paterno' ] } ${ member [ 'Apellido Materno' ] } ` || 'Unasigned' ,
56+ id : member => member [ 'Matrícula' ] ,
57+ score : member => member ?. _participations ?. total || 1 ,
58+ participations : member => member ?. _participations ?. participations
59+ } ,
60+ participation : {
61+ date : participation => participation [ 'Fecha' ] ,
62+ category : participation => participation [ 'Categoría' ] ,
63+ description : participation => participation [ 'Descripción' ] ,
64+ score : participation => participation [ 'Bits' ]
65+ }
66+ } ,
67+ baseURL : 'http://ctrl-api.hackclub.com/api/participation?org=ctrl-alt-tec'
68+ } )
69+ </ script >
5070</ body >
5171</ html >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments