src/aria/utils/Html.js
function (attributes) {
            var result = [], whiteList = ariaTemplatesDomElementWrapper.attributesWhiteList;
            var jsonUtils = ariaUtilsJson;

            /*
             * This assumes that white list is performed by config validation, but this is only available in debug mode :
             * FIXME!
             */
            var stringUtil = ariaUtilsString;
            for (var key in attributes) {
                if (attributes.hasOwnProperty(key) && !jsonUtils.isMetadata(key)) {
                    var attribute = attributes[key];
                    if (key === "classList") {
                        result.push(" class=\"");
                        result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute.join(" ")));
                        result.push("\"");
                    } else if (key === "dataset") {
                        for (var dataKey in attribute) {
                            if (attribute.hasOwnProperty(dataKey) && !jsonUtils.isMetadata(dataKey)) {
                                if (this.datasetRegex.test(dataKey)) {
                                    result.push(" data-", stringUtil.camelToDashed(dataKey), "=\"");
                                    result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute[dataKey]));
                                    result.push("\"");
                                } else {
                                    this.$logError(this.INVALID_DATASET_KEY, dataKey);
                                }
                            }
                        }
                    } else if (key === "aria") {
                        for (var ariaKey in attribute) {
                            if (attribute.hasOwnProperty(ariaKey) && !jsonUtils.isMetadata(ariaKey)) {
                                result.push(" aria-", ariaKey, "=\"");
                                result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute[ariaKey]));
                                result.push("\"");
                            }
                        }
                    } else if (whiteList.test(key)) {
                        attribute = (attribute != null) ? attribute + "" : "";
                        result.push(" ", key, "=\"");
                        result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute));
                        result.push("\"");
                    } else {
                        this.$logError(this.INVALID_CONFIGURATION, key);
                    }
                }
            }
            return result.join('');
        }
function (attributes) {
            var result = [], whiteList = ariaTemplatesDomElementWrapper.attributesWhiteList;
            var jsonUtils = ariaUtilsJson;

            /*
             * This assumes that white list is performed by config validation, but this is only available in debug mode :
             * FIXME!
             */
            var stringUtil = ariaUtilsString;
            for (var key in attributes) {
                if (attributes.hasOwnProperty(key) && !jsonUtils.isMetadata(key)) {
                    var attribute = attributes[key];
                    if (key === "classList") {
                        result.push(" class=\"");
                        result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute.join(" ")));
                        result.push("\"");
                    } else if (key === "dataset") {
                        for (var dataKey in attribute) {
                            if (attribute.hasOwnProperty(dataKey) && !jsonUtils.isMetadata(dataKey)) {
                                if (this.datasetRegex.test(dataKey)) {
                                    result.push(" data-", stringUtil.camelToDashed(dataKey), "=\"");
                                    result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute[dataKey]));
                                    result.push("\"");
                                } else {
                                    this.$logError(this.INVALID_DATASET_KEY, dataKey);
                                }
                            }
                        }
                    } else if (key === "aria") {
                        for (var ariaKey in attribute) {
                            if (attribute.hasOwnProperty(ariaKey) && !jsonUtils.isMetadata(ariaKey)) {
                                result.push(" aria-", ariaKey, "=\"");
                                result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute[ariaKey]));
                                result.push("\"");
                            }
                        }
                    } else if (whiteList.test(key)) {
                        attribute = (attribute != null) ? attribute + "" : "";
                        result.push(" ", key, "=\"");
                        result.push(stringUtil.encodeForQuotedHTMLAttribute(attribute));
                        result.push("\"");
                    } else {
                        this.$logError(this.INVALID_CONFIGURATION, key);
                    }
                }
            }
            return result.join('');
        }
function ( attributes ) { var result = [ ] , whiteList = ariaTemplatesDomElementWrapper . attributesWhiteList ; var jsonUtils = ariaUtilsJson ; /*
             * This assumes that white list is performed by config validation, but this is only available in debug mode :
             * FIXME!
             */ var stringUtil = ariaUtilsString ; for ( var key in attributes ) { if ( attributes . hasOwnProperty ( key ) && ! jsonUtils . isMetadata ( key ) ) { var attribute = attributes [ key ] ; if ( key === "classList" ) { result . push ( " class=\"" ) ; result . push ( stringUtil . encodeForQuotedHTMLAttribute ( attribute . join ( " " ) ) ) ; result . push ( "\"" ) ; } else if ( key === "dataset" ) { for ( var dataKey in attribute ) { if ( attribute . hasOwnProperty ( dataKey ) && ! jsonUtils . isMetadata ( dataKey ) ) { if ( this . datasetRegex . test ( dataKey ) ) { result . push ( " data-" , stringUtil . camelToDashed ( dataKey ) , "=\"" ) ; result . push ( stringUtil . encodeForQuotedHTMLAttribute ( attribute [ dataKey ] ) ) ; result . push ( "\"" ) ; } else { this . $logError ( this . INVALID_DATASET_KEY , dataKey ) ; } } } } else if ( key === "aria" ) { for ( var ariaKey in attribute ) { if ( attribute . hasOwnProperty ( ariaKey ) && ! jsonUtils . isMetadata ( ariaKey ) ) { result . push ( " aria-" , ariaKey , "=\"" ) ; result . push ( stringUtil . encodeForQuotedHTMLAttribute ( attribute [ ariaKey ] ) ) ; result . push ( "\"" ) ; } } } else if ( whiteList . test ( key ) ) { attribute = ( attribute != null ) ? attribute + "" : "" ; result . push ( " " , key , "=\"" ) ; result . push ( stringUtil . encodeForQuotedHTMLAttribute ( attribute ) ) ; result . push ( "\"" ) ; } else { this . $logError ( this . INVALID_CONFIGURATION , key ) ; } } } return result . join ( '' ) ; }
Build the HTML markup regarding the attributes provided.
@param {aria.templates.CfgBeans:HtmlAttribute} attributes Attributes to be parsed
@return {String} String which can be used directly in a html tag
Build the HTML markup regarding the attributes provided .