Ticket #16539: 16539_searchform.diff
File 16539_searchform.diff, 8.9 KB (added by , 14 years ago) |
---|
-
wp-content/themes/twentyeleven/rtl.css
52 52 margin-right: 102px; 53 53 } 54 54 /* Make sure the logo and search form don't collide */ 55 .one-column #branding #searchform {55 .one-column #branding form.searchform { 56 56 right: auto; 57 57 left: 40px; 58 58 } … … 99 99 padding-left: 0; 100 100 padding-right: 3px; 101 101 } 102 input #s{102 input.searchinput { 103 103 background-position: 97% 6px; 104 104 padding: 4px 28px 4px 10px; 105 105 } … … 147 147 } 148 148 149 149 /* Search Form */ 150 #branding #searchform {150 #branding form.searchform { 151 151 right: auto; 152 152 left: 7.6%; 153 153 text-align: left; 154 154 } 155 #branding #s{155 #branding .searchinput { 156 156 float: left; 157 157 } 158 158 #branding .only-search + #access div { -
wp-content/themes/twentyeleven/searchform.php
7 7 * @since Twenty Eleven 1.0 8 8 */ 9 9 ?> 10 <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> 11 <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label> 12 <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> 13 <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> 10 <?php 11 if (!isset($GLOBALS['search_form_counter'])) 12 $GLOBALS['search_form_counter'] = 1; 13 $id = $GLOBALS['search_form_counter']; 14 ?> 15 <form method="get" id="searchform-<?php echo $id; ?>" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> 16 <label for="s-<?php echo $id; ?>" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label> 17 <input type="text" class="searchinput field" name="s" id="s-<?php echo $id; ?>" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> 18 <input type="submit" class="searchsubmit submit" name="submit" id="searchsubmit-<?php echo $id; ?>" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> 14 19 </form> 20 <? $GLOBALS['search_form_counter']++; ?> 21 No newline at end of file -
wp-content/themes/twentyeleven/style.css
278 278 width: auto; 279 279 } 280 280 /* Make sure the logo and search form don't collide */ 281 .one-column #branding #searchform {281 .one-column #branding .searchform { 282 282 right: 40px; 283 283 top: 4em; 284 284 } … … 453 453 input[type=text] { 454 454 padding: 3px; 455 455 } 456 input #s{456 input.searchinput { 457 457 background: url(images/search.png) no-repeat 5px 6px; 458 458 -moz-border-radius: 2px; 459 459 border-radius: 2px; … … 462 462 line-height: 1.2em; 463 463 padding: 4px 10px 4px 28px; 464 464 } 465 input #searchsubmit {465 input.searchsubmit { 466 466 display: none; 467 467 } 468 468 … … 620 620 } 621 621 622 622 /* Search Form */ 623 #branding #searchform {623 #branding .searchform { 624 624 position: absolute; 625 625 top: 3.8em; 626 626 right: 7.6%; 627 627 text-align: right; 628 628 } 629 #branding #searchform div {629 #branding .searchform div { 630 630 margin: 0; 631 631 } 632 #branding #s{632 #branding .searchinput { 633 633 float: right; 634 634 -webkit-transition-duration: 400ms; 635 635 -webkit-transition-property: width, background; … … 642 642 -o-transition-timing-function: ease; 643 643 width: 72px; 644 644 } 645 #branding #s:focus {645 #branding .searchinput:focus { 646 646 background-color: #f9f9f9; 647 647 width: 196px; 648 648 } 649 #branding #searchsubmit {649 #branding .searchsubmit { 650 650 display: none; 651 651 } 652 #branding .only-search #searchform {652 #branding .only-search .searchform { 653 653 top: 5px; 654 654 z-index: 1; 655 655 } 656 #branding .only-search #s{656 #branding .only-search .searchinput { 657 657 background-color: #666; 658 658 border-color: #000; 659 659 color: #222; 660 660 } 661 #branding .only-search #s,662 #branding .only-search #s:focus {661 #branding .only-search .searchinput, 662 #branding .only-search .searchinput:focus { 663 663 width: 85%; 664 664 } 665 #branding .only-search #s:focus {665 #branding .only-search .searchinput:focus { 666 666 background-color: #bbb; 667 667 } 668 #branding .with-image #searchform {668 #branding .with-image .searchform { 669 669 top: auto; 670 670 bottom: -27px; 671 671 } … … 786 786 border-top: 1px solid #ddd; 787 787 padding: 6px 10px 6px 0; 788 788 } 789 .entry-content #s{789 .entry-content .searchinput { 790 790 width: 75%; 791 791 } 792 792 .comment-content ul, … … 1276 1276 /* =error404 1277 1277 ----------------------------------------------- */ 1278 1278 1279 .error404 #main #searchform {1279 .error404 #main .searchform { 1280 1280 background: #f9f9f9; 1281 1281 border: 1px solid #ddd; 1282 1282 border-width: 1px 0; … … 1284 1284 overflow: hidden; 1285 1285 padding: 1.625em 8.9%; 1286 1286 } 1287 .error404 #main #s{1287 .error404 #main .searchinput { 1288 1288 width: 95%; 1289 1289 } 1290 1290 .error404 #main .widget { … … 1758 1758 .widget_search form { 1759 1759 margin: 0 0 1.625em; 1760 1760 } 1761 .widget_search #s{1761 .widget_search .searchinput { 1762 1762 width: 77%; 1763 1763 } 1764 .widget_search #searchsubmit {1764 .widget_search .searchsubmit { 1765 1765 background: #ddd; 1766 1766 border: 1px solid #ccc; 1767 1767 -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); … … 1773 1773 position: relative; 1774 1774 top: -2px; 1775 1775 } 1776 .widget_search #searchsubmit:active {1776 .widget_search .searchsubmit:active { 1777 1777 background: #1982d1; 1778 1778 border-color: #0861a5; 1779 1779 -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); … … 2398 2398 margin-right: 0; 2399 2399 } 2400 2400 /* Make sure the logo and search form don't collide */ 2401 #branding #searchform {2401 #branding .searchform { 2402 2402 top: 1.625em !important; 2403 2403 } 2404 2404 /* Floated content doesn't work well at this size */ … … 2512 2512 #site-description { 2513 2513 font-size: 10pt; 2514 2514 } 2515 #branding #searchform {2515 #branding .searchform { 2516 2516 display: none; 2517 2517 } 2518 2518 #branding img { -
wp-content/themes/twentyeleven/colors/dark.css
42 42 input[type=text]:focus, 43 43 textarea:focus { 44 44 } 45 input #s{45 input.searchinput { 46 46 background-color: #ddd; 47 47 } 48 48 … … 67 67 #site-description { 68 68 color: #858585; 69 69 } 70 #branding #s{70 #branding input.searchinput { 71 71 background-color: #ddd; 72 72 } 73 73 … … 253 253 254 254 /* =error404 255 255 ----------------------------------------------- */ 256 .error404 #main #searchform {256 .error404 #main .searchform { 257 257 background: #060606; 258 258 border-color: #222; 259 259 } … … 406 406 } 407 407 408 408 /* Search Widget */ 409 .widget_search #searchsubmit {409 .widget_search .searchsubmit { 410 410 background: #222; 411 411 border-color: #333; 412 412 -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); … … 414 414 box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); 415 415 color: #777; 416 416 } 417 .widget_search #searchsubmit:active {417 .widget_search .searchsubmit:active { 418 418 -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 419 419 -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 420 420 box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); … … 538 538 #respond .comment-form-email .required { 539 539 color: #42caff; 540 540 } 541 #respond input#submit {541 #respond #submit { 542 542 background: #ddd; 543 543 -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); 544 544 -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); -
wp-includes/general-template.php
149 149 * @param boolean $echo Default to echo and not return the form. 150 150 */ 151 151 function get_search_form($echo = true) { 152 global $search_form_counter; 153 if (!isset($search_form_counter)) 154 $search_form_counter = 1; 152 155 do_action( 'get_search_form' ); 153 156 154 157 $search_form_template = locate_template('searchform.php'); … … 157 160 return; 158 161 } 159 162 160 $form = '<form role="search" method="get" id="searchform " action="' . home_url( '/' ) . '" >161 <div><label class="screen-reader-text" for="s ">' . __('Search for:') . '</label>162 <input type="text" value="' . get_search_query() . '" name="s" id="s" />163 <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />163 $form = '<form role="search" method="get" id="searchform-' . $search_form_counter . '" class="searchform" action="' . home_url( '/' ) . '" > 164 <div><label class="screen-reader-text" for="s-' . $search_form_counter . '">' . __('Search for:') . '</label> 165 <input type="text" class="searchinput field" value="' . get_search_query() . '" name="s" id="s-' . $search_form_counter . '" /> 166 <input type="submit" class="searchsubmit submit" id="searchsubmit-' . $search_form_counter . '" value="'. esc_attr__('Search') .'" /> 164 167 </div> 165 168 </form>'; 169 $search_form_counter++; 166 170 167 171 if ( $echo ) 168 172 echo apply_filters('get_search_form', $form);