<commit_before>﻿þ.extend('PROPERTIES', {
    //This can not be chained as its use is þelem.html = "hello" or var t = þelem.html;
    innerHTML: {
        configurable: false,
        set: function (value) {
            this.each(
                    function () {
                        this.innerHTML = value;
                    }, true)
        },
        get: function () {
            return this.nodes[0].innerHTML;
        }
    },
    firstNode: { get: function () { return this.nodes[0] } },
    clientWidth: { get: function () { return this.nodes[0].clientWidth; } },
    offsetWidth: { get: function () { return this.nodes[0].offsetWidth; } },
    scrollWidth: { get: function () { return this.nodes[0].scrollWidth; } },
    clientHeight: { get: function () { return this.nodes[0].clientHeight; } },
    offsetHeight: { get: function () { return this.nodes[0].offsetHeight; } },
    scrollHeight: { get: function () { return this.nodes[0].scrollHeight; } },

    //Position relative to its container
    offsetTop: { get: function () { return this.nodes[0].offsetTop; } },
    offsetLeft: { get: function () { return this.nodes[0].offsetLeft; } },
    offset: {
        get: function () {
            return { left: this.nodes[0].offsetLeft, top: this.nodes[0].offsetTop }
        }
    },

    //Position relative to document
    position: {
        get: function () {
            var node = this.nodes[0],
             x = parseInt(node.offsetLeft),
             y = parseInt(node.offsetTop);

            node = node.offsetParent;
            while (node != null) {
                x += parseInt(node.offsetLeft);
                y += parseInt(node.offsetTop);
                node = node.offsetParent;
            }
            return { left: x, top: y };
        }
    },

    id: { get: function () { return this.nodes[0].id } },
    dataset: { get: function () { return this.nodes[0].dataset; } },


    value: {
        get: function () {
            var node = this.nodes[0];
            if (node.nodeType == 1) {//node is an element
                switch (node.tagName) {
                    case 'INPUT':
                        if (node.type == 'checkbox') return node.checked;
                        break;
                    case 'OPTION':
                        return node.value || node.text;
                        break;
                        // Handle select boxes special
                    case 'SELECT':
                        var index = node.selectedIndex,
                        values = [],
                        options = node.options,
                        one = node.type == "select-one";

                        // Nothing was selected
                        if (index < 0) return null;

                        // Loop through all the selected options
                        for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) {
                            var option = options[i];
                            if (option.selected) {
                                // Get the specifc value for the option
                                value = option.value || option.text;

                                // We don't need an array for one selects
                                if (one)
                                    return value;

                                // Multi-Selects return an array
                                values.push(value);
                            }
                        }
                        return values;
                }
            }
            // Everything else, we just grab the value
            return (node.value || "").replace(/\r/g, "");
        }
    },

    encodedValue: function () {
        return window.encodeURIComponent(this.value);
    },

    //Number of nodes
    length: {
        get: function () { return this.nodes ? this.nodes.length : 0; }
    }
});<commit_msg>Reorganise order, clean up syntax<commit_after>﻿þ.extend('PROPERTIES', {
    //These can not be chained as all these properties return a value
    id: { get: function () { return this.nodes[0].id } },
    dataset: { get: function () { return this.nodes[0].dataset; } },

    //Access to the raw nodes
    length: { get: function () { return this.nodes ? this.nodes.length : 0; } },
    firstNode: { get: function () { return this.nodes[0] } },
    allNodes: { get: function () { return this.nodes; } },

    //Width,height and position of the first node
    clientWidth: { get: function () { return this.nodes[0].clientWidth; } },
    offsetWidth: { get: function () { return this.nodes[0].offsetWidth; } },
    scrollWidth: { get: function () { return this.nodes[0].scrollWidth; } },
    clientHeight: { get: function () { return this.nodes[0].clientHeight; } },
    offsetHeight: { get: function () { return this.nodes[0].offsetHeight; } },
    scrollHeight: { get: function () { return this.nodes[0].scrollHeight; } },

    //Position relative to its container
    offsetTop: { get: function () { return this.nodes[0].offsetTop; } },
    offsetLeft: { get: function () { return this.nodes[0].offsetLeft; } },

    //Position relative to document
    position: {
        get: function () {
            var node = this.nodes[0],
             left = parseInt(node.offsetLeft),
             top = parseInt(node.offsetTop);

            node = node.offsetParent;

            while (node != null) {
                left += parseInt(node.offsetLeft);
                top += parseInt(node.offsetTop);
                node = node.offsetParent;
            }
            return { left: left, top: top };
        }
    },

    //Read or write the innerHTML of an node
    innerHTML: {
        set: function (value) {
            this.each(
                    function () {
                        if (this.innerHTML) // Check if this node supports innerHTML
                            this.innerHTML = value;
                    }, true)
        },
        get: function () {
            return this.nodes[0].innerHTML;
        }
    },

    value: {
        get: function () {
            var node = this.nodes[0];
            if (node.nodeType == 1) { //node is an element
                switch (node.tagName) {
                    case 'INPUT':
                        if (node.type == 'checkbox') return node.checked;
                        break;
                    case 'OPTION':
                        return node.value || node.text;
                    case 'SELECT':
                        var i, max, index = node.selectedIndex, values = [],
                        options = node.options, one = node.type == "select-one";

                        if (index < 0) return null; // Nothing was selected

                        if (one) return options[index].value || options[index].text;

                        // Loop through all options and find the selected ones
                        for (i = 0, max = options.length; i < max; i++) {
                            var option = options[i];
                            if (option.selected) values.push(option.value || option.text);
                        }
                        return values;
                }
            }
            // Everything else
            return (node.value || "").replace(/\r/g, "");
        }
    },

    encodedValue: { get: function () { return window.encodeURIComponent(this.value); } }
});
{'fraction_non_alphanumeric': 0.12249023042716616, 'fraction_numerical': 0.005255356420967525, 'mean_word_length': 1.3561904761904762, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4130114', 'n_tokens_mistral': 1921, 'n_tokens_neox': 1844, 'n_words': 509}