Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cc 409 admin dejquery #685

Open
wants to merge 50 commits into
base: release280
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cc26709
rewrite forms file to be jQuery-less
tw2113 Jul 31, 2024
cf3b059
Due to the fact that I can't find anything in the current codebase th…
tw2113 Jul 31, 2024
6ba23ce
begin conversion to vanilla js for ajax plugin
tw2113 Jul 31, 2024
a55baab
early ajax conversion work
tw2113 Aug 5, 2024
e2e8a91
remove the passing in of jQuery
tw2113 Aug 5, 2024
b00f620
remove jquery dependency in clipboard file
tw2113 Aug 5, 2024
05556e2
handle possible many selected items
tw2113 Aug 6, 2024
d71c69f
we no longer have a newsletter signup form in our newsletter plugin
tw2113 Aug 6, 2024
9bcee39
merge in changes from what should be a 2.6.1 release
tw2113 Aug 12, 2024
0a33f46
handle change events
tw2113 Aug 12, 2024
ffa09cc
begin builder file conversion
tw2113 Aug 12, 2024
8b68741
refactor "that.noUniqueWarning" function
tw2113 Aug 13, 2024
2efd006
initialie our function directly instead of through jQuery
tw2113 Aug 13, 2024
e341e88
fill in some documentation about functionality
tw2113 Aug 13, 2024
68aa304
remove beforeunload event listener
tw2113 Aug 19, 2024
032c6d8
rework validateUniqueFieldLabels
tw2113 Aug 19, 2024
314f37c
rework duplicates removal
tw2113 Aug 19, 2024
8bced4e
code cleanup/linting
tw2113 Aug 19, 2024
45dbfbb
handle proper add/remove for events
tw2113 Aug 19, 2024
efbe402
convert modifyFields function
tw2113 Aug 19, 2024
9bd1991
commit all of our source changes for now to avoid stash loss
tw2113 Sep 4, 2024
52876d4
rename our request action
tw2113 Sep 4, 2024
b4f6df1
Feature/cc 426 new update notification (#674)
tw2113 Sep 11, 2024
7cbbd48
make same chagnes from #682 into our branch and src file here
tw2113 Sep 18, 2024
490482e
misc extra whitspace removal
tw2113 Sep 18, 2024
33a445e
reset this file from main, reapply as able slowly after
tw2113 Sep 18, 2024
7ad3bfe
add an ID to our specific modal popup
tw2113 Sep 20, 2024
ca8476f
revise our clear first form ajax handler to have better return values.
tw2113 Sep 20, 2024
8d4bc2f
remove the majority of the jQuery from our modal file. Leaving some p…
tw2113 Sep 20, 2024
b4672c9
provide some custom review action statuses
tw2113 Sep 21, 2024
56b25ab
rework our fetch ajax usage to one that is presently working
tw2113 Sep 21, 2024
11d4049
compiled versions at this point in time
tw2113 Sep 21, 2024
3b2a903
initially finish off completion of converting the bindevents function…
tw2113 Sep 24, 2024
f1ca1ca
build files
tw2113 Sep 24, 2024
1aa72d8
revise our unload handling to be modern
tw2113 Sep 24, 2024
eea9074
some inital jslint cleanup
tw2113 Sep 24, 2024
0962f42
watch and build files
tw2113 Sep 24, 2024
735d1f4
general code cleanup/alignment on our source files
tw2113 Sep 24, 2024
be010f8
post code cleanup compilation
tw2113 Sep 24, 2024
dc96e66
Merge branch 'release270' into feature/CC-409-admin-dejquery
tw2113 Sep 24, 2024
177e9a6
Feature/cc 438 failed disconnect submission hardening (#684)
tw2113 Oct 8, 2024
ff30665
Fix/cc 440 comment login signup errors (#683)
tw2113 Oct 8, 2024
c1f6f5b
Fix/cc 444 optin ux updates (#682)
tw2113 Oct 8, 2024
3c8ddd0
fill in current changelog items, fill in misse CHANGELOG.md items
tw2113 Oct 8, 2024
0d4bdfc
plugin version bumps for release branch
tw2113 Oct 8, 2024
2af73dd
one of my greatest const-quests in javascript, while letting some rem…
tw2113 Oct 22, 2024
c106f61
build files from new sources
tw2113 Oct 22, 2024
7a2df1e
Merge branch 'release270' into feature/CC-409-admin-dejquery
tw2113 Oct 22, 2024
2346b28
Merge branch 'release280' into feature/CC-409-admin-dejquery
tw2113 Nov 25, 2024
7ab27e4
remove duplicate code
tw2113 Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions assets/js/ctct-plugin-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/ctct-plugin-admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/ctct-plugin-admin.min.js.map

Large diffs are not rendered by default.

64 changes: 30 additions & 34 deletions assets/js/ctct-plugin-admin/ajax.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.CTCTAJAX = {};

( function( window, $, that ) {
(function (window, that) {

/**
* @constructor
Expand All @@ -16,39 +16,35 @@ window.CTCTAJAX = {};

// Handle saving the decision regarding the review prompt admin notice.
that.handleReviewAJAX = () => {
$( '#ctct-admin-notice-review_request' ).on( 'click', 'a', ( e ) => {

var ctctAction = 'dismissed';

if ( $( this ).hasClass( 'ctct-review' ) ) {
ctctAction = 'reviewed';
}

var ctctReviewAjax = {
'action': 'constant_contact_review_ajax_handler',
'ctct-review-action': ctctAction
};

$.ajax( {
url: window.ajaxurl,
data: ctctReviewAjax,
dataType: 'json',
success: ( resp ) => {
if ( window.console ) {
console.log( resp ); // eslint-disable-line no-console
}
e.preventDefault();
$( '#ctct-admin-notice-review_request' ).hide();
},
error: ( x, t, m ) => {
if ( window.console ) {
console.log( [ t, m ] ); // eslint-disable-line no-console
}
const reviewRequest = document.querySelector('#ctct-admin-notice-review_request');
if (reviewRequest) {
reviewRequest.addEventListener('click', (e) => {
e.preventDefault();
let ctctAction;
if (e.target.matches('.ctct-notice-dismiss')) {
ctctAction = 'dismissed';
} else if (e.target.matches('.ctct-review')) {
ctctAction = 'reviewed';
}
} );
} );
};

$( that.init );
const data = new FormData();
data.append('action', 'constant_contact_review_ajax_handler');
data.append('ctct_review_action', ctctAction);

fetch(window.ajaxurl, options = {
method: 'POST', body: data,
})
.then((response) => response.json())
.then((response) => {
if (response.success) {
reviewRequest.style.display = 'none';
}
}).catch((error) => {
console.log(error);
});
});
}
};

} ( window, jQuery, window.CTCTAJAX ) );
that.init();
}(window, window.CTCTAJAX));
Loading