-
Notifications
You must be signed in to change notification settings - Fork 164
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
Integrate new file fields #2775
Changes from 53 commits
a7f60d4
8f4043c
d0a6192
3f2f791
b96204b
26b7a9c
51184d1
f449034
ba2d295
769cfe2
b727677
a52b1fc
9ecc5d6
800f711
ec664fc
9b020f5
93b3f13
4ff1985
626b610
f371307
3aba811
8fbf3f8
d215155
757fbce
4ab7fba
fb9ca9c
200bfb7
791beab
937886d
cba3b5f
3030301
539c3fc
19283f6
abad92d
9a940b5
dbf12fe
bd88ae6
9056df9
22e0677
43a544c
1e350de
6714093
e3cae9d
c6421a4
595bcc8
36bb1b9
c72dca5
e19b9ed
51c576e
32d6ff7
e405c72
d727e1e
60f89fa
7c1c1b1
94f1560
958abd7
2603d30
96e0d91
4864322
832e13e
450de92
3e376b9
5d38eab
118bde4
77313f5
9eafdd7
2724d29
c9e1ff5
6734d80
f514415
a026719
27dd274
323d96c
cb0f428
d3fb9c4
1e92ca8
dcf98b6
a49d116
09cd536
6e31b75
67c1427
c850d41
7891502
e497b8e
9d76ad6
be6d6ea
0b0c94e
4d04990
a8fa334
10bc215
8800eed
d76d57e
2b48a85
71cc344
9e33d6d
7ff3749
d1f48a5
6baa6fd
7776bbc
0b8e88c
6859891
3365fff
c6f6877
6505f50
954c14e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ wordpress | |
wp-content | ||
cypress/screenshots | ||
cypress/videos | ||
build | ||
build | ||
|
||
wp-test-case |
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,22 +129,43 @@ jQuery(function($){ | |
|
||
ev.preventDefault(); | ||
|
||
var form = $(el), | ||
buttons = form.find(':submit'); | ||
|
||
if( form.data('_cf_manual') ){ | ||
form.find('[name="cfajax"]').remove(); | ||
var $form = $(el), | ||
buttons = $form.find(':submit'); | ||
var pending = []; | ||
|
||
/** | ||
* This event is triggered directly before the request for form submission is made | ||
* | ||
* Runs after cf.form.submit | ||
* | ||
* @since 1.8.0 | ||
*/ | ||
$( document ).trigger( 'cf.form.request', { | ||
$form: $form, | ||
formIdAttr: $form.attr( 'id' ) | ||
}); | ||
|
||
//Check if any cf2 fields are blocking submit | ||
var cf2 = window.cf2[ $form.attr( 'id' ) ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @New0 I shoved it into a window scoped object I was already using. That's better than a window scope object, I think. |
||
if( 'object' === typeof cf2 ){ | ||
if( cf2.hasOwnProperty( 'pending' ) && cf2.pending.length ){ | ||
return false; | ||
} | ||
} | ||
|
||
if( $form.data('_cf_manual') ){ | ||
$form.find('[name="cfajax"]').remove(); | ||
return false; | ||
} | ||
|
||
if( !form.data( 'postDisable' ) ){ | ||
if( !$form.data( 'postDisable' ) ){ | ||
buttons.prop('disabled',true); | ||
} | ||
|
||
|
||
if( typeof cf_uploader_filelist === 'object' ){ | ||
// verify required | ||
form.find('.cf-uploader-trigger').slideUp(); | ||
$form.find('.cf-uploader-trigger').slideUp(); | ||
// setup file uploader | ||
var has_files = false; | ||
var count = cf_upload_queue.length; | ||
|
@@ -161,7 +182,7 @@ jQuery(function($){ | |
data.append( field.data('field'), cf_uploader_filelist[ file ].file ); | ||
data.append( 'field', field.data('field') ); | ||
data.append( 'control', field.data('controlid') ); | ||
cf_push_file_upload( form, file_number, data ); | ||
cf_push_file_upload( $form, file_number, data ); | ||
field.val('');//@see https://github.com/CalderaWP/Caldera-Forms/issues/2514#issuecomment-395213433 | ||
field.attr('type','hidden'); | ||
field.val(field.data('controlid')); | ||
|
@@ -176,6 +197,10 @@ jQuery(function($){ | |
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
}, | ||
error : function( obj ){ | ||
if( obj.jqxhr.status === 404){ | ||
|
@@ -286,4 +311,4 @@ jQuery(function($){ | |
}; | ||
|
||
resBaldrickTriggers(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@New0 Should we be sharing phpStorm settings? Not sure mine are to blame or yours, but this is not optimal.
We need eslint or prettier #2485
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely @Shelob9, do you to share your code style settings ?
https://www.jetbrains.com/help/idea/copying-code-style-settings.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL I have that post in my list of things to do. I'll try it out today.