<commit_before>Ext.onReady(function()
{
  Ext.Ajax.defaultHeaders = {
    "Content-Type" : "application/x-www-form-urlencoded; charset=utf-8"
  };

  function readableExample(value, metadata, record, rowIndex, colIndex, store)
  {
    return record.json.name + "=\"" + value + "\"";
  }

  MetaDataWindow = function(id, name)
  {
    var hideAttr = (name === "Search Result") ? true : false;

    var config = {};
    config.title = 'Meta Data for ' + name;
    config.width = 800;
    config.height = 420;

    var grid = null;

    // get datastore
    var storeMeta = new Ext.data.JsonStore({
      url : conf_context + '/secure/MetaData?mID=' + id,
      totalProperty : 'size',
      root : 'metadata',
      id : 'id',
      fields : [ 'key', 'value' ],
      // turn on remote sorting
      remoteSort : true
    });

    var colModel = new Ext.grid.ColumnModel([ {
      header : "Name",
      dataIndex : 'key'
    },

    {
      header : "Value",
      dataIndex : 'value'
    } ]);

    var gridMeta = new Ext.grid.GridPanel({
      ds : storeMeta,
      cm : colModel,
      title : 'meta data',
      loadMask : true,
      viewConfig : {
        forceFit : true,
        autoFill : true
      },
      height : 380,
      flex : 1
    });

    if (!hideAttr)
    {
      var storeNodeAttributes = new Ext.data.JsonStore({
        url : conf_context + '/secure/AttributeList?corpusIds=' + id
            + '&noprefix',
        // turn on remote sorting
        remoteSort : false,
        fields : [ 'name', 'values' ]
      });

      var colModelAttribute = new Ext.grid.ColumnModel([ {
        header : "name",
        dataIndex : "name"
      }, {
        header : "example",
        dataIndex : "values",
        renderer : readableExample
      } ]);

      var gridAttribute = new Ext.grid.GridPanel({
        ds : storeNodeAttributes,
        cm : colModelAttribute,
        loadMask : true,
        title : 'corpus description',
        viewConfig : {
          forceFit : true,
          autoFill : true
        },
        autoWidth : true,
        height : 380,
        flex : 1
      });

      storeNodeAttributes.setDefaultSort('name', 'asc');
      storeNodeAttributes.load({
        params : {
          corpusIdList : '',
          type : 'node'
        }
      });
    }

    storeMeta.load();

    // init config
    config.items = (!hideAttr) ? [ gridMeta, gridAttribute ] : [ gridMeta ];
    config.autoScroll = true;
    config.layout = {
      type : 'hbox'
    };
    config.shadow = false;

    MetaDataWindow.superclass.constructor.call(this, config);
  };

  Ext.extend(MetaDataWindow, Ext.Window);
});<commit_msg>added line break for metaddataWindow, css property doesn't work for this, needs the renderer-property<commit_after>Ext.onReady(function()
{
  Ext.Ajax.defaultHeaders = {
    "Content-Type" : "application/x-www-form-urlencoded; charset=utf-8"
  };

  function readableExample(value, metadata, record, rowIndex, colIndex, store)
  {
    return '<p style=\'white-space: normal\'>' + record.json.name + "=\""
        + value + "\"</p>";
  }

  MetaDataWindow = function(id, name)
  {
    var hideAttr = (name === "Search Result") ? true : false;

    var config = {};
    config.title = 'Meta Data for ' + name;
    config.width = 800;
    config.height = 420;

    var grid = null;

    // get datastore
    var storeMeta = new Ext.data.JsonStore({
      url : conf_context + '/secure/MetaData?mID=' + id,
      totalProperty : 'size',
      root : 'metadata',
      id : 'id',
      fields : [ 'key', 'value' ],
      // turn on remote sorting
      remoteSort : true
    });

    var colModel = new Ext.grid.ColumnModel([ {
      header : "Name",
      dataIndex : 'key'
    }, {
      header : "Value",
      dataIndex : 'value',
      renderer : function(value)
      {
        var css = 'white-space: normal; overflow: normal; padding-right: 5px';
        return '<p style=\'' + css + '\'>' + value + '</p>';
      }
    } ]);

    var gridMeta = new Ext.grid.GridPanel({
      ds : storeMeta,
      cm : colModel,
      title : 'meta data',
      loadMask : true,
      viewConfig : {
        forceFit : true,
        autoFill : true
      },
      height : 380,
      flex : 1
    });

    if (!hideAttr)
    {
      var storeNodeAttributes = new Ext.data.JsonStore({
        url : conf_context + '/secure/AttributeList?corpusIds=' + id
            + '&noprefix',
        // turn on remote sorting
        remoteSort : false,
        fields : [ 'name', 'values' ]
      });

      var colModelAttribute = new Ext.grid.ColumnModel([ {
        header : "name",
        dataIndex : "name"
      }, {
        header : "example",
        dataIndex : "values",
        renderer : readableExample
      } ]);

      var gridAttribute = new Ext.grid.GridPanel({
        ds : storeNodeAttributes,
        cm : colModelAttribute,
        loadMask : true,
        title : 'corpus description',
        viewConfig : {
          forceFit : true,
          autoFill : true
        },
        autoWidth : true,
        height : 380,
        flex : 1
      });

      storeNodeAttributes.setDefaultSort('name', 'asc');
      storeNodeAttributes.load({
        params : {
          corpusIdList : '',
          type : 'node'
        }
      });
    }

    storeMeta.load();

    // init config
    config.items = (!hideAttr) ? [ gridMeta, gridAttribute ] : [ gridMeta ];
    config.autoScroll = true;
    config.layout = {
      type : 'hbox'
    };
    config.shadow = false;

    MetaDataWindow.superclass.constructor.call(this, config);
  };

  Ext.extend(MetaDataWindow, Ext.Window);
});
{'fraction_non_alphanumeric': 0.1372270548553169, 'fraction_numerical': 0.005503284218001065, 'mean_word_length': 1.9466527196652719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4151765', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1682, 'n_words': 397}