<commit_before>﻿define(["knockout", "jquery", "app/urls"],
function (ko, $, urls) {
	ko.bindingHandlers.placeViewer = {
		update: function (el, valueAccessor, allBindings) {
			el.innerHtml = "<span>loading...</span>";
			var locationName = "";
			var fips = ko.unwrapObservable(valueAccessor) || "";

			$.ajax(urls.fips + "places/" + fips, {
				type: "GET",
				contentType: "application/json",
			}).then(function (data) {
				locationName = data.fullName;
			}).always(function () {
				if (!locationName) locationName = "Unknown";

				el.innerHtml = "<span>" + locationName + "</span>";
			});
		}
	};
	ko.virtualElements.allowedBindings.placeViewer = true;
});<commit_msg>CS-12317: getting placeviewer hooked up on list and details page<commit_after>﻿define(["knockout", "jquery", "app/urls"],
function (ko, $, urls) {
	ko.bindingHandlers.placeViewer = {
		init: function (el, valueAccessor, allBindings) {
			return { controlsDescendantBindings: true };
		},
		update: function (el, valueAccessor, allBindings) {
			el.innerHTML = "<span>loading...</span>";
			var locationName = "";
			var fips = ko.utils.unwrapObservable(valueAccessor()) || "";

			$.ajax(urls.fips + "places/" + fips, {
				type: "GET",
				contentType: "application/json",
			}).then(function (data) {
				locationName = data.fullName;
			}).always(function () {
				if (!locationName) locationName = "Unknown";

				el.innerHTML = "<span>" + locationName + "</span>";
			});
		}
	};
	ko.virtualElements.allowedBindings.placeViewer = true;
});
{'fraction_non_alphanumeric': 0.1830708661417323, 'fraction_numerical': 0.0032808398950131233, 'mean_word_length': 3.96742671009772, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6727507', 'n_tokens_mistral': 567, 'n_tokens_neox': 496, 'n_words': 99}