function createRow(info) {
    var originCell = createElementWithClassName('td', 'origin-cell');
    originCell.textContent = info.origin.url;

    var baseScoreInput =
        createElementWithClassName('input', 'base-score-input');
    baseScoreInput.addEventListener(
        'change', handleBaseScoreChange.bind(undefined, info.origin));
    baseScoreInput.addEventListener('focus', disableAutoupdate);
    baseScoreInput.addEventListener('blur', enableAutoupdate);
    baseScoreInput.value = info.baseScore;

    var baseScoreCell = createElementWithClassName('td', 'base-score-cell');
    baseScoreCell.appendChild(baseScoreInput);

    var bonusScoreCell = createElementWithClassName('td', 'bonus-score-cell');
    bonusScoreCell.textContent = info.installedBonus;

    var totalScoreCell = createElementWithClassName('td', 'total-score-cell');
    totalScoreCell.textContent = info.totalScore;

    var engagementBar = createElementWithClassName('div', 'engagement-bar');
    engagementBar.style.width = (info.totalScore * 4) + 'px';

    var engagementBarCell =
        createElementWithClassName('td', 'engagement-bar-cell');
    engagementBarCell.appendChild(engagementBar);

    var row = /** @type {HTMLElement} */ (document.createElement('tr'));
    row.appendChild(originCell);
    row.appendChild(baseScoreCell);
    row.appendChild(bonusScoreCell);
    row.appendChild(totalScoreCell);
    row.appendChild(engagementBarCell);

    // Stores correspondent engagementBarCell to change it's length on
    // scoreChange event.
    baseScoreInput.barCellRef = engagementBar;
    return row;
  }
/**
   * Creates a single row in the engagement table.
   * @param {mojom.SiteEngagementDetails} info The info to create the row from.
   * @return {HTMLElement}
   */
Creates a single row in the engagement table.
@param {mojom.SiteEngagementDetails} info The info to create the row from.
Creates a single row in the engagement table . @param { mojom . SiteEngagementDetails } info The info to create the row from .
function createRow(info) {
    var originCell = createElementWithClassName('td', 'origin-cell');
    originCell.textContent = info.origin.url;
    var baseScoreInput =
        createElementWithClassName('input', 'base-score-input');
    baseScoreInput.addEventListener(
        'change', handleBaseScoreChange.bind(undefined, info.origin));
    baseScoreInput.addEventListener('focus', disableAutoupdate);
    baseScoreInput.addEventListener('blur', enableAutoupdate);
    baseScoreInput.value = info.baseScore;
    var baseScoreCell = createElementWithClassName('td', 'base-score-cell');
    baseScoreCell.appendChild(baseScoreInput);
    var bonusScoreCell = createElementWithClassName('td', 'bonus-score-cell');
    bonusScoreCell.textContent = info.installedBonus;
    var totalScoreCell = createElementWithClassName('td', 'total-score-cell');
    totalScoreCell.textContent = info.totalScore;
    var engagementBar = createElementWithClassName('div', 'engagement-bar');
    engagementBar.style.width = (info.totalScore * 4) + 'px';
    var engagementBarCell =
        createElementWithClassName('td', 'engagement-bar-cell');
    engagementBarCell.appendChild(engagementBar);
    var row =  (document.createElement('tr'));
    row.appendChild(originCell);
    row.appendChild(baseScoreCell);
    row.appendChild(bonusScoreCell);
    row.appendChild(totalScoreCell);
    row.appendChild(engagementBarCell);
    baseScoreInput.barCellRef = engagementBar;
    return row;
  }
function createRow ( info ) { var originCell = createElementWithClassName ( 'td' , 'origin-cell' ) ; originCell . textContent = info . origin . url ; var baseScoreInput = createElementWithClassName ( 'input' , 'base-score-input' ) ; baseScoreInput . addEventListener ( 'change' , handleBaseScoreChange . bind ( undefined , info . origin ) ) ; baseScoreInput . addEventListener ( 'focus' , disableAutoupdate ) ; baseScoreInput . addEventListener ( 'blur' , enableAutoupdate ) ; baseScoreInput . value = info . baseScore ; var baseScoreCell = createElementWithClassName ( 'td' , 'base-score-cell' ) ; baseScoreCell . appendChild ( baseScoreInput ) ; var bonusScoreCell = createElementWithClassName ( 'td' , 'bonus-score-cell' ) ; bonusScoreCell . textContent = info . installedBonus ; var totalScoreCell = createElementWithClassName ( 'td' , 'total-score-cell' ) ; totalScoreCell . textContent = info . totalScore ; var engagementBar = createElementWithClassName ( 'div' , 'engagement-bar' ) ; engagementBar . style . width = ( info . totalScore * 4 ) + 'px' ; var engagementBarCell = createElementWithClassName ( 'td' , 'engagement-bar-cell' ) ; engagementBarCell . appendChild ( engagementBar ) ; var row = ( document . createElement ( 'tr' ) ) ; row . appendChild ( originCell ) ; row . appendChild ( baseScoreCell ) ; row . appendChild ( bonusScoreCell ) ; row . appendChild ( totalScoreCell ) ; row . appendChild ( engagementBarCell ) ; baseScoreInput . barCellRef = engagementBar ; return row ; }
Creates a single row in the engagement table.
Creates a single row in the engagement table .
/** @type {HTMLElement} */ // Stores correspondent engagementBarCell to change it's length on // scoreChange event.