Skip to:
Content

BuddyPress.org

Changeset 9754


Ignore:
Timestamp:
04/16/2015 09:58:26 PM (11 years ago)
Author:
imath
Message:

Avatar UI: Add specific stylesheet and javascript files and register WordPress styles and scripts

  • Edit bp_core_register_common_scripts() in order to be able to enqueue scripts into the footer.
  • bp-plupload.js (handle: bp-plupload) is depending on plupload and wp-backbone and is the BuddyPress adaptation of wp-plupload.js. When a file is uploaded it builds some BackBone collections and views to manage the user feedbacks, the back and front end Upload UI.
  • avatar.js (handle: bp-avatar) is depending on jcrop and is responsible of building the extensible Avatar UI navigation tabs and the Crop view.
  • webcam.js (handle: bp-webcam) is depending on bp-avatar and is responsible of building the Camera view after checking the bowser supports getUserMedia to capture the video stream.
  • avatar.css (handle: bp-avatar) is depending on jcrop and is building the styles for the complete Avatar UI.

Props hnla.

See #6290

Location:
trunk/src/bp-core
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-cssjs.php

    r9665 r9754  
    2929
    3030                // Legacy
    31                 'bp-confirm'        => array( 'file' => "{$url}confirm{$min}.js",        'dependencies' => array( 'jquery' ) ),
    32                 'bp-widget-members' => array( 'file' => "{$url}widget-members{$min}.js", 'dependencies' => array( 'jquery' ) ),
    33                 'bp-jquery-query'   => array( 'file' => "{$url}jquery-query{$min}.js",   'dependencies' => array( 'jquery' ) ),
    34                 'bp-jquery-cookie'  => array( 'file' => "{$url}jquery-cookie{$min}.js",  'dependencies' => array( 'jquery' ) ),
    35                 'bp-jquery-scroll-to' => array( 'file' => "{$url}jquery-scroll-to{$min}.js", 'dependencies' => array( 'jquery' ) ),
     31                'bp-confirm'        => array( 'file' => "{$url}confirm{$min}.js",        'dependencies' => array( 'jquery' ), 'footer' => false ),
     32                'bp-widget-members' => array( 'file' => "{$url}widget-members{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => false ),
     33                'bp-jquery-query'   => array( 'file' => "{$url}jquery-query{$min}.js",   'dependencies' => array( 'jquery' ), 'footer' => false ),
     34                'bp-jquery-cookie'  => array( 'file' => "{$url}jquery-cookie{$min}.js",  'dependencies' => array( 'jquery' ), 'footer' => false ),
     35                'bp-jquery-scroll-to' => array( 'file' => "{$url}jquery-scroll-to{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => false ),
    3636
    3737                // 2.1
    38                 'jquery-caret' => array( 'file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array( 'jquery' ) ),
    39                 'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array( 'jquery', 'jquery-caret' ) ),
     38                'jquery-caret' => array( 'file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => false ),
     39                'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array( 'jquery', 'jquery-caret' ), 'footer' => false ),
     40
     41                // 2.3
     42                'bp-plupload' => array( 'file' => "{$url}bp-plupload{$min}.js", 'dependencies' => array( 'plupload', 'jquery', 'json2', 'wp-backbone' ), 'footer' => true ),
     43                'bp-avatar'   => array( 'file' => "{$url}avatar{$min}.js", 'dependencies' => array( 'jcrop' ), 'footer' => true ),
     44                'bp-webcam'   => array( 'file' => "{$url}webcam{$min}.js", 'dependencies' => array( 'bp-avatar' ), 'footer' => true ),
     45
    4046        ) );
    4147
    4248        $version = bp_get_version();
    4349        foreach ( $scripts as $id => $script ) {
    44                 wp_register_script( $id, $script['file'], $script['dependencies'], $version );
     50                wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] );
    4551        }
    4652}
     
    7783                        'file'         => $admin_bar_file,
    7884                        'dependencies' => array( 'admin-bar' )
    79                 )
     85                ),
     86                'bp-avatar' => array(
     87                        'file'         => "{$url}avatar{$min}.css",
     88                        'dependencies' => array( 'jcrop' )
     89                ),
    8090        ) );
    8191
Note: See TracChangeset for help on using the changeset viewer.