2
2
/* eslint-disable require-jsdoc */
3
3
"use strict" ;
4
4
5
- const table_columns = [ ] ;
5
+ const columns = [ ] ;
6
6
7
- table_columns . push ( helper_tabulator_col_str ( "x_date" , "Date" ) ) ;
8
- table_columns . push ( helper_tabulator_col_str ( "type" , "Type" ) ) ;
9
- table_columns . push ( helper_tabulator_col_str ( "name" , "Name" , 120 ) ) ;
10
- table_columns . push (
11
- helper_tabulator_col_str ( "x_nearest_city_start" , "City" , 120 )
12
- ) ;
13
- table_columns . push (
14
- helper_tabulator_col_str ( "x_start_locality" , "Known location start" )
15
- ) ;
16
- table_columns . push ( helper_tabulator_col_str ( "x_end_locality" , "-end" ) ) ;
17
- table_columns . push ( helper_tabulator_col_str ( "x_gear_name" , "Gear" , 120 ) ) ;
18
- table_columns . push ( helper_tabulator_col_num ( "x_min" , "Minutes" ) ) ;
19
- table_columns . push ( helper_tabulator_col_num ( "x_km" , "Kilometers" ) ) ;
20
- table_columns . push ( helper_tabulator_col_num ( "km/h" , "km/h" ) ) ;
21
- table_columns . push ( helper_tabulator_col_num ( "x_max_km/h" , "max km/h" ) ) ;
22
- table_columns . push (
23
- helper_tabulator_col_num ( "total_elevation_gain" , "Elevation (m)" )
24
- ) ;
25
- table_columns . push (
26
- helper_tabulator_col_num ( "x_elev_m/km" , "Elevation (m/km)" )
27
- ) ;
28
- table_columns . push ( helper_tabulator_col_num ( "average_heartrate" , "HR avg" ) ) ;
29
- table_columns . push ( helper_tabulator_col_num ( "max_heartrate" , "HR max" ) ) ;
30
- table_columns . push ( helper_tabulator_col_num ( "average_cadence" , "Cadence" ) ) ;
31
- table_columns . push ( helper_tabulator_col_num ( "average_watts" , "Watts avg" ) ) ;
32
- table_columns . push ( helper_tabulator_col_num ( "kilojoules" , "KJ" ) ) ;
33
- table_columns . push ( helper_tabulator_col_str ( "visibility" , "visibility" ) ) ;
34
- table_columns . push ( helper_tabulator_col_num ( "athlete_count" , "Athletes" ) ) ;
35
- table_columns . push ( helper_tabulator_col_num ( "workout_type" , "W-Type" ) ) ;
36
- table_columns . push ( helper_tabulator_col_num ( "kudos_count" , "Kudos" ) ) ;
37
- table_columns . push ( helper_tabulator_col_num ( "comment_count" , "Comments" ) ) ;
38
- table_columns . push (
39
- helper_tabulator_col_num ( "achievement_count" , "Achievements" )
40
- ) ;
7
+ columns . push ( helper_tabulator_col_str ( "x_date" , "Date" ) ) ;
8
+ columns . push ( helper_tabulator_col_str ( "type" , "Type" ) ) ;
9
+ columns . push ( helper_tabulator_col_str ( "name" , "Name" , 120 ) ) ;
10
+ columns . push ( helper_tabulator_col_str ( "x_nearest_city_start" , "City" , 120 ) ) ;
11
+ columns . push ( helper_tabulator_col_str ( "x_start_locality" , "Known location start" ) ) ;
12
+ columns . push ( helper_tabulator_col_str ( "x_end_locality" , "-end" ) ) ;
13
+ columns . push ( helper_tabulator_col_str ( "x_gear_name" , "Gear" , 120 ) ) ;
14
+ columns . push ( helper_tabulator_col_num ( "x_min" , "Minutes" ) ) ;
15
+ columns . push ( helper_tabulator_col_num ( "x_km" , "Kilometers" ) ) ;
16
+ columns . push ( helper_tabulator_col_num ( "km/h" , "km/h" ) ) ;
17
+ columns . push ( helper_tabulator_col_num ( "x_max_km/h" , "max km/h" ) ) ;
18
+ columns . push ( helper_tabulator_col_num ( "total_elevation_gain" , "Elevation (m)" ) ) ;
19
+ columns . push ( helper_tabulator_col_num ( "x_elev_m/km" , "Elevation (m/km)" ) ) ;
20
+ columns . push ( helper_tabulator_col_num ( "average_heartrate" , "HR avg" ) ) ;
21
+ columns . push ( helper_tabulator_col_num ( "max_heartrate" , "HR max" ) ) ;
22
+ columns . push ( helper_tabulator_col_num ( "average_cadence" , "Cadence" ) ) ;
23
+ columns . push ( helper_tabulator_col_num ( "average_watts" , "Watts avg" ) ) ;
24
+ columns . push ( helper_tabulator_col_num ( "kilojoules" , "KJ" ) ) ;
25
+ columns . push ( helper_tabulator_col_str ( "visibility" , "visibility" ) ) ;
26
+ columns . push ( helper_tabulator_col_num ( "athlete_count" , "Athletes" ) ) ;
27
+ columns . push ( helper_tabulator_col_num ( "workout_type" , "W-Type" ) ) ;
28
+ columns . push ( helper_tabulator_col_num ( "kudos_count" , "Kudos" ) ) ;
29
+ columns . push ( helper_tabulator_col_num ( "comment_count" , "Comments" ) ) ;
30
+ columns . push ( helper_tabulator_col_num ( "achievement_count" , "Achievements" ) ) ;
41
31
42
32
function defineTable ( ) {
43
33
const table = new Tabulator ( "#table-activity-list" , {
@@ -47,7 +37,7 @@ function defineTable() {
47
37
layout : "fitDataStretch" , // fit columns to width of table (optional)
48
38
tooltipsHeader : false ,
49
39
selectable : false , // for row click
50
- columns : table_columns ,
40
+ columns : columns ,
51
41
initialSort : [ { column : "x_date" , dir : "desc" } ] ,
52
42
} ) ;
53
43
return table ;
0 commit comments