|
342 | 342 |
|
343 | 343 | <script src="{% static 'ietf/js/agenda/agenda_filter.js' %}"></script> |
344 | 344 | <script> |
345 | | - // Update the agenda display with specified filters |
| 345 | + var current_timezone = 'UTC'; |
| 346 | + |
| 347 | + // Update the agenda display with specified filters |
346 | 348 | function update_agenda_display(filter_params) { |
347 | 349 | var agenda_rows=$('[id^="row-"]') |
348 | 350 |
|
@@ -380,46 +382,44 @@ <h2> |
380 | 382 | } |
381 | 383 | } |
382 | 384 |
|
383 | | - function update_weekview(filter_params) { |
384 | | - var weekview = $("#weekview"); |
385 | | - |
386 | | - if (!agenda_filter.filtering_is_enabled(filter_params)) { |
387 | | - weekview.addClass("hidden"); |
388 | | - return; |
389 | | - } |
390 | | - |
391 | | - // Filtering is enabled |
392 | | - weekview.removeClass("hidden"); |
393 | | - |
394 | | - var wv_iframe = document.getElementById('weekview'); |
395 | | - var wv_window = wv_iframe.contentWindow; |
396 | | - var queryparams = window.location.search; |
397 | | - {% if "-utc" in request.path %} |
398 | | - if (queryparams) { |
399 | | - queryparams += '&tz=utc'; |
400 | | - } else { |
401 | | - queryparams = '?tz=utc'; |
402 | | - } |
403 | | - {% endif %} |
404 | | - var new_url = 'week-view.html' + queryparams; |
405 | | - if (wv_iframe.src && wv_window.history && wv_window.history.replaceState) { |
406 | | - wv_window.history.replaceState({}, '', new_url); |
407 | | - wv_window.redraw_weekview(); |
408 | | - } else { |
409 | | - // either have not yet loaded the iframe or we do not support history replacement |
410 | | - wv_iframe.src = new_url; |
411 | | - } |
412 | | - } |
413 | | - |
| 385 | + function update_weekview(filter_params) { |
| 386 | + var weekview = $("#weekview"); |
| 387 | + if (agenda_filter.filtering_is_enabled(filter_params)) { |
| 388 | + weekview.removeClass("hidden"); |
| 389 | + } else { |
| 390 | + weekview.addClass("hidden"); |
| 391 | + } |
| 392 | + update_weekview_display(); |
| 393 | + } |
| 394 | + |
| 395 | + function update_weekview_display() { |
| 396 | + var weekview = $("#weekview"); |
| 397 | + if (!weekview.hasClass('hidden')) { |
| 398 | + var queryparams = window.location.search; |
| 399 | + if (queryparams) { |
| 400 | + queryparams += '&tz=' + current_timezone.toLowerCase(); |
| 401 | + } else { |
| 402 | + queryparams = '?tz=' + current_timezone.toLowerCase(); |
| 403 | + } |
| 404 | + var new_url = 'week-view.html' + queryparams; |
| 405 | + var wv_iframe = document.getElementById('weekview'); |
| 406 | + var wv_window = wv_iframe.contentWindow; |
| 407 | + if (wv_iframe.src && wv_window.history && wv_window.history.replaceState) { |
| 408 | + wv_window.history.replaceState({}, '', new_url); |
| 409 | + wv_window.redraw_weekview(); |
| 410 | + } else { |
| 411 | + // either have not yet loaded the iframe or we do not support history replacement |
| 412 | + wv_iframe.src = new_url; |
| 413 | + } |
| 414 | + } |
| 415 | + } |
| 416 | + |
414 | 417 | function update_view(filter_params) { |
415 | 418 | update_agenda_display(filter_params); |
416 | 419 | update_weekview(filter_params) |
417 | 420 | update_ical_links(filter_params) |
418 | 421 | } |
419 | 422 |
|
420 | | - agenda_filter.set_update_callback(update_view); |
421 | | - agenda_filter.enable(); |
422 | | - |
423 | 423 | /** |
424 | 424 | * Retrieve and display materials for a session |
425 | 425 | * |
|
519 | 519 | // Get meeting and local times, initialize timezone system |
520 | 520 | meeting_timezone = "{{timezone}}"; |
521 | 521 | local_timezone = moment.tz.guess(); |
522 | | - current_timezone = 'UTC'; |
523 | 522 | {% if "-utc" in request.path %} |
524 | 523 | timezone_init('UTC'); |
525 | 524 | {% else %} |
|
528 | 527 |
|
529 | 528 | init_timers(); |
530 | 529 |
|
| 530 | + set_tz_change_callback(update_weekview_display); |
| 531 | + agenda_filter.set_update_callback(update_view); |
| 532 | + agenda_filter.enable(); |
| 533 | + |
531 | 534 | </script> |
532 | 535 | {% endblock %} |
0 commit comments