src/Parser.js
/**
   * Parse a mentorship session history page with his index.
   * @param {int} pageNb - The page index
   */
Parse a mentorship session history page with his index.
@param {int} pageNb - The page index
Parse a mentorship session history page with his index . @param { int } pageNb - The page index
launchParsing(pageNb) {
    var loop = true;
    var self = this;
    $.ajax({
      url: config.sessionsHistoryLink + pageNb,
      type: "GET",
      success: function(res) {
        var json = $(res)
          .find(".crud-list:first")
          .tableToJSON({
            ignoreHiddenRows: false
          });
        $.each(json, function(index, element) {
          var dateArray = element[
            Translation[LanguageUtils.getLanguage()]["sessionDate"]
          ].split(" ");
          var month = Translation[
            LanguageUtils.getLanguage()
          ].getMonthFromSplittedDate(dateArray);
          var year = Translation[
            LanguageUtils.getLanguage()
          ].getYearFromSplittedDate(dateArray);
          if (self.treatElement(month, year, element) == false) {
            if (month == config.stopMonth) {
              loop = false;
              return false;
            }
          }
        });
        if (loop) self.launchParsing(pageNb + 1);
      }
    });
  }
launchParsing ( pageNb ) { var loop = true ; var self = this ; $ . ajax ( { url : config . sessionsHistoryLink + pageNb , type : "GET" , success : function ( res ) { var json = $ ( res ) . find ( ".crud-list:first" ) . tableToJSON ( { ignoreHiddenRows : false } ) ; $ . each ( json , function ( index , element ) { var dateArray = element [ Translation [ LanguageUtils . getLanguage ( ) ] [ "sessionDate" ] ] . split ( " " ) ; var month = Translation [ LanguageUtils . getLanguage ( ) ] . getMonthFromSplittedDate ( dateArray ) ; var year = Translation [ LanguageUtils . getLanguage ( ) ] . getYearFromSplittedDate ( dateArray ) ; if ( self . treatElement ( month , year , element ) == false ) { if ( month == config . stopMonth ) { loop = false ; return false ; } } } ) ; if ( loop ) self . launchParsing ( pageNb + 1 ) ; } } ) ; }
Parse a mentorship session history page with his index.
Parse a mentorship session history page with his index .