File tree Expand file tree Collapse file tree 5 files changed +15
-16
lines changed
Resources/Public/JavaScript Expand file tree Collapse file tree 5 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1+ /.idea
Original file line number Diff line number Diff line change 1313
1414class AjaxFormController extends ActionController
1515{
16-
1716 /**
1817 * @var Context
1918 */
2019 protected $ securityContext ;
20+
2121 /**
2222 * @Flow\Inject
2323 * @var \Neos\Flow\I18n\Service
2424 */
2525 protected $ i18nService ;
2626
27-
2827 /**
2928 * Injects the Security Context
3029 *
@@ -40,15 +39,18 @@ public function injectSecurityContext(Context $securityContext)
4039 * @param string $formIdentifier
4140 * @param string $presetName
4241 * @param string $locale
42+ * @throws \Neos\Flow\I18n\Exception\InvalidLocaleIdentifierException
4343 */
4444 public function indexAction ($ formIdentifier , $ presetName , $ locale = '' )
4545 {
4646 if (!empty ($ locale )) {
4747 $ currentLocale = new Locale ($ locale );
4848 $ this ->i18nService ->getConfiguration ()->setCurrentLocale ($ currentLocale );
4949 }
50- $ this ->view ->assign ('formIdentifier ' , $ formIdentifier );
51- $ this ->view ->assign ('presetName ' , $ presetName );
52- }
5350
51+ $ this ->view ->assignMultiple ([
52+ 'formIdentifier ' => $ formIdentifier ,
53+ 'presetName ' => $ presetName ,
54+ ]);
55+ }
5456}
Original file line number Diff line number Diff line change 1- ---
21-
32 name : ' Ajax Form Endpoint'
43 uriPattern : ' __form/{formIdentifier}/{presetName}(/{locale})'
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ var AjaxForm = (function () {
1010 this . _form = element . querySelector ( 'form' ) ;
1111 if ( ! this . _form ) {
1212 throw new Error ( 'No form element found in ajax container' ) ;
13- }
14- else {
13+ } else {
1514 this . bindFormSubmitListener ( ) ;
1615 }
1716 }
@@ -33,16 +32,14 @@ var AjaxForm = (function () {
3332 this . _form = this . _delegator . querySelector ( 'form' ) ;
3433 if ( this . _form ) {
3534 this . bindFormSubmitListener ( ) ;
36- }
37- else {
35+ } else {
3836 if ( this . _request . response . indexOf ( 'data-reset-form' ) > - 1 ) {
3937 window . setTimeout ( function ( ) {
4038 _this . ajax ( null , _this . handleResponse . bind ( _this ) ) ;
4139 } , 5000 ) ;
4240 }
4341 }
44- }
45- else {
42+ } else {
4643 console . error ( 'Something went wrong with the ajax form request' ) ;
4744 }
4845 } ;
@@ -69,7 +66,7 @@ var AjaxForm = (function () {
6966 return AjaxForm ;
7067} ( ) ) ;
7168( function ( ) {
72- document . addEventListener ( " DOMContentLoaded" , function ( ) {
69+ document . addEventListener ( ' DOMContentLoaded' , function ( ) {
7370 var ajaxForms = document . querySelectorAll ( '[data-ajax="ajax-form"]' ) ;
7471 for ( var i = 0 ; i < ajaxForms . length ; i ++ ) {
7572 new AjaxForm ( ajaxForms . item ( i ) ) ;
Original file line number Diff line number Diff line change 66 " MIT"
77 ],
88 "require" : {
9- "neos/neos" : " ~3.0 | ^4.0" ,
10- "neos/nodetypes-form" : " ~3.0 | ^4.0"
9+ "neos/neos" : " ~3.0 || ^4.0 || ^5 .0" ,
10+ "neos/nodetypes-form" : " ~3.0 || ^4.0 || ^5 .0"
1111 },
1212 "autoload" : {
1313 "psr-4" : {
9494 " Neos.Neos.Ui-20190319094900"
9595 ]
9696 }
97- }
97+ }
You can’t perform that action at this time.
0 commit comments