<commit_before>import 'core-js/stable'
import 'regenerator-runtime/runtime'

import './jquery'
import './bootstrap'
import {} from 'jquery-ujs'
import 'jquery.turbolinks/src/jquery.turbolinks'
import 'jquery.guillotine'
import 'particleground/jquery.particleground.min'
import 'jquery.growl'
import NProgress from 'nprogress'
import Cookies from 'js-cookie'
import moment from 'moment'

# this file is generated by Rails
import I18n from './i18n'

import './answerbox'
import './questionbox'
import './inbox'
import './memes'
import './notifications'
import './pagination'
import './question'
import './settings'
import './user'
import './report'
import './locale-box'
import './util'

#= require jquery3
#= require jquery_ujs
#= require jquery.turbolinks
#= require turbolinks
#= require popper
#= require bootstrap
#= require nprogress
#= require nprogress-turbolinks
#= require growl
#= require cheet
#= require jquery.guillotine
#= require jquery.particleground
#= require sweetalert
#= require js.cookie
#= require i18n
#= require_tree ./i18n
#= require tinycolor-min
#= require jquery.minicolors
# local requires to be seen by everyone:
#= require_tree ./answerbox
#= require_tree ./questionbox
#= require lists
#= require inbox
#= require memes
#= require notifications
#= require pagination
#= require question
#= require settings
#= require user
#= require report
#= require locale-box

# not required:
# _tree ./moderation

window.moment = moment

NProgress.configure
  showSpinner: false

window.translate = (scope, options) ->
  # for some reason I18n errors when calling it by assign proxy, so we got to wrap it
  I18n.translate(scope, options)

window.showNotification = (text, success=true) ->
  args =
    title: translate((if success then 'frontend.success.title' else 'frontend.error.title'))
    message: text
  if success
    $.growl.notice args
  else
    $.growl.error args

I18n.defaultLocale = 'en';
I18n.locale = Cookies.get('hl') || 'en';

window.showNotificationXHRError = (jqxhr, status, error) ->
  console.log jqxhr, status, error
  showNotification translate('frontend.error.message'), false

$(document).on "click", "button#create-account", ->
  Turbolinks.visit "/sign_up"

_ready = ->
  if typeof sweetAlertInitialize != "undefined"
    sweetAlertInitialize()

  if document.getElementById('particles')?
    jumbo         = $ '.j2-jumbo'
    bodyColorOrig = jumbo.css 'background-color'
    bodyColor     = doppler 0.25, bodyColorOrig
    console.log bodyColor, bodyColorOrig
    particleground document.getElementById('particles'),
      dotColor: bodyColor
      lineColor: bodyColor
      density: 23000

  $(".announcement").each ->
    aId = $(this)[0].dataset.announcementId
    unless (window.localStorage.getItem("announcement#{aId}"))
      $(this).toggleClass("d-none")

  $(document).on "click", ".announcement button.close", (evt) ->
    announcement = event.target.closest(".announcement")
    aId = announcement.dataset.announcementId
    window.localStorage.setItem("announcement#{aId}", true)


$(document).ready _ready
$(document).on 'page:load', _ready
<commit_msg>Import missing file<commit_after>import 'core-js/stable'
import 'regenerator-runtime/runtime'

import './jquery'
import './bootstrap'
import {} from 'jquery-ujs'
import 'jquery.turbolinks/src/jquery.turbolinks'
import 'jquery.guillotine'
import 'particleground/jquery.particleground.min'
import 'jquery.growl'
import NProgress from 'nprogress'
import Cookies from 'js-cookie'
import moment from 'moment'

# this file is generated by Rails
import I18n from './i18n'

import './answerbox'
import './questionbox'
import './inbox'
import './lists'
import './memes'
import './notifications'
import './pagination'
import './question'
import './settings'
import './user'
import './report'
import './locale-box'
import './util'

window.moment = moment

NProgress.configure
  showSpinner: false

window.translate = (scope, options) ->
  # for some reason I18n errors when calling it by assign proxy, so we got to wrap it
  I18n.translate(scope, options)

window.showNotification = (text, success=true) ->
  args =
    title: translate((if success then 'frontend.success.title' else 'frontend.error.title'))
    message: text
  if success
    $.growl.notice args
  else
    $.growl.error args

I18n.defaultLocale = 'en';
I18n.locale = Cookies.get('hl') || 'en';

window.showNotificationXHRError = (jqxhr, status, error) ->
  console.log jqxhr, status, error
  showNotification translate('frontend.error.message'), false

$(document).on "click", "button#create-account", ->
  Turbolinks.visit "/sign_up"

_ready = ->
  if typeof sweetAlertInitialize != "undefined"
    sweetAlertInitialize()

  if document.getElementById('particles')?
    jumbo         = $ '.j2-jumbo'
    bodyColorOrig = jumbo.css 'background-color'
    bodyColor     = doppler 0.25, bodyColorOrig
    console.log bodyColor, bodyColorOrig
    particleground document.getElementById('particles'),
      dotColor: bodyColor
      lineColor: bodyColor
      density: 23000

  $(".announcement").each ->
    aId = $(this)[0].dataset.announcementId
    unless (window.localStorage.getItem("announcement#{aId}"))
      $(this).toggleClass("d-none")

  $(document).on "click", ".announcement button.close", (evt) ->
    announcement = event.target.closest(".announcement")
    aId = announcement.dataset.announcementId
    window.localStorage.setItem("announcement#{aId}", true)


$(document).ready _ready
$(document).on 'page:load', _ready

{'fraction_non_alphanumeric': 0.13414412779088764, 'fraction_numerical': 0.008894536213468869, 'mean_word_length': 4.323671497584541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '969446', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1706, 'n_words': 441}