assets/js/modules/codeSource.js
function() {
                new Css('/source/assets/js/lib/prism/prism.css', 'core');
                var selection = onlyStatic ? $('.source_section pre[class*="src-"].source_visible > code') : $('.source_section pre[class*="src-"] > code');
                selection.each(function () {
                    var _this = $(this);
                    var parent = _this.parent();
                    var langClass='';
                    if (!parent.hasClass('src-json')) {
                        if (parent.hasClass('src-css')) {
                            langClass = SourceCodeToggleCSS;
                        } else if (parent.hasClass('src-js')) {
                            langClass = SourceCodeToggleJS;
                        } else {
                            langClass = SourceCodeToggleHTML;
                        }
                        if (parent.hasClass('source_visible')) {
                            parent.wrap('<div class="'+SourceCode+' '+SourceCodeStatic+'"><div class="' + SourceCodeCnt + '"></div></div>');
                        }
                        else if (!parent.hasClass('src-json')) {
                            parent.wrap('<div class="'+SourceCode+'"><div class="' + SourceCodeCnt + '"></div></div>');
                            _this.closest('.' + SourceCode).prepend('' +
                                '<a href="" class="' + SourceCodeToggle + ' ' + langClass + '"><span class="source_hide">' + RES_HIDE_CODE + '</span><span class="source_show">' + RES_SHOW_CODE + '</span> ' + RES_CODE + '</a>' +
                                '');
                        }
                        Prism.highlightElement(_this[0]);
                    }
                });
            }
function() {
                new Css('/source/assets/js/lib/prism/prism.css', 'core');
                var selection = onlyStatic ? $('.source_section pre[class*="src-"].source_visible > code') : $('.source_section pre[class*="src-"] > code');
                selection.each(function () {
                    var _this = $(this);
                    var parent = _this.parent();
                    var langClass='';
                    if (!parent.hasClass('src-json')) {
                        if (parent.hasClass('src-css')) {
                            langClass = SourceCodeToggleCSS;
                        } else if (parent.hasClass('src-js')) {
                            langClass = SourceCodeToggleJS;
                        } else {
                            langClass = SourceCodeToggleHTML;
                        }
                        if (parent.hasClass('source_visible')) {
                            parent.wrap('<div class="'+SourceCode+' '+SourceCodeStatic+'"><div class="' + SourceCodeCnt + '"></div></div>');
                        }
                        else if (!parent.hasClass('src-json')) {
                            parent.wrap('<div class="'+SourceCode+'"><div class="' + SourceCodeCnt + '"></div></div>');
                            _this.closest('.' + SourceCode).prepend('' +
                                '<a href="" class="' + SourceCodeToggle + ' ' + langClass + '"><span class="source_hide">' + RES_HIDE_CODE + '</span><span class="source_show">' + RES_SHOW_CODE + '</span> ' + RES_CODE + '</a>' +
                                '');
                        }
                        Prism.highlightElement(_this[0]);
                    }
                });
            }
function ( ) { new Css ( '/source/assets/js/lib/prism/prism.css' , 'core' ) ; var selection = onlyStatic ? $ ( '.source_section pre[class*="src-"].source_visible > code' ) : $ ( '.source_section pre[class*="src-"] > code' ) ; selection . each ( function ( ) { var _this = $ ( this ) ; var parent = _this . parent ( ) ; var langClass = '' ; if ( ! parent . hasClass ( 'src-json' ) ) { if ( parent . hasClass ( 'src-css' ) ) { langClass = SourceCodeToggleCSS ; } else if ( parent . hasClass ( 'src-js' ) ) { langClass = SourceCodeToggleJS ; } else { langClass = SourceCodeToggleHTML ; } if ( parent . hasClass ( 'source_visible' ) ) { parent . wrap ( '<div class="' + SourceCode + ' ' + SourceCodeStatic + '"><div class="' + SourceCodeCnt + '"></div></div>' ) ; } else if ( ! parent . hasClass ( 'src-json' ) ) { parent . wrap ( '<div class="' + SourceCode + '"><div class="' + SourceCodeCnt + '"></div></div>' ) ; _this . closest ( '.' + SourceCode ) . prepend ( '' + '<a href="" class="' + SourceCodeToggle + ' ' + langClass + '"><span class="source_hide">' + RES_HIDE_CODE + '</span><span class="source_show">' + RES_SHOW_CODE + '</span> ' + RES_CODE + '</a>' + '' ) ; } Prism . highlightElement ( _this [ 0 ] ) ; } } ) ; }
Code show toggle on each code block
Code show toggle on each code block