html/modules/pong-feedback/pong-feedback.js
function feedbackEvtCallback( evt ) {
  log( "pong-feedback", "feedbackEvtCallback" )
  if ( evt && evt.text ) {
    log( "pong-feedback", "feedbackEvtCallback "+evt.text )
    if ( pongLastFeedbackTxt.indexOf( evt.text ) >= 0 ) {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        var evtNo = pongLastFeedbackTxt.indexOf( feedbackTxt )
        pongLastFeedbackCnt[evtNo] = pongLastFeedbackCnt[evtNo] + 1
        pongLastFeedbackTim[evtNo] = new Date()
        moveToLastFeetback( evtNo )
      }
    } else {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        
        pongLastFeedbackTxt.shift()
        pongLastFeedbackTxt.push( feedbackTxt )
        
        pongLastFeedbackCnt.shift()
        pongLastFeedbackCnt.push( 1 )

        pongLastFeedbackTim.shift()
        pongLastFeedbackTim.push( new Date() )
      }
    }
  } 
  updateFeedback()
}
function feedbackEvtCallback( evt ) {
  log( "pong-feedback", "feedbackEvtCallback" )
  if ( evt && evt.text ) {
    log( "pong-feedback", "feedbackEvtCallback "+evt.text )
    if ( pongLastFeedbackTxt.indexOf( evt.text ) >= 0 ) {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        var evtNo = pongLastFeedbackTxt.indexOf( feedbackTxt )
        pongLastFeedbackCnt[evtNo] = pongLastFeedbackCnt[evtNo] + 1
        pongLastFeedbackTim[evtNo] = new Date()
        moveToLastFeetback( evtNo )
      }
    } else {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        
        pongLastFeedbackTxt.shift()
        pongLastFeedbackTxt.push( feedbackTxt )
        
        pongLastFeedbackCnt.shift()
        pongLastFeedbackCnt.push( 1 )

        pongLastFeedbackTim.shift()
        pongLastFeedbackTim.push( new Date() )
      }
    }
  } 
  updateFeedback()
}
function feedbackEvtCallback ( evt ) { log ( "pong-feedback" , "feedbackEvtCallback" ) if ( evt && evt . text ) { log ( "pong-feedback" , "feedbackEvtCallback " + evt . text ) if ( pongLastFeedbackTxt . indexOf ( evt . text ) >= 0 ) { if ( evt . text . length > 0 ) { var feedbackTxt = $ . i18n ( evt . text ) var evtNo = pongLastFeedbackTxt . indexOf ( feedbackTxt ) pongLastFeedbackCnt [ evtNo ] = pongLastFeedbackCnt [ evtNo ] + 1 pongLastFeedbackTim [ evtNo ] = new Date ( ) moveToLastFeetback ( evtNo ) } } else { if ( evt . text . length > 0 ) { var feedbackTxt = $ . i18n ( evt . text ) pongLastFeedbackTxt . shift ( ) pongLastFeedbackTxt . push ( feedbackTxt ) pongLastFeedbackCnt . shift ( ) pongLastFeedbackCnt . push ( 1 ) pongLastFeedbackTim . shift ( ) pongLastFeedbackTim . push ( new Date ( ) ) } } } updateFeedback ( ) }
The callback is subscribed for feedback events
The callback is subscribed for feedback events