B2G/gaia/apps/settings/js/icc.js
/**
   * Navigate through all available STK applications
   */
Navigate through all available STK applications
Navigate through all available STK applications
function updateMenu() {
    DUMP('Showing STK main menu');
    stkOpenAppName = null;
    stkCancelGoBack();
    var reqApplications =
      window.navigator.mozSettings.createLock().get('icc.applications');
    reqApplications.onsuccess = function icc_getApplications() {
      var json = reqApplications.result['icc.applications'];
      var menu = json && JSON.parse(json);
      clearList();
      setSTKScreenType(STK_SCREEN_MAINMENU);
      if (!menu || !menu.items ||
        (menu.items.length == 1 && menu.items[0] === null)) {
        DUMP('No STK available - hide & exit');
        document.getElementById('icc-mainheader').hidden = true;
        document.getElementById('icc-mainentry').hidden = true;
        return;
      }
      DUMP('STK Main App Menu title: ' + menu.title);
      DUMP('STK Main App Menu default item: ' + menu.defaultItem);
      iccMenuItem.textContent = menu.title;
      showTitle(menu.title);
      menu.items.forEach(function(menuItem) {
        DUMP('STK Main App Menu item: ' + menuItem.text + ' # ' +
              menuItem.identifier);
        iccStkList.appendChild(buildMenuEntry({
          id: 'stk-menuitem-' + menuItem.identifier,
          text: menuItem.text,
          nai: _(menuItem.nai),
          onclick: onMainMenuItemClick,
          attributes: [['stk-menu-item-identifier', menuItem.identifier]]
        }));
      });
      if (menu.isHelpAvailable) {
        iccStkList.appendChild(buildMenuEntry({
          id: 'stk-helpmenuitem',
          text: _('operatorServices-helpmenu'),
          onclick: showHelpMenu,
          attributes: []
        }));
      }
    };
  }
function updateMenu ( ) { DUMP ( 'Showing STK main menu' ) ; stkOpenAppName = null ; stkCancelGoBack ( ) ; var reqApplications = window . navigator . mozSettings . createLock ( ) . get ( 'icc.applications' ) ; reqApplications . onsuccess = function icc_getApplications ( ) { var json = reqApplications . result [ 'icc.applications' ] ; var menu = json && JSON . parse ( json ) ; clearList ( ) ; setSTKScreenType ( STK_SCREEN_MAINMENU ) ; if ( ! menu || ! menu . items || ( menu . items . length == 1 && menu . items [ 0 ] === null ) ) { DUMP ( 'No STK available - hide & exit' ) ; document . getElementById ( 'icc-mainheader' ) . hidden = true ; document . getElementById ( 'icc-mainentry' ) . hidden = true ; return ; } DUMP ( 'STK Main App Menu title: ' + menu . title ) ; DUMP ( 'STK Main App Menu default item: ' + menu . defaultItem ) ; iccMenuItem . textContent = menu . title ; showTitle ( menu . title ) ; menu . items . forEach ( function ( menuItem ) { DUMP ( 'STK Main App Menu item: ' + menuItem . text + ' # ' + menuItem . identifier ) ; iccStkList . appendChild ( buildMenuEntry ( { id : 'stk-menuitem-' + menuItem . identifier , text : menuItem . text , nai : _ ( menuItem . nai ) , onclick : onMainMenuItemClick , attributes : [ [ 'stk-menu-item-identifier' , menuItem . identifier ] ] } ) ) ; } ) ; if ( menu . isHelpAvailable ) { iccStkList . appendChild ( buildMenuEntry ( { id : 'stk-helpmenuitem' , text : _ ( 'operatorServices-helpmenu' ) , onclick : showHelpMenu , attributes : [ ] } ) ) ; } } ; }
Navigate through all available STK applications
Navigate through all available STK applications
// Optional Help menu