function fillStoredPages(pages) {
    var storedPagesTable = $('stored-pages');
    storedPagesTable.textContent = '';

    var template = $('stored-pages-table-row');
    var td = template.content.querySelectorAll('td');
    for (let pageIndex = 0; pageIndex < pages.length; pageIndex++) {
      var page = pages[pageIndex];
      td[0].textContent = pageIndex + 1;
      var checkbox = td[1].querySelector('input');
      checkbox.setAttribute('value', page.id);

      var link = td[2].querySelector('a');
      link.setAttribute('href', page.onlineUrl);
      var maxUrlCharsPerLine = 50;
      if (page.onlineUrl.length > maxUrlCharsPerLine) {
        link.textContent = '';
        for (let i = 0; i < page.onlineUrl.length; i += maxUrlCharsPerLine) {
          link.textContent += page.onlineUrl.slice(i, i + maxUrlCharsPerLine);
          link.textContent += '\r\n';
        }
      } else {
        link.textContent = page.onlineUrl;
      }

      td[3].textContent = page.namespace;
      td[4].textContent = Math.round(page.size / 1024);

      var row = document.importNode(template.content, true);
      storedPagesTable.appendChild(row);
    }
    offlinePages = pages;
  }
/**
   * Fill stored pages table.
   * @param {!Array<OfflinePage>} pages An array object representing
   *     stored offline pages.
   */
Fill stored pages table.
@param {!Array} pages An array object representing
stored offline pages.
Fill stored pages table . @param { !Array } pages An array object representing stored offline pages .
function fillStoredPages(pages) {
    var storedPagesTable = $('stored-pages');
    storedPagesTable.textContent = '';
    var template = $('stored-pages-table-row');
    var td = template.content.querySelectorAll('td');
    for (let pageIndex = 0; pageIndex < pages.length; pageIndex++) {
      var page = pages[pageIndex];
      td[0].textContent = pageIndex + 1;
      var checkbox = td[1].querySelector('input');
      checkbox.setAttribute('value', page.id);
      var link = td[2].querySelector('a');
      link.setAttribute('href', page.onlineUrl);
      var maxUrlCharsPerLine = 50;
      if (page.onlineUrl.length > maxUrlCharsPerLine) {
        link.textContent = '';
        for (let i = 0; i < page.onlineUrl.length; i += maxUrlCharsPerLine) {
          link.textContent += page.onlineUrl.slice(i, i + maxUrlCharsPerLine);
          link.textContent += '\r\n';
        }
      } else {
        link.textContent = page.onlineUrl;
      }
      td[3].textContent = page.namespace;
      td[4].textContent = Math.round(page.size / 1024);
      var row = document.importNode(template.content, true);
      storedPagesTable.appendChild(row);
    }
    offlinePages = pages;
  }
function fillStoredPages ( pages ) { var storedPagesTable = $ ( 'stored-pages' ) ; storedPagesTable . textContent = '' ; var template = $ ( 'stored-pages-table-row' ) ; var td = template . content . querySelectorAll ( 'td' ) ; for ( let pageIndex = 0 ; pageIndex < pages . length ; pageIndex ++ ) { var page = pages [ pageIndex ] ; td [ 0 ] . textContent = pageIndex + 1 ; var checkbox = td [ 1 ] . querySelector ( 'input' ) ; checkbox . setAttribute ( 'value' , page . id ) ; var link = td [ 2 ] . querySelector ( 'a' ) ; link . setAttribute ( 'href' , page . onlineUrl ) ; var maxUrlCharsPerLine = 50 ; if ( page . onlineUrl . length > maxUrlCharsPerLine ) { link . textContent = '' ; for ( let i = 0 ; i < page . onlineUrl . length ; i += maxUrlCharsPerLine ) { link . textContent += page . onlineUrl . slice ( i , i + maxUrlCharsPerLine ) ; link . textContent += '\r\n' ; } } else { link . textContent = page . onlineUrl ; } td [ 3 ] . textContent = page . namespace ; td [ 4 ] . textContent = Math . round ( page . size / 1024 ) ; var row = document . importNode ( template . content , true ) ; storedPagesTable . appendChild ( row ) ; } offlinePages = pages ; }
Fill stored pages table.
Fill stored pages table .