<commit_before>(function() {
    gf.HudItem = Class.extend({
        init: function(x, y, settings) {
            //can be dragged
            this.draggable = false;

            //is this item visible?
            this.visible = true;

            //value of the item
            this.value = typeof settings.value == 'string' ? '' : 0;

            this.name = '';

            //use the passed settings object ot override the default values above
            gf.utils.setValues(this, settings);

            this.default = this.value;

            //create the base div of this element
            this._createElement(x, y);

            //some private stuffs
            this.dirty = true;

            //dragging stuff
            this.dragging = false;
        },
        reset: function() {
            this.set(this.default);
            return this;
        },
        setValue: function(val) {
            this.value = val;
            this.dirty = true;
            return this;
        },
        getValue: function() {
            return this.value;
        },
        update: function() {
            if(!this.dirty) return;

            this.$elm.text(this.value);
            return this;
        },
        //virtual events
        onClick: function(e) {},
        onMouseDown: function(e) {
            if(!this.draggable) return;

            this.dragging = {
                x: e.clientX,
                y: e.clientY
            }
        },
        onMouseUp: function(e) {
            this.dragging = false;
        },
        onMouseMove: function(e) {
            if(!this.draggable || !this.dragging) return;

            var diffX = e.clientX - this.dragging.x,
                diffY = e.clientY - this.dragging.y,
                pos = this.$elm.position();

            this.dragging.x = e.clientX;
            this.dragging.y = e.clientY;

            this.$elm.css({
                top: pos.top += diffY,
                left: pos.left += diffX
            });
        },
        //private functions
        _createElement: function(x, y) {
            this.$elm = $('<div/>', {
                'class': 'gf-hud-item ' + this.name
            }).css({<commit_msg>Add some drag events<commit_after>(function() {
    gf.HudItem = Class.extend({
        init: function(x, y, settings) {
            //can be dragged
            this.draggable = false;

            //is this item visible?
            this.visible = true;

            //value of the item
            this.value = typeof settings.value == 'string' ? '' : 0;

            this.name = '';

            //use the passed settings object ot override the default values above
            gf.utils.setValues(this, settings);

            this.default = this.value;

            //create the base div of this element
            this._createElement(x, y);

            //some private stuffs
            this.dirty = true;

            //dragging stuff
            this.dragging = false;
        },
        reset: function() {
            this.set(this.default);
            return this;
        },
        setValue: function(val) {
            this.value = val;
            this.dirty = true;
            return this;
        },
        getValue: function() {
            return this.value;
        },
        update: function() {
            if(!this.dirty) return;

            this.$elm.text(this.value);
            return this;
        },
        //virtual events
        onClick: function(e) {},
        onDragStart: function(e) {},
        onDragEnd: function(e) {},
        onMouseDown: function(e) {
            if(!this.draggable) return;

            this.dragging = {
                x: e.clientX,
                y: e.clientY
            };
            this.onDragStart(e);
        },
        onMouseUp: function(e) {
            this.dragging = false;
            this.onDragEnd(e);
        },
        onMouseMove: function(e) {
            if(!this.draggable || !this.dragging) return;

            var diffX = e.clientX - this.dragging.x,
                diffY = e.clientY - this.dragging.y,
                pos = this.$elm.position();

            this.dragging.x = e.clientX;
            this.dragging.y = e.clientY;

            this.$elm.css({
                top: pos.top += diffY,
                left: pos.left += diffX
            });
        },
        //private functions
        _createElement: function(x, y) {
            this.$elm = $('<div/>', {
                'class': 'gf-hud-item ' + this.name
            }).css({
{'fraction_non_alphanumeric': 0.12009695901278096, 'fraction_numerical': 0.00044072278536800354, 'mean_word_length': 1.21630859375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2845950', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1213, 'n_words': 284}