]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/js/theme.dev.js
Wordpress 3.3.1
[autoinstalls/wordpress.git] / wp-admin / js / theme.dev.js
1 var ThemeViewer;
2
3 (function($){
4         ThemeViewer = function( args ) {
5
6                 function init() {
7                         $( '#filter-click, #mini-filter-click' ).unbind( 'click' ).click( function() {
8                                 $( '#filter-click' ).toggleClass( 'current' );
9                                 $( '#filter-box' ).slideToggle();
10                                 $( '#current-theme' ).slideToggle( 300 );
11                                 return false;
12                         });
13
14                         $( '#filter-box :checkbox' ).unbind( 'click' ).click( function() {
15                                 var count = $( '#filter-box :checked' ).length,
16                                         text  = $( '#filter-click' ).text();
17
18                                 if ( text.indexOf( '(' ) != -1 )
19                                         text = text.substr( 0, text.indexOf( '(' ) );
20
21                                 if ( count == 0 )
22                                         $( '#filter-click' ).text( text );
23                                 else
24                                         $( '#filter-click' ).text( text + ' (' + count + ')' );
25                         });
26
27                         /* $('#filter-box :submit').unbind( 'click' ).click(function() {
28                                 var features = [];
29                                 $('#filter-box :checked').each(function() {
30                                         features.push($(this).val());
31                                 });
32
33                                 listTable.update_rows({'features': features}, true, function() {
34                                         $( '#filter-click' ).toggleClass( 'current' );
35                                         $( '#filter-box' ).slideToggle();
36                                         $( '#current-theme' ).slideToggle( 300 );
37                                 });
38
39                                 return false;
40                         }); */
41                 }
42
43                 // These are the functions we expose
44                 var api = {
45                         init: init
46                 };
47
48         return api;
49         }
50 })(jQuery);
51
52 jQuery( document ).ready( function($) {
53         theme_viewer = new ThemeViewer();
54         theme_viewer.init();
55 });