<commit_before>// @flow
import jQuery from 'jquery';
import { imageRepository } from '../application/repositories';

const copy = () => {
  jQuery('#clipboard').show();
  jQuery('#clipboard').focus();
  jQuery('#clipboard').select();
  document.execCommand('Copy');
  window.getSelection().removeAllRanges();
  jQuery('#clipboard').hide();
};

// TODO: Use callback that MDL snackbar is ready
jQuery(document).ready(() => {
  setTimeout(() => {
    imageRepository.fetch((images) => {
      if (images.isEmpty()) {
        chrome.runtime.openOptionsPage();
        return;
      }

      const img = images.getRandom();
      const imageUrl = img.src;
      jQuery('main').empty().append(`<img style="min-width: 100px; min-height: 100px;max-width: 500px; max-height: 500px;" src="${imageUrl}">`);<commit_msg>Fix browser action<commit_after>// @flow
import jQuery from 'jquery';
import { imageRepository } from '../application/repositories';

const copy = () => {
  jQuery('#clipboard').show();
  jQuery('#clipboard').focus();
  jQuery('#clipboard').select();
  document.execCommand('Copy');
  window.getSelection().removeAllRanges();
  jQuery('#clipboard').hide();
};

// TODO: Use callback that MDL snackbar is ready
jQuery(document).ready(() => {
  setTimeout(() => {
    imageRepository.fetch().subscribe((images) => {
      if (images.isEmpty()) {
        chrome.runtime.openOptionsPage();
        return;
      }

      const img = images.getRandom();
      const imageUrl = img.src;
      jQuery('main').empty().append(`<img style="min-width: 100px; min-height: 100px;max-width: 500px; max-height: 500px;" src="${imageUrl}">`);
{'fraction_non_alphanumeric': 0.19412124923453766, 'fraction_numerical': 0.014696876913655848, 'mean_word_length': 4.04320987654321, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5433393', 'n_tokens_mistral': 503, 'n_tokens_neox': 474, 'n_words': 97}