Improved www.ttss.krakow.pl
Jacek Kowalski
2016-12-06 e2b2838c65bf5a4cd85b0f534e8126450f1fbc55
Feature delayed and "at stop" entries
2 files modified
25 ■■■■ changed files
index.html 9 ●●●●● patch | view | raw | blame | history
index.js 16 ●●●●● patch | view | raw | blame | history
index.html
@@ -22,6 +22,15 @@
            .input-group-btn:first-child {
                width: 50%;
            }
            @keyframes blink {
                50% { color: transparent; }
            }
            .status-boarding {
                animation: blink 1s linear infinite;
            }
            .status-delayed {
                font-weight: bold;
            }
        </style>
    </head>
    <body>
index.js
@@ -170,13 +170,19 @@
            addCellWithText(tr, data.actual[i].patternText);
            addCellWithText(tr, data.actual[i].direction);
            var status = parseStatus(data.actual[i]);
            addCellWithText(tr, status);
            var status_cell = addCellWithText(tr, status);
            var delay = parseDelay(data.actual[i]);
            addCellWithText(tr, delay);
            var delay_cell = addCellWithText(tr, delay);
            
            if(status == parseStatusBoarding) tr.className = 'success';
            else if(parseInt(delay) > 9) tr.className = 'danger';
            else if(parseInt(delay) > 3) tr.className = 'warning';
            if(status == parseStatusBoarding) {
                tr.className = 'success';
                status_cell.className = 'status-boarding';
            } else if(parseInt(delay) > 9) {
                tr.className = 'danger';
                delay_cell.className = 'status-delayed';
            } else if(parseInt(delay) > 3) {
                tr.className = 'warning';
            }
            times_table.appendChild(tr);
        }