1 // $Id$
  2 
  3 /**
  4  * Appends the given items to the given list, optionally inserting a separator
  5  * between the items in the list.
  6  *
  7  * @param {String} list The list to append items to.
  8  * @param {Array} items The list of items to append to the list.
  9  * @param {String} [separator] A string to add between the items.
 10  */
 11 AjaxSolr.theme.prototype.list_items = function (list, items, separator) {
 12   jQuery(list).empty();
 13   for (var i = 0, l = items.length; i < l; i++) {
 14     var li = jQuery('<li/>');
 15     if (AjaxSolr.isArray(items[i])) {
 16       for (var j = 0, m = items[i].length; j < m; j++) {
 17         if (separator && j > 0) {
 18           li.append(separator);
 19         }
 20         li.append(items[i][j]);
 21       }
 22     }
 23     else {
 24       if (separator && i > 0) {
 25         li.append(separator);
 26       }
 27       li.append(items[i]);
 28     }
 29     jQuery(list).append(li);
 30   }
 31 };
 32