Changeset 9610
- Timestamp:
- 03/20/2020 03:15:13 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-code-blocks-expand-contract
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-code-blocks-expand-contract/wporg-bbp-code-blocks-expand-contract.css
r9607 r9610 4 4 } 5 5 6 #bbpress-forums div.bbp-reply-content a.wporg-bbp-code-expand,7 #bbpress-forums div.bbp-topic-content a.wporg-bbp-code-expand {6 #bbpress-forums div.bbp-reply-content .wporg-bbp-code-tools a.wporg-bbp-code-expand, 7 #bbpress-forums div.bbp-topic-content .wporg-bbp-code-tools a.wporg-bbp-code-expand { 8 8 background: #f0f0f0; 9 9 display: inline-block; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-code-blocks-expand-contract/wporg-bbp-code-blocks-expand-contract.js
r9607 r9610 4 4 5 5 if ( typeof this.scrollHeight !== 'undefined' && $el.height() < this.scrollHeight ) { 6 var btn = $( '<div class="wporg-bbp-code-tools"><a class="wporg-bbp-code-expand" href="#">Expand</a></div>' ); 6 var btn = $( '<div class="wporg-bbp-code-tools"><a class="wporg-bbp-code-expand" href="#"></a></div>' ); 7 8 btn.find( 'a' ).text( bbpCodeBlocksExpandContract.expand ); 7 9 8 10 btn.insertAfter( $el.closest( 'pre' ) ) … … 30 32 code.css( 'max-height', maxHeightGoal ); 31 33 code.animate( { height: heightGoal }); 32 $( this ).text( 'Contract');34 $( this ).text( bbpCodeBlocksExpandContract.contract ); 33 35 } else { 34 36 $( [document.documentElement, document.body] ).animate({ … … 43 45 ); 44 46 45 $( this ).text( 'Expand');47 $( this ).text( bbpCodeBlocksExpandContract.expand ); 46 48 } 47 49 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-code-blocks-expand-contract/wporg-bbp-code-blocks-expand-contract.php
r9608 r9610 1 1 <?php 2 namespace WordPressdotorg\BBP_Code_Blocks_Expand_Contract; 2 3 /** 3 * Plugin Name: bbPress: Code blocks formatter4 * Description: Convert wiki markup links into HTML WordPress Codex links.4 * Plugin Name: bbPress: Code blocks Expand/Contract 5 * Description: Adds an Expander to code blocks which are higher than the default code block size. 5 6 * Version: 1.0 6 7 * Author: WordPress.org … … 24 25 */ 25 26 26 if ( ! defined( 'ABSPATH' ) ) exit; 27 28 if ( ! class_exists( 'WPORG_bbPress_Code_Blocks' ) ) { 29 class WPORG_bbPress_Code_Blocks { 30 public function __construct() { 31 wp_enqueue_script( 'wporg-bbp-code-blocks-expand-contract', plugins_url( 'wporg-bbp-code-blocks-expand-contract.js', __FILE__ ), [ 'jquery' ], 1, true ); 32 wp_enqueue_style( 'wporg-bbp-code-blocks-expand-contract', plugins_url( 'wporg-bbp-code-blocks-expand-contract.css', __FILE__ ), [], 1 ); 33 } 34 } } 35 36 new WPORG_bbPress_Code_Blocks; 27 function wp_head() { 28 wp_enqueue_script( 'wporg-bbp-code-blocks-expand-contract', plugins_url( 'wporg-bbp-code-blocks-expand-contract.js', __FILE__ ), [ 'jquery' ], 1, true ); 29 wp_localize_script( 'wporg-bbp-code-blocks-expand-contract', 'bbpCodeBlocksExpandContract', [ 30 'expand' => __( 'Expand', 'wporg' ), 31 'contract' => __( 'Contract', 'wporg' ), 32 ] ); 33 wp_enqueue_style( 'wporg-bbp-code-blocks-expand-contract', plugins_url( 'wporg-bbp-code-blocks-expand-contract.css', __FILE__ ), [], 1 ); 34 } 35 add_action( 'wp_head', __NAMESPACE__ . '\wp_head' );
Note: See TracChangeset
for help on using the changeset viewer.