<commit_before># Require Stylesheets
require "stylesheets"

# Require Modernizr
require "modernizr"

# Require Lazysizes
# require "lazysizes/plugins/custommedia/ls.custommedia"
# require "lazysizes/plugins/respimg/ls.respimg"
# require "lazysizes"

require 'waypoints/lib/jquery.waypoints'
require 'webui-popover/dist/jquery.webui-popover.js'
require 'chosen-js'

# Require Custom Modules
# Modal = require "./modules/modal"
{Toggle, Dismiss} = require './modules/toggle'
{TextInput}       = require './modules/form'
StoryCollapse     = require './modules/stories'
Rules             = require './modules/rules'

# Require entry modules
# EX:

# Inject SVG Sprite
sprites = require.context "icons", off
sprites.keys().forEach sprites

new TextInput()
new StoryCollapse '#story-collapse-toggle'
new Toggle '.switch'
new Dismiss '[data-dismiss]'
new Rules()

$(document).on 'ready page:load', ->
  # Datepicker
  $("input.datepicker").each (input) ->
    $(@).datepicker
      dateFormat: "yy-mm-dd"
      altField: $(@).next()
      onClose: -> $(@).trigger 'blur'

  # Chosen
  $('select').chosen
    no_results_text: '沒有選項符合'
    search_contains: on

  # Popover
  $('.popover-trigger').webuiPopover()

$(document).on "page:change", ->
  # Let cached input value trigger 'is-focus'
  $('input.form-control:not([autofocus], :hidden)').trigger 'blur'

  # Stuck Header
  Waypoint.destroyAll()

  $main_header = $('#main-header')
  
  $('.card__heading, .character-selector__heading').waypoint
    handler: (direction) ->
      if direction is 'down'
        $main_header.addClass 'has-background'
      else
        $main_header.removeClass 'has-background'
    offset: -> $main_header.height()<commit_msg>add waypoint detector to billboard<commit_after># Require Stylesheets
require "stylesheets"

# Require Modernizr
require "modernizr"

# Require Lazysizes
# require "lazysizes/plugins/custommedia/ls.custommedia"
# require "lazysizes/plugins/respimg/ls.respimg"
# require "lazysizes"

require 'waypoints/lib/jquery.waypoints'
require 'webui-popover/dist/jquery.webui-popover.js'
require 'chosen-js'

# Require Custom Modules
# Modal = require "./modules/modal"
{Toggle, Dismiss} = require './modules/toggle'
{TextInput}       = require './modules/form'
StoryCollapse     = require './modules/stories'
Rules             = require './modules/rules'

# Require entry modules
# EX:

# Inject SVG Sprite
sprites = require.context "icons", off
sprites.keys().forEach sprites

new TextInput()
new StoryCollapse '#story-collapse-toggle'
new Toggle '.switch'
new Dismiss '[data-dismiss]'
new Rules()

$(document).on 'ready page:load', ->
  # Datepicker
  $("input.datepicker").each (input) ->
    $(@).datepicker
      dateFormat: "yy-mm-dd"
      altField: $(@).next()
      onClose: -> $(@).trigger 'blur'

  # Chosen
  $('select').chosen
    no_results_text: '沒有選項符合'
    search_contains: on

  # Popover
  $('.popover-trigger').webuiPopover()

$(document).on "page:change", ->
  # Let cached input value trigger 'is-focus'
  $('input.form-control:not([autofocus], :hidden)').trigger 'blur'

  # Stuck Header
  Waypoint.destroyAll()

  $main_header = $('#main-header')
  
  $('.card__heading,
     .character-selector__heading,
     .billboard__heading').waypoint
    handler: (direction) ->
      if direction is 'down'
        $main_header.addClass 'has-background'
      else
        $main_header.removeClass 'has-background'
    offset: -> $main_header.height()
{'fraction_non_alphanumeric': 0.15077989601386482, 'fraction_numerical': 0.0, 'mean_word_length': 3.829846582984658, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1832008', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1130, 'n_words': 246}