apps/settings/js/carrier.js
// create a button to apply <apn> data to the current fields
create a button to apply  data to the current fields
create a button to apply data to the current fields
function createAPNItem(item) {
      var input = document.createElement('input');
      input.type = 'radio';
      input.name = usage + 'ApnSettingsCarrier';
      input.dataset.setting = 'ril.' + usage + '.carrier';
      input.value = item.carrier || item.apn;
      input.onclick = function fillAPNData() {
        rilData(usage, 'apn').value = item.apn || '';
        rilData(usage, 'user').value = item.user || '';
        rilData(usage, 'passwd').value = item.password || '';
        rilData(usage, 'httpProxyHost').value = item.proxy || '';
        rilData(usage, 'httpProxyPort').value = item.port || '';
        if (usage == 'mms') {
          rilData(usage, 'mmsc').value = item.mmsc || '';
          rilData(usage, 'mmsproxy').value = item.mmsproxy || '';
          rilData(usage, 'mmsport').value = item.mmsport || '';
        }
        var input = document.getElementById('ril-' + usage + '-authType');
        input.value = AUTH_TYPES[item.authtype] || 'notDefined';
        var parent = input.parentElement;
        var button = input.previousElementSibling;
        var index = input.selectedIndex;
        if (index >= 0) {
          var selection = input.options[index];
          button.textContent = selection.textContent;
          button.dataset.l10nId = selection.dataset.l10nId;
        }
      };
      var span = document.createElement('span');
      var label = document.createElement('label');
      label.classList.add('pack-radio');
      label.appendChild(input);
      label.appendChild(span);
      var a = document.createElement('a');
      a.textContent = item.carrier || item.apn;
      var li = document.createElement('li');
      li.appendChild(label);
      li.appendChild(a);
      return li;
    }
function createAPNItem ( item ) { var input = document . createElement ( 'input' ) ; input . type = 'radio' ; input . name = usage + 'ApnSettingsCarrier' ; input . dataset . setting = 'ril.' + usage + '.carrier' ; input . value = item . carrier || item . apn ; input . onclick = function fillAPNData ( ) { rilData ( usage , 'apn' ) . value = item . apn || '' ; rilData ( usage , 'user' ) . value = item . user || '' ; rilData ( usage , 'passwd' ) . value = item . password || '' ; rilData ( usage , 'httpProxyHost' ) . value = item . proxy || '' ; rilData ( usage , 'httpProxyPort' ) . value = item . port || '' ; if ( usage == 'mms' ) { rilData ( usage , 'mmsc' ) . value = item . mmsc || '' ; rilData ( usage , 'mmsproxy' ) . value = item . mmsproxy || '' ; rilData ( usage , 'mmsport' ) . value = item . mmsport || '' ; } var input = document . getElementById ( 'ril-' + usage + '-authType' ) ; input . value = AUTH_TYPES [ item . authtype ] || 'notDefined' ; var parent = input . parentElement ; var button = input . previousElementSibling ; var index = input . selectedIndex ; if ( index >= 0 ) { var selection = input . options [ index ] ; button . textContent = selection . textContent ; button . dataset . l10nId = selection . dataset . l10nId ; } } ; var span = document . createElement ( 'span' ) ; var label = document . createElement ( 'label' ) ; label . classList . add ( 'pack-radio' ) ; label . appendChild ( input ) ; label . appendChild ( span ) ; var a = document . createElement ( 'a' ) ; a . textContent = item . carrier || item . apn ; var li = document . createElement ( 'li' ) ; li . appendChild ( label ) ; li . appendChild ( a ) ; return li ; }
create a button to apply <apn> data to the current fields
create a button to apply <apn > data to the current fields
// create an <input type="radio"> element // include the radio button element in a list item