~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

Viewing changes to wp-admin/js/theme.js

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:05:37 UTC
  • mfrom: (1.1.1 wp4-upstream)
  • Revision ID: nick.moffitt@canonical.com-20150115110537-8bp1y42eyg0jsa7c
Tags: 4.1
MergeĀ upstreamĀ versionĀ 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
763
763
 
764
764
                this.$el.html( this.html( data ) );
765
765
 
766
 
                themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );
 
766
                themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: true } );
767
767
 
768
768
                this.$el.fadeIn( 200, function() {
769
769
                        $( 'body' ).addClass( 'theme-installer-active full-overlay-active' );
824
824
        index: 0,
825
825
 
826
826
        // The theme count element
827
 
        count: $( '.theme-count' ),
 
827
        count: $( '.wp-filter .theme-count' ),
828
828
 
829
829
        initialize: function( options ) {
830
830
                var self = this;
996
996
                this.model = self.collection.get( id );
997
997
 
998
998
                // Trigger a route update for the current model
999
 
                themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.id ) );
 
999
                themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.id ) );
1000
1000
 
1001
1001
                // Sets this.view to 'detail'
1002
1002
                this.setView( 'detail' );
1132
1132
 
1133
1133
                // Update the URL hash
1134
1134
                if ( event.target.value ) {
1135
 
                        themes.router.navigate( themes.router.baseUrl( '?search=' + event.target.value ), options );
 
1135
                        themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + event.target.value ), options );
1136
1136
                } else {
1137
1137
                        themes.router.navigate( themes.router.baseUrl( '' ) );
1138
1138
                }
1142
1142
                var url = themes.router.baseUrl( '' );
1143
1143
 
1144
1144
                if ( event.target.value ) {
1145
 
                        url = themes.router.baseUrl( '?search=' + event.target.value );
 
1145
                        url = themes.router.baseUrl( themes.router.searchPath + event.target.value );
1146
1146
                }
1147
1147
 
1148
1148
                this.searching = false;
1167
1167
                return 'themes.php' + url;
1168
1168
        },
1169
1169
 
 
1170
        themePath: '?theme=',
 
1171
        searchPath: '?search=',
 
1172
 
1170
1173
        search: function( query ) {
1171
1174
                $( '.wp-filter-search' ).val( query );
1172
1175
        },
1296
1299
                this.collection.query( request );
1297
1300
 
1298
1301
                // Set route
1299
 
                themes.router.navigate( themes.router.baseUrl( '?search=' + value ), { replace: true } );
 
1302
                themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + value ), { replace: true } );
1300
1303
        }, 300 )
1301
1304
});
1302
1305
 
1395
1398
                this.sort( sort );
1396
1399
 
1397
1400
                // Trigger a router.naviagte update
1398
 
                themes.router.navigate( themes.router.baseUrl( '?browse=' + sort ) );
 
1401
                themes.router.navigate( themes.router.baseUrl( themes.router.browsePath + sort ) );
1399
1402
        },
1400
1403
 
1401
1404
        sort: function( sort ) {
1568
1571
                return 'theme-install.php' + url;
1569
1572
        },
1570
1573
 
 
1574
        themePath: '?theme=',
 
1575
        browsePath: '?browse=',
 
1576
        searchPath: '?search=',
 
1577
 
1571
1578
        search: function( query ) {
1572
1579
                $( '.wp-filter-search' ).val( query );
1573
1580
        },
1659
1666
        } else {
1660
1667
                themes.Run.init();
1661
1668
        }
 
1669
 
 
1670
        $( '.broken-themes .delete-theme' ).on( 'click', function() {
 
1671
                return confirm( _wpThemeSettings.settings.confirmDelete );
 
1672
        });
1662
1673
});
1663
1674
 
1664
1675
})( jQuery );