Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/26/2017 12:29:31 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Admin: Use some JavaScript to spruce up the badge-animation.

@todo Update the "What's New" page contents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/classes/class-bbp-admin.php

    r6602 r6604  
    533533        $version = bbp_get_version();
    534534
    535         // Register the JS
     535        // Footer JS
     536        wp_register_script( 'bbp-admin-badge-js',   $this->js_url . 'badge' . $suffix . '.js', array(), $version, true );
     537
     538        // Header JS
    536539        wp_register_script( 'bbp-admin-common-js',  $this->js_url . 'common'    . $suffix . '.js', array( 'jquery', 'suggest'              ), $version );
    537540        wp_register_script( 'bbp-admin-topics-js',  $this->js_url . 'topics'    . $suffix . '.js', array( 'jquery'                         ), $version );
     
    541544        // Post type checker (only topics and replies)
    542545        if ( 'post' === get_current_screen()->base ) {
    543 
    544546            switch ( get_current_screen()->post_type ) {
    545547                case bbp_get_reply_post_type() :
     
    560562                    break;
    561563            }
     564
     565        // Enqueue the badge JS
     566        } elseif ( in_array( get_current_screen()->id, array( 'dashboard_page_bbp-about', 'dashboard_page_bbp-credits' ), true ) ) {
     567            wp_enqueue_script( 'bbp-admin-badge-js' );
    562568        }
    563569    }
     
    728734
    729735    /**
     736     * Output the shared screen header for about_screen() & credits_screen()
     737     *
     738     * Contains title, subtitle, and badge area
     739     *
     740     * @since 2.6.0 bbPress (r6604)
     741     */
     742    private function screen_header() {
     743        list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     744
     745        <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
     746        <div class="about-text"><?php printf( esc_html__( 'bbPress is fun to use, contains no artificial colors or preservatives, and is absolutely wonderful in every environment. Your community is going to love using it.', 'bbpress' ), $display_version ); ?></div>
     747
     748        <span class="bbp-hive" id="bbp-hive"></span>
     749        <div class="bbp-badge" id="bbp-badge">
     750            <span class="bbp-bee" id="bbp-bee"></span>
     751        </div>
     752
     753        <?php
     754    }
     755
     756    /**
    730757     * Output the about screen
    731758     *
    732759     * @since 2.2.0 bbPress (r4159)
     760     *
     761     * @todo Host this remotely.
    733762     */
    734763    public function about_screen() {
    735 
    736         list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     764        ?>
    737765
    738766        <div class="wrap about-wrap">
    739             <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
    740             <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is sweet and savory, contains no artificial flavors or preservatives, is environmentally friendly, and is a great compliment to your site.', 'bbpress' ), $display_version ); ?></div>
    741             <div class="bbp-badge"></div>
     767
     768            <?php $this->screen_header(); ?>
    742769
    743770            <h2 class="nav-tab-wrapper">
     
    804831     * Output the credits screen
    805832     *
    806      * Hardcoding this in here is pretty janky. It's fine for now, but we'll
    807      * want to leverage api.wordpress.org eventually.
    808      *
    809833     * @since 2.2.0 bbPress (r4159)
     834     *
     835     * @todo Host this remotely.
    810836     */
    811837    public function credits_screen() {
    812 
    813         list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     838        ?>
    814839
    815840        <div class="wrap about-wrap">
    816             <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
    817             <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is sweet and savory, contains no artificial flavors or preservatives, is environmentally friendly, and is a great compliment to your site.', 'bbpress' ), $display_version ); ?></div>
    818             <div class="bbp-badge"></div>
     841
     842            <?php $this->screen_header(); ?>
    819843
    820844            <h2 class="nav-tab-wrapper">
Note: See TracChangeset for help on using the changeset viewer.