Ticket #2941: 2941.patch
| File 2941.patch, 2.0 KB (added by , 8 years ago) |
|---|
-
wordpress.org/public_html/wp-content/plugins/plugin-directory/js/edit-form.js
4 4 5 5 ( function( $, wp, pluginDirectory ) { 6 6 var PluginEdit = { 7 $testedWith: {},8 7 9 8 ready: function() { 10 PluginEdit.$testedWith = $( '#tested-with-select');9 $( '#submitdiv' ).on( 'click', '.set-plugin-status', PluginEdit.setPluginStatus ); 11 10 12 $( '#submitdiv' )13 .on( 'click', '.edit-tested-with', PluginEdit.editTestedWith )14 .on( 'click', '.save-tested-with', PluginEdit.updateTestedWith )15 .on( 'click', '.cancel-tested-with', PluginEdit.cancelTestedWith )16 .on( 'click', '.set-plugin-status', PluginEdit.setPluginStatus );17 18 11 _.each( $( '#post-body' ).find( '.comments-box' ), PluginEdit.loadComments ); 19 12 20 13 $( '#add-new-comment' ).on( 'click', 'a.button', PluginEdit.prepareCommentForm ); … … 39 32 $( '#contact-author' ).appendTo( '#plugin-review .inside' ); 40 33 }, 41 34 42 editTestedWith: function() {43 if ( PluginEdit.$testedWith.is( ':hidden' ) ) {44 PluginEdit.$testedWith.slideDown( 'fast', function() {45 $( 'select', PluginEdit.$testedWith ).focus();46 } );47 $( this ).hide();48 }49 },50 51 updateTestedWith: function() {52 PluginEdit.$testedWith.slideUp( 'fast' ).siblings( 'button.edit-tested-with' ).show().focus();53 $( '#tested-with-display' ).text( $( 'option:selected', PluginEdit.$testedWith ).text() );54 },55 56 cancelTestedWith: function() {57 $( '#tested-with' ).val( $( '#hidden-tested-with' ).val() );58 PluginEdit.updateTestedWith();59 },60 61 35 setPluginStatus: function() { 62 36 if ( 'approved' === $(this).val() ) { 63 37 return confirm( pluginDirectory.approvePluginAYS ); … … 135 109 $( '#committer-error' ).empty().hide(); 136 110 } 137 111 } 112 138 113 }; 139 114 140 115 $( PluginEdit.ready );