<commit_before><!DOCTYPE html><!--[if lt IE 9]>
<html class="no-js lt-ie9" lang="en"><![endif]--><!--[if gt IE 8]><!-->
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" class="no-js"
      lang="en">
<!--<![endif]-->
<head lang="en">
	<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE" th:text="#{global.title}">IRIDA Platform</title>

	<link rel="stylesheet" th:href="@{/resources/bower_components/Font-Awesome/css/font-awesome.min.css}"
	      href="/resources/bower_components/Font-Awesome/css/font-awesome.min.css"/>
	<link rel="stylesheet" th:href="@{/resources/bower_components/AngularJS-Toaster/toaster.css}"
	      href="/resources/bower_components/AngularJS-Toaster/toaster.css"/>

	<style>
		.ng-cloak {
			display: none !important;
		}
	</style>
</head>
<body vocab="http://schema.org/" typeof="WebPage" id="ng-app" ng-app="irida">
<div toaster-container=""></div>
<th:block layout:fragment="main-section">
	<!--/* This is where each pages content should be loaded. */-->
</th:block>

<script type="text/ng-template" id="/session-modal.html">
	<div>
		<div class="modal-header">
			<b class="modal-title"><span th:text="#{session.timeout-modal.header}"></span>&nbsp;{{timeleft | moment}}</b>
		</div>
		<div class="modal-footer">
			<button class="btn btn-default" ng-click="logout()" th:text="#{session.timeout-modal.logout}">Log me out</button>
			<button class="btn btn-primary" ng-click="poke()" th:text="#{session.timeout-modal.poke}">Keep me here</button>
		</div>
	</div>
</script>

<script th:src="@{/resources/bower_components/jquery/dist/jquery.min.js}"
        src="/resources/bower_components/jquery/dist/jquery.min.js"></script>

<th:block sec:authorize="isAuthenticated()">
	<script th:inline="javascript">
		var TL = {
			BASE_URL: /*[[@{/}]]*/ '/',
			SESSION_LENGTH: /*[[${#httpSession.getAttribute('SESSION_TIMEOUT')}]]*/ 1800
		};
	</script>
	
	<script th:src="@{/resources/bower_components/lodash/dist/lodash.min.js}"
	        src="/resources/bower_components/lodash/dist/lodash.min.js"></script>
	<script th:src="@{/resources/bower_components/angular/angular.min.js}"
	        src="/resources/bower_components/angular/angular.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-animate/angular-animate.min.js}"
	        src="/resources/bower_components/angular-animate/angular-animate.min.js"></script>
	<script src="/resources/bower_components/angular-messages/angular-messages.min.js"
	        th:src="@{/resources/bower_components/angular-messages/angular-messages.min.js}"></script>
	<script th:src="@{/resources/bower_components/angular-resource/angular-resource.min.js}"
	        src="/resources/bower_components/angular-resource/angular-resource.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-sanitize/angular-sanitize.min.js}"
	        src="/resources/bower_components/angular-sanitize/angular-sanitize.min.js"></script>
	<script th:src="@{'/resources/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js'}"
	        src="/resources/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-ui-utils/ui-utils.min.js}"
	        src="/resources/bower_components/angular-ui-utils/ui-utils.min.js"></script>
	<script th:src="@{/resources/bower_components/restangular/src/restangular.js}"
	        src="/resources/bower_components/restangular/src/restangular.js"></script>

	<script th:src="@{/resources/bower_components/AngularJS-Toaster/toaster.js}"
	        src="/resources/bower_components/AngularJS-Toaster/toaster.js"></script>
	<script th:src="@{/resources/js/services/notifications/irida-notifications.js}"
	        src="/resources/js/services/notifications/irida-notifications-min.js"></script>

	<script th:inline="javascript">
		/*<![CDATA[*/
		function SessionFactory($timeout, $interval, $window, $modal) {
			var modalWait = 120000, // 2 minutes
			    initialWait = TL.SESSION_LENGTH * 1000 - modalWait + 500, // Give a little overlap
			    timeout,
			    restartTimeout;

			function _restart() {
				$modal.open({
					templateUrl: '/session-modal.html',
					controller : ['$scope', '$http', '$window', '$modalInstance', function ($scope, $http, $window, $modalInstance) {
						$scope.poke = function () {
							$interval.cancel(countdown);
							$timeout.cancel(restartTimeout);
							$timeout.cancel(timeout);
							$http.head($window.location.href).success(function () {
								start();
								$modalInstance.close();
							});
						};

						$scope.logout = function () {
							$window.location = TL.BASE_URL + "logout";
						};

						$scope.timeleft = modalWait;
						var countdown = $interval(function () {
							$scope.timeleft = $scope.timeleft - 1000;
						}, 1000);

						restartTimeout = $timeout(function () {
							$window.location.reload();
						}, modalWait);
					}]
				});
			}

			function start() {
				timeout = $timeout(function SessionTimer() {
					_restart();
				}, initialWait);
			}

			function reset() {
				$timeout.cancel(timeout);
				start();
			}

			return ({
				start: start,
				reset: reset<commit_msg>Added a check to see if the session modal was open<commit_after><!DOCTYPE html><!--[if lt IE 9]>
<html class="no-js lt-ie9" lang="en"><![endif]--><!--[if gt IE 8]><!-->
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" class="no-js"
      lang="en">
<!--<![endif]-->
<head lang="en">
	<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE" th:text="#{global.title}">IRIDA Platform</title>

	<link rel="stylesheet" th:href="@{/resources/bower_components/Font-Awesome/css/font-awesome.min.css}"
	      href="/resources/bower_components/Font-Awesome/css/font-awesome.min.css"/>
	<link rel="stylesheet" th:href="@{/resources/bower_components/AngularJS-Toaster/toaster.css}"
	      href="/resources/bower_components/AngularJS-Toaster/toaster.css"/>

	<style>
		.ng-cloak {
			display: none !important;
		}
	</style>
</head>
<body vocab="http://schema.org/" typeof="WebPage" id="ng-app" ng-app="irida">
<div toaster-container=""></div>
<th:block layout:fragment="main-section">
	<!--/* This is where each pages content should be loaded. */-->
</th:block>

<script type="text/ng-template" id="/session-modal.html">
	<div>
		<div class="modal-header">
			<b class="modal-title"><span th:text="#{session.timeout-modal.header}"></span>&nbsp;{{timeleft | moment}}</b>
		</div>
		<div class="modal-footer">
			<button class="btn btn-default" ng-click="logout()" th:text="#{session.timeout-modal.logout}">Log me out</button>
			<button class="btn btn-primary" ng-click="poke()" th:text="#{session.timeout-modal.poke}">Keep me here</button>
		</div>
	</div>
</script>

<script th:src="@{/resources/bower_components/jquery/dist/jquery.min.js}"
        src="/resources/bower_components/jquery/dist/jquery.min.js"></script>

<th:block sec:authorize="isAuthenticated()">
	<script th:inline="javascript">
		var TL = {
			BASE_URL: /*[[@{/}]]*/ '/',
			SESSION_LENGTH: /*[[${#httpSession.getAttribute('SESSION_TIMEOUT')}]]*/ 1800
		};
	</script>
	
	<script th:src="@{/resources/bower_components/lodash/dist/lodash.min.js}"
	        src="/resources/bower_components/lodash/dist/lodash.min.js"></script>
	<script th:src="@{/resources/bower_components/angular/angular.min.js}"
	        src="/resources/bower_components/angular/angular.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-animate/angular-animate.min.js}"
	        src="/resources/bower_components/angular-animate/angular-animate.min.js"></script>
	<script src="/resources/bower_components/angular-messages/angular-messages.min.js"
	        th:src="@{/resources/bower_components/angular-messages/angular-messages.min.js}"></script>
	<script th:src="@{/resources/bower_components/angular-resource/angular-resource.min.js}"
	        src="/resources/bower_components/angular-resource/angular-resource.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-sanitize/angular-sanitize.min.js}"
	        src="/resources/bower_components/angular-sanitize/angular-sanitize.min.js"></script>
	<script th:src="@{'/resources/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js'}"
	        src="/resources/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
	<script th:src="@{/resources/bower_components/angular-ui-utils/ui-utils.min.js}"
	        src="/resources/bower_components/angular-ui-utils/ui-utils.min.js"></script>
	<script th:src="@{/resources/bower_components/restangular/src/restangular.js}"
	        src="/resources/bower_components/restangular/src/restangular.js"></script>

	<script th:src="@{/resources/bower_components/AngularJS-Toaster/toaster.js}"
	        src="/resources/bower_components/AngularJS-Toaster/toaster.js"></script>
	<script th:src="@{/resources/js/services/notifications/irida-notifications.js}"
	        src="/resources/js/services/notifications/irida-notifications-min.js"></script>

	<script th:inline="javascript">
		/*<![CDATA[*/
		function SessionFactory($timeout, $interval, $window, $modal) {
			var modalWait = 120000, // 2 minutes
			    initialWait = TL.SESSION_LENGTH * 1000 - modalWait + 500, // Give a little overlap
			    timeout,
			    restartTimeout,
				opened = false;

			function _restart() {
				if (!opened) {
					opened = true;
					$modal.open({
						templateUrl: '/session-modal.html',
						controller : ['$scope', '$http', '$window', '$modalInstance', function ($scope, $http, $window, $modalInstance) {
							$scope.poke = function () {
								$interval.cancel(countdown);
								$timeout.cancel(restartTimeout);
								$timeout.cancel(timeout);
								$http.head($window.location.href).success(function () {
									start();
									opened = false;
									$modalInstance.close();
								});
							};

							$scope.logout = function () {
								$window.location = TL.BASE_URL + "logout";
							};

							$scope.timeleft = modalWait;
							var countdown = $interval(function () {
								$scope.timeleft = $scope.timeleft - 1000;
							}, 1000);

							restartTimeout = $timeout(function () {
								$window.location.reload();
							}, modalWait);
						}]
					});
				}
			}

			function start() {
				timeout = $timeout(function SessionTimer() {
					_restart();
				}, initialWait);
			}

			function reset() {
				$timeout.cancel(timeout);
				start();
			}

			return ({
				start: start,
				reset: reset
{'fraction_non_alphanumeric': 0.19002938110131742, 'fraction_numerical': 0.005497109278741351, 'mean_word_length': 3.8942486085343226, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, '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': '3425218', 'n_tokens_mistral': 4016, 'n_tokens_neox': 3440, 'n_words': 451}