function parseCookie() {
  const cookie = document.cookie.split("; ")
  var valsFound = 0;
  for(var i = 0; i < cookie.length && valsFound < 4; i++) {
    if(cookie[i].includes("sortDir")) {
      sortDir = cookie[i].substring(cookie[i].indexOf("=") + 1);
      valsFound ++;
    } else if (cookie[i].includes("totalElems")) {
      totalElems = parseInt(cookie[i].substring(cookie[i].indexOf("=") + 1));
      valsFound ++;
    } else if (cookie[i].includes("numElemsPerPage")) {
      numElemsPerPage = parseInt(cookie[i].substring(cookie[i].indexOf("=") + 1));
      valsFound ++;
    } else if (cookie[i].includes("sortBy")) {
      sortBy = cookie[i].substring(cookie[i].indexOf("=") + 1);
      valsFound ++;
    }
  }
}
/* Parses the cookie string to find any saved comment settings. */
Parses the cookie string to find any saved comment settings.
Parses the cookie string to find any saved comment settings .
function parseCookie() {
  const cookie = document.cookie.split("; ")
  var valsFound = 0;
  for(var i = 0; i < cookie.length && valsFound < 4; i++) {
    if(cookie[i].includes("sortDir")) {
      sortDir = cookie[i].substring(cookie[i].indexOf("=") + 1);
      valsFound ++;
    } else if (cookie[i].includes("totalElems")) {
      totalElems = parseInt(cookie[i].substring(cookie[i].indexOf("=") + 1));
      valsFound ++;
    } else if (cookie[i].includes("numElemsPerPage")) {
      numElemsPerPage = parseInt(cookie[i].substring(cookie[i].indexOf("=") + 1));
      valsFound ++;
    } else if (cookie[i].includes("sortBy")) {
      sortBy = cookie[i].substring(cookie[i].indexOf("=") + 1);
      valsFound ++;
    }
  }
}
function parseCookie ( ) { const cookie = document . cookie . split ( "; " ) var valsFound = 0 ; for ( var i = 0 ; i < cookie . length && valsFound < 4 ; i ++ ) { if ( cookie [ i ] . includes ( "sortDir" ) ) { sortDir = cookie [ i ] . substring ( cookie [ i ] . indexOf ( "=" ) + 1 ) ; valsFound ++ ; } else if ( cookie [ i ] . includes ( "totalElems" ) ) { totalElems = parseInt ( cookie [ i ] . substring ( cookie [ i ] . indexOf ( "=" ) + 1 ) ) ; valsFound ++ ; } else if ( cookie [ i ] . includes ( "numElemsPerPage" ) ) { numElemsPerPage = parseInt ( cookie [ i ] . substring ( cookie [ i ] . indexOf ( "=" ) + 1 ) ) ; valsFound ++ ; } else if ( cookie [ i ] . includes ( "sortBy" ) ) { sortBy = cookie [ i ] . substring ( cookie [ i ] . indexOf ( "=" ) + 1 ) ; valsFound ++ ; } } }
Parses the cookie string to find any saved comment settings.
Parses the cookie string to find any saved comment settings .