B2G/gaia/apps/settings/js/carrier.js
// create a network operator list item
create a network operator list item
create a network operator list item
function newListItem(network, callback) {
    var name = document.createElement('a');
    name.textContent = network.shortName || network.longName;
    var state = document.createElement('small');
    localize(state,
      network.state ? ('state-' + network.state) : 'state-unknown');
    var li = document.createElement('li');
    li.appendChild(state);
    li.appendChild(name);
    li.dataset.cachedState = network.state || 'unknown';
    li.classList.add('operatorItem');
    li.onclick = function() {
      callback(network, true);
    };
    return li;
  }
function newListItem ( network , callback ) { var name = document . createElement ( 'a' ) ; name . textContent = network . shortName || network . longName ; var state = document . createElement ( 'small' ) ; localize ( state , network . state ? ( 'state-' + network . state ) : 'state-unknown' ) ; var li = document . createElement ( 'li' ) ; li . appendChild ( state ) ; li . appendChild ( name ) ; li . dataset . cachedState = network . state || 'unknown' ; li . classList . add ( 'operatorItem' ) ; li . onclick = function ( ) { callback ( network , true ) ; } ; return li ; }
create a network operator list item
create a network operator list item
/**
     * A network list item has the following HTML structure:
     *   <li>
     *     <small> Network State </small>
     *     <a> Network Name </a>
     *   </li>
     */ // name // state // create list item // bind connection callback