<commit_before>#= require 'overlay_me/menu'
#= require 'overlay_me/menu_item'
#= require 'overlay_me/overlays/init'
#= require 'overlay_me/overlays/image'
#= require 'overlay_me/overlays/dynamic_images_mngt'
#= require 'overlay_me/overlays/content_div'
#= require 'overlay_me/overlays/images_mngt_div'

if OverlayMe.mustLoad()

  # creating a overlay_panel
  overlay_panel = new OverlayMe.MenuItem({id: "overlay_panel", title: "Overlays" })

  # adding the #container management block
  overlay_panel.append new OverlayMe.Overlays.ContentDivManagementBlock().render()

  # adding image management block
  OverlayMe.images_management_div = new OverlayMe.Overlays.ImagesManagementDiv()
  overlay_panel.append OverlayMe.images_management_div.render()

  OverlayMe.loadDefaultImage = ->
    # double check that the dynamic loading list is also empty
    if OverlayMe.dyn_manager.isEmpty()
      OverlayMe.dyn_manager.addImage('https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png')

  # adding all overlay images
  $.ajax
    url: '/overlay_images'
    dataType: 'json'
    success: (data) ->
      if data.length == 0 # in case all is empty (default for newcomers)
        OverlayMe.loadDefaultImage()
      else
        $.each data, (index, img_path) ->
          OverlayMe.images_management_div.append new OverlayMe.Overlays.Image(img_path).render()
    error: ->
      OverlayMe.loadDefaultImage()

  # add the panel to the page menu
  $(OverlayMe.Menu).append overlay_panel.render()
  
  # repeating original window#mousemove event
  $(window).bind 'mousemove', (event) ->
    $(window).trigger('mymousemove', event)<commit_msg>changed default image to be a random unicorn<commit_after>#= require 'overlay_me/menu'
#= require 'overlay_me/menu_item'
#= require 'overlay_me/overlays/init'
#= require 'overlay_me/overlays/image'
#= require 'overlay_me/overlays/dynamic_images_mngt'
#= require 'overlay_me/overlays/content_div'
#= require 'overlay_me/overlays/images_mngt_div'

if OverlayMe.mustLoad()

  # creating a overlay_panel
  overlay_panel = new OverlayMe.MenuItem({id: "overlay_panel", title: "Overlays" })

  # adding the #container management block
  overlay_panel.append new OverlayMe.Overlays.ContentDivManagementBlock().render()

  # adding image management block
  OverlayMe.images_management_div = new OverlayMe.Overlays.ImagesManagementDiv()
  overlay_panel.append OverlayMe.images_management_div.render()

  OverlayMe.loadDefaultImage = ->
    # double check that the dynamic loading list is also empty
    if OverlayMe.dyn_manager.isEmpty()
      unicorns = [
        "http://img.photobucket.com/albums/v629/Master_Becca/unicorn.png",
        "http://fc07.deviantart.net/fs49/f/2009/200/b/3/Fat_Unicorn_and_the_Rainbow_by_la_ratta.jpg",
        "http://www.deviantart.com/download/126388773/Unicorn_Pukes_Rainbow_by_Angel35W.jpg",
        "http://macmcrae.com/wp-content/uploads/2010/02/unicorn.jpg",
        "http://www.deviantart.com/download/195169729/rainbow_farting_unicorn_by_hi_my_name_is_light-d3875xd.jpg",
        "http://edwardhotspur.files.wordpress.com/2012/01/rainbowunicorn.jpg",
        "https://s.deviantart.com/th/fs18/f/2007/220/1/3/Unicorn_Vomit___Finished___by_Rainbow_Colors_Club.jpg",
        "http://4.bp.blogspot.com/-uPLiez-m9vY/TacC_Bmsn3I/AAAAAAAAAyg/jusQIA8aAME/s1600/Behold_A_Rainbow_Unicorn_Ninja_by_Jess4921.jpg",
        "http://www.everquestdragon.com/everquestdragon/main/image.axd?picture=2009%2F9%2FPaperPaperNewrainbow.png"
      ]
      OverlayMe.dyn_manager.addImage(unicorns[Math.floor(Math.random()*unicorns.length)])

  # adding all overlay images
  $.ajax
    url: '/overlay_images'
    dataType: 'json'
    success: (data) ->
      if data.length == 0 # in case all is empty (default for newcomers)
        OverlayMe.loadDefaultImage()
      else
        $.each data, (index, img_path) ->
          OverlayMe.images_management_div.append new OverlayMe.Overlays.Image(img_path).render()
    error: ->
      OverlayMe.loadDefaultImage()

  # add the panel to the page menu
  $(OverlayMe.Menu).append overlay_panel.render()
  
  # repeating original window#mousemove event
  $(window).bind 'mousemove', (event) ->
    $(window).trigger('mymousemove', event)
{'fraction_non_alphanumeric': 0.11946277097078228, 'fraction_numerical': 0.020263901979264844, 'mean_word_length': 4.253712871287129, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7553506', 'n_tokens_mistral': 1537, 'n_tokens_neox': 1437, 'n_words': 232}