| [ Index ] |
PHP Cross Reference of GlotPress |
[Summary view] [Print] [Text view]
1 jQuery(function($) { 2 $gp.showhide('#upper-filters-toolbar a.sort', '#upper-filters-toolbar dl.sort', { 3 show_text: 'Sort ↓', 4 hide_text: 'Sort ↑', 5 focus: '#sort\\[by\\]' 6 }); 7 $gp.showhide('#upper-filters-toolbar a.filter', '#upper-filters-toolbar dl.filters', { 8 show_text: 'Filter ↓', 9 hide_text: 'Filter ↑', 10 focus: '#filters\\[term\\]' 11 }); 12 13 var rows_checked = 0; 14 15 $('form.filters-toolbar.bulk-actions').submit(function(e) { 16 var row_ids = $('input:checked', $('table#translations th.checkbox')).map(function() { 17 return $(this).parents('tr.preview').attr('row'); 18 }).get().join(','); 19 $('input[name="bulk[row-ids]"]', $(this)).val(row_ids); 20 }); 21 22 $('a#export').click(function() { 23 var format = $('#export-format').val(); 24 var what_to_export = $('#what-to-export').val(); 25 var url = ''; 26 if (what_to_export == 'filtered') { 27 var separator = ( $(this).attr('filters').indexOf('?') == -1 )? '?' : '&'; 28 url = $(this).attr('filters') + separator + 'format='+format; 29 } else { 30 url = $(this).attr('href') + '?format='+format; 31 } 32 window.location = url; 33 return false; 34 }); 35 36 var lastClicked = false; 37 // Check all checkboxes from WP common.js, synced with [20400] 38 $('tbody').children().children('.checkbox').find(':checkbox').click( function(e) { 39 if ( 'undefined' == e.shiftKey ) { return true; } 40 if ( e.shiftKey ) { 41 if ( !lastClicked ) { return true; } 42 checks = $( lastClicked ).closest( 'table' ).find( ':checkbox' ); 43 first = checks.index( lastClicked ); 44 last = checks.index( this ); 45 checked = $(this).prop('checked'); 46 if ( 0 < first && 0 < last && first != last ) { 47 checks.slice( first, last ).prop( 'checked', function(){ 48 if ( $(this).closest('tr').is(':visible') ) 49 return checked; 50 51 return false; 52 }); 53 } 54 } 55 lastClicked = this; 56 return true; 57 }); 58 59 $('thead, tfoot').find('.checkbox :checkbox').click( function(e) { 60 var c = $(this).prop('checked'), 61 kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard, 62 toggle = e.shiftKey || kbtoggle; 63 64 $(this).closest( 'table' ).children( 'tbody' ).filter(':visible') 65 .children().children('.checkbox').find(':checkbox') 66 .prop('checked', function() { 67 if ( $(this).closest('tr').is(':hidden') ) 68 return false; 69 if ( toggle ) 70 return $(this).prop( 'checked' ); 71 else if (c) 72 return true; 73 return false; 74 }); 75 76 $(this).closest('table').children('thead, tfoot').filter(':visible') 77 .children().children('.checkbox').find(':checkbox') 78 .prop('checked', function() { 79 if ( toggle ) 80 return false; 81 else if (c) 82 return true; 83 return false; 84 }); 85 }); 86 });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu May 24 03:59:35 2012 | Hosted by follow the white rabbit. |