<commit_before>/*!
 * Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

// jQuery to collapse the navbar on scroll
$(window).scroll(function() {
    if ($(".navbar").offset().top > 50) {
        $(".navbar-fixed-top").addClass("top-nav-collapse");
    } else {
        $(".navbar-fixed-top").removeClass("top-nav-collapse");
    }
});

// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
    });
});

// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
    $('.navbar-toggle:visible').click();
});

Number.prototype.toWords = function() {
    function tw(s,n){var ns=s.slice(0,3),nw=[["","one","two","three","four","five","six","seven","eight","nine"],["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],["","thousand","million","billion","trillion"]];
        return (ns.length<1)?"":tw(s.slice(3),n+1)+((ns.length>1)?(((ns.length==3&&ns[2]!="0")?nw[0][ns[2]]+" hundred ":"")+((ns[1]=="1")?nw[1][ns[0]]+" ":((ns[1]!="0")?nw[2][ns[1]]+" ":"")+(ns[0]!="0"?nw[0][ns[0]]+" ":""))):(ns[0]!="0"?nw[0][ns[0]]+" ":""))+(parseInt(ns,10)!=0?nw[3][n]+(n>0?" ":""):"");}
    return tw(this.toString().split("").reverse().join(""),0);
}

// Song request form handlers 
$("#songName,#songSong").on('input propertychange',function(){$("#songSubmit").prop("disabled",($('#songName').val()==''||$('#songSong').val()=='')?true:false);});
$("#songForm").submit(function(event){
    event.preventDefault();
    $("#songSubmit").prop('disabled',true);
//    $.post($(this).prop('action'),$(this).serialize(),function(data){
	  $.getJSON($(this).prop('action') + "?callback=?", $(this).serialize(), function(data){
            if(data.status=="SUCCESS")
                $("#songResult").text("SUCCESS - Thanks for requesting the song: '"+data.row[2]+"'").addClass("text-success").removeClass("text-danger");
            else
                $("#songResult").text(data.status+" - "+data.message).addClass("text-danger").removeClass("text-success");
        },'text').fail(function(){$("#songResult").text("Safari doesn't allow us to verify requests but hopefully we got it.").addClass("text-warning").removeClass("text-success");});
    $("#songSong").val('');
});<commit_msg>Added GA event to scroll links<commit_after>/*!
 * Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

// jQuery to collapse the navbar on scroll
$(window).scroll(function() {
    if ($(".navbar").offset().top > 50) {
        $(".navbar-fixed-top").addClass("top-nav-collapse");
    } else {
        $(".navbar-fixed-top").removeClass("top-nav-collapse");
    }
});

// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
		console.log($anchor.attr('href'));
		ga('send','event','click','nav buttons',$anchor.attr('href'));
        event.preventDefault();
    });
});

// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
    $('.navbar-toggle:visible').click();
});

Number.prototype.toWords = function() {
    function tw(s,n){var ns=s.slice(0,3),nw=[["","one","two","three","four","five","six","seven","eight","nine"],["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],["","thousand","million","billion","trillion"]];
        return (ns.length<1)?"":tw(s.slice(3),n+1)+((ns.length>1)?(((ns.length==3&&ns[2]!="0")?nw[0][ns[2]]+" hundred ":"")+((ns[1]=="1")?nw[1][ns[0]]+" ":((ns[1]!="0")?nw[2][ns[1]]+" ":"")+(ns[0]!="0"?nw[0][ns[0]]+" ":""))):(ns[0]!="0"?nw[0][ns[0]]+" ":""))+(parseInt(ns,10)!=0?nw[3][n]+(n>0?" ":""):"");}
    return tw(this.toString().split("").reverse().join(""),0);
}

// Song request form handlers 
$("#songName,#songSong").on('input propertychange',function(){$("#songSubmit").prop("disabled",($('#songName').val()==''||$('#songSong').val()=='')?true:false);});
$("#songForm").submit(function(event){
    event.preventDefault();
    $("#songSubmit").prop('disabled',true);
//    $.post($(this).prop('action'),$(this).serialize(),function(data){
	  $.getJSON($(this).prop('action') + "?callback=?", $(this).serialize(), function(data){
            if(data.status=="SUCCESS")
                $("#songResult").text("SUCCESS - Thanks for requesting the song: '"+data.row[2]+"'").addClass("text-success").removeClass("text-danger");
            else
                $("#songResult").text(data.status+" - "+data.message).addClass("text-danger").removeClass("text-success");
        },'text').fail(function(){$("#songResult").text("Safari doesn't allow us to verify requests but hopefully we got it.").addClass("text-warning").removeClass("text-success");});
    $("#songSong").val('');
});
{'fraction_non_alphanumeric': 0.2856888888888889, 'fraction_numerical': 0.015644444444444443, 'mean_word_length': 5.1152173913043475, 'pattern_counts': {'":': 14, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '569647', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1833, 'n_words': 248}