Changeset 3630
- Timestamp:
- 07/07/2016 05:03:29 AM (8 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
r3621 r3630 7 7 8 8 // Cacheing hack 9 wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '2016070 4a' );9 wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160707' ); 10 10 } 11 11 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 ); 12 13 function inline_scripts() { 14 ?> 15 <script type="text/javascript"> 16 var el = document.getElementById( 'make-welcome-hide' ); 17 if ( el ) { 18 el.addEventListener( 'click', function( e ) { 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 } 24 } ); 25 } 26 </script> 27 <?php 28 } 29 add_action( 'wp_footer', __NAMESPACE__ . '\inline_scripts' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php
r3599 r3630 13 13 14 14 <nav id="site-navigation" class="navigation-main clear" role="navigation"> 15 <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'p2-breathe' ); ?>"><?php _e( 'Skip to content', 'p2-breathe' ); ?></a></div>15 <div class="screen-reader-text skip-link"><a href="#content" title="<?php _e( 'Skip to content', 'p2-breathe' ); ?>"><?php _e( 'Skip to content', 'p2-breathe' ); ?></a></div> 16 16 17 17 <?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => false ) ); ?> … … 23 23 $welcome = get_page_by_path( 'welcome' ); 24 24 25 if ( $welcome ) { 25 $cookie = 'welcome-' . get_current_blog_id(); 26 27 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : ''; 28 29 if ( $welcome && md5( $welcome->post_content ) !== $hash ) { 26 30 setup_postdata( $welcome ); 27 31 ?> 28 <div class="make-welcome-wrapper"><div class="make-welcome"> 29 <?php 30 the_content(); 31 edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID ); 32 ?> 33 </div></div> 32 <div class="make-welcome-wrapper"> 33 <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo md5( $welcome->post_content ); ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span> 34 <div class="make-welcome"> 35 <?php 36 the_content(); 37 edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID ); 38 ?> 39 </div> 40 </div> 34 41 <?php 35 42 wp_reset_postdata(); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/style.css
r3621 r3630 308 308 width:100%; 309 309 background: #eeeeee; 310 /* jQuery slideUp overrides the margin, causing the animation to be a bit funky. !important stops that. */ 311 margin: -4em 0 4em 0 !important; 312 } 313 314 #make-welcome-hide { 315 float: right; 316 margin: 30px; 317 cursor: pointer; 310 318 } 311 319 … … 316 324 width: 100%; 317 325 max-width: 960px; 318 margin: calc(-4em + 16px) auto 4emauto;326 margin: 0px auto; 319 327 padding-bottom: 14px; 320 328 }
Note: See TracChangeset
for help on using the changeset viewer.