<commit_before>{make}      = require '../../render/make'
{changelog} = require '../changelog'

module.exports.share_dialog = ->
  selector = '.share-button'
  text = $(selector).text()
  new Share selector, #External Library included from the web page
    description: text
    url:         changelog.url()
    networks:
      facebook:
        app_id:  1510955112514265
      email:
        description: text + "\n\nCheck it out here!: " + document.location.href

module.exports.world = (level) ->
  goals = level.get 'goal'

  dialogAction = (world) ->
    switch world.get('name')
      when 'Retry' then retry(world)
      when 'Next'  then next(world)
      else ''

  retry = (world) ->
    window.location.reload()

  next = (world) ->
    window.open world.get('next_url'), '_self'

  star_count = ->
    ticks_diff  = level.get('ticks')  - goals.ticks
    clicks_diff = level.get('clicks') - goals.clicks
    bricks_diff = level.get('bricks') - goals.bricks

    # calculate total score with a minimum for each being 0
    extra_moves = [ticks_diff, clicks_diff, bricks_diff].reduce (sum, diff) ->
      sum + if diff < 0 then 0 else diff

    if extra_moves <= 0
      3
    else if extra_moves <= 3
      2
    else
      1<commit_msg>fix email share<commit_after>{make}      = require '../../render/make'
{changelog} = require '../changelog'

module.exports.share_dialog = ->
  selector = '.share-button'
  text = $(selector).text()
  new Share selector, #External Library included from the web page
    description: text
    url:         changelog.url()
    networks:
      facebook:
        app_id:  1510955112514265
      email:
        description: text + "\n\nCheck it out here!: " + changelog.url()

module.exports.world = (level) ->
  goals = level.get 'goal'

  dialogAction = (world) ->
    switch world.get('name')
      when 'Retry' then retry(world)
      when 'Next'  then next(world)
      else ''

  retry = (world) ->
    window.location.reload()

  next = (world) ->
    window.open world.get('next_url'), '_self'

  star_count = ->
    ticks_diff  = level.get('ticks')  - goals.ticks
    clicks_diff = level.get('clicks') - goals.clicks
    bricks_diff = level.get('bricks') - goals.bricks

    # calculate total score with a minimum for each being 0
    extra_moves = [ticks_diff, clicks_diff, bricks_diff].reduce (sum, diff) ->
      sum + if diff < 0 then 0 else diff

    if extra_moves <= 0
      3
    else if extra_moves <= 3
      2
    else
      1
{'fraction_non_alphanumeric': 0.12987535182951346, 'fraction_numerical': 0.019300361881785282, 'mean_word_length': 2.5141242937853105, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2747824', 'n_tokens_mistral': 844, 'n_tokens_neox': 805, 'n_words': 217}