<commit_before>/*jslint browser: true,  nomen: true*/
/*global define: false */

define(["./dom_helper", "./session", "./xenaQuery", "../css/hub.css"], function (dom_helper, session, xenaQuery) {
	'use strict';

	var hosts;
	function newHubNode(host) {
		//build checkbox
		var checkbox = session.hostCheckBox(host),
			label = session.getHubName(host),
			tmpNode = dom_helper.elt("result2",
					dom_helper.hrefLink(label + " (connecting)", "../datapages/?host=" + host));
		tmpNode.setAttribute("id", "statusHub" + host);
		checkbox.appendChild(tmpNode);
		return dom_helper.elt("h4", checkbox);
	}

	function addHost() {
		var node = document.getElementById("textHub"),

		host = node.value;
		host = host.trim();
		//if host is not start with http(s)
		if (host === "") {
			return;
		}

		// get ride of ending '/''
		if (host[host.length-1]==='/') {
			host = host.slice(0, host.length-1);
		}
		// specially code for galaxyxena.soe.ucsc.edu
		if (host.match(/galaxyxena.*.ucsc.edu/gi))
		{
			host = "https://galaxyxena.soe.ucsc.edu:443/xena";
		}

		host = xenaQuery.server_url(host);

		if (hosts.indexOf(host) !== -1) {
			node.value = "";
			return;
		}

		node.parentNode.insertBefore(newHubNode(host), node.previousSibling);
		node.parentNode.insertBefore(dom_helper.elt("br"), node.previousSibling);
		hosts.push(host);
		node.value = "";
		session.updateHostStatus(host);
	}

	return function (main) {
		session.sessionStorageInitialize();
		hosts = JSON.parse(sessionStorage.state).allHosts;
		var node = dom_helper.sectionNode("hub"),<commit_msg>lint.<commit_after>/*eslint strict: [2, "function"], camelcase: 0, no-use-before-define: 0 */
/*eslint-env browser */
/*global define: false */

define(["./dom_helper", "./session", "./xenaQuery", "../css/hub.css"], function (dom_helper, session, xenaQuery) {
	'use strict';

	var hosts;
	function newHubNode(host) {
		//build checkbox
		var checkbox = session.hostCheckBox(host),
			label = session.getHubName(host),
			tmpNode = dom_helper.elt("result2",
					dom_helper.hrefLink(label + " (connecting)", "../datapages/?host=" + host));
		tmpNode.setAttribute("id", "statusHub" + host);
		checkbox.appendChild(tmpNode);
		return dom_helper.elt("h4", checkbox);
	}

	function addHost() {
		var node = document.getElementById("textHub"),

		host = node.value;
		host = host.trim();
		//if host is not start with http(s)
		if (host === "") {
			return;
		}

		// get ride of ending '/''
		if (host[host.length - 1] === '/') {
			host = host.slice(0, host.length - 1);
		}
		// specially code for galaxyxena.soe.ucsc.edu
		if (host.match(/galaxyxena.*.ucsc.edu/gi))
		{
			host = "https://galaxyxena.soe.ucsc.edu:443/xena";
		}

		host = xenaQuery.server_url(host);

		if (hosts.indexOf(host) !== -1) {
			node.value = "";
			return;
		}

		node.parentNode.insertBefore(newHubNode(host), node.previousSibling);
		node.parentNode.insertBefore(dom_helper.elt("br"), node.previousSibling);
		hosts.push(host);
		node.value = "";
		session.updateHostStatus(host);
	}

	return function (main) {
		session.sessionStorageInitialize();
		hosts = JSON.parse(sessionStorage.state).allHosts;
		var node = dom_helper.sectionNode("hub"),
{'fraction_non_alphanumeric': 0.18141870684243566, 'fraction_numerical': 0.006591337099811676, 'mean_word_length': 3.8434650455927053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2386004', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1109, 'n_words': 208}