From 9ffc063a080d22470f2ddd0b8a714af0f659bf15 Mon Sep 17 00:00:00 2001 From: Dennis Irmscher Date: Tue, 29 Aug 2017 11:28:50 +0200 Subject: [PATCH 1/6] Added bower.json --- Configuration/Settings.yaml | 2 ++ .../Private/Fusion/ProtoTypes/Page.fusion | 2 ++ bower.json | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 bower.json diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index e9f805f..13ff736 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -1,3 +1,5 @@ +ObisConcept: + includeFrontendAssets: true Neos: Flow: mvc: diff --git a/Resources/Private/Fusion/ProtoTypes/Page.fusion b/Resources/Private/Fusion/ProtoTypes/Page.fusion index 85f9394..7678df5 100644 --- a/Resources/Private/Fusion/ProtoTypes/Page.fusion +++ b/Resources/Private/Fusion/ProtoTypes/Page.fusion @@ -12,6 +12,7 @@ prototype(Neos.Neos:Page) { path = 'resource://ObisConcept.NeosAjaxForm/Public/JavaScript/main.min.js' } } + @if.includeFrontendAssets = ${Configuration.setting('ObisConcept.includeFrontendAssets')} } ajaxFormBackendJs = Neos.Fusion:Tag { @@ -24,6 +25,7 @@ prototype(Neos.Neos:Page) { } } @if.onlyRenderWhenNotInLiveWorkspace = ${node.context.workspace.name != 'live'} + @if.includeFrontendAssets = ${Configuration.setting('ObisConcept.includeFrontendAssets')} } } diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..1a73b89 --- /dev/null +++ b/bower.json @@ -0,0 +1,20 @@ +{ + "name": "obisconcept-neos-ajax-form", + "description": "A Neos CMS package to load and submit forms with ajax", + "main": [ + "Resources/Private/Assets/JavaScript/main.js" + ], + "license": "MIT", + "ignore": [ + "Classes", + "Resources/Fusion", + "Resources/Templates", + "Resources/Translations", + "composer.json", + "gulpfile.js", + "package.json" + ], + "dependencies": { + "jquery": "1.9.1 - 3" + } +} From a00b808ccf23d0e5daab6b553302f4e60959df4b Mon Sep 17 00:00:00 2001 From: Dennis Irmscher Date: Tue, 29 Aug 2017 11:46:41 +0200 Subject: [PATCH 2/6] Fixed bower ignore --- bower.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 1a73b89..7d6ca48 100644 --- a/bower.json +++ b/bower.json @@ -7,9 +7,10 @@ "license": "MIT", "ignore": [ "Classes", - "Resources/Fusion", - "Resources/Templates", - "Resources/Translations", + "Configuration", + "Resources/Private/Fusion", + "Resources/Private/Templates", + "Resources/Private/Translations", "composer.json", "gulpfile.js", "package.json" From c3b4bcb415c6efe82f1d2d20afa857f64fbb82da Mon Sep 17 00:00:00 2001 From: Maximilian Schmidt Date: Wed, 13 Sep 2017 12:46:52 +0200 Subject: [PATCH 3/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 61bfcab..df594af 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "obisconcept/neos-ajax-form", + "name": "mcstreetguy/neos-ajax-form", "type": "neos-plugin", "authors": [ { From ba3165624be24e36384d43b269a1c2f2517459a5 Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Wed, 13 Sep 2017 12:55:42 +0200 Subject: [PATCH 4/6] FIX: Submit handler called twice --- Resources/Private/Assets/JavaScript/main.js | 2 +- Resources/Public/JavaScript/backend.min.js | 2 +- Resources/Public/JavaScript/main.js | 2 +- Resources/Public/JavaScript/main.min.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/Private/Assets/JavaScript/main.js b/Resources/Private/Assets/JavaScript/main.js index 864b749..b24d4b3 100755 --- a/Resources/Private/Assets/JavaScript/main.js +++ b/Resources/Private/Assets/JavaScript/main.js @@ -23,7 +23,7 @@ window.initAjaxForm = function() { var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : '' ) + presetName + '/' + formIdentifier; - $(ajaxForm).on('submit', 'form', function (e) { + $(ajaxForm).off('submit').on('submit', 'form', function (e) { var formObj = $(this); var formURL = formObj.attr('action'); diff --git a/Resources/Public/JavaScript/backend.min.js b/Resources/Public/JavaScript/backend.min.js index 984afbd..6c7357e 100644 --- a/Resources/Public/JavaScript/backend.min.js +++ b/Resources/Public/JavaScript/backend.min.js @@ -1,2 +1,2 @@ "function"==typeof document.addEventListener&&document.addEventListener("Neos.PageLoaded",function(e){initAjaxForm()}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhY2tlbmQuanMiXSwibmFtZXMiOlsiZG9jdW1lbnQiLCJhZGRFdmVudExpc3RlbmVyIiwiZXZlbnQiLCJpbml0QWpheEZvcm0iXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFBQSxVQUFBQyxrQkFFQUQsU0FBQUMsaUJBQUEsa0JBQUEsU0FBQUMsR0FFQUMiLCJmaWxlIjoiYmFja2VuZC5taW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpZiAodHlwZW9mIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIgPT09ICdmdW5jdGlvbicpIHtcblxuICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ05lb3MuUGFnZUxvYWRlZCcsIGZ1bmN0aW9uKGV2ZW50KSB7XG5cbiAgICAgICAgaW5pdEFqYXhGb3JtKCk7XG5cbiAgICB9KTtcblxufVxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhY2tlbmQuanMiXSwibmFtZXMiOlsiZG9jdW1lbnQiLCJhZGRFdmVudExpc3RlbmVyIiwiZXZlbnQiLCJpbml0QWpheEZvcm0iXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFBQSxVQUFBQyxrQkFFQUQsU0FBQUMsaUJBQUEsa0JBQUEsU0FBQUMsR0FFQUMiLCJmaWxlIjoiYmFja2VuZC5taW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpZiAodHlwZW9mIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIgPT09ICdmdW5jdGlvbicpIHtcblxuICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ05lb3MuUGFnZUxvYWRlZCcsIGZ1bmN0aW9uKGV2ZW50KSB7XG5cbiAgICAgICAgaW5pdEFqYXhGb3JtKCk7XG5cbiAgICB9KTtcblxufVxuIl19 diff --git a/Resources/Public/JavaScript/main.js b/Resources/Public/JavaScript/main.js index 864b749..b24d4b3 100755 --- a/Resources/Public/JavaScript/main.js +++ b/Resources/Public/JavaScript/main.js @@ -23,7 +23,7 @@ window.initAjaxForm = function() { var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : '' ) + presetName + '/' + formIdentifier; - $(ajaxForm).on('submit', 'form', function (e) { + $(ajaxForm).off('submit').on('submit', 'form', function (e) { var formObj = $(this); var formURL = formObj.attr('action'); diff --git a/Resources/Public/JavaScript/main.min.js b/Resources/Public/JavaScript/main.min.js index f068f5e..038e161 100755 --- a/Resources/Public/JavaScript/main.min.js +++ b/Resources/Public/JavaScript/main.min.js @@ -1,2 +1,2 @@ -$(document).ready(function(){initAjaxForm()}),window.initButtonClickHandler=function(){$('.ajax-form button[type="submit"]').on("click",function(){$('.ajax-form button[type="submit"]').removeAttr("clicked"),$(this).attr("clicked","true")})},window.initAjaxForm=function(){$.each($(".ajax-form"),function(t,a){var n=$(a).attr("data-identifier"),e=$(a).attr("data-preset-name"),i=$(a).attr("data-dimension"),c=location.protocol+"//"+location.host+"/form/"+(""!=i?i+"/":"")+e+"/"+n;$(a).on("submit","form",function(t){var n=$(this),e=n.attr("action"),i=new FormData(this),c=$(this).find('button[clicked="true"]');i.append($(c).attr("name"),$(c).attr("value")),$.ajax({url:e,type:"POST",data:i,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,beforeSend:function(){$(a).find(".ajax-content").replaceWith('')},success:function(t){if($(a).find(".ajax-content").replaceWith(t),initButtonClickHandler(),$(a).find(".g-recaptcha").length){var n=$(a).find(".g-recaptcha"),e=n.data("sitekey");grecaptcha.render(n[0],{sitekey:e})}}}),t.preventDefault()}),$(a).load(c+" .ajax-content",function(){if(initButtonClickHandler(),$(this).css("min-height",$(this).css("height")),$(this).find(".g-recaptcha").length){var t=$(this).find(".g-recaptcha"),a=t.data("sitekey");grecaptcha.render(t[0],{sitekey:a})}})})}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsiJCIsImRvY3VtZW50IiwicmVhZHkiLCJpbml0QWpheEZvcm0iLCJ3aW5kb3ciLCJpbml0QnV0dG9uQ2xpY2tIYW5kbGVyIiwib24iLCJyZW1vdmVBdHRyIiwidGhpcyIsImF0dHIiLCJlYWNoIiwiaWR4IiwiYWpheEZvcm0iLCJmb3JtSWRlbnRpZmllciIsInByZXNldE5hbWUiLCJkaW1lbnNpb24iLCJmb3JtQWpheFVybCIsImxvY2F0aW9uIiwicHJvdG9jb2wiLCJob3N0IiwiZSIsImZvcm1PYmoiLCJmb3JtVVJMIiwiZm9ybURhdGEiLCJGb3JtRGF0YSIsInRyaWdnZXIiLCJmaW5kIiwiYXBwZW5kIiwiYWpheCIsInVybCIsInR5cGUiLCJkYXRhIiwibWltZVR5cGUiLCJjb250ZW50VHlwZSIsImNhY2hlIiwicHJvY2Vzc0RhdGEiLCJiZWZvcmVTZW5kIiwicmVwbGFjZVdpdGgiLCJzdWNjZXNzIiwibGVuZ3RoIiwiY2FwdGNoYSIsInNpdGVrZXkiLCJncmVjYXB0Y2hhIiwicmVuZGVyIiwicHJldmVudERlZmF1bHQiLCJsb2FkIiwiY3NzIl0sIm1hcHBpbmdzIjoiQUFBQUEsRUFBQUMsVUFBQUMsTUFBQSxXQUVBQyxpQkFJQUMsT0FBQUMsdUJBQUE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Zvcm0pLmF0dHIoJ2RhdGEtaWRlbnRpZmllcicpO1xuICAgICAgICB2YXIgcHJlc2V0TmFtZSA9ICQoYWpheEZvcm0pLmF0dHIoJ2RhdGEtcHJlc2V0LW5hbWUnKTtcbiAgICAgICAgdmFyIGRpbWVuc2lvbiA9ICQoYWpheEZvcm0pLmF0dHIoJ2RhdGEtZGltZW5zaW9uJyk7XG5cbiAgICAgICAgdmFyIGZvcm1BamF4VXJsID0gbG9jYXRpb24ucHJvdG9jb2wgKyAnLy8nICsgbG9jYXRpb24uaG9zdCArICcvZm9ybS8nICArICggZGltZW5zaW9uICE9ICcnID8gZGltZW5zaW9uICsgJy8nIDogJycgKSArIHByZXNldE5hbWUgKyAnLycgKyBmb3JtSWRlbnRpZmllcjtcblxuICAgICAgICAkKGFqYXhGb3JtKS5vbignc3VibWl0JywgJ2Zvcm0nLCBmdW5jdGlvbiAoZSkge1xuXG4gICAgICAgICAgICB2YXIgZm9ybU9iaiA9ICQodGhpcyk7XG4gICAgICAgICAgICB2YXIgZm9ybVVSTCA9IGZvcm1PYmouYXR0cignYWN0aW9uJyk7XG4gICAgICAgICAgICB2YXIgZm9ybURhdGEgPSBuZXcgRm9ybURhdGEodGhpcyk7XG5cbiAgICAgICAgICAgIHZhciB0cmlnZ2VyID0gJCh0aGlzKS5maW5kKCdidXR0b25bY2xpY2tlZD1cInRydWVcIl0nKTtcblxuICAgICAgICAgICAgZm9ybURhdGEuYXBwZW5kKCQodHJpZ2dlcikuYXR0cignbmFtZScpLCAkKHRyaWdnZXIpLmF0dHIoJ3ZhbHVlJykpO1xuXG4gICAgICAgICAgICAkLmFqYXgoe1xuXG4gICAgICAgICAgICAgICAgdXJsOiBmb3JtVVJMLFxuICAgICAgICAgICAgICAgIHR5cGU6ICdQT1NUJyxcbiAgICAgICAgICAgICAgICBkYXRhOiBmb3JtRGF0YSxcbiAgICAgICAgICAgICAgICBtaW1lVHlwZTogJ211bHRpcGFydC9mb3JtLWRhdGEnLFxuICAgICAgICAgICAgICAgIGNvbnRlbnRUeXBlOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBjYWNoZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgcHJvY2Vzc0RhdGE6IGZhbHNlLFxuICAgICAgICAgICAgICAgIGJlZm9yZVNlbmQ6IGZ1bmN0aW9uICgpIHtcblxuICAgICAgICAgICAgICAgICAgICAkKGFqYXhGb3JtKS5maW5kKCcuYWpheC1jb250ZW50JykucmVwbGFjZVdpdGgoJzxpIGNsYXNzPVwiIGFqYXgtY29udGVudCBmYSBmYS1zcGlubmVyIGZhLXB1bHNlXCI+PC9pPicpO1xuXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzdWNjZXNzOiBmdW5jdGlvbiAoZGF0YSkge1xuXG4gICAgICAgICAgICAgICAgICAgICQoYWpheEZvcm0pLmZpbmQoJy5hamF4LWNvbnRlbnQnKS5yZXBsYWNlV2l0aChkYXRhKTtcblxuICAgICAgICAgICAgICAgICAgICBpbml0QnV0dG9uQ2xpY2tIYW5kbGVyKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCQoYWpheEZvcm0pLmZpbmQoJy5nLXJlY2FwdGNoYScpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgIHZhciBjYXB0Y2hhID0gJChhamF4Rm9ybSkuZmluZCgnLmctcmVjYXB0Y2hhJyk7XG4gICAgICAgICAgICAgICAgICAgICAgdmFyIHNpdGVrZXkgPSBjYXB0Y2hhLmRhdGEoJ3NpdGVrZXknKTtcbiAgICAgICAgICAgICAgICAgICAgICBncmVjYXB0Y2hhLnJlbmRlcihjYXB0Y2hhWzBdLCB7XCJzaXRla2V5XCI6IHNpdGVrZXl9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuXG4gICAgICAgIH0pO1xuXG4gICAgICAgICQoYWpheEZvcm0pLmxvYWQoZm9ybUFqYXhVcmwgKyAnIC5hamF4LWNvbnRlbnQnLCBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgIGluaXRCdXR0b25DbGlja0hhbmRsZXIoKTtcblxuICAgICAgICAgICAgJCh0aGlzKS5jc3MoXCJtaW4taGVpZ2h0XCIsICQodGhpcykuY3NzKFwiaGVpZ2h0XCIpKTtcblxuICAgICAgICAgICAgaWYgKCQodGhpcykuZmluZCgnLmctcmVjYXB0Y2hhJykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgIHZhciBjYXB0Y2hhID0gJCh0aGlzKS5maW5kKCcuZy1yZWNhcHRjaGEnKTtcbiAgICAgICAgICAgICAgdmFyIHNpdGVrZXkgPSBjYXB0Y2hhLmRhdGEoJ3NpdGVrZXknKTtcbiAgICAgICAgICAgICAgZ3JlY2FwdGNoYS5yZW5kZXIoY2FwdGNoYVswXSwge1wic2l0ZWtleVwiOiBzaXRla2V5fSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSk7XG5cbiAgICB9KTtcblxufVxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 +$(document).ready(function(){initAjaxForm()}),window.initButtonClickHandler=function(){$('.ajax-form button[type="submit"]').on("click",function(){$('.ajax-form button[type="submit"]').removeAttr("clicked"),$(this).attr("clicked","true")})},window.initAjaxForm=function(){$.each($(".ajax-form"),function(t,a){var n=$(a).attr("data-identifier"),e=$(a).attr("data-preset-name"),i=$(a).attr("data-dimension"),c=location.protocol+"//"+location.host+"/form/"+(""!=i?i+"/":"")+e+"/"+n;$(a).off("submit").on("submit","form",function(t){var n=$(this),e=n.attr("action"),i=new FormData(this),c=$(this).find('button[clicked="true"]');i.append($(c).attr("name"),$(c).attr("value")),$.ajax({url:e,type:"POST",data:i,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,beforeSend:function(){$(a).find(".ajax-content").replaceWith('')},success:function(t){if($(a).find(".ajax-content").replaceWith(t),initButtonClickHandler(),$(a).find(".g-recaptcha").length){var n=$(a).find(".g-recaptcha"),e=n.data("sitekey");grecaptcha.render(n[0],{sitekey:e})}}}),t.preventDefault()}),$(a).load(c+" .ajax-content",function(){if(initButtonClickHandler(),$(this).css("min-height",$(this).css("height")),$(this).find(".g-recaptcha").length){var t=$(this).find(".g-recaptcha"),a=t.data("sitekey");grecaptcha.render(t[0],{sitekey:a})}})})}; +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsiJCIsImRvY3VtZW50IiwicmVhZHkiLCJpbml0QWpheEZvcm0iLCJ3aW5kb3ciLCJpbml0QnV0dG9uQ2xpY2tIYW5kbGVyIiwib24iLCJyZW1vdmVBdHRyIiwidGhpcyIsImF0dHIiLCJlYWNoIiwiaWR4IiwiYWpheEZvcm0iLCJmb3JtSWRlbnRpZmllciIsInByZXNldE5hbWUiLCJkaW1lbnNpb24iLCJmb3JtQWpheFVybCIsImxvY2F0aW9uIiwicHJvdG9jb2wiLCJob3N0Iiwib2ZmIiwiZSIsImZvcm1PYmoiLCJmb3JtVVJMIiwiZm9ybURhdGEiLCJGb3JtRGF0YSIsInRyaWdnZXIiLCJmaW5kIiwiYXBwZW5kIiwiYWpheCIsInVybCIsInR5cGUiLCJkYXRhIiwibWltZVR5cGUiLCJjb250ZW50VHlwZSIsImNhY2hlIiwicHJvY2Vzc0RhdGEiLCJiZWZvcmVTZW5kIiwicmVwbGFjZVdpdGgiLCJzdWNjZXNzIiwibGVuZ3RoIiwiY2FwdGNoYSIsInNpdGVrZXkiLCJncmVjYXB0Y2hhIiwicmVuZGVyIiwicHJldmVudERlZmF1bHQiLCJsb2FkIiwiY3NzIl0sIm1hcHBpbmdzIjoiQUFBQUEsRUFBQUMsVUFBQUMsTUFBQSxXQUVBQyxpQkFJQUMsT0FBQUMsdUJBQUEsV0FFQUwsRUFBQSxvQ0FBQU0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amF4Rm9ybSkuYXR0cignZGF0YS1pZGVudGlmaWVyJyk7XG4gICAgICAgIHZhciBwcmVzZXROYW1lID0gJChhamF4Rm9ybSkuYXR0cignZGF0YS1wcmVzZXQtbmFtZScpO1xuICAgICAgICB2YXIgZGltZW5zaW9uID0gJChhamF4Rm9ybSkuYXR0cignZGF0YS1kaW1lbnNpb24nKTtcblxuICAgICAgICB2YXIgZm9ybUFqYXhVcmwgPSBsb2NhdGlvbi5wcm90b2NvbCArICcvLycgKyBsb2NhdGlvbi5ob3N0ICsgJy9mb3JtLycgICsgKCBkaW1lbnNpb24gIT0gJycgPyBkaW1lbnNpb24gKyAnLycgOiAnJyApICsgcHJlc2V0TmFtZSArICcvJyArIGZvcm1JZGVudGlmaWVyO1xuXG4gICAgICAgICQoYWpheEZvcm0pLm9mZignc3VibWl0Jykub24oJ3N1Ym1pdCcsICdmb3JtJywgZnVuY3Rpb24gKGUpIHtcblxuICAgICAgICAgICAgdmFyIGZvcm1PYmogPSAkKHRoaXMpO1xuICAgICAgICAgICAgdmFyIGZvcm1VUkwgPSBmb3JtT2JqLmF0dHIoJ2FjdGlvbicpO1xuICAgICAgICAgICAgdmFyIGZvcm1EYXRhID0gbmV3IEZvcm1EYXRhKHRoaXMpO1xuXG4gICAgICAgICAgICB2YXIgdHJpZ2dlciA9ICQodGhpcykuZmluZCgnYnV0dG9uW2NsaWNrZWQ9XCJ0cnVlXCJdJyk7XG5cbiAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgkKHRyaWdnZXIpLmF0dHIoJ25hbWUnKSwgJCh0cmlnZ2VyKS5hdHRyKCd2YWx1ZScpKTtcblxuICAgICAgICAgICAgJC5hamF4KHtcblxuICAgICAgICAgICAgICAgIHVybDogZm9ybVVSTCxcbiAgICAgICAgICAgICAgICB0eXBlOiAnUE9TVCcsXG4gICAgICAgICAgICAgICAgZGF0YTogZm9ybURhdGEsXG4gICAgICAgICAgICAgICAgbWltZVR5cGU6ICdtdWx0aXBhcnQvZm9ybS1kYXRhJyxcbiAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgY2FjaGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHByb2Nlc3NEYXRhOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBiZWZvcmVTZW5kOiBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgJChhamF4Rm9ybSkuZmluZCgnLmFqYXgtY29udGVudCcpLnJlcGxhY2VXaXRoKCc8aSBjbGFzcz1cIiBhamF4LWNvbnRlbnQgZmEgZmEtc3Bpbm5lciBmYS1wdWxzZVwiPjwvaT4nKTtcblxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24gKGRhdGEpIHtcblxuICAgICAgICAgICAgICAgICAgICAkKGFqYXhGb3JtKS5maW5kKCcuYWpheC1jb250ZW50JykucmVwbGFjZVdpdGgoZGF0YSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaW5pdEJ1dHRvbkNsaWNrSGFuZGxlcigpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICgkKGFqYXhGb3JtKS5maW5kKCcuZy1yZWNhcHRjaGEnKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQoYWpheEZvcm0pLmZpbmQoJy5nLXJlY2FwdGNoYScpO1xuICAgICAgICAgICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgZ3JlY2FwdGNoYS5yZW5kZXIoY2FwdGNoYVswXSwge1wic2l0ZWtleVwiOiBzaXRla2V5fSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICB9KTtcblxuICAgICAgICAkKGFqYXhGb3JtKS5sb2FkKGZvcm1BamF4VXJsICsgJyAuYWpheC1jb250ZW50JywgZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICBpbml0QnV0dG9uQ2xpY2tIYW5kbGVyKCk7XG5cbiAgICAgICAgICAgICQodGhpcykuY3NzKFwibWluLWhlaWdodFwiLCAkKHRoaXMpLmNzcyhcImhlaWdodFwiKSk7XG5cbiAgICAgICAgICAgIGlmICgkKHRoaXMpLmZpbmQoJy5nLXJlY2FwdGNoYScpLmxlbmd0aCkge1xuICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQodGhpcykuZmluZCgnLmctcmVjYXB0Y2hhJyk7XG4gICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgIGdyZWNhcHRjaGEucmVuZGVyKGNhcHRjaGFbMF0sIHtcInNpdGVrZXlcIjogc2l0ZWtleX0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgfSk7XG5cbn1cbiJdfQ== From 8add8380d34572167be9ca6c8b332f4a5caaee42 Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Wed, 13 Sep 2017 13:01:55 +0200 Subject: [PATCH 5/6] Removed dev stuff from composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index df594af..61bfcab 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mcstreetguy/neos-ajax-form", + "name": "obisconcept/neos-ajax-form", "type": "neos-plugin", "authors": [ { From fbb14be457e9ac0b945688cb8890e60f2feec752 Mon Sep 17 00:00:00 2001 From: Dennis Irmscher Date: Tue, 26 Sep 2017 11:10:50 +0200 Subject: [PATCH 6/6] Fixed routing if no language dimension present --- Resources/Private/Assets/JavaScript/main.js | 2 +- Resources/Public/JavaScript/main.js | 2 +- Resources/Public/JavaScript/main.min.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Private/Assets/JavaScript/main.js b/Resources/Private/Assets/JavaScript/main.js index b24d4b3..a64359e 100755 --- a/Resources/Private/Assets/JavaScript/main.js +++ b/Resources/Private/Assets/JavaScript/main.js @@ -21,7 +21,7 @@ window.initAjaxForm = function() { var presetName = $(ajaxForm).attr('data-preset-name'); var dimension = $(ajaxForm).attr('data-dimension'); - var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : '' ) + presetName + '/' + formIdentifier; + var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : 'en/' ) + presetName + '/' + formIdentifier; $(ajaxForm).off('submit').on('submit', 'form', function (e) { diff --git a/Resources/Public/JavaScript/main.js b/Resources/Public/JavaScript/main.js index b24d4b3..a64359e 100755 --- a/Resources/Public/JavaScript/main.js +++ b/Resources/Public/JavaScript/main.js @@ -21,7 +21,7 @@ window.initAjaxForm = function() { var presetName = $(ajaxForm).attr('data-preset-name'); var dimension = $(ajaxForm).attr('data-dimension'); - var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : '' ) + presetName + '/' + formIdentifier; + var formAjaxUrl = location.protocol + '//' + location.host + '/form/' + ( dimension != '' ? dimension + '/' : 'en/' ) + presetName + '/' + formIdentifier; $(ajaxForm).off('submit').on('submit', 'form', function (e) { diff --git a/Resources/Public/JavaScript/main.min.js b/Resources/Public/JavaScript/main.min.js index 038e161..3aad43a 100755 --- a/Resources/Public/JavaScript/main.min.js +++ b/Resources/Public/JavaScript/main.min.js @@ -1,2 +1,2 @@ -$(document).ready(function(){initAjaxForm()}),window.initButtonClickHandler=function(){$('.ajax-form button[type="submit"]').on("click",function(){$('.ajax-form button[type="submit"]').removeAttr("clicked"),$(this).attr("clicked","true")})},window.initAjaxForm=function(){$.each($(".ajax-form"),function(t,a){var n=$(a).attr("data-identifier"),e=$(a).attr("data-preset-name"),i=$(a).attr("data-dimension"),c=location.protocol+"//"+location.host+"/form/"+(""!=i?i+"/":"")+e+"/"+n;$(a).off("submit").on("submit","form",function(t){var n=$(this),e=n.attr("action"),i=new FormData(this),c=$(this).find('button[clicked="true"]');i.append($(c).attr("name"),$(c).attr("value")),$.ajax({url:e,type:"POST",data:i,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,beforeSend:function(){$(a).find(".ajax-content").replaceWith('')},success:function(t){if($(a).find(".ajax-content").replaceWith(t),initButtonClickHandler(),$(a).find(".g-recaptcha").length){var n=$(a).find(".g-recaptcha"),e=n.data("sitekey");grecaptcha.render(n[0],{sitekey:e})}}}),t.preventDefault()}),$(a).load(c+" .ajax-content",function(){if(initButtonClickHandler(),$(this).css("min-height",$(this).css("height")),$(this).find(".g-recaptcha").length){var t=$(this).find(".g-recaptcha"),a=t.data("sitekey");grecaptcha.render(t[0],{sitekey:a})}})})}; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsiJCIsImRvY3VtZW50IiwicmVhZHkiLCJpbml0QWpheEZvcm0iLCJ3aW5kb3ciLCJpbml0QnV0dG9uQ2xpY2tIYW5kbGVyIiwib24iLCJyZW1vdmVBdHRyIiwidGhpcyIsImF0dHIiLCJlYWNoIiwiaWR4IiwiYWpheEZvcm0iLCJmb3JtSWRlbnRpZmllciIsInByZXNldE5hbWUiLCJkaW1lbnNpb24iLCJmb3JtQWpheFVybCIsImxvY2F0aW9uIiwicHJvdG9jb2wiLCJob3N0Iiwib2ZmIiwiZSIsImZvcm1PYmoiLCJmb3JtVVJMIiwiZm9ybURhdGEiLCJGb3JtRGF0YSIsInRyaWdnZXIiLCJmaW5kIiwiYXBwZW5kIiwiYWpheCIsInVybCIsInR5cGUiLCJkYXRhIiwibWltZVR5cGUiLCJjb250ZW50VHlwZSIsImNhY2hlIiwicHJvY2Vzc0RhdGEi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cGVuZCgkKHRyaWdnZXIpLmF0dHIoJ25hbWUnKSwgJCh0cmlnZ2VyKS5hdHRyKCd2YWx1ZScpKTtcblxuICAgICAgICAgICAgJC5hamF4KHtcblxuICAgICAgICAgICAgICAgIHVybDogZm9ybVVSTCxcbiAgICAgICAgICAgICAgICB0eXBlOiAnUE9TVCcsXG4gICAgICAgICAgICAgICAgZGF0YTogZm9ybURhdGEsXG4gICAgICAgICAgICAgICAgbWltZVR5cGU6ICdtdWx0aXBhcnQvZm9ybS1kYXRhJyxcbiAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgY2FjaGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHByb2Nlc3NEYXRhOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBiZWZvcmVTZW5kOiBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgJChhamF4Rm9ybSkuZmluZCgnLmFqYXgtY29udGVudCcpLnJlcGxhY2VXaXRoKCc8aSBjbGFzcz1cIiBhamF4LWNvbnRlbnQgZmEgZmEtc3Bpbm5lciBmYS1wdWxzZVwiPjwvaT4nKTtcblxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24gKGRhdGEpIHtcblxuICAgICAgICAgICAgICAgICAgICAkKGFqYXhGb3JtKS5maW5kKCcuYWpheC1jb250ZW50JykucmVwbGFjZVdpdGgoZGF0YSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaW5pdEJ1dHRvbkNsaWNrSGFuZGxlcigpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICgkKGFqYXhGb3JtKS5maW5kKCcuZy1yZWNhcHRjaGEnKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQoYWpheEZvcm0pLmZpbmQoJy5nLXJlY2FwdGNoYScpO1xuICAgICAgICAgICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgZ3JlY2FwdGNoYS5yZW5kZXIoY2FwdGNoYVswXSwge1wic2l0ZWtleVwiOiBzaXRla2V5fSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICB9KTtcblxuICAgICAgICAkKGFqYXhGb3JtKS5sb2FkKGZvcm1BamF4VXJsICsgJyAuYWpheC1jb250ZW50JywgZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICBpbml0QnV0dG9uQ2xpY2tIYW5kbGVyKCk7XG5cbiAgICAgICAgICAgICQodGhpcykuY3NzKFwibWluLWhlaWdodFwiLCAkKHRoaXMpLmNzcyhcImhlaWdodFwiKSk7XG5cbiAgICAgICAgICAgIGlmICgkKHRoaXMpLmZpbmQoJy5nLXJlY2FwdGNoYScpLmxlbmd0aCkge1xuICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQodGhpcykuZmluZCgnLmctcmVjYXB0Y2hhJyk7XG4gICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgIGdyZWNhcHRjaGEucmVuZGVyKGNhcHRjaGFbMF0sIHtcInNpdGVrZXlcIjogc2l0ZWtleX0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgfSk7XG5cbn1cbiJdfQ== +$(document).ready(function(){initAjaxForm()}),window.initButtonClickHandler=function(){$('.ajax-form button[type="submit"]').on("click",function(){$('.ajax-form button[type="submit"]').removeAttr("clicked"),$(this).attr("clicked","true")})},window.initAjaxForm=function(){$.each($(".ajax-form"),function(t,a){var n=$(a).attr("data-identifier"),e=$(a).attr("data-preset-name"),i=$(a).attr("data-dimension"),c=location.protocol+"//"+location.host+"/form/"+(""!=i?i+"/":"en/")+e+"/"+n;$(a).off("submit").on("submit","form",function(t){var n=$(this),e=n.attr("action"),i=new FormData(this),c=$(this).find('button[clicked="true"]');i.append($(c).attr("name"),$(c).attr("value")),$.ajax({url:e,type:"POST",data:i,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,beforeSend:function(){$(a).find(".ajax-content").replaceWith('')},success:function(t){if($(a).find(".ajax-content").replaceWith(t),initButtonClickHandler(),$(a).find(".g-recaptcha").length){var n=$(a).find(".g-recaptcha"),e=n.data("sitekey");grecaptcha.render(n[0],{sitekey:e})}}}),t.preventDefault()}),$(a).load(c+" .ajax-content",function(){if(initButtonClickHandler(),$(this).css("min-height",$(this).css("height")),$(this).find(".g-recaptcha").length){var t=$(this).find(".g-recaptcha"),a=t.data("sitekey");grecaptcha.render(t[0],{sitekey:a})}})})}; +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsiJCIsImRvY3VtZW50IiwicmVhZHkiLCJpbml0QWpheEZvcm0iLCJ3aW5kb3ciLCJpbml0QnV0dG9uQ2xpY2tIYW5kbGVyIiwib24iLCJyZW1vdmVBdHRyIiwidGhpcyIsImF0dHIiLCJlYWNoIiwiaWR4IiwiYWpheEZvcm0iLCJmb3JtSWRlbnRpZmllciIsInByZXNldE5hbWUiLCJkaW1lbnNpb24iLCJmb3JtQWpheFVybCIsImxvY2F0aW9uIiwicHJvdG9jb2wiLCJob3N0Iiwib2ZmIiwiZSIsImZvcm1PYmoiLCJmb3JtVVJMIiwiZm9ybURhdGEiLCJGb3JtRGF0YSIsInRyaWdnZXIiLCJmaW5kIiwiYXBwZW5kIiwiYWpheCIsInVybCIsInR5cGUiLCJkYXRhIiwibWltZVR5cGUiLCJjb250ZW50VHlwZSIsImNhY2hlIiwicHJvY2Vzc0RhdGEiLCJiZWZvcmVTZW5kIiwicmV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XIpLmF0dHIoJ25hbWUnKSwgJCh0cmlnZ2VyKS5hdHRyKCd2YWx1ZScpKTtcblxuICAgICAgICAgICAgJC5hamF4KHtcblxuICAgICAgICAgICAgICAgIHVybDogZm9ybVVSTCxcbiAgICAgICAgICAgICAgICB0eXBlOiAnUE9TVCcsXG4gICAgICAgICAgICAgICAgZGF0YTogZm9ybURhdGEsXG4gICAgICAgICAgICAgICAgbWltZVR5cGU6ICdtdWx0aXBhcnQvZm9ybS1kYXRhJyxcbiAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgY2FjaGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHByb2Nlc3NEYXRhOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBiZWZvcmVTZW5kOiBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgJChhamF4Rm9ybSkuZmluZCgnLmFqYXgtY29udGVudCcpLnJlcGxhY2VXaXRoKCc8aSBjbGFzcz1cIiBhamF4LWNvbnRlbnQgZmEgZmEtc3Bpbm5lciBmYS1wdWxzZVwiPjwvaT4nKTtcblxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24gKGRhdGEpIHtcblxuICAgICAgICAgICAgICAgICAgICAkKGFqYXhGb3JtKS5maW5kKCcuYWpheC1jb250ZW50JykucmVwbGFjZVdpdGgoZGF0YSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaW5pdEJ1dHRvbkNsaWNrSGFuZGxlcigpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICgkKGFqYXhGb3JtKS5maW5kKCcuZy1yZWNhcHRjaGEnKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQoYWpheEZvcm0pLmZpbmQoJy5nLXJlY2FwdGNoYScpO1xuICAgICAgICAgICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgZ3JlY2FwdGNoYS5yZW5kZXIoY2FwdGNoYVswXSwge1wic2l0ZWtleVwiOiBzaXRla2V5fSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICB9KTtcblxuICAgICAgICAkKGFqYXhGb3JtKS5sb2FkKGZvcm1BamF4VXJsICsgJyAuYWpheC1jb250ZW50JywgZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICBpbml0QnV0dG9uQ2xpY2tIYW5kbGVyKCk7XG5cbiAgICAgICAgICAgICQodGhpcykuY3NzKFwibWluLWhlaWdodFwiLCAkKHRoaXMpLmNzcyhcImhlaWdodFwiKSk7XG5cbiAgICAgICAgICAgIGlmICgkKHRoaXMpLmZpbmQoJy5nLXJlY2FwdGNoYScpLmxlbmd0aCkge1xuICAgICAgICAgICAgICB2YXIgY2FwdGNoYSA9ICQodGhpcykuZmluZCgnLmctcmVjYXB0Y2hhJyk7XG4gICAgICAgICAgICAgIHZhciBzaXRla2V5ID0gY2FwdGNoYS5kYXRhKCdzaXRla2V5Jyk7XG4gICAgICAgICAgICAgIGdyZWNhcHRjaGEucmVuZGVyKGNhcHRjaGFbMF0sIHtcInNpdGVrZXlcIjogc2l0ZWtleX0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgfSk7XG5cbn1cbiJdfQ==