src/options.js
/**
 * Makes a checklist from content of array.
 */
Makes a checklist from content of array.
Makes a checklist from content of array .
function formCreate () {
  chrome.storage.sync.get('memberships', function (arrayList) {
    const list = arrayList.memberships || []
    const container = document.getElementById('check-list')
    for (const key in DiscountServices) {
      const newP = document.createElement('p')
      const newLabel = document.createElement('label')
      newLabel.className = 'check-container'
      newLabel.innerText = DiscountServices[key].name
      const checkbox = document.createElement('input')
      checkbox.type = 'checkbox'
      checkbox.checked = list.includes(key) === true
      checkbox.name = key
      const newA = document.createElement('a')
      newA.href = DiscountServices[key].homepage
      newA.innerText = '[link]'
      const newSpan = document.createElement('span')
      newSpan.className = 'checkmark'
      newLabel.appendChild(checkbox)
      newLabel.appendChild(newSpan)
      newP.appendChild(newLabel)
      newP.appendChild(newA)
      container.appendChild(newP)
    }
  })
}
function formCreate ( ) { chrome . storage . sync . get ( 'memberships' , function ( arrayList ) { const list = arrayList . memberships || [ ] const container = document . getElementById ( 'check-list' ) for ( const key in DiscountServices ) { const newP = document . createElement ( 'p' ) const newLabel = document . createElement ( 'label' ) newLabel . className = 'check-container' newLabel . innerText = DiscountServices [ key ] . name const checkbox = document . createElement ( 'input' ) checkbox . type = 'checkbox' checkbox . checked = list . includes ( key ) === true checkbox . name = key const newA = document . createElement ( 'a' ) newA . href = DiscountServices [ key ] . homepage newA . innerText = '[link]' const newSpan = document . createElement ( 'span' ) newSpan . className = 'checkmark' newLabel . appendChild ( checkbox ) newLabel . appendChild ( newSpan ) newP . appendChild ( newLabel ) newP . appendChild ( newA ) container . appendChild ( newP ) } } ) }
Makes a checklist from content of array.
Makes a checklist from content of array .