function trx_addons_build_page_toc() {
    "use strict";

    var toc = '', toc_count = 0;

    jQuery('[id^="toc_menu_"],.sc_anchor').each(function(idx) {
        "use strict";
        var obj = jQuery(this);
        var obj_id = obj.attr('id') || ('sc_anchor_'+Math.random()).replace('.', '');
        var row = obj.parents('.wpb_row');
        if (row.length == 0) row = obj.parent();
        var row_id = row.length>0 && row.attr('id')!=undefined && row.attr('id')!='' ? row.attr('id') : '';
        var id = row_id || obj_id.substr(10);
        if (row.length>0 && row_id == '') {
            row.attr('id', id);
        }
        var url = obj.data('url');
        var icon = obj.data('icon') || 'toc_menu_icon_default';
        var title = obj.attr('title');
        var description = obj.data('description');
        var separator = obj.data('separator');
        toc_count++;
        toc += '<div class="toc_menu_item'+(separator=='yes' ? ' toc_menu_separator' : '')+'" data-id="'+id+'">'
            + (title || description 
               ? '<a href="' + (url ? url : '#'+id) + '" class="toc_menu_description">'
               + (title ? '<span class="toc_menu_description_title">' + title + '</span>' : '')
               + (description ? '<span class="toc_menu_description_text">' + description + '</span>' : '')
               + '</a>' 
               : '')
            + '<a href="' + (url ? url : '#'+id) + '" class="toc_menu_icon '+icon+'"></a>'
            + '</div>';
    });

    if (toc_count > 0)
        jQuery('body').append('<div id="toc_menu" class="toc_menu"><div class="toc_menu_inner">'+toc+'</div></div>');
}
// Build page TOC from the tag's id
Build page TOC from the tag's id
Build page TOC from the tag ' s id
function trx_addons_build_page_toc() {
    "use strict";
    var toc = '', toc_count = 0;
    jQuery('[id^="toc_menu_"],.sc_anchor').each(function(idx) {
        "use strict";
        var obj = jQuery(this);
        var obj_id = obj.attr('id') || ('sc_anchor_'+Math.random()).replace('.', '');
        var row = obj.parents('.wpb_row');
        if (row.length == 0) row = obj.parent();
        var row_id = row.length>0 && row.attr('id')!=undefined && row.attr('id')!='' ? row.attr('id') : '';
        var id = row_id || obj_id.substr(10);
        if (row.length>0 && row_id == '') {
            row.attr('id', id);
        }
        var url = obj.data('url');
        var icon = obj.data('icon') || 'toc_menu_icon_default';
        var title = obj.attr('title');
        var description = obj.data('description');
        var separator = obj.data('separator');
        toc_count++;
        toc += '<div class="toc_menu_item'+(separator=='yes' ? ' toc_menu_separator' : '')+'" data-id="'+id+'">'
            + (title || description 
               ? '<a href="' + (url ? url : '#'+id) + '" class="toc_menu_description">'
               + (title ? '<span class="toc_menu_description_title">' + title + '</span>' : '')
               + (description ? '<span class="toc_menu_description_text">' + description + '</span>' : '')
               + '</a>' 
               : '')
            + '<a href="' + (url ? url : '#'+id) + '" class="toc_menu_icon '+icon+'"></a>'
            + '</div>';
    });
    if (toc_count > 0)
        jQuery('body').append('<div id="toc_menu" class="toc_menu"><div class="toc_menu_inner">'+toc+'</div></div>');
}
function trx_addons_build_page_toc ( ) { "use strict" ; var toc = '' , toc_count = 0 ; jQuery ( '[id^="toc_menu_"],.sc_anchor' ) . each ( function ( idx ) { "use strict" ; var obj = jQuery ( this ) ; var obj_id = obj . attr ( 'id' ) || ( 'sc_anchor_' + Math . random ( ) ) . replace ( '.' , '' ) ; var row = obj . parents ( '.wpb_row' ) ; if ( row . length == 0 ) row = obj . parent ( ) ; var row_id = row . length > 0 && row . attr ( 'id' ) != undefined && row . attr ( 'id' ) != '' ? row . attr ( 'id' ) : '' ; var id = row_id || obj_id . substr ( 10 ) ; if ( row . length > 0 && row_id == '' ) { row . attr ( 'id' , id ) ; } var url = obj . data ( 'url' ) ; var icon = obj . data ( 'icon' ) || 'toc_menu_icon_default' ; var title = obj . attr ( 'title' ) ; var description = obj . data ( 'description' ) ; var separator = obj . data ( 'separator' ) ; toc_count ++ ; toc += '<div class="toc_menu_item' + ( separator == 'yes' ? ' toc_menu_separator' : '' ) + '" data-id="' + id + '">' + ( title || description ? '<a href="' + ( url ? url : '#' + id ) + '" class="toc_menu_description">' + ( title ? '<span class="toc_menu_description_title">' + title + '</span>' : '' ) + ( description ? '<span class="toc_menu_description_text">' + description + '</span>' : '' ) + '</a>' : '' ) + '<a href="' + ( url ? url : '#' + id ) + '" class="toc_menu_icon ' + icon + '"></a>' + '</div>' ; } ) ; if ( toc_count > 0 ) jQuery ( 'body' ) . append ( '<div id="toc_menu" class="toc_menu"><div class="toc_menu_inner">' + toc + '</div></div>' ) ; }
Build page TOC from the tag's id
Build page TOC from the tag ' s id