Last active
August 10, 2017 00:59
-
-
Save dkd903/e602a64f5595e615bea56ffaff48a5f6 to your computer and use it in GitHub Desktop.
Revisions
-
dkd903 revised this gist
Aug 10, 2017 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,16 @@ /** * Add this to your theme's style.css file, or put this css block in the header */ body .syntaxhighlighter table td.code .container textarea { white-space: pre-wrap !important; } body .syntaxhighlighter .line { white-space: pre-wrap !important; /* Uncomment the line below and adjust its value if after double click highlight, * the content moves, up or down. em units only */ /* line-height: 1.125em */ } /** * Add this script block to your theme's JavaScript. Ideally this block of code should be added -
dkd903 revised this gist
Aug 10, 2017 . 1 changed file with 7 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,29 +10,30 @@ body .syntaxhighlighter table td.code .container textarea, body .syntaxhighlight * to only that page where you anticipate the presence of a SyntaxHighlighter embed */ ( function($) { var sh3MaxRetries = 10, syntaxHighlighterTracker = 0; var syntaxHighlighterWrap = function(){ $( '.syntaxhighlighter' ).each( function() { var $syntaxPalette = $( this ), $codePalette = $syntaxPalette.find( 'td.code' ), $lineNos = $syntaxPalette.find( 'td.gutter' ); /* go through each line in the code palette */ $lineNos.children( '.line' ).each( function( i ) { var height = $codePalette.find( '.line:nth-child(' + ( i + 1 ) + ')' ).height() || 0; if ( !height ) { height = 'auto'; } else { height = height += 'px'; } /* update line number height with code palette line height */ $( this ).attr( 'style', 'height: ' + height + ' !important;' ); }); }); }; var waitForSyntaxHighlighterToLoad = function() { /* check max retries */ if ( ++syntaxHighlighterTracker > sh3MaxRetries ) { return; } if ( $( '.syntaxhighlighter' ).length === 0 ) { /* wait for syntax highlighter to initialize */ setTimeout( waitForSyntaxHighlighterToLoad, 800 ); } else { syntaxHighlighterWrap(); -
dkd903 revised this gist
Aug 10, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,8 @@ body .syntaxhighlighter table td.code .container textarea, body .syntaxhighlight } /** * Add this script block to your theme's JavaScript. Ideally this block of code should be added * to only that page where you anticipate the presence of a SyntaxHighlighter embed */ ( function($) { var syntaxHighlighterTracker = 0; -
dkd903 revised this gist
Aug 10, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ body .syntaxhighlighter table td.code .container textarea, body .syntaxhighlight } /** * Add this script block to your theme's JavaScript. Ideally this block of code should be added to only that page where you anticipate the presence of a SyntaxHighlighter embed */ ( function($) { var syntaxHighlighterTracker = 0; -
dkd903 renamed this gist
Aug 9, 2017 . 1 changed file with 11 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,16 @@ /** * Add this to your theme's style.css file, or put this css block in the header */ body .syntaxhighlighter table td.code .container textarea, body .syntaxhighlighter .line { white-space: pre-wrap !important; } /** * Add this script block to your theme's JavaScript file */ ( function($) { var syntaxHighlighterTracker = 0; var syntaxHighlighterWrap = function(){ $( '.syntaxhighlighter' ).each( function() { var $syntaxPalette = $( this ), $codePalette = $syntaxPalette.find( 'td.code' ), @@ -18,7 +27,7 @@ }; var waitForSyntaxHighlighterToLoad = function() { // set max retries if ( ++syntaxHighlighterTracker > 10 ) { return; } if ( $( '.syntaxhighlighter' ).length === 0 ) { -
dkd903 revised this gist
May 13, 2017 . 1 changed file with 30 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,32 @@ ( function($) { var syntaxHighlighterTracker = 0; var syntaxHighlighterWrap = function(){ $( 'body .syntaxhighlighter .line' ).attr( 'style', 'white-space: pre-wrap !important;' ); $( '.syntaxhighlighter' ).each( function() { var $syntaxPalette = $( this ), $codePalette = $syntaxPalette.find( 'td.code' ), $lineNos = $syntaxPalette.find( 'td.gutter' ); // go through each line in the code palette $lineNos.children( '.line' ).each( function( i ) { var height = $codePalette.find( '.line:nth-child(' + ( i + 1 ) + ')' ).height() || 0; if ( !height ) { height = 'auto'; } else { height = height += 'px'; } // update line number height with code palette line height $( this ).attr( 'style', 'height: ' + height + ' !important;' ); }); }); }; var waitForSyntaxHighlighterToLoad = function() { // set max retries if ( ++syntaxHighlighterTracker > 5 ) { return; } if ( $( '.syntaxhighlighter' ).length === 0 ) { // wait for syntax highlighter to initialize setTimeout( waitForSyntaxHighlighterToLoad, 800 ); } else { syntaxHighlighterWrap(); } }; waitForSyntaxHighlighterToLoad(); }( window.jQuery )); -
dkd903 created this gist
May 13, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ ( function($) { var syntaxHighlighterWrap = function(){ $( 'body .syntaxhighlighter .line' ).attr( 'style', 'white-space: pre-wrap !important;' ); $( '.syntaxhighlighter' ).each( function() { var $syntaxPalette = $( this ), $codePalette = $syntaxPalette.find( 'td.code' ), $lineNos = $syntaxPalette.find( 'td.gutter' ); // go through each line in the code palette $lineNos.children( '.line' ).each( function( i ) { var height = $codePalette.find( '.line:nth-child(' + ( i + 1 ) + ')' ).height() || 0; if ( !height ) { height = 'auto'; } else { height = height += 'px'; } // update line number height with code palette line height $( this ).attr( 'style', 'height: ' + height + ' !important;' ); }); }); }; var waitForSyntaxHighlighterToLoad = function() { if ( $( '.syntaxhighlighter' ).length === 0 ) { // wait for syntax highlighter to initialize setTimeout( waitForSyntaxHighlighterToLoad, 800 ); } else { syntaxHighlighterWrap(); } }; waitForSyntaxHighlighterToLoad(); }( window.jQuery ));