Changeset 3672
- Timestamp:
- 07/12/2016 05:50:17 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php
r3659 r3672 7 7 8 8 // Cacheing hack 9 wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '201607 09' );9 wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160712' ); 10 10 } 11 11 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 ); … … 18 18 el.addEventListener( 'click', function( e ) { 19 19 document.cookie = el.dataset.cookie + '=' + el.dataset.hash + '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; 20 var wrapper = document.getElementsByClassName( 'make-welcome-wrapper' ).item( 0 ); 21 if ( wrapper ) { 22 jQuery( wrapper ).slideUp(); 23 } 20 jQuery( '.make-welcome' ).slideUp(); 24 21 } ); 25 22 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php
r3671 r3672 1 1 <?php 2 $welcome = get_page_by_path( 'welcome' ); 3 $cookie = 'welcome-' . get_current_blog_id(); 4 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : ''; 5 $content_hash = $welcome ? md5( $welcome->post_content ) : ''; 2 6 3 7 $GLOBALS['pagetitle'] = get_bloginfo( 'name', 'display' ); … … 21 25 22 26 <?php 23 $welcome = get_page_by_path( 'welcome' );24 27 25 $cookie = 'welcome-' . get_current_blog_id(); 26 27 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : ''; 28 29 $content_hash = $welcome ? md5( $welcome->post_content ) : ''; 30 31 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) { 28 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) : 32 29 $columns = preg_split( '|<hr\s*/?>|', $welcome->post_content ); 33 30 if ( count( $columns ) === 2 ) { 34 $welcome->post_content = "<div class=' first-column'>\n\n{$columns[0]}</div><div class='second-column'>\n\n{$columns[1]}</div>";31 $welcome->post_content = "<div class='content-area'>\n\n{$columns[0]}</div><div class='widget-area'>\n\n{$columns[1]}</div>"; 35 32 } 36 33 setup_postdata( $welcome ); 37 34 ?> 38 <div class="make-welcome-wrapper"> 39 <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span> 40 <?php 41 edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID ); 42 ?> 43 <div class="make-welcome"> 44 <?php 45 the_content(); 46 ?> 35 <div class="make-welcome"> 36 <div class="entry-meta"> 37 <?php edit_post_link( __( 'Edit', 'o2' ) ); ?> 38 <button type="button" id="make-welcome-hide" class="toggle dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php esc_attr_e( 'Hide this message', 'p2-breathe' ); ?>"></button> 39 </div> 40 <div class="entry-content clear"> 41 <?php the_content(); ?> 47 42 </div> 48 43 </div> 49 44 <?php 50 45 wp_reset_postdata(); 51 } 46 endif; 52 47 ?> 53 48 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/style.css
r3671 r3672 172 172 overflow-x: hidden; 173 173 } 174 174 175 175 body.responsive-show #page { 176 176 overflow-x: visible; … … 328 328 } 329 329 330 .make-welcome-wrapper { 331 width: 100%; 330 .make-welcome { 332 331 background: #eee; 333 332 /* jQuery slideUp overrides the margin, causing the animation to be a bit funky. !important stops that. */ 334 333 margin: -4em 0 4em 0 !important; 334 padding: 2em 0; 335 335 position: relative; 336 padding: 2em 0; 337 } 338 339 #make-welcome-hide { 340 position: absolute; 341 right: 0; 342 top: 0; 343 margin: 15px; 344 cursor: pointer; 345 } 346 347 .make-welcome-edit { 348 position: absolute; 349 right: 50px; 350 top: 0; 351 padding-right: 15px; 352 border-right: 1px solid #ccc; 353 font-size: 1.3em; 354 line-height: 1.5; 355 } 356 357 .make-welcome { 336 width: 100%; 337 } 338 339 .make-welcome .entry-content { 358 340 font-size: 14px; 359 341 color: #333; … … 362 344 max-width: 940px; 363 345 margin: 0px auto; 364 padding: 0 0 14px;365 } 366 367 .make-welcome h4 {346 padding: 0; 347 } 348 349 .make-welcome .entry-content h4 { 368 350 margin: 14px 0; 369 351 } 370 352 371 .make-welcome p {353 .make-welcome .entry-content p { 372 354 display: inline; 373 355 } 374 356 375 .make-welcome h4,376 .make-welcome . welcome p:first-child {357 .make-welcome .entry-content h4, 358 .make-welcome .entry-content .welcome p:first-child { 377 359 font-weight: normal; 378 360 font-size: 18px; … … 380 362 } 381 363 382 .make-welcome . column {364 .make-welcome .entry-content .column { 383 365 vertical-align: top; 384 366 display: inline-block; … … 386 368 } 387 369 388 .make-welcome .first-column { 389 width: 71%; 390 display: inline-block; 391 } 392 393 .make-welcome .second-column { 394 width: 25%; 395 float: right; 396 } 397 398 .make-welcome .welcome { 370 .make-welcome .entry-content .welcome { 399 371 padding-top: 1%; 400 372 } 401 373 402 .make-welcome . o2-appended-tags,403 .make-welcome . o2-post-footer-actions {374 .make-welcome .entry-content .o2-appended-tags, 375 .make-welcome .entry-content .o2-post-footer-actions { 404 376 display: none; 405 377 } 406 378 379 .make-welcome .entry-meta { 380 margin: 15px; 381 position: absolute; 382 right: 0; 383 top: 0; 384 } 385 386 .make-welcome .entry-meta .post-edit-link { 387 margin-right: 15px; 388 } 389 390 .make-welcome .entry-meta [type="button"] { 391 background: transparent; 392 border: 0; 393 box-shadow: none; 394 -webkit-appearance: none; 395 padding: 0; 396 text-shadow: none; 397 } 398 399 .make-welcome .entry-meta [type="button"]:focus { 400 outline: thin dotted; 401 } 402 407 403 @media screen and (min-width: 960px) { 408 .make-welcome { 409 padding-bottom: 0; 410 } 411 412 .make-welcome p { 404 .make-welcome .entry-content p { 413 405 display: block; 414 406 } 415 407 416 .make-welcome . column {408 .make-welcome .entry-content .column { 417 409 width: 30%; 418 410 padding: 1.5%; 419 411 } 420 412 421 .make-welcome . welcome p:first-child {413 .make-welcome .entry-content .welcome p:first-child { 422 414 font-size: 22px; 423 415 margin: 12px 0 23px; 424 416 } 425 417 426 .make-welcome h4, .make-welcome p { 418 .make-welcome .entry-content h4, 419 .make-welcome .entry-content p { 427 420 margin-bottom: 14px; 428 421 } … … 430 423 431 424 @media screen and (max-width: 1000px) { 432 .make-welcome .first-column, 433 .make-welcome .second-column { 425 .make-welcome .entry-content .content-area, 426 .make-welcome .entry-content .widget-area { 427 clear: both; 428 float: none; 429 padding: 0 20px; 434 430 width: auto; 435 float: none; 436 clear: both; 437 padding: 0 20px; 438 } 439 } 431 } 432 }
Note: See TracChangeset
for help on using the changeset viewer.