PageSourceSearch

https://easychair.org/js/home.js?version=542

js easychair.org collected 2026-10-01 08:45:08 UTC 2,755 bytes, 95 lines download raw bytes

1// (c) 2019-2020, 2025 EasyChair Ltd
2
3'use strict';
4
5function Slider(id, items, displayClass) {
6  try {
7    // the element to hide when all items are displayed
8    this.id = id;
9    // the base name used for all items
10    this.items = items;
11    // index of currently displayed item
12    this.current = 0;
13    // the class that will be assigned to the radio for displayed element
14    this.displayClass = displayClass;
15  }
16  catch (err) {
17    logError(err,'Slider.create');
18  }
19} // Slider
20
21Slider.prototype.displayItem = function(index) {
22  try {
23    var items = this.items;
24    if (index >= 0 && index < items.length && index != this.current) {
25      $(this.items[this.current]).style.display = 'none';
26      $(this.items[index]).style.display = 'block';
27
28      var radioBlock = $(this.id);
29      var displayClass = this.displayClass;
30      removeClass(radioBlock.childNodes[this.current],displayClass) ;
31      addClass(radioBlock.childNodes[index], displayClass);
32      this.current = index;
33    }
34  }
35  catch (err) {
36    logError(err,'Slider.displayItem');
37  }
38}; // Slider.displayItem
39
40function MenuHandler(burgerId, burgerClass, menuClass) {
41  try {
42    // the id of a main burger ul
43    this.burgerId = burgerId;  
44    // the class of burger submenu ul
45    this.burgerClass = burgerClass; 
46    // the class of submenu ul
47    this.menuClass = menuClass; 
48  }
49  catch (err) {
50    logError(err,'MenuHandler.create');
51  }
52} // MenuHandler
53
54MenuHandler.prototype.touchBurger = function(event) {
55  try {
56    var elem = $(this.burgerId);
57    toggleBurger(elem, elem.style.display !== 'block');
58  }
59  catch (err) {
60    logError(err,'MenuHandler.touchBurger');
61  }
62} // touchBurger
63
64MenuHandler.prototype.touchItem = function(submenuId, event) {
65  try {
66    event.stopPropagation();
67    const elem = $(submenuId);
68    // burger menu
69    if (elem.classList.contains(this.burgerClass)) {
70      const items = document.getElementsByClassName(this.burgerClass);
71      for (let i = 0; i < items.length; i++){
72        const item = items[i];
73        toggleBurger(item, elem === item && elem.style.display !== 'block');
74      }
75    } else {
76      const items = document.getElementsByClassName(this.menuClass);
77      for (let i = 0; i < items.length; i++){
78        const item = items[i];
79        toggleMenu(item, elem === item && elem.style.visibility !== 'visible');
80      }
81    }
82  } catch (err) {
83    logError(err,'MenuHandler.touchItem');
84  }
85} // touchItem
86
87function toggleBurger(elem, show) {
88    elem.style.display = show ? 'block' : 'none';
89    elem.style.opacity = show ? '1.0' : '0.0';
90} // toggleBurger
91
92function toggleMenu(elem, show) {
93    elem.style.visibility = show ? 'visible' : 'hidden';
94    elem.style.opacity = show ? '1.0' : '0.0';
95} // toggleMenu

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.