<commit_before>require(
	[
		"jquery",
		"services/SettingsService",
		"services/MailService",
		"services/AlertService",
		"widgets/SavedSearchesWidget",
		"bootstrap-dialog",
		"moment",

		"hbs!templates/mailList",
		"hbs!templates/mailDetails",
		"hbs!templates/searchMailModal",

		"lightbox",
		"bootstrap-daterangepicker"
	],
	function(
		$,
		SettingsService,
		MailService,
		AlertService,
		SavedSearchesWidget,
		Dialog,
		moment,
		mailListTemplate,
		mailDetailsTemplate,
		searchMailModalTemplate
	) {
		"use strict";

		/**
		 * Creates the markup for the filters popover
		 */
		var buildFiltersPopoverText = function(context) {
			var html = "<strong>Current Page:</strong> " + context.page + "<br />";
			html += "<strong>Message Filter:</strong> " + context.searchMessage + "<br />";
			html += "<strong>Date Range:</strong> " + moment(context.searchStart).format("MMMM D, YYYY") + " - ";
			html += moment(context.searchEnd).format("MMMM D, YYYY");

			return html;
		};

		/**
		 * Calculates the height of the window minus nav bars and table headers.
		 */
		var calculateWindowHeight = function() {
			return $(window).outerHeight(true) -
				$("#mailItemsHeader").outerHeight(true) -
				$(".navbar").outerHeight(true) -
				$("#mailSearchNav").outerHeight(true);
		};

		/**
		 * Retrieves an attachment and displays it to the user. This expects the context to
		 * have "attachmentID" and "mailID".
		 */
		var displayAttachment = function(context) {
			context.message = "Retrieving...";

			AlertService.block(context)
				.then(MailService.getAttachment)
				.then(showAttachmentInLightbox)<commit_msg>Added from and to in current filter popover. closes #13<commit_after>require(
	[
		"jquery",
		"services/SettingsService",
		"services/MailService",
		"services/AlertService",
		"widgets/SavedSearchesWidget",
		"bootstrap-dialog",
		"moment",

		"hbs!templates/mailList",
		"hbs!templates/mailDetails",
		"hbs!templates/searchMailModal",

		"lightbox",
		"bootstrap-daterangepicker"
	],
	function(
		$,
		SettingsService,
		MailService,
		AlertService,
		SavedSearchesWidget,
		Dialog,
		moment,
		mailListTemplate,
		mailDetailsTemplate,
		searchMailModalTemplate
	) {
		"use strict";

		/**
		 * Creates the markup for the filters popover
		 */
		var buildFiltersPopoverText = function(context) {
			var html = "<strong>Current Page:</strong> " + context.page + "<br />";
			html += "<strong>Message Filter:</strong> " + context.searchMessage + "<br />";
			html += "<strong>Date Range:</strong> " + moment(context.searchStart).format("MMMM D, YYYY") + " - ";
			html += moment(context.searchEnd).format("MMMM D, YYYY") + "<br />";
			html += "<strong>From:</strong> " + context.searchFrom + "<br />";
			html += "<strong>To:</strong> " + context.searchTo + "<br />";

			return html;
		};

		/**
		 * Calculates the height of the window minus nav bars and table headers.
		 */
		var calculateWindowHeight = function() {
			return $(window).outerHeight(true) -
				$("#mailItemsHeader").outerHeight(true) -
				$(".navbar").outerHeight(true) -
				$("#mailSearchNav").outerHeight(true);
		};

		/**
		 * Retrieves an attachment and displays it to the user. This expects the context to
		 * have "attachmentID" and "mailID".
		 */
		var displayAttachment = function(context) {
			context.message = "Retrieving...";

			AlertService.block(context)
				.then(MailService.getAttachment)
				.then(showAttachmentInLightbox)
{'fraction_non_alphanumeric': 0.15357867284844973, 'fraction_numerical': 0.0005795421616922632, 'mean_word_length': 3.8688293370944993, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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': '7317404', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1070, 'n_words': 225}