Ticket #7104: 7104.css.patch
File 7104.css.patch, 16.9 KB (added by , 8 years ago) |
---|
-
Gruntfile.js
5 5 BUILD_DIR = 'build/', 6 6 7 7 BP_CSS = [ 8 '**/*.css', 9 '**/css-*.php' 8 '**/*.css' 10 9 ], 11 10 12 11 // CSS exclusions, for excluding files from certain tasks, e.g. rtlcss 13 12 BP_EXCLUDED_CSS = [ 14 '!**/*-rtl.css', 15 '!**/*-rtl.php' 13 '!**/*-rtl.css' 16 14 ], 17 15 18 16 BP_JS = [ -
src/bp-activity/bp-activity-embeds.php
62 62 /** 63 63 * Add inline styles for BP activity embeds. 64 64 * 65 * This is subject to change or be removed entirely for a different system.66 * Potentially for BP_Legacy::locate_asset_in_stack().67 *68 65 * @since 2.6.0 69 * @access private70 66 */ 71 function _bp_activity_embed_add_inline_styles() {67 function bp_activity_embed_add_inline_styles() { 72 68 if ( false === bp_is_single_activity() ) { 73 69 return; 74 70 } 75 71 76 ob_start(); 72 $min = bp_core_get_minified_asset_suffix(); 73 77 74 if ( is_rtl() ) { 78 bp_get_asset_template_part( 'embeds/css-activity', 'rtl');75 $css = bp_get_template_asset( "assets/embeds/activity-rtl{$min}.css" ); 79 76 } else { 80 bp_get_asset_template_part( 'embeds/css-activity');77 $css = bp_get_template_asset( "assets/embeds/activity{$min}.css" ); 81 78 } 82 $css = ob_get_clean();83 79 84 80 // Rudimentary CSS protection. 85 81 $css = wp_kses( $css, array( "\'", '\"' ) ); 86 82 87 83 printf( '<style type="text/css">%s</style>', $css ); 88 84 } 89 add_action( 'embed_head', ' _bp_activity_embed_add_inline_styles', 20 );85 add_action( 'embed_head', 'bp_activity_embed_add_inline_styles', 20 ); 90 86 91 87 /** 92 88 * Query for the activity item on the activity embed template. -
src/bp-core/bp-core-template-loader.php
150 150 } 151 151 152 152 /** 153 * Get a BuddyPress template asset for display in a theme. 154 * 155 * @since 2.6.0 156 * 157 * @param string $filename Relative filename against the template directory to search for. 158 * @param bool $load Whether to load the file if found immediately. Default: false. 159 */ 160 function bp_get_template_asset( $filename, $load = false ) { 161 /** 162 * Filters the filename before locating. 163 * 164 * @since 2.6.0 165 * 166 * @param array $filename Filename to locate. 167 * @param bool $load Whether we should load the file immediately. 168 */ 169 $filename = apply_filters( 'bp_get_template_asset', $filename, $load ); 170 171 // Ensure assets can be located when running from /src/. 172 if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' ) { 173 $filename = str_replace( '.min', '', $filename ); 174 } 175 176 $located = bp_locate_template_asset( $filename ); 177 if ( false === $located ) { 178 return; 179 } 180 181 if ( true === $load ) { 182 readfile( $located['file'] ); 183 } else { 184 return file_get_contents( $located['file'] ); 185 } 186 } 187 188 /** 189 * Retrieve the path of the highest priority asset that exists. 190 * 191 * Similar to {@link bp_locate_template()}, but for files like CSS and JS. 192 * 193 * @since 2.6.0 194 * 195 * @param string Asset name to search for. 196 * @return array|bool Array of asset data if one is located (includes absolute filepath and URI). 197 * Boolean false on failure. 198 */ 199 function bp_locate_template_asset( $asset_name ) { 200 201 // No file found yet. 202 $located = false; 203 $template_locations = bp_get_template_stack(); 204 $asset_name = ltrim( $asset_name, '/' ); 205 206 // Loop through template stack to try to find the asset. 207 foreach ( (array) $template_locations as $template_location ) { 208 209 // Continue if $template_location is empty. 210 if ( empty( $template_location ) ) { 211 continue; 212 } 213 214 if ( file_exists( trailingslashit( $template_location ) . $asset_name ) ) { 215 $located = array(); 216 $located['file'] = $located['uri'] = trailingslashit( $template_location ) . $asset_name; 217 218 $content_dir = constant( 'WP_CONTENT_DIR' ); 219 220 // IIS (Windows) here; replace back slashes with forward slash. 221 if ( strpos( $located['uri'], '\\' ) !== false ) { 222 $located['uri'] = str_replace( '\\', '/', $located['uri'] ); 223 $content_dir = str_replace( '\\', '/', $content_dir ); 224 } 225 226 // Make URI path is relative to site URL. 227 $located['uri'] = str_replace( $content_dir, content_url(), $located['uri'] ); 228 break; 229 } 230 } 231 232 return $located; 233 } 234 235 /** 153 236 * Register a new template stack location. 154 237 * 155 238 * This allows for templates to live in places beyond just the parent/child -
new file src/bp-templates/bp-legacy/buddypress/assets/embeds/activity-rtl.css
new file mode 100644
- + 1 #bp-embed-header:after { 2 clear: both; 3 content: ""; 4 display: table; 5 margin-bottom: 1em; 6 } 7 8 .bp-embed-avatar { 9 float: right; 10 margin: 0 0 0 .75em; 11 } 12 13 p.bp-embed-activity-action { 14 font-size: 15px; 15 margin-bottom: 0; 16 } 17 18 p.bp-embed-activity-action a:first-child { 19 color: #32373c; 20 font-weight: bold; 21 } 22 23 p.bp-embed-activity-action img.avatar { 24 padding: 0 3px 0 4px; 25 vertical-align: text-bottom; 26 } 27 28 .bp-embed-excerpt { 29 margin-bottom: 1em; 30 } 31 32 .bp-embed-excerpt a { 33 color: #21759b; 34 display: inline-block; 35 overflow: hidden; 36 text-overflow: ellipsis; 37 vertical-align: top; 38 white-space: nowrap; 39 max-width: 250px; 40 } 41 42 .activity-read-more { 43 margin-right: .5em; 44 } 45 46 .activity-read-more a { 47 color: #b4b9be; 48 } 49 50 .wp-embed-footer { 51 margin-top: 20px; 52 } 53 54 span.bp-embed-timestamp { 55 font-size: .9em; 56 } 57 58 video { 59 width: 100%; 60 height: auto; 61 } 62 63 .bp-activity-embed-display-media { 64 border: 1px solid #ccc; 65 border-radius: 6px; 66 } 67 68 .bp-activity-embed-display-media.one-col, 69 .bp-activity-embed-display-media.one-col .thumb, 70 .bp-activity-embed-display-media.one-col .thumb img { 71 width: 100%; 72 } 73 74 .bp-activity-embed-display-media.two-col .thumb, 75 .bp-activity-embed-display-media.two-col .caption { 76 display: table-cell; 77 } 78 79 .bp-activity-embed-display-media.two-col .thumb { 80 background: #000; 81 vertical-align: middle; 82 } 83 84 .bp-activity-embed-display-media.two-col .caption { 85 vertical-align: top; 86 } 87 88 .bp-activity-embed-display-media.two-col .thumb img { 89 border-left: 1px solid #ccc; 90 display: block; 91 width: 100%; 92 } 93 94 .bp-activity-embed-display-media .thumb { 95 position: relative; 96 } 97 98 .bp-activity-embed-display-media .caption { 99 padding: .2em .5em .5em .5em; 100 } 101 102 a.play-btn { 103 background: rgba(0, 0, 0, 0.75); 104 border-radius: 50%; 105 height: 50px; 106 right: 50%; 107 margin: 0; 108 padding: 1em; 109 position: absolute; 110 text-indent: 0.25em; 111 top: 50%; 112 transform: translateY(-50%) translateX(50%); 113 -webkit-transform: translateY(-50%) translateX(50%); 114 transition: all 0.2s ease-out; 115 width: 50px; 116 } 117 118 .bp-activity-embed-display-media.two-col a.play-btn { 119 height: 35px; 120 width: 35px; 121 } 122 123 a.play-btn:hover { 124 background: rgba(0, 0, 0, 0.95); 125 transform: translateY(-50%) translateX(50%) scale(1.05); 126 -webkit-transform: translateY(-50%) translateX(50%) scale(1.05); 127 transition: all 0.2s ease-out; 128 } 129 130 .bp-activity-embed-display-media .thumb svg { 131 fill: #fff; 132 overflow: hidden; 133 } 134 135 .bp-activity-embed-display-media .caption-description { 136 font-size: 90%; 137 margin: .4em 0; 138 } 139 140 @media only screen and (max-width: 480px) { 141 .bp-activity-embed-display-media.two-col .thumb { 142 border-bottom: 1px solid #ccc; 143 border-left: 0; 144 display: block; 145 max-width: none !important; 146 } 147 148 a.play-btn { 149 height: 35px; 150 width: 35px; 151 } 152 } 153 No newline at end of file -
new file src/bp-templates/bp-legacy/buddypress/assets/embeds/activity.css
new file mode 100644
- + 1 #bp-embed-header:after { 2 clear: both; 3 content: ""; 4 display: table; 5 margin-bottom: 1em; 6 } 7 8 .bp-embed-avatar { 9 float: left; 10 margin: 0 .75em 0 0; 11 } 12 13 p.bp-embed-activity-action { 14 font-size: 15px; 15 margin-bottom: 0; 16 } 17 18 p.bp-embed-activity-action a:first-child { 19 color: #32373c; 20 font-weight: bold; 21 } 22 23 p.bp-embed-activity-action img.avatar { 24 padding: 0 4px 0 3px; 25 vertical-align: text-bottom; 26 } 27 28 .bp-embed-excerpt { 29 margin-bottom: 1em; 30 } 31 32 .bp-embed-excerpt a { 33 color: #21759b; 34 display: inline-block; 35 overflow: hidden; 36 text-overflow: ellipsis; 37 vertical-align: top; 38 white-space: nowrap; 39 max-width: 250px; 40 } 41 42 .activity-read-more { 43 margin-left: .5em; 44 } 45 46 .activity-read-more a { 47 color: #b4b9be; 48 } 49 50 .wp-embed-footer { 51 margin-top: 20px; 52 } 53 54 span.bp-embed-timestamp { 55 font-size: .9em; 56 } 57 58 video { 59 width: 100%; 60 height: auto; 61 } 62 63 .bp-activity-embed-display-media { 64 border: 1px solid #ccc; 65 border-radius: 6px; 66 } 67 68 .bp-activity-embed-display-media.one-col, 69 .bp-activity-embed-display-media.one-col .thumb, 70 .bp-activity-embed-display-media.one-col .thumb img { 71 width: 100%; 72 } 73 74 .bp-activity-embed-display-media.two-col .thumb, 75 .bp-activity-embed-display-media.two-col .caption { 76 display: table-cell; 77 } 78 79 .bp-activity-embed-display-media.two-col .thumb { 80 background: #000; 81 vertical-align: middle; 82 } 83 84 .bp-activity-embed-display-media.two-col .caption { 85 vertical-align: top; 86 } 87 88 .bp-activity-embed-display-media.two-col .thumb img { 89 border-right: 1px solid #ccc; 90 display: block; 91 width: 100%; 92 } 93 94 .bp-activity-embed-display-media .thumb { 95 position: relative; 96 } 97 98 .bp-activity-embed-display-media .caption { 99 padding: .2em .5em .5em .5em; 100 } 101 102 a.play-btn { 103 background: rgba(0, 0, 0, 0.75); 104 border-radius: 50%; 105 height: 50px; 106 left: 50%; 107 margin: 0; 108 padding: 1em; 109 position: absolute; 110 text-indent: 0.25em; 111 top: 50%; 112 transform: translateY(-50%) translateX(-50%); 113 -webkit-transform: translateY(-50%) translateX(-50%); 114 transition: all 0.2s ease-out; 115 width: 50px; 116 } 117 118 .bp-activity-embed-display-media.two-col a.play-btn { 119 height: 35px; 120 width: 35px; 121 } 122 123 a.play-btn:hover { 124 background: rgba(0, 0, 0, 0.95); 125 transform: translateY(-50%) translateX(-50%) scale(1.05); 126 -webkit-transform: translateY(-50%) translateX(-50%) scale(1.05); 127 transition: all 0.2s ease-out; 128 } 129 130 .bp-activity-embed-display-media .thumb svg { 131 fill: #fff; 132 overflow: hidden; 133 } 134 135 .bp-activity-embed-display-media .caption-description { 136 font-size: 90%; 137 margin: .4em 0; 138 } 139 140 @media only screen and (max-width: 480px) { 141 .bp-activity-embed-display-media.two-col .thumb { 142 border-bottom: 1px solid #ccc; 143 border-right: 0; 144 display: block; 145 max-width: none !important; 146 } 147 148 a.play-btn { 149 height: 35px; 150 width: 35px; 151 } 152 } 153 No newline at end of file -
deleted file src/bp-templates/bp-legacy/buddypress/assets/embeds/css-activity-rtl.php
deleted file mode 100644
+ - 1 #bp-embed-header:after {2 clear: both;3 content: "";4 display: table;5 margin-bottom: 1em;6 }7 8 .bp-embed-avatar {9 float: right;10 margin: 0 0 0 .75em;11 }12 13 p.bp-embed-activity-action {14 font-size: 15px;15 margin-bottom: 0;16 }17 18 p.bp-embed-activity-action a:first-child {19 color: #32373c;20 font-weight: bold;21 }22 23 p.bp-embed-activity-action img.avatar {24 padding: 0 3px 0 4px;25 vertical-align: text-bottom;26 }27 28 .bp-embed-excerpt {29 margin-bottom: 1em;30 }31 32 .bp-embed-excerpt a {33 color: #21759b;34 display: inline-block;35 overflow: hidden;36 text-overflow: ellipsis;37 vertical-align: top;38 white-space: nowrap;39 max-width: 250px;40 }41 42 .activity-read-more {43 margin-right: .5em;44 }45 46 .activity-read-more a {47 color: #b4b9be;48 }49 50 .wp-embed-footer {51 margin-top: 20px;52 }53 54 span.bp-embed-timestamp {55 font-size: .9em;56 }57 58 video {59 width: 100%;60 height: auto;61 }62 63 .bp-activity-embed-display-media {64 border: 1px solid #ccc;65 border-radius: 6px;66 }67 68 .bp-activity-embed-display-media.one-col,69 .bp-activity-embed-display-media.one-col .thumb,70 .bp-activity-embed-display-media.one-col .thumb img {71 width: 100%;72 }73 74 .bp-activity-embed-display-media.two-col .thumb,75 .bp-activity-embed-display-media.two-col .caption {76 display: table-cell;77 }78 79 .bp-activity-embed-display-media.two-col .thumb {80 background: #000;81 vertical-align: middle;82 }83 84 .bp-activity-embed-display-media.two-col .caption {85 vertical-align: top;86 }87 88 .bp-activity-embed-display-media.two-col .thumb img {89 border-left: 1px solid #ccc;90 display: block;91 width: 100%;92 }93 94 .bp-activity-embed-display-media .thumb {95 position: relative;96 }97 98 .bp-activity-embed-display-media .caption {99 padding: .2em .5em .5em .5em;100 }101 102 a.play-btn {103 background: rgba(0, 0, 0, 0.75);104 border-radius: 50%;105 height: 50px;106 right: 50%;107 margin: 0;108 padding: 1em;109 position: absolute;110 text-indent: 0.25em;111 top: 50%;112 transform: translateY(-50%) translateX(50%);113 -webkit-transform: translateY(-50%) translateX(50%);114 transition: all 0.2s ease-out;115 width: 50px;116 }117 118 .bp-activity-embed-display-media.two-col a.play-btn {119 height: 35px;120 width: 35px;121 }122 123 a.play-btn:hover {124 background: rgba(0, 0, 0, 0.95);125 transform: translateY(-50%) translateX(50%) scale(1.05);126 -webkit-transform: translateY(-50%) translateX(50%) scale(1.05);127 transition: all 0.2s ease-out;128 }129 130 .bp-activity-embed-display-media .thumb svg {131 fill: #fff;132 overflow: hidden;133 }134 135 .bp-activity-embed-display-media .caption-description {136 font-size: 90%;137 margin: .4em 0;138 }139 140 @media only screen and (max-width: 480px) {141 .bp-activity-embed-display-media.two-col .thumb {142 border-bottom: 1px solid #ccc;143 border-left: 0;144 display: block;145 max-width: none !important;146 }147 148 a.play-btn {149 height: 35px;150 width: 35px;151 }152 }153 No newline at end of file -
deleted file src/bp-templates/bp-legacy/buddypress/assets/embeds/css-activity.php
deleted file mode 100644
+ - 1 #bp-embed-header:after {2 clear: both;3 content: "";4 display: table;5 margin-bottom: 1em;6 }7 8 .bp-embed-avatar {9 float: left;10 margin: 0 .75em 0 0;11 }12 13 p.bp-embed-activity-action {14 font-size: 15px;15 margin-bottom: 0;16 }17 18 p.bp-embed-activity-action a:first-child {19 color: #32373c;20 font-weight: bold;21 }22 23 p.bp-embed-activity-action img.avatar {24 padding: 0 4px 0 3px;25 vertical-align: text-bottom;26 }27 28 .bp-embed-excerpt {29 margin-bottom: 1em;30 }31 32 .bp-embed-excerpt a {33 color: #21759b;34 display: inline-block;35 overflow: hidden;36 text-overflow: ellipsis;37 vertical-align: top;38 white-space: nowrap;39 max-width: 250px;40 }41 42 .activity-read-more {43 margin-left: .5em;44 }45 46 .activity-read-more a {47 color: #b4b9be;48 }49 50 .wp-embed-footer {51 margin-top: 20px;52 }53 54 span.bp-embed-timestamp {55 font-size: .9em;56 }57 58 video {59 width: 100%;60 height: auto;61 }62 63 .bp-activity-embed-display-media {64 border: 1px solid #ccc;65 border-radius: 6px;66 }67 68 .bp-activity-embed-display-media.one-col,69 .bp-activity-embed-display-media.one-col .thumb,70 .bp-activity-embed-display-media.one-col .thumb img {71 width: 100%;72 }73 74 .bp-activity-embed-display-media.two-col .thumb,75 .bp-activity-embed-display-media.two-col .caption {76 display: table-cell;77 }78 79 .bp-activity-embed-display-media.two-col .thumb {80 background: #000;81 vertical-align: middle;82 }83 84 .bp-activity-embed-display-media.two-col .caption {85 vertical-align: top;86 }87 88 .bp-activity-embed-display-media.two-col .thumb img {89 border-right: 1px solid #ccc;90 display: block;91 width: 100%;92 }93 94 .bp-activity-embed-display-media .thumb {95 position: relative;96 }97 98 .bp-activity-embed-display-media .caption {99 padding: .2em .5em .5em .5em;100 }101 102 a.play-btn {103 background: rgba(0, 0, 0, 0.75);104 border-radius: 50%;105 height: 50px;106 left: 50%;107 margin: 0;108 padding: 1em;109 position: absolute;110 text-indent: 0.25em;111 top: 50%;112 transform: translateY(-50%) translateX(-50%);113 -webkit-transform: translateY(-50%) translateX(-50%);114 transition: all 0.2s ease-out;115 width: 50px;116 }117 118 .bp-activity-embed-display-media.two-col a.play-btn {119 height: 35px;120 width: 35px;121 }122 123 a.play-btn:hover {124 background: rgba(0, 0, 0, 0.95);125 transform: translateY(-50%) translateX(-50%) scale(1.05);126 -webkit-transform: translateY(-50%) translateX(-50%) scale(1.05);127 transition: all 0.2s ease-out;128 }129 130 .bp-activity-embed-display-media .thumb svg {131 fill: #fff;132 overflow: hidden;133 }134 135 .bp-activity-embed-display-media .caption-description {136 font-size: 90%;137 margin: .4em 0;138 }139 140 @media only screen and (max-width: 480px) {141 .bp-activity-embed-display-media.two-col .thumb {142 border-bottom: 1px solid #ccc;143 border-right: 0;144 display: block;145 max-width: none !important;146 }147 148 a.play-btn {149 height: 35px;150 width: 35px;151 }152 }153 No newline at end of file