Changeset 10155
- Timestamp:
- 09/29/2015 10:42:56 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-cssjs.php
r10108 r10155 43 43 'bp-avatar' => array( 'file' => "{$url}avatar{$min}.js", 'dependencies' => array( 'jcrop' ), 'footer' => true ), 44 44 'bp-webcam' => array( 'file' => "{$url}webcam{$min}.js", 'dependencies' => array( 'bp-avatar' ), 'footer' => true ), 45 46 // 2.4 47 'bp-cover-image' => array( 'file' => "{$url}cover-image{$min}.js", 'dependencies' => array(), 'footer' => true ), 45 48 46 49 ) ); … … 141 144 142 145 /** 146 * Enqueues the css and js required by the Cover Image UI. 147 * 148 * @since 2.4.0 149 */ 150 function bp_core_cover_image_scripts() { 151 if ( ! bp_attachments_cover_image_is_edit() ) { 152 return false; 153 } 154 155 // Enqueue the Attachments scripts for the Cover Image UI 156 bp_attachments_enqueue_scripts( 'BP_Attachment_Cover_Image' ); 157 } 158 add_action( 'bp_enqueue_scripts', 'bp_core_cover_image_scripts' ); 159 160 /** 143 161 * Enqueues jCrop library and hooks BP's custom cropper JS. 144 162 */ … … 338 356 ) ); 339 357 } 358 359 /** 360 * Add inline css to display the component's single item cover image 361 * 362 * @since 2.4.0 363 * 364 * @param bool $return true to get the inline css 365 * @return string|array the inline css or an associative array containing 366 * the css rules and the style handle 367 */ 368 function bp_add_cover_image_inline_css( $return = false ) { 369 $bp = buddypress(); 370 371 // Find the component of the current item 372 if ( bp_is_user() ) { 373 374 // User is not allowed to upload cover images 375 // no need to carry on 376 if ( bp_disable_cover_image_uploads() ) { 377 return; 378 } 379 380 $cover_image_object = array( 381 'component' => 'xprofile', 382 'object' => $bp->displayed_user 383 ); 384 } elseif ( bp_is_group() ) { 385 386 // Users are not allowed to upload cover images for their groups 387 // no need to carry on 388 if ( bp_disable_group_cover_image_uploads() ) { 389 return; 390 } 391 392 $cover_image_object = array( 393 'component' =>'groups', 394 'object' => $bp->groups->current_group 395 ); 396 } else { 397 $cover_image_object = apply_filters( 'bp_current_cover_image_object_inline_css', array() ); 398 } 399 400 // Bail if no component were found. 401 if ( empty( $cover_image_object['component'] ) || empty( $cover_image_object['object'] ) || ! bp_is_active( $cover_image_object['component'], 'cover_image' ) ) { 402 return; 403 } 404 405 // Get the settings of the cover image feature for the current component 406 $params = bp_attachments_get_cover_image_settings( $cover_image_object['component'] ); 407 408 // Bail if no params. 409 if ( empty( $params ) ) { 410 return; 411 } 412 413 // Try to call the callback 414 if ( is_callable( $params['callback'] ) ) { 415 416 $object_dir = $cover_image_object['component']; 417 418 if ( 'xprofile' === $object_dir ) { 419 $object_dir = 'members'; 420 } 421 422 $cover_image = bp_attachments_get_attachment( 'url', array( 423 'object_dir' => $object_dir, 424 'item_id' => $cover_image_object['object']->id, 425 ) ); 426 427 if ( empty( $cover_image ) ) { 428 if ( ! empty( $params['default_cover'] ) ) { 429 $cover_image = $params['default_cover']; 430 } 431 } 432 433 $inline_css = call_user_func_array( $params['callback'], array( array( 434 'cover_image' => esc_url( $cover_image ), 435 'component' => sanitize_key( $cover_image_object['component'] ), 436 'object_id' => (int) $cover_image_object['object']->id, 437 'width' => (int) $params['width'], 438 'height' => (int) $params['height'], 439 ) ) ); 440 441 // Finally add the inline css to the handle 442 if ( ! empty( $inline_css ) ) { 443 444 // Used to get the css when Ajax setting the cover image 445 if ( true === $return ) { 446 return array( 447 'css_rules' => '<style type="text/css">' . "\n" . $inline_css . "\n" . '</style>', 448 'handle' => $params['theme_handle'], 449 ); 450 } 451 452 wp_add_inline_style( $params['theme_handle'], $inline_css ); 453 } else { 454 return false; 455 } 456 } 457 } 458 add_action( 'bp_enqueue_scripts', 'bp_add_cover_image_inline_css', 11 ); -
trunk/src/bp-core/css/avatar-rtl.css
r10050 r10155 1 div.bp-avatar-status { 1 div.bp-avatar-status, 2 div.bp-cover-image-status { 2 3 clear: both; 3 4 margin: 1em 0; 4 5 } 5 6 6 div.bp-avatar-status p.updated { 7 div.bp-avatar-status p.updated, 8 div.bp-cover-image-status p.updated { 7 9 display: block; 8 10 padding: 10px 15px; 9 11 } 10 12 11 div.bp-avatar-status p.success { 13 div.bp-avatar-status p.success, 14 div.bp-cover-image-status p.success { 12 15 background-color: #efc; 13 16 border: 1px solid #591; … … 15 18 } 16 19 17 div.bp-avatar-status p.error { 20 div.bp-avatar-status p.error, 21 div.bp-cover-image-status p.error { 18 22 background-color: #fdc; 19 23 border: 1px solid #a00; … … 21 25 } 22 26 23 div.bp-avatar-status .bp-progress { 27 div.bp-avatar-status .bp-progress, 28 div.bp-cover-image-status .bp-progress { 24 29 background: none; 25 30 border: 1px solid #d1d1d1; … … 34 39 } 35 40 36 div.bp-avatar-status .bp-bar { 41 div.bp-avatar-status .bp-bar, 42 div.bp-cover-image-status .bp-bar { 37 43 background-color: #c3ff88; 38 44 width: 0; -
trunk/src/bp-core/css/avatar.css
r10050 r10155 1 div.bp-avatar-status { 1 div.bp-avatar-status, 2 div.bp-cover-image-status { 2 3 clear: both; 3 4 margin: 1em 0; 4 5 } 5 6 6 div.bp-avatar-status p.updated { 7 div.bp-avatar-status p.updated, 8 div.bp-cover-image-status p.updated { 7 9 display: block; 8 10 padding: 10px 15px; 9 11 } 10 12 11 div.bp-avatar-status p.success { 13 div.bp-avatar-status p.success, 14 div.bp-cover-image-status p.success { 12 15 background-color: #efc; 13 16 border: 1px solid #591; … … 15 18 } 16 19 17 div.bp-avatar-status p.error { 20 div.bp-avatar-status p.error, 21 div.bp-cover-image-status p.error { 18 22 background-color: #fdc; 19 23 border: 1px solid #a00; … … 21 25 } 22 26 23 div.bp-avatar-status .bp-progress { 27 div.bp-avatar-status .bp-progress, 28 div.bp-cover-image-status .bp-progress { 24 29 background: none; 25 30 border: 1px solid #d1d1d1; … … 34 39 } 35 40 36 div.bp-avatar-status .bp-bar { 41 div.bp-avatar-status .bp-bar, 42 div.bp-cover-image-status .bp-bar { 37 43 background-color: #c3ff88; 38 44 width: 0; -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r10150 r10155 1718 1718 die(); 1719 1719 } 1720 1721 /** 1722 * BP Legacy's callback for the cover image feature 1723 * 1724 * @since 2.4.0 1725 * 1726 * @param array $params the current component's feature parameters 1727 * @return array an array to inform about the css handle to attach the css rules to 1728 */ 1729 function bp_legacy_theme_cover_image( $params = array() ) { 1730 if ( empty( $params ) ) { 1731 return; 1732 } 1733 1734 // avatar height - padding - 1/2 avatar height 1735 $avatar_offset = $params['height'] - 5 - round( (int) bp_core_avatar_full_height() / 2 ); 1736 1737 // header content offset + spacing 1738 $top_offset = bp_core_avatar_full_height() - 10; 1739 $left_offset = bp_core_avatar_full_width() + 20; 1740 1741 $cover_image = isset( $params['cover_image'] ) ? 'background-image: url(' . $params['cover_image'] . ');' : ''; 1742 1743 $hide_avatar_style = ''; 1744 1745 // Adjust the cover image header, in case avatars are completely disabled 1746 if ( ! buddypress()->avatar->show_avatars ) { 1747 $hide_avatar_style = ' 1748 #buddypress #item-header-cover-image #item-header-avatar { 1749 display: none; 1750 } 1751 '; 1752 1753 if ( bp_is_user() ) { 1754 $hide_avatar_style = ' 1755 #buddypress #item-header-cover-image #item-header-avatar a { 1756 display: block; 1757 height: ' . $top_offset . 'px; 1758 margin: 0 15px 19px 0; 1759 } 1760 1761 #buddypress div#item-header #item-header-cover-image #item-header-content { 1762 margin-left:auto; 1763 } 1764 '; 1765 } 1766 } 1767 1768 return ' 1769 /* Cover image */ 1770 #buddypress #header-cover-image { 1771 height: ' . $params["height"] . 'px; 1772 ' . $cover_image . ' 1773 } 1774 1775 #buddypress #create-group-form #header-cover-image { 1776 position: relative; 1777 margin: 1em 0; 1778 } 1779 1780 .bp-user #buddypress #item-header { 1781 padding-top: 0; 1782 } 1783 1784 #buddypress #item-header-cover-image #item-header-avatar { 1785 margin-top: '. $avatar_offset .'px; 1786 float: left; 1787 overflow: visible; 1788 width:auto; 1789 } 1790 1791 #buddypress div#item-header #item-header-cover-image #item-header-content { 1792 clear: both; 1793 float: left; 1794 margin-left: ' . $left_offset . 'px; 1795 margin-top: -' . $top_offset . 'px; 1796 width:auto; 1797 } 1798 1799 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, 1800 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { 1801 margin-top: ' . $params["height"] . 'px; 1802 margin-left: 0; 1803 clear: none; 1804 max-width: 50%; 1805 } 1806 1807 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { 1808 padding-top: 20px; 1809 max-width: 20%; 1810 } 1811 1812 ' . $hide_avatar_style . ' 1813 1814 #buddypress div#item-header-cover-image h2 a, 1815 #buddypress div#item-header-cover-image h2 { 1816 color: #FFF; 1817 text-rendering: optimizelegibility; 1818 text-shadow: 0px 0px 3px rgba( 0, 0, 0, 0.8 ); 1819 margin: 0; 1820 font-size:200%; 1821 } 1822 1823 #buddypress #item-header-cover-image #item-header-avatar img.avatar { 1824 border: solid 2px #FFF; 1825 background: rgba( 255, 255, 255, 0.8 ); 1826 } 1827 1828 #buddypress #item-header-cover-image #item-header-avatar a { 1829 border: none; 1830 text-decoration: none; 1831 } 1832 1833 #buddypress #item-header-cover-image #item-buttons { 1834 overflow:hidden; 1835 margin: 20px 0 10px; 1836 padding: 0 0 5px; 1837 } 1838 1839 #buddypress #item-header-cover-image #item-buttons:before { 1840 content:"\00a0"; 1841 } 1842 1843 @media screen and (max-width: 782px) { 1844 #buddypress #item-header-cover-image #item-header-avatar, 1845 .bp-user #buddypress #item-header #item-header-cover-image #item-header-avatar, 1846 #buddypress div#item-header #item-header-cover-image #item-header-content { 1847 width:100%; 1848 text-align:center; 1849 } 1850 1851 #buddypress #item-header-cover-image #item-header-avatar a { 1852 display:inline-block; 1853 } 1854 1855 #buddypress #item-header-cover-image #item-header-avatar img { 1856 margin:0; 1857 } 1858 1859 #buddypress div#item-header #item-header-cover-image #item-header-content, 1860 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, 1861 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { 1862 margin:0; 1863 } 1864 1865 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, 1866 body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { 1867 max-width: 100%; 1868 } 1869 1870 #buddypress div#item-header-cover-image h2 a, 1871 #buddypress div#item-header-cover-image h2 { 1872 color: inherit; 1873 text-shadow: none; 1874 margin:25px 0 0; 1875 font-size:200%; 1876 } 1877 1878 #buddypress #item-header-cover-image #item-buttons div { 1879 float:none; 1880 display:inline-block; 1881 } 1882 1883 #buddypress #item-header-cover-image #item-buttons:before { 1884 content:""; 1885 } 1886 1887 #buddypress #item-header-cover-image #item-buttons { 1888 margin: 5px 0; 1889 } 1890 } 1891 '; 1892 } -
trunk/src/bp-templates/bp-legacy/css/buddypress-rtl.css
r10086 r10155 20 20 3.7 - Topics and Tables - Forums and General 21 21 3.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums 22 3.8.1 - Cover Image 22 23 3.9 - Private Messaging Threads 23 24 3.10 - Extended Profiles … … 846 847 cursor: default; 847 848 opacity: .4; 848 } 849 } 850 849 851 .bp-screen-reader-text { 850 852 position: absolute; … … 1173 1175 #buddypress div#item-header { 1174 1176 overflow: hidden; 1177 position: relative; 1175 1178 } 1176 1179 #buddypress div#item-header div#item-header-content { … … 1252 1255 float: right; 1253 1256 margin: 10px 0 0 10px; 1257 } 1258 body.no-js #buddypress div#item-header .js-self-profile-button { 1259 display:none; 1254 1260 } 1255 1261 #buddypress div#item-header div#message.info { … … 1398 1404 } 1399 1405 1406 /*-------------------------------------------------------------- 1407 3.8.1 - Cover Image 1408 --------------------------------------------------------------*/ 1409 1410 #buddypress #header-cover-image { 1411 background-color: #c5c5c5; 1412 background-position: center top; 1413 background-repeat: no-repeat; 1414 background-size: cover; 1415 border: 0; 1416 display: block; 1417 right: 0; 1418 margin: 0; 1419 padding: 0; 1420 position: absolute; 1421 top: 0; 1422 width: 100%; 1423 z-index: 1; 1424 } 1425 1426 #buddypress #item-header-cover-image { 1427 padding: 0 1em; 1428 position: relative; 1429 z-index: 999; 1430 } 1400 1431 1401 1432 /*-------------------------------------------------------------- -
trunk/src/bp-templates/bp-legacy/css/buddypress.css
r10086 r10155 20 20 3.7 - Topics and Tables - Forums and General 21 21 3.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums 22 3.8.1 - Cover Image 22 23 3.9 - Private Messaging Threads 23 24 3.10 - Extended Profiles … … 846 847 cursor: default; 847 848 opacity: .4; 848 } 849 } 850 849 851 .bp-screen-reader-text { 850 852 position: absolute; … … 1173 1175 #buddypress div#item-header { 1174 1176 overflow: hidden; 1177 position: relative; 1175 1178 } 1176 1179 #buddypress div#item-header div#item-header-content { … … 1252 1255 float: left; 1253 1256 margin: 10px 10px 0 0; 1257 } 1258 body.no-js #buddypress div#item-header .js-self-profile-button { 1259 display:none; 1254 1260 } 1255 1261 #buddypress div#item-header div#message.info { … … 1398 1404 } 1399 1405 1406 /*-------------------------------------------------------------- 1407 3.8.1 - Cover Image 1408 --------------------------------------------------------------*/ 1409 1410 #buddypress #header-cover-image { 1411 background-color: #c5c5c5; 1412 background-position: center top; 1413 background-repeat: no-repeat; 1414 background-size: cover; 1415 border: 0; 1416 display: block; 1417 left: 0; 1418 margin: 0; 1419 padding: 0; 1420 position: absolute; 1421 top: 0; 1422 width: 100%; 1423 z-index: 1; 1424 } 1425 1426 #buddypress #item-header-cover-image { 1427 padding: 0 1em; 1428 position: relative; 1429 z-index: 999; 1430 } 1400 1431 1401 1432 /*-------------------------------------------------------------- -
trunk/src/bp-templates/bp-legacy/css/twentyfifteen-rtl.css
r9905 r10155 956 956 } 957 957 958 .bp-user #buddypress #item-header #item-header-avatar img.avatar,959 958 .bp-user #buddypress #item-header #item-header-avatar a { 960 959 border-bottom: 0; -
trunk/src/bp-templates/bp-legacy/css/twentyfifteen.css
r9905 r10155 956 956 } 957 957 958 .bp-user #buddypress #item-header #item-header-avatar img.avatar,959 958 .bp-user #buddypress #item-header #item-header-avatar a { 960 959 border-bottom: 0; -
trunk/src/bp-templates/bp-legacy/css/twentyfifteen.scss
r9933 r10155 1200 1200 width: 100%; 1201 1201 1202 img.avatar,1203 1202 a { 1204 1203 border-bottom: 0; -
trunk/src/bp-templates/bp-legacy/css/twentyfourteen-rtl.css
r9905 r10155 783 783 width: 20%; 784 784 } 785 .bp-user #buddypress #item-header #item-header-avatar img {786 margin: 0;787 }788 785 .bp-user #buddypress #item-header #item-header-content { 789 786 float: left; -
trunk/src/bp-templates/bp-legacy/css/twentyfourteen.css
r9905 r10155 783 783 width: 20%; 784 784 } 785 .bp-user #buddypress #item-header #item-header-avatar img {786 margin: 0;787 }788 785 .bp-user #buddypress #item-header #item-header-content { 789 786 float: right; -
trunk/src/bp-templates/bp-legacy/css/twentyfourteen.scss
r9933 r10155 1101 1101 text-align: left; 1102 1102 width: 20%; 1103 1104 img {margin: 0;}1105 1103 } 1106 1104 -
trunk/src/bp-templates/bp-legacy/css/twentythirteen-rtl.css
r9973 r10155 954 954 width: 20%; 955 955 } 956 .bp-user #buddypress #item-header #item-header-avatar img.avatar,957 956 .bp-user #buddypress #item-header #item-header-avatar a { 958 957 float: right; 959 width: 100%;960 958 } 961 959 .bp-user #buddypress #item-header #item-header-content { -
trunk/src/bp-templates/bp-legacy/css/twentythirteen.css
r9973 r10155 954 954 width: 20%; 955 955 } 956 .bp-user #buddypress #item-header #item-header-avatar img.avatar,957 956 .bp-user #buddypress #item-header #item-header-avatar a { 958 957 float: left; 959 width: 100%;960 958 } 961 959 .bp-user #buddypress #item-header #item-header-content { -
trunk/src/bp-templates/bp-legacy/css/twentythirteen.scss
r9972 r10155 1268 1268 width: 20%; 1269 1269 1270 img.avatar,1271 1270 a { 1272 1271 float: left; 1273 width: 100%;1274 1272 } 1275 1273 }
Note: See TracChangeset
for help on using the changeset viewer.