<commit_before>function modal(nextSelector) {
    var overlay = '<div class="overlay"></div>';
    $(overlay).insertBefore($('.container')).fadeIn();
    nextSelector.removeClass('hidden-modal').addClass('modal');
    $('.overlay').click(function(){
        $('.overlay').fadeOut().remove();
        $('.modal').removeClass('modal').addClass('hidden-modal');
    });
    $('.close-modal').click(function(){
        $('.overlay').fadeOut().remove();
        $('.modal').removeClass('modal').addClass('hidden-modal');
    });
}

function checkout(pk, image, description, amount, email, label, form, submit) {
    submit = typeof submit !== 'undefined' ? submit : true;
    var token = function(token) {
        form.append('<input type="hidden" name="stripe_token" value="' + token.id + '" />');
        form.append('<input type="hidden" name="stripe_email" value="' + token.email + '" />');
        $('a').click(function() { return false; });
        $('button').click(function() { return false; });
        if (submit) {
            form.submit();
        }
    }
    StripeCheckout.open({
        key: pk,
        image: image,
        name: 'MuckRock',
        description: description,
        amount: amount,
        email: email,
        panelLabel: label,
        token: token
    });
}

function getCheckoutData(button) {
    var amount = button.data('amount');
    var description = button.data('description');
    var email = button.data('email');
    var form = button.data('form');
    var label = button.data('label');
    return {
        'amount': amount,
        'description': description,
        'email': email,
        'label': label,
        'form': $(form)
    }
}

$('textarea').autosize();

if (typeof $.cookie('broadcast') == 'undefined') {
    $.cookie('broadcast', 1);
}

// MODALS
$('.modal-button').click(function(){ modal($(this).next()); });
$('.embed.hidden-modal').each(function() {
    var textarea = $(this).children('textarea');
    var doc_id = textarea.data('docId');
    var embed = '<div class="viewer" id="viewer-' + doc_id + '"></div> <script src="https://s3.amazonaws.com/s3.documentcloud.org/viewer/loader.js"><\/script> <script>DV.load("https://www.documentcloud.org/documents/' + doc_id + '.js", {width: 600, height: 600, sidebar: false, container: "#viewer-' + doc_id + '"});<\/script>';<commit_msg>add bitcoin support, close #298<commit_after>function modal(nextSelector) {
    var overlay = '<div class="overlay"></div>';
    $(overlay).insertBefore($('.container')).fadeIn();
    nextSelector.removeClass('hidden-modal').addClass('modal');
    $('.overlay').click(function(){
        $('.overlay').fadeOut().remove();
        $('.modal').removeClass('modal').addClass('hidden-modal');
    });
    $('.close-modal').click(function(){
        $('.overlay').fadeOut().remove();
        $('.modal').removeClass('modal').addClass('hidden-modal');
    });
}

function checkout(pk, image, description, amount, email, label, form, submit) {
    submit = typeof submit !== 'undefined' ? submit : true;
    var token = function(token) {
        form.append('<input type="hidden" name="stripe_token" value="' + token.id + '" />');
        form.append('<input type="hidden" name="stripe_email" value="' + token.email + '" />');
        $('a').click(function() { return false; });
        $('button').click(function() { return false; });
        if (submit) {
            form.submit();
        }
    }
    StripeCheckout.open({
        key: pk,
        image: image,
        name: 'MuckRock',
        description: description,
        amount: amount,
        email: email,
        panelLabel: label,
        token: token,
        bitcoin: true
    });
}

function getCheckoutData(button) {
    var amount = button.data('amount');
    var description = button.data('description');
    var email = button.data('email');
    var form = button.data('form');
    var label = button.data('label');
    return {
        'amount': amount,
        'description': description,
        'email': email,
        'label': label,
        'form': $(form)
    }
}

$('textarea').autosize();

if (typeof $.cookie('broadcast') == 'undefined') {
    $.cookie('broadcast', 1);
}

// MODALS
$('.modal-button').click(function(){ modal($(this).next()); });
$('.embed.hidden-modal').each(function() {
    var textarea = $(this).children('textarea');
    var doc_id = textarea.data('docId');
    var embed = '<div class="viewer" id="viewer-' + doc_id + '"></div> <script src="https://s3.amazonaws.com/s3.documentcloud.org/viewer/loader.js"><\/script> <script>DV.load("https://www.documentcloud.org/documents/' + doc_id + '.js", {width: 600, height: 600, sidebar: false, container: "#viewer-' + doc_id + '"});<\/script>';
{'fraction_non_alphanumeric': 0.2122172902134855, 'fraction_numerical': 0.004438807863031071, 'mean_word_length': 3.1618293755496922, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 4, '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': '2737762', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1401, 'n_words': 275}