Making WordPress.org

Ticket #2296: 2296.diff

File 2296.diff, 4.6 KB (added by obenland, 9 years ago)
  • wp-content/plugins/plugin-directory/readme/class-parser.php

     
    359359                        if ( $this->faq ) {
    360360                                $this->sections['faq'] .= "\n<dl>\n";
    361361                                foreach ( $this->faq as $question => $answer ) {
    362                                         $this->sections['faq'] .= "<dt>{$question}</dt>\n<dd>{$answer}</dd>\n";
     362                                        $this->sections['faq'] .= "<dt><button class=\"button-link\" aria-expanded=\"false\">{$question}</button></dt>\n<dd>{$answer}</dd>\n";
    363363                                }
    364364                                $this->sections['faq'] .= "\n</dl>\n";
    365365                        }
  • wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/faq/style.scss

     
    1616                border-bottom: 1px solid $color__border;
    1717        }
    1818
    19         dt {
     19        .button-link {
    2020                border-top: 1px solid $color__border;
    2121                cursor: pointer;
    2222                font-size: ms( 0 );
    2323                font-weight: 600;
     24                margin-bottom: 1px;
    2425                padding: 1rem 0;
     26                text-align: left;
     27                width: 100%;
    2528
    2629                &:before {
    2730                        content: "\f347";
     
    3033                        margin: 0 1rem;
    3134                }
    3235
     36                &:focus {
     37                        border: 0;
     38                        border-top: 1px solid $color__border;
     39                        box-shadow: none;
     40                        outline: none;
     41                }
     42
    3343                &.open:before {
    3444                        content: "\f343";
    3545                }
  • wp-content/themes/pub/wporg-plugins/css/style-rtl.css

     
    22762276  border-bottom: 1px solid #eee;
    22772277}
    22782278
    2279 #faq dt {
     2279#faq .button-link {
    22802280  border-top: 1px solid #eee;
    22812281  cursor: pointer;
    22822282  font-size: 16px;
    22832283  font-size: 1rem;
    22842284  font-weight: 600;
     2285  margin-bottom: 1px;
    22852286  padding: 16px 0;
    22862287  padding: 1rem 0;
     2288  text-align: right;
     2289  width: 100%;
    22872290}
    22882291
    2289 #faq dt:before {
     2292#faq .button-link:before {
    22902293  content: "\f347";
    22912294  float: left;
    22922295  font-family: dashicons;
     
    22942297  margin: 0 1rem;
    22952298}
    22962299
    2297 #faq dt.open:before {
     2300#faq .button-link:focus {
     2301  border: 0;
     2302  border-top: 1px solid #eee;
     2303  -webkit-box-shadow: none;
     2304  box-shadow: none;
     2305  outline: none;
     2306}
     2307
     2308#faq .button-link.open:before {
    22982309  content: "\f343";
    22992310}
    23002311
     
    34033414  .plugin-support .counter-count {
    34043415    top: 5px;
    34053416  }
    3406 }
     3417}
     3418 No newline at end of file
  • wp-content/themes/pub/wporg-plugins/css/style.css

     
    22762276  border-bottom: 1px solid #eee;
    22772277}
    22782278
    2279 #faq dt {
     2279#faq .button-link {
    22802280  border-top: 1px solid #eee;
    22812281  cursor: pointer;
    22822282  font-size: 16px;
    22832283  font-size: 1rem;
    22842284  font-weight: 600;
     2285  margin-bottom: 1px;
    22852286  padding: 16px 0;
    22862287  padding: 1rem 0;
     2288  text-align: left;
     2289  width: 100%;
    22872290}
    22882291
    2289 #faq dt:before {
     2292#faq .button-link:before {
    22902293  content: "\f347";
    22912294  float: right;
    22922295  font-family: dashicons;
     
    22942297  margin: 0 1rem;
    22952298}
    22962299
    2297 #faq dt.open:before {
     2300#faq .button-link:focus {
     2301  border: 0;
     2302  border-top: 1px solid #eee;
     2303  -webkit-box-shadow: none;
     2304  box-shadow: none;
     2305  outline: none;
     2306}
     2307
     2308#faq .button-link.open:before {
    22982309  content: "\f343";
    22992310}
    23002311
     
    34043415    top: 5px;
    34053416  }
    34063417}
     3418/*# sourceMappingURL=style.css.map */
     3419 No newline at end of file
  • wp-content/themes/pub/wporg-plugins/js/section-faq.js

     
    11( function( $ ) {
    2         $( '#faq' ).on( 'click', 'dt', function( event ) {
     2        $( '#faq' ).on( 'click', '.button-link', function( event ) {
    33                var $question = $( event.target );
    44
    55                if ( ! $question.is( '.open' ) ) {
    6                         $question.siblings( '.open' ).toggleClass( 'open' ).attr( 'aria-expanded', false ).next( 'dd' ).slideToggle( 200 );
     6                        $question.siblings( '.open' ).toggleClass( 'open' ).attr( 'aria-expanded', false ).parent().next( 'dd' ).slideToggle( 200 );
    77                }
    88
    99                $question.toggleClass( 'open' ).attr( 'aria-expanded', function( index, attribute ) {
    1010                        return 'true' !== attribute;
    11                 } ).next( 'dd' ).slideToggle( 200 );
     11                } ).parent().next( 'dd' ).slideToggle( 200 );
    1212        });
    1313} )( jQuery );