diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/feedback/feedback.js | 73 | ||||
-rw-r--r-- | script/postman.js | 4 |
2 files changed, 77 insertions, 0 deletions
diff --git a/script/feedback/feedback.js b/script/feedback/feedback.js new file mode 100644 index 0000000..97940cf --- /dev/null +++ b/script/feedback/feedback.js @@ -0,0 +1,73 @@ +jQuery(document).ready(function($) { + + $( '#the-list #postman-plugin-disbale-link' ).click(function(e) { + e.preventDefault(); + + var reason = $( '#postman-feedback-dialog-content .postman-reason' ), + deactivateLink = $( this ).attr( 'href' ); + + $( "#postman-feedback-dialog-content" ).dialog({ + title: 'Post SMTP Feedback Form', + dialogClass: 'postman-feedback-dialog-form', + resizable: false, + minWidth: 400, + minHeight: 300, + modal: true, + buttons: { + 'skip' : { + text: 'Skip', + id: 'postman-feedback-dialog-skip', + click: function() { + $( this ).dialog( "close" ); + + location.href = deactivateLink; + } + }, + 'go' : { + text: 'Continue', + id: 'postman-feedback-dialog-go', + class: 'button', + click: function() { + $( this ).dialog( "close" ); + + var form = $( this ).find( 'form' ).serializeArray(), + result = {}; + + $.each( form, function() { + if ( '' !== this.value ) + result[ this.name ] = this.value; + }); + + if ( ! jQuery.isEmptyObject( result ) ) { + result.action = 'post_user_feedback'; + + $.post( post_feedback.admin_ajax, result, function(result) { + + }); + } + + // Remove this comment to deactivate plugin + location.href = deactivateLink; + }, + }, + 'cancel' : { + text: 'Cancel', + id: 'postman-feedback-dialog-cancel', + class: 'button button-primary', + click: function() { + $( this ).dialog( "close" ); + } + } + } + }); + + reason.change(function() { + $( '.postman-reason-input' ).hide(); + + if ( $( this ).hasClass( 'postman-custom-input' ) ) { + $( this ).find( '.postman-reason-input' ).show(); + } + }); + + }); +});
\ No newline at end of file diff --git a/script/postman.js b/script/postman.js index f019dbb..c6c0e98 100644 --- a/script/postman.js +++ b/script/postman.js @@ -1,3 +1,7 @@ +jQuery(document).ready(function($) { + $( ".email-log-date" ).datepicker(); +}); + var redirectUrlWarning = false; if (!console) console = { |