github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/prow/spyglass/lenses/metadata/metadata.ts (about)

     1  function toggleExpansion(dataId: string, textId: string, iconId: string): void {
     2    const body = document.getElementById(dataId)!;
     3    body.classList.toggle('hidden');
     4    const icon = document.getElementById(iconId)!;
     5    const textElem = document.getElementById(textId)!;
     6    if (body.classList.contains('hidden')) {
     7      icon.innerHTML = 'expand_more';
     8      textElem.innerText = 'Show more'
     9    } else {
    10      icon.innerHTML = 'expand_less';
    11      textElem.innerText = 'Show less'
    12    }
    13    spyglass.contentUpdated();
    14  }
    15  
    16  function getLocalStartTime(): void {
    17    const elem = document.getElementById("start_time")!;
    18    elem.innerText = (new Date(elem.innerText)).toString();
    19  }
    20  
    21  (window as any).toggleExpansion = toggleExpansion;
    22  window.onload = getLocalStartTime;