adding needed includes from 2018 for /program/*
authorAndrew Engelbrecht <andrew@fsf.org>
Wed, 6 Mar 2019 23:00:15 +0000 (18:00 -0500)
committerAndrew Engelbrecht <andrew@fsf.org>
Wed, 6 Mar 2019 23:00:15 +0000 (18:00 -0500)
2019/includes/program-menu.html [new file with mode: 0644]
2019/includes/program_js.html [new file with mode: 0755]

diff --git a/2019/includes/program-menu.html b/2019/includes/program-menu.html
new file mode 100644 (file)
index 0000000..9e3860f
--- /dev/null
@@ -0,0 +1,17 @@
+
+<div class="contain-fluid">
+  <div class="row margin-top">
+    <div class="col-sm-8">
+
+      <ol class="breadcrumb text-center">
+        <li id="p-sessions"><a href="/2019/program/index.html">Sessions</a></li>
+ <!--       <li id="p-grid-sch"><a href="/2019/program/grid-schedule.html">Grid Schedule</a></li>-->
+        <li><a href="app.html">Other ways to use the schedule</a></li>
+        <li id="p-speakers"><a href="/2019/speakers">Speakers</a></li>
+        <!--<li id="p-social"><a href="/2019/program/social.html">Social &amp; Community Events</a>-->
+      </ol>
+
+  </div>
+</div>
+</div>
+<br>
diff --git a/2019/includes/program_js.html b/2019/includes/program_js.html
new file mode 100755 (executable)
index 0000000..02e6ad5
--- /dev/null
@@ -0,0 +1,133 @@
+<!-- start html templates -->
+<script id="details-menu-up-glyph" type="text/x-generic-html-template">
+    <span class="glyphicon glyphicon-menu-up" style="margin-left: 5px;"
+          aria-hidden="true"></span>
+</script>
+<script id="details-menu-down-glyph" type="text/x-generic-html-template">
+    <span class="glyphicon glyphicon-menu-down"  style="margin-left: 5px;"
+          aria-hidden="true"></span>
+</script>
+<!-- end html templates -->
+
+<script>
+ $(window).ready(function() {
+     $('.collapse').removeClass('in');
+     $('.program-session-room-details button').show();
+
+     init_toggle_all();
+
+     $('.session-desc')
+         .on('show.bs.collapse', function() {
+             var id = $(this).attr('id');
+             // find corresponding "Details"/"Collapse details" button.
+             var btn = $('[data-target="#'+ id + '"]');
+             var glyph = $('#details-menu-up-glyph').text();
+             $(btn).text('Collapse details');
+             $(glyph).appendTo(btn);
+         });
+
+     $('.session-desc')
+         .on('hide.bs.collapse', function() {
+             var id = $(this).attr('id');
+             // find corresponding "Details"/"Collapse details" button.
+             var btn = $('[data-target="#'+ id + '"]');
+             var glyph = $('#details-menu-down-glyph').text();
+             $(btn).text('Show details');
+             $(glyph).appendTo(btn);
+         });
+ });
+
+ $(window).resize(function() {
+     reinit_toggle_all();
+ });
+
+ $(window).scroll(function() {
+     position_toggle_all();
+ });
+
+ function init_toggle_all(reinit=false) {
+     var block = '.program-session-details-toggle-all';
+     // on click init.
+     if (!reinit)
+         toggle_all_click_init();
+
+     // positioning.
+     window.toggle_all_pos = $(block).offset();
+     position_toggle_all();
+     $(block).show();
+ }
+
+ function reinit_toggle_all() {
+     // make position static to know the real position of toggle all.
+     toggle_all_static();
+     init_toggle_all(true);
+ }
+
+ function toggle_all_fixed() {
+     $('.program-session-details-toggle-all button').addClass('fixed');
+ }
+
+ function toggle_all_static() {
+     $('.program-session-details-toggle-all button').removeClass('fixed');
+ }
+
+ function position_toggle_all() {
+     var toggle_all_btn = '.program-session-details-toggle-all button';
+     var t_pos = window.toggle_all_pos;
+     var w_top = $(window).scrollTop();
+
+     if(w_top > t_pos.top)
+         toggle_all_fixed();
+     else
+         toggle_all_static();
+
+ }
+
+ function toggle_all_click_init() {
+     var toggle_all_btn = '.program-session-details-toggle-all button';
+     var details_btn = '.program-session-room-details button';
+
+     // initially everything is collapsed.
+     window.toggle_all = {
+         'collapsed': true,
+         'clicked': false,
+     };
+
+     $(toggle_all_btn).click(function() {
+
+         if (window.toggle_all.collapsed) {
+             $('.collapse').collapse('show');
+             window.toggle_all.collapsed = false;
+         } else {
+             $('.collapse').collapse('hide');
+             window.toggle_all.collapsed = true;
+         }
+
+         // set toggle all clicked.
+         window.toggle_all.clicked = true;
+     });
+
+     $('.collapse').on('shown.bs.collapse', function() {
+         update_toggle_all_text('Collapse all');
+     });
+
+     $('.collapse').on('hidden.bs.collapse', function() {
+         update_toggle_all_text('Expand all');
+     });
+ }
+
+ function update_toggle_all_text(txt) {
+     var toggle_all_btn = '.program-session-details-toggle-all button';
+
+     // update text only when toggle all is clicked.
+     if (window.toggle_all.clicked)
+         $(toggle_all_btn).text(txt);
+
+     // reset toggle clicked
+     window.toggle_all.clicked = false;
+ }
+</script>
+
+<script type="text/javascript">
+ $(".program-link").addClass("active");
+</script>