From 7b1d5c5b8dd5ea000918333330b8e034b3b60160 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 15 Mar 2019 22:00:37 +0100 Subject: [PATCH] JavaScript: remove needless variable assignments Signed-off-by: Rolf Eike Beer --- theme/list_lib.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/theme/list_lib.js b/theme/list_lib.js index 1694e81cd..c89527517 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -259,8 +259,7 @@ function putTags(tags) */ function putRating(rating) { - var result; - result = '
'; + var result = '
'; for (var i = 0; i < rating; i++) result += ' ★ '; for (var i = rating; i < 5; i++) @@ -704,8 +703,7 @@ function showStats() function getDiveStats() { - var res = ""; - res += ''; + var res = '
'; res += ''; res += ''; res += getStatsRows(); @@ -859,8 +857,7 @@ function get_weights_HTML(dive) if (!dive.Weights.length) return ""; - var result = ""; - result += '
' + translate.Year + '#' + translate.Total_Time + '' + translate.Average_Time + '' + translate.Shortest_Time + '' + translate.Longest_Time + '' + translate.Average_Depth + '' + translate.Min_Depth + '' + translate.Max_Depth + '' + translate.Average_SAC + '' + translate.Min_SAC + '' + translate.Max_SAC + '' + translate.Average_Temp + '' + translate.Min_Temp + '' + translate.Max_Temp + '
'; + var result = '
' + translate.Weight + '' + translate.Type + '
'; for (var i in dive.Weights) { result += get_weight_HTML(dive.Weights[i]); } @@ -904,8 +901,7 @@ function get_cylinders_HTML(dive) if (!dive.Cylinders.length) return ""; - var result = ""; - result += '

' + translate.Dive_equipment + '

' + translate.Weight + '' + translate.Type + '
'; + var result = '

' + translate.Dive_equipment + '

' + translate.Type + '' + translate.Size + '' + translate.Work_Pressure + '' + translate.Start_Pressure + '' + translate.End_Pressure + ''+translate.Gas+'
'; for (var i in dive.Cylinders) { result += get_cylinder_HTML(dive.Cylinders[i]); } @@ -941,8 +937,7 @@ function get_bookmarks_HTML(dive) { if (!dive.events || dive.events <= 0) return ""; - var result = ""; - result += '

' + translate.Events + '

' + translate.Type + '' + translate.Size + '' + translate.Work_Pressure + '' + translate.Start_Pressure + '' + translate.End_Pressure + ''+translate.Gas+'
'; + var result = '

' + translate.Events + '

' + translate.Name + '' + translate.Time + '' + translate.Value + '
'; for (var i in dive.events) { result += get_bookmark_HTML(dive.events[i]); } @@ -993,8 +988,7 @@ function put_divecomputer_details(dc) if (dc.length <= 0) return; - var res = ''; - res += '

Divecomputer:

'; + var res = '

Divecomputer:

'; for (var i =0; i < dc.length; i++) { res += '
' + translate.Name + '' + translate.Time + '' + translate.Value + '
'; res += '';
Model : ' + dc[i].model + '