  



//this script needs to be placed in the footer so it executes after the ko binding

function BoldTagsFromQueryParam(){
	// first, get query param, if exists
	var urlParams = new URLSearchParams(window.location.search);
	let tagid = urlParams.get('tagid');
	let nameToMatchOnTags = "";
	
	// second, select the tag on the filter	
	let list = $('.router-filter .form-check-input');
	for(let i = 0; i < list.length; i++){
		if(tagid === list[i].value){
			nameToMatchOnTags = list[i].getAttribute("data-tag-name");
			list[i].checked = true;
		}
	}
	
	// third, now that we have nameToMatchOnTags, let's iterate through the list of tags on the entire page, and if match is found, add a class font-weight-bold
	var tagList = $('.tag-name');
	for(let i = 0; i < tagList.length; i++){
		let textContent = tagList[i].textContent;

		if(textContent === nameToMatchOnTags){
			for(let j = 0; j < tagList[i].attributes.length; j++){
				let attr = tagList[i].attributes[j];
				let tempClass = attr.nodeValue;
				let newClass = tempClass + " font-weight-bold";
				attr.nodeValue = newClass;
			}
		}
	}
}



$( window ).ready(function() {
	BoldTagsFromQueryParam()
});
 