()
| 354 | } |
| 355 | |
| 356 | function updateAvailableStreams() { |
| 357 | var container = jQuery("#available-streams"); |
| 358 | $.each(visNS.availableStreamsHash, function(streamIdSanitized, streamName) { |
| 359 | var entry = jQuery(container).find("#stream-" + streamIdSanitized) |
| 360 | if (entry.length == 0) { |
| 361 | var checked = "checked" |
| 362 | if (streamName.startsWith("__")) { |
| 363 | checked = "" |
| 364 | } |
| 365 | // Render template |
| 366 | var template = $('#stream_selector_template').html(); |
| 367 | var html = Mustache.render(template, {"checked": checked, "streamName": streamName, "streamNameSanitized": streamIdSanitized}); |
| 368 | container.append(html); |
| 369 | |
| 370 | // keep list of streams in sorted order |
| 371 | var items = jQuery("#available-streams li").get(); |
| 372 | items.sort(asc_sort); |
| 373 | jQuery(items).appendTo('#available-streams'); |
| 374 | } |
| 375 | }); |
| 376 | } |
| 377 | |
| 378 | // Called when a stream's checkbox is selected/unselected. |
| 379 | function checkStream(checkBox) { |
no test coverage detected