<commit_before>"use strict";
let Bacon = require("baconjs");
const Utils = require("./lib/utils.js");

const KEYS = {
  GROUP: {
    DOMAIN: "domainGroup",
    WINDOW: "windowGroup"
  },
  SORT: {
    NATURAL: "naturalSort",
    REVERSE: "reverseSort",
    MRU: "mruSort"
  }
};

var sortByDomainValue = false;
var version = null;
var options = {};

function clickHandler() {
  if (options.closetab) {
    chrome.tabs.getCurrent(tab => {
      chrome.tabs.remove(tab.id);
    });
  }

  chrome.tabs.update(this.tabId, {active: true});
  chrome.windows.update(this.windowId, {focused: true});
  return false;
}

function setVersion() {
  var versionElement = document.getElementById("version");
  if (!version ) {
    var manifest = version || chrome.runtime.getManifest();
    version = version || manifest.version;
  }

  versionElement.innerText = "Tabist (" + version + ")";
}

function setDevStatus() {
  var statusElement = document.getElementById("developmentStatus");

  chrome.management.getSelf(info => {
    if(info.installType == "development"){
      statusElement.innerText = "( " + info.installType + " )";
    }
  });
}

// Returns a link object for a tab with click handlers set
function makeLink(tab) {
  var link = document.createElement("a");
  link.href = "#";
  link.onclick = clickHandler;
  link.tabId = tab.id;
  link.windowId = tab.windowId;

  var text = tab.title || tab.url;
  var audibleText = tab.audible ? "&#x1f508; " : "";
  var favicon = tab.favIconUrl ? "<img src='" + tab.favIconUrl + "' width='24' height='24'/><span>&nbsp;</span>": "";
  link.innerHTML = favicon + audibleText + text;

  return link;
}

// ======================================
// Main update routine
// ======================================
function updateTabList() {
  var start = Date.now();<commit_msg>Adds a selected tab to each selected tab in each window<commit_after>"use strict";
let Bacon = require("baconjs");
const Utils = require("./lib/utils.js");

const KEYS = {
  GROUP: {
    DOMAIN: "domainGroup",
    WINDOW: "windowGroup"
  },
  SORT: {
    NATURAL: "naturalSort",
    REVERSE: "reverseSort",
    MRU: "mruSort"
  }
};

var sortByDomainValue = false;
var version = null;
var options = {};

function clickHandler() {
  if (options.closetab) {
    chrome.tabs.getCurrent(tab => {
      chrome.tabs.remove(tab.id);
    });
  }

  chrome.tabs.update(this.tabId, {active: true});
  chrome.windows.update(this.windowId, {focused: true});
  return false;
}

function setVersion() {
  var versionElement = document.getElementById("version");
  if (!version ) {
    var manifest = version || chrome.runtime.getManifest();
    version = version || manifest.version;
  }

  versionElement.innerText = "Tabist (" + version + ")";
}

function setDevStatus() {
  var statusElement = document.getElementById("developmentStatus");

  chrome.management.getSelf(info => {
    if(info.installType == "development"){
      statusElement.innerText = "( " + info.installType + " )";
    }
  });
}

// Returns a link object for a tab with click handlers set
function makeLink(tab) {
  var link = document.createElement("a");
  link.href = "#";
  link.onclick = clickHandler;
  link.tabId = tab.id;
  link.windowId = tab.windowId;

  var linkText = tab.title || tab.url;
  var isActive = tab.active ? " <span style='color:darkred'> &raquo; (Selected)</span> " : "" ;

  var audibleText = tab.audible ? "&#x1f508; " : "";
  var favicon = tab.favIconUrl ? "<img src='" + tab.favIconUrl + "' width='24' height='24'/><span>&nbsp;</span>": "";
  link.innerHTML = favicon + audibleText + linkText + isActive;

  return link;
}

// ======================================
// Main update routine
// ======================================
function updateTabList() {
  var start = Date.now();
{'fraction_non_alphanumeric': 0.19741014799154333, 'fraction_numerical': 0.004228329809725159, 'mean_word_length': 3.803299492385787, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 15, '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': '4389847', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1185, 'n_words': 265}