<commit_before>/*!
 * formvalidation.js (https://github.com/chemerisuk/formvalidation.js)
 *
 * HTML5 forms polyfill
 *
 * Copyright (c) 2013 <NAME>
 *
 */
window.addEventListener && (function(document, window) {
    // helper type
    function TooltipAPI(options, overrides) {
        var el = document.createElement("div");

        Object.keys(options || {}).forEach(function(key) {
            el[key] = options[key];
        });
        
        el.className = "formvalidation-tooltip";

        el.onmousedown = function(e) {
            // fix problems with loosing focus when click on tooltip
            e.preventDefault();
            e.stopPropagation();
        };

        this._el = el;

        Object.keys(overrides || {}).forEach(function(key) {
            this[key] = overrides[key];
        }, this);

        this.hide();
    }

    TooltipAPI.prototype = {
        capture: function(el) {
            return !!(this._target = el);
        },
        show: function() {
            if (this._target) {
                this.refresh();

                var boundingRect = this._target.getBoundingClientRect(),
                    clientTop = htmlEl.clientTop || bodyEl.clientTop || 0,
                    clientLeft = htmlEl.clientLeft || bodyEl.clientLeft || 0,
                    scrollTop = window.pageYOffset || htmlEl.scrollTop || bodyEl.scrollTop,
                    scrollLeft = window.pageXOffset || htmlEl.scrollLeft || bodyEl.scrollLeft;

                if (this._el.parentNode === null) {
                    bodyEl.appendChild(this._el);
                }

                this._el.style.left = boundingRect.left + scrollLeft - clientLeft + "px";
                this._el.style.top = boundingRect.bottom + scrollTop - clientTop + "px";
                this._el.style.visibility = "visible";
            }<commit_msg>Make validation message <label>s with [for] when input has id<commit_after>/*!
 * formvalidation.js (https://github.com/chemerisuk/formvalidation.js)
 *
 * HTML5 forms polyfill
 *
 * Copyright (c) 2013 <NAME>
 *
 */
window.addEventListener && (function(document, window) {
    // helper type
    function TooltipAPI(options, overrides) {
        var el = document.createElement("label");

        Object.keys(options || {}).forEach(function(key) {
            el[key] = options[key];
        });
        
        el.className = "formvalidation-tooltip";

        el.onmousedown = function(e) {
            // fix problems with loosing focus when click on tooltip
            e.preventDefault();
            e.stopPropagation();
        };

        this._el = el;

        Object.keys(overrides || {}).forEach(function(key) {
            this[key] = overrides[key];
        }, this);

        this.hide();
    }

    TooltipAPI.prototype = {
        capture: function(el) {
            return !!(this._target = el);
        },
        show: function() {
            if (this._target) {
                this.refresh();

                var boundingRect = this._target.getBoundingClientRect(),
                    clientTop = htmlEl.clientTop || bodyEl.clientTop || 0,
                    clientLeft = htmlEl.clientLeft || bodyEl.clientLeft || 0,
                    scrollTop = window.pageYOffset || htmlEl.scrollTop || bodyEl.scrollTop,
                    scrollLeft = window.pageXOffset || htmlEl.scrollLeft || bodyEl.scrollLeft;

                if (this._el.parentNode === null) {
                    bodyEl.appendChild(this._el);
                }

                this._el.style.left = boundingRect.left + scrollLeft - clientLeft + "px";
                this._el.style.top = boundingRect.bottom + scrollTop - clientTop + "px";
                this._el.style.visibility = "visible";
                if (this._target.id)
                    this._el.setAttribute('for', this._target.id)
            }
{'fraction_non_alphanumeric': 0.12639501686997145, 'fraction_numerical': 0.003633532312483779, 'mean_word_length': 1.7806637806637806, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '1153930', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1020, 'n_words': 201}