apps/costcontrol/js/settings/settings.js
// Configure reset dialogs for telephony and data usage
Configure reset dialogs for telephony and data usage
Configure reset dialogs for telephony and data usage
function configureResets() {
    var mode;
    var dialog = document.getElementById('reset-confirmation-dialog');
    var resetTelephonyButton = document.getElementById('reset-telephony');
    resetTelephonyButton.addEventListener('click',
      function _onTelephonyReset() {
        mode = 'telephony';
        vmanager.changeViewTo(dialog.id);
      }
    );
    var resetDataUsage = document.getElementById('reset-data-usage');
    resetDataUsage.addEventListener('click', function _onTelephonyReset() {
      mode = 'data-usage';
      vmanager.changeViewTo(dialog.id);
    });
    var ok = dialog.querySelector('.danger');
    ok.addEventListener('click', function _onAcceptReset() {
      if (mode === 'data-usage') {
        resetData();
      }
      else if (mode === 'telephony') {
        resetTelephony();
      }
      updateUI();
      vmanager.closeCurrentView();
    });
    var cancel = dialog.querySelector('.close-reset-dialog');
    cancel.addEventListener('click', function _onCancelReset() {
      vmanager.closeCurrentView();
    });
  }
function configureResets ( ) { var mode ; var dialog = document . getElementById ( 'reset-confirmation-dialog' ) ; var resetTelephonyButton = document . getElementById ( 'reset-telephony' ) ; resetTelephonyButton . addEventListener ( 'click' , function _onTelephonyReset ( ) { mode = 'telephony' ; vmanager . changeViewTo ( dialog . id ) ; } ) ; var resetDataUsage = document . getElementById ( 'reset-data-usage' ) ; resetDataUsage . addEventListener ( 'click' , function _onTelephonyReset ( ) { mode = 'data-usage' ; vmanager . changeViewTo ( dialog . id ) ; } ) ; var ok = dialog . querySelector ( '.danger' ) ; ok . addEventListener ( 'click' , function _onAcceptReset ( ) { if ( mode === 'data-usage' ) { resetData ( ) ; } else if ( mode === 'telephony' ) { resetTelephony ( ) ; } updateUI ( ) ; vmanager . closeCurrentView ( ) ; } ) ; var cancel = dialog . querySelector ( '.close-reset-dialog' ) ; cancel . addEventListener ( 'click' , function _onCancelReset ( ) { vmanager . closeCurrentView ( ) ; } ) ; }
Configure reset dialogs for telephony and data usage
Configure reset dialogs for telephony and data usage
// Reset statistics // Reset data usage, take in count spent offsets to fix the charts // Reset telephony counters