<commit_before>Ext.namespace('Kwc.Abstract.Image');
Kwc.Abstract.Image.DimensionWindow = Ext.extend(Ext.Window, {

    dimensions: null,
    value: null, //contains width, height, cropdata

    title: trlKwf('Configure'),
    closeAction: 'close',
    modal: true,
    minWidth: 418,
    minHeight: 250,
    width: 418,
    height: 250,
    layout: 'fit',
    resizable: false,

    minImageSize: 64,

    initComponent: function() {
        var radios = [];
        for (var i in this.dimensions) {
            radios.push({
                inputValue: i,
                boxLabel: Kwc.Abstract.Image.DimensionField.getDimensionString(this.dimensions, {dimension: i}),
                name: 'dimension',
                listeners: {
                    check: this._enableDisableFields,
                    scope: this
                }
            });
        }
        this._dimensionField = new Kwf.Form.RadioGroup({
            columns: 1,
            hideLabel: true,
            vertical: false,
            items: radios
        });
        this._widthField = new Ext.form.NumberField({
            width: 45,
            enableKeyEvents: true,
            validateOnBlur: false,
            validationEvent: false,
            allowNegative: false
        });
        this._heightField = new Ext.form.NumberField({
            width: 45,
            enableKeyEvents: true,
            validateOnBlur: false,
            validationEvent: false,
            allowNegative: false
        });
        this._xField = new Ext.BoxComponent({
            autoEl: {
                html: 'x',
                style: 'line-height:20px;text-align:center;padding-left:2px;padding-right:2px;'
            }
        });
        this._pxField = new Ext.BoxComponent({
            autoEl: {
                html: 'px',
                style: 'line-height:20px;text-align:center;padding-left:2px;'
            }
        });
        this._userSelection = new Ext.FormPanel({
            xtype: 'panel',
            layout: 'column',
            hideBorders: true,
            autoHeight: true,
            items: [
                this._widthField,
                this._xField,
                this._heightField,
                this._pxField
            ]
        });

        this._widthField.on('blur', this._validateSizes, this);
        this._widthField.on('keyup', this._validateSizes, this);
        this._widthField.on('keyup', this._updateOutSize, this);
        this._heightField.on('blur', this._validateSizes, this);
        this._heightField.on('keyup', this._validateSizes, this);
        this._heightField.on('keyup', this._updateOutSize, this);
        this._dimensionField.on('change', this._validateSizes, this);
        this._dimensionField.on('change', this._resetCropRegion, this);

        // Has to be initialised before cropRegion because cropRegion needs dimensionValue
        if (this.value && this.value.dimension) {
            this._dimensionField.setValue(this.value.dimension);
            this._widthField.setValue(this.value.width);
            this._heightField.setValue(this.value.height);
        } else {
            for (var i in this.dimensions) {
                break;
            }
            this._dimensionField.setValue(i);
        }
        this._enableDisableFields();

        this._initCropRegion();

        this._configPane = new Ext.FormPanel({
            region: 'west',
            bodyStyle: 'padding: 10px',
            width: 200,
            autoScroll: true,
            title: trlKwf('Select dimension'),
            hideBorders: true,
            items: [
                this._dimensionField,
                this._userSelection
            ]
        });

        this._cropPane = new Ext.Panel({
            region: 'center',
            title: trlKwf('Select image region'),
            width: 600,
            height: 200,
            items: [
                this._cropImage
            ]
        });

        this.items = new Ext.FormPanel({
            bodyStyle: 'padding: 10px',
            layout: 'border',
            items: [
                this._configPane,
                this._cropPane
            ]
        });
        this.buttons = [
            {
                text: trlKwf('OK'),
                handler: function() {
                    if (this._validateSizes()) {<commit_msg>Remove double border<commit_after>Ext.namespace('Kwc.Abstract.Image');
Kwc.Abstract.Image.DimensionWindow = Ext.extend(Ext.Window, {

    dimensions: null,
    value: null, //contains width, height, cropdata

    title: trlKwf('Configure'),
    closeAction: 'close',
    modal: true,
    minWidth: 418,
    minHeight: 250,
    width: 418,
    height: 250,
    layout: 'fit',
    resizable: false,

    minImageSize: 64,

    initComponent: function() {
        var radios = [];
        for (var i in this.dimensions) {
            radios.push({
                inputValue: i,
                boxLabel: Kwc.Abstract.Image.DimensionField.getDimensionString(this.dimensions, {dimension: i}),
                name: 'dimension',
                listeners: {
                    check: this._enableDisableFields,
                    scope: this
                }
            });
        }
        this._dimensionField = new Kwf.Form.RadioGroup({
            columns: 1,
            hideLabel: true,
            vertical: false,
            items: radios
        });
        this._widthField = new Ext.form.NumberField({
            width: 45,
            enableKeyEvents: true,
            validateOnBlur: false,
            validationEvent: false,
            allowNegative: false
        });
        this._heightField = new Ext.form.NumberField({
            width: 45,
            enableKeyEvents: true,
            validateOnBlur: false,
            validationEvent: false,
            allowNegative: false
        });
        this._xField = new Ext.BoxComponent({
            autoEl: {
                html: 'x',
                style: 'line-height:20px;text-align:center;padding-left:2px;padding-right:2px;'
            }
        });
        this._pxField = new Ext.BoxComponent({
            autoEl: {
                html: 'px',
                style: 'line-height:20px;text-align:center;padding-left:2px;'
            }
        });
        this._userSelection = new Ext.FormPanel({
            xtype: 'panel',
            layout: 'column',
            hideBorders: true,
            autoHeight: true,
            items: [
                this._widthField,
                this._xField,
                this._heightField,
                this._pxField
            ]
        });

        this._widthField.on('blur', this._validateSizes, this);
        this._widthField.on('keyup', this._validateSizes, this);
        this._widthField.on('keyup', this._updateOutSize, this);
        this._heightField.on('blur', this._validateSizes, this);
        this._heightField.on('keyup', this._validateSizes, this);
        this._heightField.on('keyup', this._updateOutSize, this);
        this._dimensionField.on('change', this._validateSizes, this);
        this._dimensionField.on('change', this._resetCropRegion, this);

        // Has to be initialised before cropRegion because cropRegion needs dimensionValue
        if (this.value && this.value.dimension) {
            this._dimensionField.setValue(this.value.dimension);
            this._widthField.setValue(this.value.width);
            this._heightField.setValue(this.value.height);
        } else {
            for (var i in this.dimensions) {
                break;
            }
            this._dimensionField.setValue(i);
        }
        this._enableDisableFields();

        this._initCropRegion();

        this._configPane = new Ext.FormPanel({
            region: 'west',
            bodyStyle: 'padding: 10px',
            width: 200,
            autoScroll: true,
            title: trlKwf('Select dimension'),
            hideBorders: true,
            items: [
                this._dimensionField,
                this._userSelection
            ]
        });

        this._cropPane = new Ext.Panel({
            region: 'center',
            title: trlKwf('Select image region'),
            width: 600,
            height: 200,
            items: [
                this._cropImage
            ]
        });

        this.items = new Ext.FormPanel({
            border: false,
            bodyStyle: 'padding: 10px',
            layout: 'border',
            items: [
                this._configPane,
                this._cropPane
            ]
        });
        this.buttons = [
            {
                text: trlKwf('OK'),
                handler: function() {
                    if (this._validateSizes()) {
{'fraction_non_alphanumeric': 0.10923217550274222, 'fraction_numerical': 0.008912248628884826, 'mean_word_length': 1.5044349070100143, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424021', 'n_tokens_mistral': 2433, 'n_tokens_neox': 2284, 'n_words': 456}