docs/_static/websupport.js
function initComparator() {
    by = 'rating'; // Default to sort by rating.
    // If the sortBy cookie is set, use that instead.
    if (document.cookie.length > 0) {
      var start = document.cookie.indexOf('sortBy=');
      if (start != -1) {
        start = start + 7;
        var end = document.cookie.indexOf(";", start);
        if (end == -1) {
          end = document.cookie.length;
          by = unescape(document.cookie.substring(start, end));
        }
      }
    }
    setComparator();
  }
function initComparator() {
    by = 'rating'; // Default to sort by rating.
    // If the sortBy cookie is set, use that instead.
    if (document.cookie.length > 0) {
      var start = document.cookie.indexOf('sortBy=');
      if (start != -1) {
        start = start + 7;
        var end = document.cookie.indexOf(";", start);
        if (end == -1) {
          end = document.cookie.length;
          by = unescape(document.cookie.substring(start, end));
        }
      }
    }
    setComparator();
  }
function initComparator ( ) { by = 'rating' ; // Default to sort by rating. // If the sortBy cookie is set, use that instead. if ( document . cookie . length > 0 ) { var start = document . cookie . indexOf ( 'sortBy=' ) ; if ( start != - 1 ) { start = start + 7 ; var end = document . cookie . indexOf ( ";" , start ) ; if ( end == - 1 ) { end = document . cookie . length ; by = unescape ( document . cookie . substring ( start , end ) ) ; } } } setComparator ( ) ; }
Create a comp function. If the user has preferences stored in
the sortBy cookie, use those, otherwise use the default.
Create a comp function . If the user has preferences stored in the sortBy cookie use those otherwise use the default .