<commit_before>'use strict';
var $ = require('jquery');

var pointers = require('js/pointers');
var AccountClaimer = require('js/accountClaimer.js');
var $osf = require('js/osfHelpers');

// NodeActions is needed for rendering recent logs in nodelists (e.g. regsitrations and forks
// pages
require('js/project');

require('js/registerNode');

var node = window.contextVars.node;


new pointers.PointerDisplay('#showLinks');

if (!window.contextVars.currentUser.isContributor) {
    new AccountClaimer('.contributor-unregistered');
}

if (node.isPublic && node.piwikSiteID) {
    $osf.trackPiwik(node.piwikHost, node.piwikSiteID);
}

// Used for clearing backward/forward cache issues
$(window).unload(function(){
    return 'Unload';
});
$(document).ready(function() {
    $.getJSON(node.urls.api, function(data) {    
        $('body').trigger('nodeLoad', data);
    });

    var self = this;
    var thresholdScrollPosition = 50;
    var smallScreenSize = 767;
    var nonNavTopMargin = 50;
    var navMaxTopMargin = 95;
    self.adjustPanelPosition = function() {
        var bodyWidth = $(document.body).width();
        var scrollTopPosition = $(window).scrollTop();
        if (bodyWidth <= smallScreenSize) {
            if (scrollTopPosition >= thresholdScrollPosition) {
                $('.cp-handle').css('margin-top', nonNavTopMargin);
            }
            else {
                $('.cp-handle').css('margin-top', navMaxTopMargin - scrollTopPosition);
            }
        }
    };
    var THROTTLE = 10;

    self.adjustPanelPosition(); /* Init when refreshing the page*/
    $(window).scroll(
        $osf.debounce(
            function() {
                self.adjustPanelPosition();
    }, THROTTLE));

    THROTTLE = 50;
    $( window ).resize(
        $osf.debounce(
            function() {
                var bodyWidth = $(document.body).width();
                var scrollTopPosition = $(window).scrollTop();
                if (bodyWidth > smallScreenSize || scrollTopPosition < thresholdScrollPosition) {
                    $('.cp-handle').css('margin-top', navMaxTopMargin);
                } else if (bodyWidth < smallScreenSize || scrollTopPosition > thresholdScrollPosition) {
                    $('.cp-handle').css('margin-top', nonNavTopMargin);
                }
    }, THROTTLE));
});<commit_msg>Upper case constant variable<commit_after>'use strict';
var $ = require('jquery');

var pointers = require('js/pointers');
var AccountClaimer = require('js/accountClaimer.js');
var $osf = require('js/osfHelpers');

// NodeActions is needed for rendering recent logs in nodelists (e.g. regsitrations and forks
// pages
require('js/project');

require('js/registerNode');

var node = window.contextVars.node;


new pointers.PointerDisplay('#showLinks');

if (!window.contextVars.currentUser.isContributor) {
    new AccountClaimer('.contributor-unregistered');
}

if (node.isPublic && node.piwikSiteID) {
    $osf.trackPiwik(node.piwikHost, node.piwikSiteID);
}

// Used for clearing backward/forward cache issues
$(window).unload(function(){
    return 'Unload';
});
$(document).ready(function() {
    $.getJSON(node.urls.api, function(data) {    
        $('body').trigger('nodeLoad', data);
    });

    var self = this;
    var THRESHOLD_SCROLL_POSITION  = 50;
    var SMALL_SCREEN_SIZE = 767;
    var NON_NAV_TOP_MARGIN = 50;
    var NAV_MAX_TOP_MARGIN = 95;
    self.adjustPanelPosition = function() {
        var bodyWidth = $(document.body).width();
        var scrollTopPosition = $(window).scrollTop();
        if (bodyWidth <= SMALL_SCREEN_SIZE) {
            if (scrollTopPosition >= THRESHOLD_SCROLL_POSITION) {
                $('.cp-handle').css('margin-top', NON_NAV_TOP_MARGIN);
            }
            else {
                $('.cp-handle').css('margin-top', NAV_MAX_TOP_MARGIN - scrollTopPosition);
            }
        }
    };
    var THROTTLE = 10;

    self.adjustPanelPosition(); /* Init when refreshing the page*/
    $(window).scroll(
        $osf.debounce(
            function() {
                self.adjustPanelPosition();
    }, THROTTLE));

    THROTTLE = 50;
    $( window ).resize(
        $osf.debounce(
            function() {
                var bodyWidth = $(document.body).width();
                var scrollTopPosition = $(window).scrollTop();
                if (bodyWidth > SMALL_SCREEN_SIZE || scrollTopPosition < THRESHOLD_SCROLL_POSITION) {
                    $('.cp-handle').css('margin-top', NAV_MAX_TOP_MARGIN);
                } else if (bodyWidth < SMALL_SCREEN_SIZE || scrollTopPosition > THRESHOLD_SCROLL_POSITION) {
                    $('.cp-handle').css('margin-top', NON_NAV_TOP_MARGIN);
                }
    }, THROTTLE));
});
{'fraction_non_alphanumeric': 0.1435224386113463, 'fraction_numerical': 0.00550381033022862, 'mean_word_length': 2.6486486486486487, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4730350', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1397, 'n_words': 271}