Changeset 687
- Timestamp:
- 06/06/2014 09:51:08 PM (11 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php
r686 r687 31 31 <p> 32 32 <strong><?php _e( 'Source file:', 'wporg' ); ?></strong> 33 <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a><br /> 34 <strong><?php _e( 'View source code:', 'wporg' ); ?></strong> 35 <?php if ( post_type_has_source_code() ) { ?> 36 <a href="#source-code"><?php _e( 'below', 'wporg' ); ?></a> or 37 <?php } ?> 38 <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'on the WP Trac code browser…', 'wporg' ); ?></a> 33 <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a> 39 34 </p> 35 <?php if ( post_type_has_source_code() ) { ?> 36 <p> 37 <a href="#source-code"><?php _e( 'View source', 'wporg' ); ?></a> 38 </p> 39 <?php } else { ?> 40 <p> 41 <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a> 42 </p> 43 <?php } ?> 40 44 </section> 41 45 <?php endif; ?> … … 131 135 <pre class="brush: php; toolbar: false;"><?php echo esc_html( get_source_code() ); ?></pre> 132 136 </div> 133 <p><a href="#" class="show-complete-source"><?php _e( 'View full source code…', 'wporg' ); ?></a></p> 137 <p class="source-code-links"> 138 <span> 139 <a href="#" class="show-complete-source"><?php _e( 'Expand full source code', 'wporg' ); ?></a> 140 <a href="#" class="less-complete-source"><?php _e( 'Collapse full source code', 'wporg' ); ?></a> 141 </span> 142 <span><a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a></span> 143 </p> 134 144 </section> 135 145 <?php endif; ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php
r686 r687 29 29 <p> 30 30 <strong><?php _e( 'Source file:', 'wporg' ); ?></strong> 31 <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a><br /> 32 <strong><?php _e( 'View source code:', 'wporg' ); ?></strong> 33 <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'on the WP Trac code browser…', 'wporg' ); ?></a> 31 <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a> 32 </p> 33 <p> 34 <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a> 34 35 </p> 35 36 </section> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js
r677 r687 5 5 */ 6 6 ( function( $ ) { 7 var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource ;7 var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, $sourceCollapsedHeight; 8 8 9 function showCompleteSource( e ) {9 function toggleCompleteSource( e ) { 10 10 e.preventDefault(); 11 11 12 var heightGoal = $sourceCodeTable.height() + 47; // takes into consideration potential x-scrollbar 12 if ( $showCompleteSource.is(':visible') ) { 13 var heightGoal = $sourceCodeTable.height() + 37; // takes into consideration potential x-scrollbar 14 } else { 15 var heightGoal = $sourceCollapsedHeight; 16 } 13 17 14 18 $sourceCodeContainer.animate( { height: heightGoal + 'px' } ); 15 19 16 $showCompleteSource.hide(); 20 $showCompleteSource.toggle(); 21 $lessCompleteSource.toggle(); 17 22 18 23 } … … 28 33 $sourceCodeTable = $sourceContent.find( 'table' ); 29 34 30 if ( 188 < $sourceCodeTable.height() ) { 35 // 1em (margin) + 20 * 17px. Lines are 1.1em which rounds to 17px: calc( 1em + 17px * 20 ). 36 // Extra 10px added to partially show next line so it's clear there is more. 37 $sourceCollapsedHeight = 196; 38 39 if ( ( $sourceCollapsedHeight - 12 ) < $sourceCodeTable.height() ) { 31 40 32 41 // Do this with javascript so javascript-less can enjoy the total sourcecode 33 // 1em (margin) + 20 * 17px. Lines are 1.1em which rounds to 17px: calc( 1em + 17px * 20 ). 34 // Extra 10px added to partially show next line so it's clear there is more. 35 $( '.source-code-container' ).css( { height: '196px' } ); 42 $( '.source-code-container' ).css( { height: $sourceCollapsedHeight + 'px' } ); 36 43 37 44 $showCompleteSource = $( '.show-complete-source' ); 45 $lessCompleteSource = $( '.less-complete-source' ); 38 46 47 $( '.source-code-links span:first' ).show(); 39 48 $showCompleteSource.show(); 40 $showCompleteSource.on( 'click', showCompleteSource ); 49 $showCompleteSource.on( 'click', toggleCompleteSource ); 50 $lessCompleteSource.on( 'click', toggleCompleteSource ); 41 51 } 42 52 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r677 r687 856 856 } 857 857 858 .single { 859 .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method { 860 border-bottom-style: none; 861 } 862 } 863 864 .source-content { 865 overflow: auto; 866 } 867 868 .source-code-links { 869 margin-left: 2em; 870 margin-top: 1em; 871 } 872 873 .source-code-links span:first-child { 874 display: none; 875 border-right: 1px solid #999; 876 margin-right: 1em; 877 padding-right: 1em; 878 } 879 858 880 .source-code-container { 859 881 border-right: 1px solid #dfdfdf; … … 862 884 } 863 885 864 .show-complete-source {886 .show-complete-source, .less-complete-source { 865 887 display: none; 866 888 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
r677 r687 1068 1068 padding: 20px; 1069 1069 } 1070 .devhub-wrap .single .wp-parser-class, .devhub-wrap .single .wp-parser-function, .devhub-wrap .single .wp-parser-hook, .devhub-wrap .single .wp-parser-method { 1071 border-bottom-style: none; 1072 } 1073 .devhub-wrap .source-content { 1074 overflow: auto; 1075 } 1076 .devhub-wrap .source-code-links { 1077 margin-left: 2em; 1078 margin-top: 1em; 1079 } 1080 .devhub-wrap .source-code-links span:first-child { 1081 display: none; 1082 border-right: 1px solid #999; 1083 margin-right: 1em; 1084 padding-right: 1em; 1085 } 1070 1086 .devhub-wrap .source-code-container { 1071 1087 border-right: 1px solid #dfdfdf; … … 1073 1089 overflow-y: hidden; 1074 1090 } 1075 .devhub-wrap .show-complete-source {1091 .devhub-wrap .show-complete-source, .devhub-wrap .less-complete-source { 1076 1092 display: none; 1077 1093 }
Note: See TracChangeset
for help on using the changeset viewer.