<commit_before>Ext.require([
    'AIDRFM.common.AIDRFMFunctions',
    'AIDRFM.common.StandardLayout',
    'AIDRFM.common.Header',
    'AIDRFM.common.Footer'
]);

Ext.define('TAGGUI.new-custom-attribute.view.NewCustomAttributePanel', {
    extend: 'AIDRFM.common.StandardLayout',
    alias: 'widget.new-custom-attribute-view',

    initComponent: function () {
        var me = this;

        this.breadcrumbs = Ext.create('Ext.container.Container', {
            html: '<div class="bread-crumbs">' +
                '<a href="' + BASE_URL + '/protected/home">My Collections</a><span>&nbsp;>&nbsp;New Classifier</span></div>',
            margin: 0,
            padding: 0
        });

        this.taggerTitle = Ext.create('Ext.form.Label', {
            cls: 'header-h1 bold-text',
            text: 'New Classifier',
            flex: 1
        });

        this.codeE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Short name',
            name: 'code',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. donationtype',
            maxLength: 64,
            maxLengthText: 'The maximum length for this field is 64 ',
            maskRe: /[A-za-z0-9_]/,
    	    stripCharsRe: /[^A-za-z0-9_]/
        });

        this.nameE = Ext.create('Ext.form.field.Text', {
            flex: 1,
            fieldLabel: 'Name',
            name: 'name',
            id: 'nameCustomClassifier',
            allowBlank: false,
            emptyText: 'e.g. Donation type'
        });

        this.descriptionE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Description',
            name: 'description',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. Indicate the '+ COLLECTION_TYPES[TYPE]["singular"] + ' being donated'
        });

        this.codeLabelE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Short name',
            name: 'code',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. shoesdonation',
            maxLength: 64,
            maxLengthText: 'The maximum length for this field is 64 ',
            maskRe: /[^ ]/
        });

        this.nameLabelE = Ext.create('Ext.form.field.Text', {
            flex: 1,
            fieldLabel: 'Name',
            name: 'name',
            id: 'nameCategory',
            allowBlank: false,
            maxLength: 140,
            emptyText: 'e.g. Donation of shoes'
        });

        this.DescriptionLabelE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Description',
            name: 'description',
            allowBlank: false,
            maxLength: 600,
            flex: 1,
            emptyText: 'e.g. Footwear in general, shoes, boots, etc.'
        });

        this.newLabelL = Ext.create('Ext.form.Label', {
            flex: 1,
            text: 'New Tag',
            padding: '15 0 0 0',
            cls: 'header-h2'
        });

        this.saveButton = Ext.create('Ext.Button', {
            text: 'Save',
            margin: '0 10 0 10',
            cls: 'btn btn-green',
            id: 'attributeCreate'
        });

        this.cancelButton = Ext.create('Ext.Button', {
            text: 'Cancel',
            cls: 'btn btn-red',
            id: 'attributeCancelCreate'
        });

        this.addLabelButton = Ext.create('Ext.Button', {
            text: 'Add Tag',
            cls: 'btn btn-green',
            id: 'addLabel'
        });

        this.labelsStore = Ext.create('Ext.data.JsonStore', {
            pageSize: 100,
            storeId: 'labelsStore',
            fields: ['code', 'description', 'name'],
            proxy: {
                type: 'ajax',
                url: '',
                reader: {
                    root: 'data',
                    totalProperty: 'total'
                }
            },
            autoLoad: false
        });

        this.labelsTpl = new Ext.XTemplate(
            '<div class="attribute-list">',

            '<tpl for=".">',

            '<tpl if="xindex == 1">' +
                '<div class="attributes-title"><div class="inner"><h2>Tags</h2></div></div>' +
            '</tpl>' +

            '<div class="attribute-item">',

            '<div class="content">',

            '<div class="img">',
            '<img alt="Attribute image" src="/AIDRFetchManager/resources/img/AIDR/AIDR_EMBLEM_CMYK_COLOUR_HR.jpg" width="70" height="70">',
            '</div>',

            '<div class="info">',
            '<div class="styled-text-14" id="docCountField_{id}">Name:&nbsp;&nbsp;&nbsp;{name}</div>',
            '<div class="styled-text-14" id="docCountField_{id}">Short name:&nbsp;&nbsp;&nbsp;{code}</div>',
            '<div class="styled-text-14" id="docCountField_{id}">Description:&nbsp;&nbsp;&nbsp;{description}</div>',
            '</div>',

            '</div>',
            '</div>',

            '</tpl>',

            '</div>'
        );

        this.labelsView = Ext.create('Ext.view.View', {
            store: this.labelsStore,
            id: 'labelsViewId',
            tpl: this.labelsTpl,
            itemSelector: 'li.crisesItem'
        });

        this.editForm = Ext.create('Ext.form.Panel', {
            id: 'collectionForm',
            bodyCls: 'no-border',
            items: [
                {
                    xtype: 'container',
                    defaults: {
                        width: 350,
                        labelWidth: 120
                    },
                    layout: {
                        type: 'vbox',
                        align: 'stretch'
                    },
                    items: [
                         {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.nameE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'nameInfo'
                                }
                            ]
                        },                            
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.codeE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'codeInfo'
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0 0 0',
                            padding: '0 0 20 0',
                            cls: 'bordered-bottom',
                            items: [
                                this.descriptionE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'descriptionInfo'
                                }
                            ]
                        },
                        this.newLabelL,
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.nameLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.codeLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0 0 0',
                            items: [
                                this.DescriptionLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            padding: '15 0 15 0',
                            cls: 'bordered-bottom',
                            items: [
                                this.addLabelButton
                            ]
                        }
                    ]
                }
            ]
        });

        this.items = [
            this.breadcrumbs,
            {
                xtype: 'container',
                margin: '5 0 0 0',
                html: '<div class="horizontalLine"></div>'
            },
            {
                xtype: 'container',
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                items: [
                    this.taggerTitle
                ]
            },
            this.editForm,
            this.labelsView,
            {
                xtype: 'container',
                layout: 'hbox',
                margin: '15 0 0 0',
                items: [
                    this.cancelButton,
                    this.saveButton
                ]
            }
        ];
        this.callParent(arguments);
    }

})
<commit_msg>edited 2 shortcode fields to allow only alphanumeric and underscore<commit_after>Ext.require([
    'AIDRFM.common.AIDRFMFunctions',
    'AIDRFM.common.StandardLayout',
    'AIDRFM.common.Header',
    'AIDRFM.common.Footer'
]);

Ext.define('TAGGUI.new-custom-attribute.view.NewCustomAttributePanel', {
    extend: 'AIDRFM.common.StandardLayout',
    alias: 'widget.new-custom-attribute-view',

    initComponent: function () {
        var me = this;

        this.breadcrumbs = Ext.create('Ext.container.Container', {
            html: '<div class="bread-crumbs">' +
                '<a href="' + BASE_URL + '/protected/home">My Collections</a><span>&nbsp;>&nbsp;New Classifier</span></div>',
            margin: 0,
            padding: 0
        });

        this.taggerTitle = Ext.create('Ext.form.Label', {
            cls: 'header-h1 bold-text',
            text: 'New Classifier',
            flex: 1
        });

        this.codeE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Short name',
            name: 'code',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. donationtype',
            maxLength: 64,
            maxLengthText: 'The maximum length for this field is 64 ',
            maskRe: /[\w]/,
    	    stripCharsRe: /[^\w]/
        });

        this.nameE = Ext.create('Ext.form.field.Text', {
            flex: 1,
            fieldLabel: 'Name',
            name: 'name',
            id: 'nameCustomClassifier',
            allowBlank: false,
            emptyText: 'e.g. Donation type'
        });

        this.descriptionE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Description',
            name: 'description',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. Indicate the '+ COLLECTION_TYPES[TYPE]["singular"] + ' being donated'
        });

        this.codeLabelE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Short name',
            name: 'code',
            allowBlank: false,
            flex: 1,
            emptyText: 'e.g. shoesdonation',
            maxLength: 64,
            maxLengthText: 'The maximum length for this field is 64 ',
            maskRe: /[\w]/,
    	    stripCharsRe: /[^\w]/
        });

        this.nameLabelE = Ext.create('Ext.form.field.Text', {
            flex: 1,
            fieldLabel: 'Name',
            name: 'name',
            id: 'nameCategory',
            allowBlank: false,
            maxLength: 140,
            emptyText: 'e.g. Donation of shoes'
        });

        this.DescriptionLabelE = Ext.create('Ext.form.field.Text', {
            fieldLabel: 'Description',
            name: 'description',
            allowBlank: false,
            maxLength: 600,
            flex: 1,
            emptyText: 'e.g. Footwear in general, shoes, boots, etc.'
        });

        this.newLabelL = Ext.create('Ext.form.Label', {
            flex: 1,
            text: 'New Tag',
            padding: '15 0 0 0',
            cls: 'header-h2'
        });

        this.saveButton = Ext.create('Ext.Button', {
            text: 'Save',
            margin: '0 10 0 10',
            cls: 'btn btn-green',
            id: 'attributeCreate'
        });

        this.cancelButton = Ext.create('Ext.Button', {
            text: 'Cancel',
            cls: 'btn btn-red',
            id: 'attributeCancelCreate'
        });

        this.addLabelButton = Ext.create('Ext.Button', {
            text: 'Add Tag',
            cls: 'btn btn-green',
            id: 'addLabel'
        });

        this.labelsStore = Ext.create('Ext.data.JsonStore', {
            pageSize: 100,
            storeId: 'labelsStore',
            fields: ['code', 'description', 'name'],
            proxy: {
                type: 'ajax',
                url: '',
                reader: {
                    root: 'data',
                    totalProperty: 'total'
                }
            },
            autoLoad: false
        });

        this.labelsTpl = new Ext.XTemplate(
            '<div class="attribute-list">',

            '<tpl for=".">',

            '<tpl if="xindex == 1">' +
                '<div class="attributes-title"><div class="inner"><h2>Tags</h2></div></div>' +
            '</tpl>' +

            '<div class="attribute-item">',

            '<div class="content">',

            '<div class="img">',
            '<img alt="Attribute image" src="/AIDRFetchManager/resources/img/AIDR/AIDR_EMBLEM_CMYK_COLOUR_HR.jpg" width="70" height="70">',
            '</div>',

            '<div class="info">',
            '<div class="styled-text-14" id="docCountField_{id}">Name:&nbsp;&nbsp;&nbsp;{name}</div>',
            '<div class="styled-text-14" id="docCountField_{id}">Short name:&nbsp;&nbsp;&nbsp;{code}</div>',
            '<div class="styled-text-14" id="docCountField_{id}">Description:&nbsp;&nbsp;&nbsp;{description}</div>',
            '</div>',

            '</div>',
            '</div>',

            '</tpl>',

            '</div>'
        );

        this.labelsView = Ext.create('Ext.view.View', {
            store: this.labelsStore,
            id: 'labelsViewId',
            tpl: this.labelsTpl,
            itemSelector: 'li.crisesItem'
        });

        this.editForm = Ext.create('Ext.form.Panel', {
            id: 'collectionForm',
            bodyCls: 'no-border',
            items: [
                {
                    xtype: 'container',
                    defaults: {
                        width: 350,
                        labelWidth: 120
                    },
                    layout: {
                        type: 'vbox',
                        align: 'stretch'
                    },
                    items: [
                         {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.nameE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'nameInfo'
                                }
                            ]
                        },                            
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.codeE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'codeInfo'
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0 0 0',
                            padding: '0 0 20 0',
                            cls: 'bordered-bottom',
                            items: [
                                this.descriptionE,
                                {
                                    border: false,
                                    bodyStyle: 'background:none',
                                    html: '<img src="/AIDRFetchManager/resources/img/info.png"/>',
                                    height: 22,
                                    width: 22,
                                    id: 'descriptionInfo'
                                }
                            ]
                        },
                        this.newLabelL,
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.nameLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0',
                            items: [
                                this.codeLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            margin: '5 0 0 0',
                            items: [
                                this.DescriptionLabelE
                            ]
                        },
                        {
                            xtype: 'container',
                            layout: 'hbox',
                            padding: '15 0 15 0',
                            cls: 'bordered-bottom',
                            items: [
                                this.addLabelButton
                            ]
                        }
                    ]
                }
            ]
        });

        this.items = [
            this.breadcrumbs,
            {
                xtype: 'container',
                margin: '5 0 0 0',
                html: '<div class="horizontalLine"></div>'
            },
            {
                xtype: 'container',
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                items: [
                    this.taggerTitle
                ]
            },
            this.editForm,
            this.labelsView,
            {
                xtype: 'container',
                layout: 'hbox',
                margin: '15 0 0 0',
                items: [
                    this.cancelButton,
                    this.saveButton
                ]
            }
        ];
        this.callParent(arguments);
    }

})

{'fraction_non_alphanumeric': 0.11587147030185005, 'fraction_numerical': 0.010662122687439143, 'mean_word_length': 0.8350008933357156, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6894644', 'n_tokens_mistral': 5262, 'n_tokens_neox': 4919, 'n_words': 938}