<commit_before>/*
 * ESUI (Enterprise Simple UI)
 * Copyright 2010 Baidu Inc. All rights reserved.
 * 
 * path:    esui/util.js
 * desc:    控件实用方法
 * author:  erik
 */

///import esui.config;
///import baidu.event.on;
    
/**
 * UI组件功能库
 *
 * @static
 * @private
 */
esui.util = function () {
    var ctrlContainer = {};
    var componentMap  = {};
    var guid          = 0;

    return {
        /**
         * 初始化控件渲染
         * 
         * @public
         * @param {HTMLElement} opt_wrap 渲染的区域容器元素
         * @param {Object}      opt_propMap 控件附加属性值
         * @param {Function}    opt_attrReplacer 属性替换函数
         * @return {Object} 控件集合
         */
        init: function ( opt_wrap, opt_propMap, opt_attrReplacer ) {
            opt_propMap = opt_propMap || {};
            
            // 容器为空的判断
            opt_wrap = opt_wrap || document.body;
            
            var elements = opt_wrap.getElementsByTagName( '*' );
            var uiAttr = esui.config.UI_ATTRIBUTE || 'ui';
            var realEls = [];
            var attrs, attrStr, attrArr, attrArrLen;
            var attr, attrValue, attrItem, extraAttrMap;
            var i, len, key, el, uis = {};
            
            // 把dom元素存储到临时数组中
            // 控件渲染的过程会导致elements的改变
            for ( i = 0, len = elements.length; i < len; i++ ) {
                realEls.push( elements[ i ] );
            }
            
            // 循环解析自定义的ui属性并渲染控件
            // <div ui="type:UIType;id:uiId;..."></div>
            for ( i = 0, len = realEls.length; i < len; i++ ) {
                el = realEls[ i ];
                attrStr = el.getAttribute( uiAttr );
                
                if ( attrStr ) {
                    // 解析ui属性
                    attrs       = {};<commit_msg>fix bug: undefined variable has been global variable<commit_after>/*
 * ESUI (Enterprise Simple UI)
 * Copyright 2010 Baidu Inc. All rights reserved.
 * 
 * path:    esui/util.js
 * desc:    控件实用方法
 * author:  erik
 */

///import esui.config;
///import baidu.event.on;
    
/**
 * UI组件功能库
 *
 * @static
 * @private
 */
esui.util = function () {
    var ctrlContainer = {};
    var componentMap  = {};
    var guid          = 0;

    return {
        /**
         * 初始化控件渲染
         * 
         * @public
         * @param {HTMLElement} opt_wrap 渲染的区域容器元素
         * @param {Object}      opt_propMap 控件附加属性值
         * @param {Function}    opt_attrReplacer 属性替换函数
         * @return {Object} 控件集合
         */
        init: function ( opt_wrap, opt_propMap, opt_attrReplacer ) {
            opt_propMap = opt_propMap || {};
            
            // 容器为空的判断
            opt_wrap = opt_wrap || document.body;
            
            var elements = opt_wrap.getElementsByTagName( '*' );
            var uiAttr = esui.config.UI_ATTRIBUTE || 'ui';
            var realEls = [];
            var attrs, attrStr, attrArr, attrArrLen;
            var attr, attrValue, attrItem, attrSegment, extraAttrMap;
            var i, len, key, el, uis = {};
            
            // 把dom元素存储到临时数组中
            // 控件渲染的过程会导致elements的改变
            for ( i = 0, len = elements.length; i < len; i++ ) {
                realEls.push( elements[ i ] );
            }
            
            // 循环解析自定义的ui属性并渲染控件
            // <div ui="type:UIType;id:uiId;..."></div>
            for ( i = 0, len = realEls.length; i < len; i++ ) {
                el = realEls[ i ];
                attrStr = el.getAttribute( uiAttr );
                
                if ( attrStr ) {
                    // 解析ui属性
                    attrs       = {};
{'fraction_non_alphanumeric': 0.11886160714285714, 'fraction_numerical': 0.00390625, 'mean_word_length': 1.332465842550423, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '1306534', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1279, 'n_words': 252}