Further improving EIBI schedules display.

This commit is contained in:
Marat Fayzullin 2024-01-20 23:07:18 -05:00
parent ab9ff1fe8e
commit 686850b2a3
2 changed files with 15 additions and 13 deletions

View File

@ -303,10 +303,12 @@ FeatureMarker.prototype.getInfoHTML = function(name, receiverMarker = null) {
if (this.schedule) { if (this.schedule) {
var odd = false; var odd = false;
var list = this.schedule.map(function(x) { var list = this.schedule.map(function(x) {
var row = '<tr title="' var hint = x.tgt? 'Transmitting to ' + x.tgt : '';
+ "Transmitting to " + x.tgt if (hint && x.lang) hint += ' (' + x.lang.replace(/ *[:(].*/, '') + ')';
+ (x.lang? ' (' + x.lang.replace(/:.*/, '') + ')' : '')
+ '" style="background-color:' + (odd? '#E0FFE0':'#FFFFFF') var row = '<tr '
+ (hint? 'title="' + hint + '" ' : '')
+ 'style="background-color:' + (odd? '#E0FFE0':'#FFFFFF')
+ ';"><td>' + ('0000' + x.time1).slice(-4) + ';"><td>' + ('0000' + x.time1).slice(-4)
+ '&#8209;' + ('0000' + x.time2).slice(-4) + '&#8209;' + ('0000' + x.time2).slice(-4)
+ '</td><td width="100%">' + x.name + '</td>' + '</td><td width="100%">' + x.name + '</td>'

View File

@ -306,15 +306,15 @@ class Markers(object):
targets = {} targets = {}
comment = "" comment = ""
langstr = "" langstr = ""
for row in schedule: # for row in schedule:
lang = row["lang"] # lang = row["lang"]
target = row["tgt"] # target = row["tgt"]
if target and target not in targets: # if target and target not in targets:
targets[target] = True # targets[target] = True
comment += (", " if comment else " to ") + target # comment += (", " if comment else " to ") + target
if lang and lang not in langs: # if lang and lang not in langs:
langs[lang] = True # langs[lang] = True
langstr += (", " if langstr else "") + re.sub(r"(:|\s*\().*$", "", lang) # langstr += (", " if langstr else "") + re.sub(r"(:|\s*\().*$", "", lang)
# Compose comment # Compose comment
comment = ("Transmitting" + comment) if comment else "Transmitter" comment = ("Transmitting" + comment) if comment else "Transmitter"