Actions

Widget

Difference between revisions of "CastofCharacters"

From ThornsWiki

Line 1: Line 1:
 
<style>
 
<style>
.coc-row {
+
 
    margin: 10px auto;
+
.filter-navigation {
 +
  width: 100%;
 +
  background: #242422;
 +
  position: relative;
 +
  border-bottom: 4px solid #deb975;
 +
  padding: 15px 0;
 +
  color: #fffcf2;
 +
}
 +
 
 +
.filter-navigation .filters {padding:10px 45px 0 45px;}
 +
.filter-navigation ul {padding:0;}
 +
 
 +
.filter-navigation li {
 +
  list-style-type: none;
 +
  display: inline-block;
 
}
 
}
  
/* Add padding BETWEEN each column */
+
.filter-navigation li a {
.coc-row,
+
color: #deb975;
.coc-row > .coc-column {
+
    margin: 2px 1px;
     display: flex;
+
    display: inline-block;
     flex-wrap: wrap;
+
    background: #454545;
    flex-direction: row;
+
     padding: 2px 5px;
    justify-content: space-around;
+
     text-decoration: none;
 +
font-size:.8em;
 +
letter-spacing:0.05em;
 +
font-family:'Open Sans', sans-serif;
 +
text-transform:uppercase;
 +
 
 
}
 
}
 +
 +
.filter-navigation li a.selected {
 +
color: #242422;
 +
background: #deb975;
 +
  font-weight: bold;
 +
}
  
/* Create three equal columns that floats next to each other */
+
.filter-navigation ul b {
.coc-column {
+
  margin: 0 5px;
    flex:1;
 
    width: 32.15%;
 
    display: none; /* Hide all elements by default */
 
 
}
 
}
  
/* Content */
+
table tr th.infobox-label {
.card-content {
+
     text-align: left;
     background-color: #403c39 !important;
+
    text-transform: uppercase;
     padding: 0px 0px;
+
    font-weight: bold;
     color:#ccc5b9;
+
    font-size: .75rem;
     border: 4px solid #deb975;
+
     line-height: 1.25em;
 +
     color: #deb975;
 +
     background-color: #474440;
 +
    vertical-align: middle;
 +
    letter-spacing: 0.035rem;
 
}
 
}
  
 
h4.charname {
 
h4.charname {
background-color:#deb975;
+
    background-color:#deb975;
 
     padding:10px;
 
     padding:10px;
 
     color:#fffcf2;
 
     color:#fffcf2;
Line 37: Line 63:
 
     margin:-5px auto;
 
     margin:-5px auto;
 
     font-family: 'Metamorphous', cursive;
 
     font-family: 'Metamorphous', cursive;
     font-size:.9em; }
+
     font-size:.9em;
+
}
p {
+
 
padding:0px 20px;
 
  }
 
 
 
/* Race Colors */
 
 
.tint img { display: block;  
 
.tint img { display: block;  
 
}
 
}
Line 70: Line 92:
 
.tint:hover:before { background: none; }
 
.tint:hover:before { background: none; }
  
.galdor:before {  
+
.grid {
background: rgba(255,234,119, 0.45);
+
max-width: 100%;
    }
+
    display: flex;
.human:before {
+
    flex-flow: row wrap;
background: rgba(204, 128, 63, 0.45);
+
    justify-content: space-evenly;
}
+
    align-content: center;
.passive:before {
+
    /*margin: 0px auto;*/
background: rgba(190, 183, 164, 0.45);
 
}
 
.raen:before {
 
background: rgba(89, 159, 160, 0.45);
 
 
}
 
}
.wick:before {
 
background: rgba(203, 232, 150, 0.45);
 
}
 
  
/* The "show" class is added to the filtered elements */
+
.grid .item {
.show {
+
   width: 30%;
   display: block;
+
  margin: 1%;
 
}
 
}
 
/* Style the buttons */
 
 
#btn-group button {
 
background-color: #403c39;
 
color: #fffcf2;
 
padding: 10px 30px;
 
float: left;
 
font-family: 'Open Sans', sans-serif;
 
font-size: .75em;
 
text-transform: uppercase;
 
border: 1px solid #deb975;
 
display: block;
 
max-width: 100%;
 
margin: 0px 13px;
 
border-radius: 0px !important;
 
}
 
 
 
 
/* Clear floats (clearfix hack) */
+
/* On screens that are 992px wide or less, go from four columns to two columns */ @media screen and (max-width: 992px) {
#btn-group:after {
 
    content: "";
 
    clear: both;
 
    display: table;
 
}
 
 
 
/*#btn-group button:not(:last-child) {
 
    border-right: none;
 
}*/
 
  
/* Add a background color on hover */
+
.grid .item {
  
#btn-group button:hover {
+
      min-width:350px;
    background-color: #403c39;
+
      max-width:100%;
    color:#deb975;
 
 
}
 
}
  
#btn-group button:active {
+
/* On screens that are 600px wide or less, make the columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) {
    background-color: #403c39;
 
    color:#deb975;
 
}
 
  
#btn-group button.active {
+
.grid .item {
    background-color: #deb975;
 
    color:#403c39;
 
}
 
  
/* Character Links */
+
      min-width:350px;
.cs-link {
+
      max-width:100%;
display: block;
+
  }
border: 1px solid #deb975;
 
padding: 10px;
 
text-decoration: none;
 
color: #fffcf2;
 
background-color: #242422;
 
width: 75%;
 
margin: 10px auto;
 
}
 
 
 
.cs-link a {
 
color:#fffcf2;;
 
text-decoration:none;
 
 
}
 
}
 
 
.cs-link a:hover {
+
</style>
color:#403c39;
 
text-decoration:none;
 
}
 
  
.cs-link:hover  {
+
<script
background: #deb975;
+
  src="https://code.jquery.com/jquery-3.4.0.min.js"
color:#403c39;
+
  integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg="
}
+
  crossorigin="anonymous"></script>
 +
 +
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
 
 
/* GLOBAL NAV */
+
<script>
.staticnav {
+
$(document).ready(function() {
background-color:#474440;  
+
  var $container = $(".grid"); // the container with all the elements to filter inside
overflow:hidden;
+
  var filters = {}; //should be outside the scope of the filtering function
margin-top:-30px;
 
margin-bottom:20px;
 
border-bottom:2px solid #deb975;
 
}
 
  
.staticnav a:link, .staticnav a:visited {
+
  /* --- read the documentation on isotope.metafizzy.co for more options --- */
float:left;
+
  var $grid = $container.isotope({
display:block;
+
    itemSelector: ".item", // the elements to filter
Text-align:center;
+
    percentPosition: true, // true if you use percentage widths
Padding:15px 20px;
+
getSortData: {
Text-decoration:none;
+
    first: '.Firstname',
Font-size:0.85em;
+
    last: '.Lastname',
Font-family:'Metamorphous', serif;
+
  },
text-transform:uppercase;
+
  // sort by last name then first name
color:#ccc5b9;
+
sortBy: [ 'last', 'first' ]
}
+
  });
  
.staticnav a:first-child {
+
  // save some classes for later usage
margin-left:30px;
+
  /* ---
}
+
  activeClass: adds this class to filters that are selected (active)
 +
  comboClass: the class that indicates that the filter group is a chain filter, i.e. if you select two filters, only items with BOTH filters will be shown
 +
  exclClass: the class that indicates that the filter group is an exclusion filter, i.e. you can only select one filter from that group at a time
 +
  resetClass: the class for the overall reset button
 +
  --- */
 +
  var activeClass = "selected",
 +
    comboClass = "combine",
 +
    exclClass = "exclusive",
 +
    resetClass = "reset";
  
.staticnav a:hover {
+
  var $defaults = $("a." + activeClass + '[data-filter-value=""]');
Background-color: #ccc5b9;
+
  $(".option-set a").click(function(e) {
Color:#474440;
+
    // insert your link selector where it says '.option-set a'
 +
    var $this = $(this); // cache the clicked link
 +
    var comboFilter,
 +
      filterAttr = "data-filter-value";
 +
    if (resetClass && !$this.hasClass(resetClass)) {
 +
      // defining variables
 +
      var filterValue = $this.attr(filterAttr); // cache the filter
 +
      var $optionSet = $this.parents(".option-set"); // cache the parent element
 +
      var group = $optionSet.attr("data-filter-group"); // cache the parent filter group
 +
      var filterGroup = filters[group]; // make new variable for the property being filtered
 +
      if (!filterGroup) {
 +
        // if the property doesn't exist
 +
        filterGroup = filters[group] = []; // make a new empty array
 +
      }
 +
      var $selectAll = $optionSet.find("a[" + filterAttr + '=""]'); // cache the 'select all' button in the current group
 +
      $("." + resetClass).removeClass(activeClass);
 +
      comboFiltering(
 +
        $this,
 +
        filters,
 +
        filterAttr,
 +
        filterValue,
 +
        $optionSet,
 +
        group,
 +
        $selectAll,
 +
        activeClass,
 +
        comboClass,
 +
        exclClass
 +
      );
 +
      comboFilter = getComboFilter(filters); // join all the filters
 +
      if (!comboFilter.length) $("a." + resetClass).addClass(activeClass);
 +
      $this.toggleClass(activeClass);
 +
    } else {
 +
      filters = {};
 +
      comboFilter = "";
 +
      $(".option-set a").removeClass(activeClass);
 +
      $(this).addClass(activeClass);
 +
      $defaults.addClass(activeClass);
 +
    }
 +
    $grid.isotope({
 +
      filter: comboFilter
 +
    });
 +
    e.preventDefault();
 +
  });
 +
});
 +
function comboFiltering(
 +
  $this,
 +
  filters,
 +
  filterAttr,
 +
  filterValue,
 +
  $optionSet,
 +
  group,
 +
  $selectAll,
 +
  activeClass,
 +
  comboClass,
 +
  exclClass
 +
) {
 +
  // for non-exclusive groups of filters
 +
  if (!$optionSet.hasClass(exclClass)) {
 +
    // replace 'exclusive' with the class of your exclusive filter groups
 +
    // if link is a filter that isn't selected
 +
    if (!$this.hasClass(activeClass) && filterValue.length) {
 +
      filters[group].push(filterValue); // add filter to array
 +
      $selectAll.removeClass(activeClass); // remove the selected class from the 'select all' button
 +
    } else if (filterValue.length) {
 +
      // if link is a selected filter
 +
      // remove filter from array
 +
      // check if the filter group we're concerned with is a combination filter (.one.two instead of .one,.two)
 +
      if ($optionSet.hasClass(comboClass)) {
 +
        filters[group][0] = filters[group][0].replace(filterValue, ""); // delete the filter from the combined string
 +
        if (!filters[group][0].length)
 +
          // check if there is anything left in the string after deletion
 +
          filters[group].splice(0, 1); // if no, remove the empty string
 +
      } else {
 +
        // if filter group is not a combo filter
 +
        var curIndex = filters[group].indexOf(filterValue); // get index of filter string in array
 +
        if (curIndex > -1) filters[group].splice(curIndex, 1); // remove the filter
 +
      }
 +
      if (!$optionSet.find("a." + activeClass).not($this).length)
 +
        // if there are no remaining filters
 +
        $selectAll.addClass(activeClass); // add the active class to the 'select all' button
 +
    } else {
 +
      // if link is the show all button for that group
 +
      $optionSet.find("a." + activeClass).removeClass(activeClass); // remove the active class from all other buttons
 +
      filters[group] = []; // clear the array of all filters
 +
    }
 +
    // join everything to a single string for the combined filtering groups
 +
    if ($optionSet.hasClass(comboClass) && filters[group].length)
 +
      filters[group] = [filters[group].join("")];
 +
  } else {
 +
    // for exclusive groups
 +
    // if link is a filter that isn't selected
 +
    if (!$this.hasClass(activeClass) && filterValue.length) {
 +
      // run a loop for all active filters
 +
      $optionSet.find("a." + activeClass).each(function(k, filterLink) {
 +
        // remove all active filters in the same group from the array
 +
        var removeFilter = $(filterLink).attr(filterAttr);
 +
        var removeIndex = filters[group].indexOf(removeFilter);
 +
        filters[group].splice(removeIndex, 1);
 +
      });
 +
      filters[group].push(filterValue); // add selected filter to array
 +
      $optionSet.find("a." + activeClass).removeClass(activeClass); // remove the active class from all other links in the group
 +
    } else if (filterValue.length) {
 +
      // if link is a selected filter
 +
      // remove filter from array
 +
      var curIndex = filters[group].indexOf(filterValue);
 +
      if (curIndex > -1) filters[group].splice(curIndex, 1);
 +
      if (!$optionSet.find("a." + activeClass).not($this).length)
 +
        // if there are no remaining filters
 +
        $selectAll.addClass(activeClass); // add active class to 'select all' button
 +
    } else {
 +
      // if link is the show all button for that group
 +
      $optionSet.find("a." + activeClass).removeClass(activeClass); // remove active class from all other buttons
 +
      filters[group] = []; // reset all filters for this group
 +
    }
 +
  }
 
}
 
}
 +
/* --- concat filters --- */
 +
function getComboFilter(filters) {
 +
  // pass the entire array of filters to the function
 +
  var i = 0; // set counter variable as zero
 +
  var comboFilters = []; // make a new array to save the string of filters
  
.staticnav.active {
+
  for (var prop in filters) {
Background-color: #ccc5b9;
+
    // loop through all the properties in the filter array passed to the function
Color:#474440;
+
    var filterGroup = filters[prop]; // define variable
}
+
    // skip to next filter group if it doesn't have any values
 +
    if (!filterGroup.length) {
 +
      continue; // exit loop and move on with next iteration
 +
    }
 +
    if (i === 0) {
 +
      // copy to new array
 +
      comboFilters = filterGroup.slice(0);
 +
    } else {
 +
      var filterSelectors = [];
 +
      // copy to fresh array
 +
      var groupCombo = comboFilters.slice(0);
 +
      // merge filter Groups
 +
      for (var k = 0, len3 = filterGroup.length; k < len3; k++) {
 +
        for (var j = 0, len2 = groupCombo.length; j < len2; j++) {
 +
          filterSelectors.push(groupCombo[j] + filterGroup[k]);
 +
        }
 +
      }
 +
      // apply filter selectors to combo filters for next group
 +
      comboFilters = filterSelectors;
 +
    }
 +
    i++; // increment
 +
  }
  
.staticnav .icon {
+
  var comboFilter = comboFilters.join(", ");
    display: none;
+
  return comboFilter;
}
+
}
 +
</script>
  
@media screen and (max-width: 600px) {
+
<div class="filter-navigation">
    .staticnav a {
+
  <div class="filters">
        float: none;
 
margin:0px auto;
 
width: 100%; }
 
 
.staticnav a:first-child {
 
margin-left:0px;
 
}
 
    }
 
  
</style>
 
  
<script>
+
filterSelection("all")
+
     <!--li class="option-set">-filter-value=".New">Newest</li-->
function filterSelection(c) {
 
  var x, i;
 
  x = document.getElementsByClassName("column");
 
  if (c == "all") c = "";
 
  for (i = 0; i < x.length; i++) {
 
     w3RemoveClass(x[i], "show");
 
    if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
 
  }
 
}
 
  
function w3AddClass(element, name) {
+
    <ul class="filter option-set exclusive" data-filter-group="race">
  var i, arr1, arr2;
+
      <li style="font-family:'Metamorphous',serif;text-transform:uppercase;font-size:.9rem;letter-spacing:0.025rem; width:125px;"><b>Sort by Race</b></li>
  arr1 = element.className.split(" ");
+
      <li>="selected">All</li>
  arr2 = name.split(" ");
+
      <li>=".Galdor">Galdor</li>
  for (i = 0; i < arr2.length; i++) {
+
      <li>">Human</li>
    if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}
+
  }
+
      <li><a href="#" data-filter-value=".Raen">Raen</li>
}
+
 +
    </ul>
  
function w3RemoveClass(element, name) {
+
   </div>
   var i, arr1, arr2;
 
  arr1 = element.className.split(" ");
 
  arr2 = name.split(" ");
 
  for (i = 0; i < arr2.length; i++) {
 
    while (arr1.indexOf(arr2[i]) > -1) {
 
      arr1.splice(arr1.indexOf(arr2[i]), 1);   
 
    }
 
  }
 
  element.className = arr1.join(" ");
 
}
 
  
 +
  <div class="log"></div>
  
// Add active class to the current button (highlight it)
 
var btnContainer = document.getElementById("btn-group");
 
var btns = btnContainer.getElementsByClassName("btn");
 
for (var i = 0; i < btns.length; i++) {
 
  btns[i].addEventListener("click", function(){
 
    var current = document.getElementsByClassName("active");
 
    current[0].className = current[0].className.replace(" active", "");
 
    this.className += " active";
 
  });
 
}
 
</script>
 
 
<div style="width:100%; margin:25px auto 0px; padding:5px 0px;">
 
      <div id="btn-group" style="width:85%; margin:0px auto;">
 
            <button  class="btn active" onclick="filterSelection('all')"> Show all</button>
 
            <button  class="btn" onclick="filterSelection('galdori')"> Galdor</button>
 
            <button  class="btn" onclick="filterSelection('humans')"> Human</button>
 
            <button class="btn" onclick="filterSelection('passives')"> Passive</button>
 
            <button  class="btn" onclick="filterSelection('raen')"> Raen</button>
 
            <button  class="btn" onclick="filterSelection('wicks')"> Wick</button>
 
      </div>
 
 
</div>
 
</div>

Revision as of 15:25, 5 May 2020

<style>

.filter-navigation {

 width: 100%;
 background: #242422;
 position: relative;
 border-bottom: 4px solid #deb975;
 padding: 15px 0;
 color: #fffcf2;

}

.filter-navigation .filters {padding:10px 45px 0 45px;} .filter-navigation ul {padding:0;}

.filter-navigation li {

 list-style-type: none;
 display: inline-block;

}

.filter-navigation li a {

	color: #deb975;
   margin: 2px 1px;
   display: inline-block;
   background: #454545;
   padding: 2px 5px;
   text-decoration: none;

font-size:.8em; letter-spacing:0.05em; font-family:'Open Sans', sans-serif; text-transform:uppercase;

}

.filter-navigation li a.selected { color: #242422;

		background: #deb975;
 		font-weight: bold;

}

.filter-navigation ul b {

 margin: 0 5px;

}

table tr th.infobox-label {

   text-align: left;
   text-transform: uppercase;
   font-weight: bold;
   font-size: .75rem;
   line-height: 1.25em;
   color: #deb975;
   background-color: #474440;
   vertical-align: middle;
   letter-spacing: 0.035rem;

}

h4.charname {

   background-color:#deb975;
   padding:10px;
   color:#fffcf2;
   display:block;
   width:100%;
   text-align:center;
   margin:-5px auto;
   font-family: 'Metamorphous', cursive;
   font-size:.9em;

}

.tint img { display: block; }

.tint {

 position: relative;
 float: left;
 cursor: pointer;
 width:100%;
 margin-left:0px;
 margin-top:0px;

}

.tint:before {

 content: "";
 display: block;
 position: absolute;
 top: 0;
 bottom: 0;
 left: 0;
 right: 0;
 background: rgba(148, 124, 84, 0.45);
 transition: all .3s linear;

}

.tint:hover:before { background: none; }

.grid { max-width: 100%;

   display: flex;
   flex-flow: row wrap;
   justify-content: space-evenly;
   align-content: center;
   /*margin: 0px auto;*/

}

.grid .item {

 width: 30%;
 margin: 1%;

}

/* On screens that are 992px wide or less, go from four columns to two columns */ @media screen and (max-width: 992px) {

.grid .item {

      min-width:350px;
      max-width:100%;

}

/* On screens that are 600px wide or less, make the columns stack on top of each other instead of next to each other */ @media screen and (max-width: 600px) {

.grid .item {

      min-width:350px;
      max-width:100%;
  }

}

</style>

<script

 src="https://code.jquery.com/jquery-3.4.0.min.js"
 integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg="
 crossorigin="anonymous"></script>

<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>

<script> $(document).ready(function() {

 var $container = $(".grid"); // the container with all the elements to filter inside
 var filters = {}; //should be outside the scope of the filtering function
 /* --- read the documentation on isotope.metafizzy.co for more options --- */
 var $grid = $container.isotope({
   itemSelector: ".item", // the elements to filter
   percentPosition: true, // true if you use percentage widths

getSortData: {

   first: '.Firstname',
   last: '.Lastname',
 	},
 // sort by last name then first name

sortBy: [ 'last', 'first' ]

 });
 // save some classes for later usage
 /* ---
 activeClass: adds this class to filters that are selected (active)
 comboClass: the class that indicates that the filter group is a chain filter, i.e. if you select two filters, only items with BOTH filters will be shown
 exclClass: the class that indicates that the filter group is an exclusion filter, i.e. you can only select one filter from that group at a time
 resetClass: the class for the overall reset button
 --- */
 var activeClass = "selected",
   comboClass = "combine",
   exclClass = "exclusive",
   resetClass = "reset";
 var $defaults = $("a." + activeClass + '[data-filter-value=""]');
 $(".option-set a").click(function(e) {
   // insert your link selector where it says '.option-set a'
   var $this = $(this); // cache the clicked link
   var comboFilter,
     filterAttr = "data-filter-value";
   if (resetClass && !$this.hasClass(resetClass)) {
     // defining variables
     var filterValue = $this.attr(filterAttr); // cache the filter
     var $optionSet = $this.parents(".option-set"); // cache the parent element
     var group = $optionSet.attr("data-filter-group"); // cache the parent filter group
     var filterGroup = filters[group]; // make new variable for the property being filtered
     if (!filterGroup) {
       // if the property doesn't exist
       filterGroup = filters[group] = []; // make a new empty array
     }
     var $selectAll = $optionSet.find("a[" + filterAttr + '=""]'); // cache the 'select all' button in the current group
     $("." + resetClass).removeClass(activeClass);
     comboFiltering(
       $this,
       filters,
       filterAttr,
       filterValue,
       $optionSet,
       group,
       $selectAll,
       activeClass,
       comboClass,
       exclClass
     );
     comboFilter = getComboFilter(filters); // join all the filters
     if (!comboFilter.length) $("a." + resetClass).addClass(activeClass);
     $this.toggleClass(activeClass);
   } else {
     filters = {};
     comboFilter = "";
     $(".option-set a").removeClass(activeClass);
     $(this).addClass(activeClass);
     $defaults.addClass(activeClass);
   }
   $grid.isotope({
     filter: comboFilter
   });
   e.preventDefault();
 });

}); function comboFiltering(

 $this,
 filters,
 filterAttr,
 filterValue,
 $optionSet,
 group,
 $selectAll,
 activeClass,
 comboClass,
 exclClass

) {

 // for non-exclusive groups of filters
 if (!$optionSet.hasClass(exclClass)) {
   // replace 'exclusive' with the class of your exclusive filter groups
   // if link is a filter that isn't selected
   if (!$this.hasClass(activeClass) && filterValue.length) {
     filters[group].push(filterValue); // add filter to array
     $selectAll.removeClass(activeClass); // remove the selected class from the 'select all' button
   } else if (filterValue.length) {
     // if link is a selected filter
     // remove filter from array
     // check if the filter group we're concerned with is a combination filter (.one.two instead of .one,.two)
     if ($optionSet.hasClass(comboClass)) {
       filters[group][0] = filters[group][0].replace(filterValue, ""); // delete the filter from the combined string
       if (!filters[group][0].length)
         // check if there is anything left in the string after deletion
         filters[group].splice(0, 1); // if no, remove the empty string
     } else {
       // if filter group is not a combo filter
       var curIndex = filters[group].indexOf(filterValue); // get index of filter string in array
       if (curIndex > -1) filters[group].splice(curIndex, 1); // remove the filter
     }
     if (!$optionSet.find("a." + activeClass).not($this).length)
       // if there are no remaining filters
       $selectAll.addClass(activeClass); // add the active class to the 'select all' button
   } else {
     // if link is the show all button for that group
     $optionSet.find("a." + activeClass).removeClass(activeClass); // remove the active class from all other buttons
     filters[group] = []; // clear the array of all filters
   }
   // join everything to a single string for the combined filtering groups
   if ($optionSet.hasClass(comboClass) && filters[group].length)
     filters[group] = [filters[group].join("")];
 } else {
   // for exclusive groups
   // if link is a filter that isn't selected
   if (!$this.hasClass(activeClass) && filterValue.length) {
     // run a loop for all active filters
     $optionSet.find("a." + activeClass).each(function(k, filterLink) {
       // remove all active filters in the same group from the array
       var removeFilter = $(filterLink).attr(filterAttr);
       var removeIndex = filters[group].indexOf(removeFilter);
       filters[group].splice(removeIndex, 1);
     });
     filters[group].push(filterValue); // add selected filter to array
     $optionSet.find("a." + activeClass).removeClass(activeClass); // remove the active class from all other links in the group
   } else if (filterValue.length) {
     // if link is a selected filter
     // remove filter from array
     var curIndex = filters[group].indexOf(filterValue);
     if (curIndex > -1) filters[group].splice(curIndex, 1);
     if (!$optionSet.find("a." + activeClass).not($this).length)
       // if there are no remaining filters
       $selectAll.addClass(activeClass); // add active class to 'select all' button
   } else {
     // if link is the show all button for that group
     $optionSet.find("a." + activeClass).removeClass(activeClass); // remove active class from all other buttons
     filters[group] = []; // reset all filters for this group
   }
 }

} /* --- concat filters --- */ function getComboFilter(filters) {

 // pass the entire array of filters to the function
 var i = 0; // set counter variable as zero
 var comboFilters = []; // make a new array to save the string of filters
 for (var prop in filters) {
   // loop through all the properties in the filter array passed to the function
   var filterGroup = filters[prop]; // define variable
   // skip to next filter group if it doesn't have any values
   if (!filterGroup.length) {
     continue; // exit loop and move on with next iteration
   }
   if (i === 0) {
     // copy to new array
     comboFilters = filterGroup.slice(0);
   } else {
     var filterSelectors = [];
     // copy to fresh array
     var groupCombo = comboFilters.slice(0);
     // merge filter Groups
     for (var k = 0, len3 = filterGroup.length; k < len3; k++) {
       for (var j = 0, len2 = groupCombo.length; j < len2; j++) {
         filterSelectors.push(groupCombo[j] + filterGroup[k]);
       }
     }
     // apply filter selectors to combo filters for next group
     comboFilters = filterSelectors;
   }
   i++; // increment
 }
 var comboFilter = comboFilters.join(", ");
 return comboFilter;

} </script>