1jQuery( document ).ready( function( $ ) { 2 $('.complete-event').click(function(e) { 3 e.preventDefault(); 4 const event_id = $( this ).attr( 'data-event-id' ); 5 6 $('.dx-confirmation-popup-wrapper').addClass('confirmation-is-visible'); 7 $('.button-primary-confirmation').attr('data-event-id', event_id); 8 const name = $( this ).closest( 'tr' ).find( '.event-name' ).text(); 9 $('.dx-confirmation-text').html(`Are you sure you want to complete ${name} ?`); 10 }); 11 12 $('.button-primary-confirmation').click(function(e) { 13 e.preventDefault(); 14 const event_id = $( this ).attr( 'data-event-id' ); 15 const data = { 16 'action': 'dxbpm_complete_event', 17 'event_id': event_id, 18 }; 19 20 $.post( BPM_FORM.ajaxurl, data, function( response ) { 21 window.location.reload(); 22 } ); 23 $('.dx-confirmation-popup-wrapper').removeClass('confirmation-is-visible'); 24 }); 25 26 $('.button-secondary-confirmation').click(function(e) { 27 e.preventDefault(); 28 $('.dx-confirmation-popup-wrapper').removeClass('confirmation-is-visible'); 29 }); 30 31 // BPM Theme Memo Functionality 32 $memoActivateButtonAdd = $(".activities-memo-add"); 33 $memoActivateButtonView = $(".activities-memo-view"); 34 $memoMessage = $(".dx-message-wrapper"); 35 $memoPopup = $(".dx-memo-popup-wrapper"); 36 $memoPopupConfirm = $(".button-primary-memo"); 37 $memoPopupClear = $(".button-clear-memo"); 38 $memoPopupClearSave = $(".button-clear-save-memo"); 39 $memoPopupDiscard = $(".button-secondary-memo"); 40 $memoMessageDiscard = $(".button-primary-message"); 41 $memoMessageClose = $(".button-secondary-message"); 42 43 $memoActivateButtonAdd.click(function(e) { 44 // We'll have to send the event ID to the backend, so let's store it in the modal's markup. 45 let activityId = $(e.currentTarget).closest('[id^=today_event-]').attr('id').split('-')[1]; 46 $('.dx-memo-activity').val(activityId); 47 let data = { 48 'action': 'dxbpm_get_memo', 49 'activity_id': activityId, 50 }; 51 $.post( BPM_FORM.ajaxurl, data, function( response ) { 52 $(".dx-memo-text").val(response); 53 // Display the modal 54 $memoPopup.css("pointer-events", "all"); 55 $memoPopup.css("opacity", "1"); 56 $memoPopup.css("transition", ".3s"); 57 }); 58 }); 59 60 $memoPopupConfirm.click(function() { 61 $memoPopup.css("opacity", "0"); 62 $memoPopup.css("pointer-events", "none"); 63 let memoValue = $(".dx-memo-text").val(); 64 let activityId = $('.dx-memo-activity').val(); 65 let data = { 66 'action': 'dxbpm_submit_memo', 67 'activity_id': activityId, 68 'memo_text': memoValue 69 }; 70 $.post(BPM_FORM.ajaxurl, data); 71 }); 72 73 $memoPopupClear.click(function() { 74 $(".dx-memo-text").val(''); 75 }); 76 77 $memoPopupClearSave.click(function() { 78 $(".dx-memo-text").val(''); 79 $memoPopupConfirm.click(); 80 }); 81 82 $memoPopupDiscard.click(function() { 83 $memoPopup.css("opacity", "0"); 84 $memoPopup.css("pointer-events", "none"); 85 $(this).closest(".dx-message-text").html(''); 86 }); 87 88 $memoActivateButtonView.click(function() { 89 $memoMessage.css("pointer-events", "all"); 90 $memoMessage.css("opacity", "1"); 91 $memoMessage.css("transition", ".3s"); 92 }); 93 94 $memoMessageClose.click(function() { 95 $memoMessage.css("opacity", "0"); 96 $memoMessage.css("pointer-events", "none"); 97 }); 98} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.