1
0
mirror of https://github.com/mbirth/tcl_update_db.git synced 2024-11-09 23:06:45 +00:00

Small improvements to OTA versions display in tooltip.

This commit is contained in:
Markus Birth 2018-02-16 23:50:42 +01:00
parent 74d733b98c
commit 423631cc7a
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -51,15 +51,25 @@ document.addEventListener 'DOMContentLoaded', (event) ->
if vermeta['OTA'].length > 0
fromList = (v['fv'] for v in vermeta['OTA'])
fromList = fromList.join ', '
otaInfo = "✔️ (from #{fromList})"
fromList = fromList.sort().reverse()
fromListText = fromList.join ', '
if fromList.length > 3
fromMore = fromList.length - 3
fromList = fromList[0..2]
fromListText = (fromList.join ', ') + " + #{fromMore} more"
otaInfo = "✔️ (from #{fromListText})"
else
otaInfo = ""
if vermeta['OTA_FROM'].length > 0
toList = (v['tv'] for v in vermeta['OTA_FROM'])
toList = toList.join ', '
updateInfo = "<strong>OTA possible to #{toList}</strong>"
toList = toList.sort().reverse()
toListText = toList.join ', '
if toList.length > 3
toMore = toList.length - 3
toList = toList[0..2]
toListText = (toList.join ', ') + " + #{toMore} more"
updateInfo = "<strong>OTA possible to #{toListText}</strong>"
else
updateInfo = "No OTA to future version."