Changeset 1296
- Timestamp:
- 02/24/2015 04:48:58 AM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
r1293 r1296 73 73 'themes' => false, 74 74 'settings' => array( 75 'title' => __( 'WordPress › %s « Free WordPress Themes', 'wporg-themes' ), 75 76 'isMobile' => wp_is_mobile(), 76 77 'isInstall' => true, … … 188 189 $theme->authorurl = $user->user_nicename; 189 190 $theme->authordispname = wp_kses( $user->display_name, $themes_allowedtags ); 190 191 191 192 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 192 193 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1282 r1296 1 1 ( function ( $, wp ) { 2 2 google.load("visualization", "1", {packages:["corechart"]}); 3 4 wp.themes.utils = { 5 title: function ( item ) { 6 var title = $( 'title' ); 7 8 title.html( wp.themes.data.settings.title.replace( '%s', item ) ); 9 } 10 }; 3 11 4 12 _.extend( wp.themes.view.Appearance.prototype, { … … 19 27 // Trigger a route update for the current model 20 28 wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.themePath + this.model.id ) ); 29 wp.themes.utils.title( this.model.attributes.name ); 21 30 22 31 // Sets this.view to 'detail' … … 54 63 el: '#themes', 55 64 65 sort: function( sort ) { 66 var sorter = $( '.filter-links [data-sort="' + sort + '"]' ); 67 this.clearSearch(); 68 69 $( '.filter-links li > a, .theme-filter' ).removeClass( this.activeClass ); 70 sorter.addClass( this.activeClass ); 71 wp.themes.utils.title( sorter.text() ); 72 73 this.browse( sort ); 74 }, 75 56 76 // Applying filters triggers a tag request. 57 77 applyFilters: function( event ) { 58 var name, 78 var names = [], 79 name, 59 80 tags = this.filtersChecked(), 60 81 request = { tag: tags }, … … 71 92 _.each( tags, function( tag ) { 72 93 name = $( 'label[for="filter-id-' + tag + '"]' ).text(); 94 names.push( name ); 73 95 filteringBy.append( '<span class="tag">' + name + '</span>' ); 74 96 }); 75 97 76 98 wp.themes.router.navigate( wp.themes.router.baseUrl( 'tag/' + tags.join( '+' ) ) ); 99 wp.themes.utils.title( names.join( ', ' ) ); 77 100 78 101 // Get the themes by sending Ajax POST request to api.wordpress.org/themes … … 439 462 } 440 463 }); 464 }, 465 466 // Single theme overlay screen 467 // It's shown when clicking a theme 468 collapse: function( event ) { 469 var self = this, 470 scroll, sorter; 471 472 event = event || window.event; 473 474 // Prevent collapsing detailed view when there is only one theme available 475 if ( wp.themes.data.themes.length === 1 ) { 476 return; 477 } 478 479 // Detect if the click is inside the overlay 480 // and don't close it unless the target was 481 // the div.back button 482 if ( $( event.target ).is( '.theme-backdrop' ) || $( event.target ).is( '.close' ) || event.keyCode === 27 ) { 483 484 // Add a temporary closing class while overlay fades out 485 $( 'body' ).addClass( 'closing-overlay' ); 486 487 // With a quick fade out animation 488 this.$el.fadeOut( 130, function() { 489 // Clicking outside the modal box closes the overlay 490 $( 'body' ).removeClass( 'closing-overlay' ); 491 // Handle event cleanup 492 self.closeOverlay(); 493 494 // Get scroll position to avoid jumping to the top 495 scroll = document.body.scrollTop; 496 497 sorter = $( '.filter-links .current' ); 498 499 // Clean the url structure 500 wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.browsePath + sorter.data( 'sort' ) ) ); 501 wp.themes.utils.title( sorter.text() ); 502 503 // Restore scroll position 504 document.body.scrollTop = scroll; 505 506 // Return focus to the theme div 507 if ( wp.themes.focusedTheme ) { 508 wp.themes.focusedTheme.focus(); 509 } 510 }); 511 } 441 512 } 442 513 }); … … 497 568 _.extend( wp.themes.view.InstallerSearch.prototype, { 498 569 doSearch: _.debounce( function( value ) { 499 var request = {}; 570 var request = {}, 571 sort = 'featured'; 500 572 501 573 request.search = value; … … 528 600 // Set route 529 601 if ( value ) { 602 wp.themes.utils.title( value ); 530 603 wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.searchPath + value ), { replace: true } ); 531 604 } else { 532 wp.themes.router.navigate( wp.themes.router.baseUrl( '' ) ); 605 wp.themes.router.navigate( wp.themes.router.baseUrl( themes.router.browsePath + sort ) ); 606 this.parent.sort( sort ); 533 607 } 534 608 }, 300 ) … … 582 656 request.author = author; 583 657 self.view.collection.query( request ); 658 wp.themes.utils.title( author ); 584 659 }); 585 660 }
Note: See TracChangeset
for help on using the changeset viewer.