wapi-doc/layout/own-scripts.js
/*
  Initialize the interactive functionality of the page.
*/
Initialize the interactive functionality of the page.
Initialize the interactive functionality of the page .
function init() {
  var i, j
  var buttons = document.querySelectorAll('.collapse-button')
  for (i = 0; i < buttons.length; i++) {
    buttons[i].onclick = toggleCollapseButton
    if (buttons[i].className.indexOf('show') !== -1) {
      toggleCollapseButton({ target: buttons[i].children[0] })
    }
  }
  var responseCodes = document.querySelectorAll('.example-names')
  for (i = 0; i < responseCodes.length; i++) {
    var tabButtons = childrenByClass(responseCodes[i], 'tab-button')
    for (j = 0; j < tabButtons.length; j++) {
      tabButtons[j].onclick = toggleTabButton
      if (j === 0) {
        toggleTabButton({ target: tabButtons[j] })
      }
    }
  }
  var navItems = document.querySelectorAll('nav .resource-group .heading')
  for (i = 0; i < navItems.length; i++) {
    navItems[i].onclick = toggleCollapseNav
    toggleCollapseNav({ target: navItems[i].children[0] })
  }
}
function init ( ) { var i , j var buttons = document . querySelectorAll ( '.collapse-button' ) for ( i = 0 ; i < buttons . length ; i ++ ) { buttons [ i ] . onclick = toggleCollapseButton if ( buttons [ i ] . className . indexOf ( 'show' ) !== - 1 ) { toggleCollapseButton ( { target : buttons [ i ] . children [ 0 ] } ) } } var responseCodes = document . querySelectorAll ( '.example-names' ) for ( i = 0 ; i < responseCodes . length ; i ++ ) { var tabButtons = childrenByClass ( responseCodes [ i ] , 'tab-button' ) for ( j = 0 ; j < tabButtons . length ; j ++ ) { tabButtons [ j ] . onclick = toggleTabButton if ( j === 0 ) { toggleTabButton ( { target : tabButtons [ j ] } ) } } } var navItems = document . querySelectorAll ( 'nav .resource-group .heading' ) for ( i = 0 ; i < navItems . length ; i ++ ) { navItems [ i ] . onclick = toggleCollapseNav toggleCollapseNav ( { target : navItems [ i ] . children [ 0 ] } ) } }
Initialize the interactive functionality of the page.
Initialize the interactive functionality of the page .
// Make collapse buttons clickable // Show by default? Then toggle now. // Show by default? // Make nav items clickable to collapse/expand their content. // Show all by default