diff --git a/.gitattributes b/.gitattributes index 0fdde0717f..22b702ac65 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ .gitkeep export-ignore /.env export-ignore +/.project export-ignore /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore diff --git a/Documentation/Changelog/Index.rst b/Documentation/Changelog/Index.rst index c05353e9fc..ed17b3343f 100644 --- a/Documentation/Changelog/Index.rst +++ b/Documentation/Changelog/Index.rst @@ -17,6 +17,13 @@ All changes are documented on https://docs.typo3.org/typo3cms/extensions/femanag :Changes: Release Description +- :Version: + 6.1.2 + :Date: + 2020-12-03 + :Changes: + * [BUGFIX] JavaScript error in FeManager.js - thanks to https://github.com/grischpel + - :Version: 6.1.1 :Date: @@ -56,6 +63,27 @@ All changes are documented on https://docs.typo3.org/typo3cms/extensions/femanag * [TASK] Update Unit and Behaviour Tests - Sponsored by inixmedia and in2code * [TASK] Remove legacy password hashing code - Sponsored by in2code +- :Version: + 5.4.2 + :Date: + 2020-12-03 + :Changes: + * [BUGFIX] JavaScript error in FeManager.js - thanks to https://github.com/grischpel + +- :Version: + 5.4.1 + :Date: + 2020-10-26 + :Changes: + * [BUGFIX] Prevent Exceptions on wrong file upload - thanks to https://github.com/in2code-de/femanager/pull/262 + +- :Version: + 5.4.0 + :Date: + 2020-08-30 + :Changes: + * [FEATURE] Add support for country selection options (for TYPO3 V8 / V9) - :ref:`see documentation `- Sponsored by Resultify.se + - :Version: 5.3.1 :Date: diff --git a/Resources/Private/JavaScript/Femanager.js b/Resources/Private/JavaScript/Femanager.js index 18089aad10..00b1d5b7a4 100644 --- a/Resources/Private/JavaScript/Femanager.js +++ b/Resources/Private/JavaScript/Femanager.js @@ -1,5 +1,11 @@ jQuery(document).ready(function($) { - var labels = JSON.parse(document.querySelector('.tx-femanager[data-labels]').dataset['labels']); + var labels; + + if (document.querySelector(".tx-femanager[data-labels]") != null) { + labels = JSON.parse(document.querySelector('.tx-femanager[data-labels]').dataset['labels']); + } else { + labels = []; + } // javascript validation $('.feManagerValidation').femanagerValidation($); diff --git a/Resources/Private/gulpfile.js b/Resources/Private/gulpfile.js index 5cfa738364..7aedfdf3c1 100644 --- a/Resources/Private/gulpfile.js +++ b/Resources/Private/gulpfile.js @@ -27,7 +27,7 @@ gulp.task('css', function() { }); gulp.task('js', function() { - gulp.src('JavaScript/**/*.js') + return gulp.src('JavaScript/**/*.js') .pipe(plumber()) .pipe(uglify()) .pipe(rename({ @@ -43,11 +43,11 @@ gulp.task('js', function() { *********************************/ gulp.task('watch', function() { - gulp.watch('Sass/**/*.scss', ['css']); - gulp.watch('JavaScript/**/*.js', ['js']); + gulp.watch('Sass/**/*.scss', gulp.task('css')); + gulp.watch('JavaScript/**/*.js', gulp.task('js')); }); -gulp.task('default', ['css', 'js', 'watch']); +gulp.task('default', gulp.series('css', 'js', 'watch')); /** * Get arguments from commandline diff --git a/Resources/Private/package.json b/Resources/Private/package.json index 49315d9f18..24443bc587 100644 --- a/Resources/Private/package.json +++ b/Resources/Private/package.json @@ -12,10 +12,10 @@ "author": "in2code.de", "license": "GPL2", "devDependencies": { - "gulp": "^3.9.0", + "gulp": "^4.0.0", "gulp-plumber": "^1.0.1", "gulp-rename": "^1.2.2", - "gulp-sass": "^2.1.1", + "gulp-sass": "^3.2.1", "gulp-uglify": "^1.5.1", "npm-run-all": "^4.1.5" } diff --git a/Resources/Public/JavaScript/Femanager.min.js b/Resources/Public/JavaScript/Femanager.min.js index 087b3897c1..25e162f312 100644 --- a/Resources/Public/JavaScript/Femanager.min.js +++ b/Resources/Public/JavaScript/Femanager.min.js @@ -1 +1 @@ -function createUploader(e){if(0!=e("#femanager_field_fine-uploader").length){var a={imageNames:{},getImageNames:function(){return e.map(this.imageNames,function(e){return e}).join(",")},addImageName:function(a,t){this.imageNames[a]=t,e("#femanager_field_image").val(this.getImageNames())},deleteImageName:function(a){delete this.imageNames[a],e("#femanager_field_image").val(this.getImageNames())}};new qq.FineUploader({element:document.getElementById("femanager_field_fine-uploader"),request:{endpoint:Femanager.getBaseUrl()+"index.php?eID=femanagerFileUpload&id="+e("#femanagerPid").val(),customHeaders:{Accept:"application/json"}},multiple:!0,template:e(".image_container_template:first").html(),fileTemplate:'
  • {cancelButtonText}{retryButtonText}{deleteButtonText}{statusText}
  • ',deleteFile:{enabled:!0,forceConfirm:!0,endpoint:Femanager.getBaseUrl()+"index.php?eID=femanagerFileDelete&id="+e("#femanagerPid").val()},classes:{success:"alert alert-success",fail:"alert alert-error"},validation:{allowedExtensions:getValueFromField("#uploadFileExtension","jpeg, jpg, gif, png, bmp","array"),sizeLimit:getValueFromField("#uploadSize",25e6,"int"),itemLimit:getValueFromField("#uploadAmount",1,"int")},callbacks:{onComplete:function(t,n,i){if(i.success){var o=e("").addClass("fileupload_image").prop("src",e("#uploadFolder").val()+"/"+i.uploadName).prop("alt",i.uploadName);o.appendTo(this.getItemByFileId(t)),a.addImageName(t,i.uploadName)}},onDeleteComplete:function(e,t,n){a.deleteImageName(e)}}});return a}}function getValueFromField(e,a,t){var n=a;return $(e).length&&(n=$(e).val()),void 0!==t&&("int"===t?n=parseInt(n):"array"===t&&(n=n.toString(),n=n.replace(/[\s,]+/g,","),n=n.split(","))),n}jQuery(document).ready(function(e){function a(e){e+="";var a=e.charAt(0).toLowerCase();return a+e.substr(1)}var t=JSON.parse(document.querySelector(".tx-femanager[data-labels]").dataset.labels);e(".feManagerValidation").femanagerValidation(e);var n=createUploader(e);e("#femanager_field_image").length>0&&e.each(e("#femanager_field_image").val().split(","),function(e,a){a.trim().length>0&&n.addImageName(a,a)}),e("#femanager_field_preview-image").find(".qq-upload-delete").click(function(a){a.preventDefault();var t=e(a.target).parent();n.deleteImageName(t.find(".qq-upload-file").text()),t.fadeOut("",function(){e(this).remove()})}),e("*[data-confirm]").click(function(a){var t=e(this).attr("data-confirm");confirm(t)||a.preventDefault()}),document.querySelectorAll("[data-data-endpoint]").forEach(function(n){var i=function(i){var o=n.dataset.dataEndpoint,l={"tx_femanager_pi1[action]":o,"tx_femanager_pi1[controller]":"Data"};arguments=JSON.parse(JSON.stringify(n.dataset));for(var r in arguments)if(arguments.hasOwnProperty(r)&&r.match("arguments")){var s=document.getElementById(arguments[r]);if(s){var d=a(r.substr(9));l["tx_femanager_pi1["+d+"]"]=s.value}}var p=Femanager.getBaseUrl()+"index.php?id="+e("#femanagerPid").val()+"&type=1594138042";e.ajax({url:p,data:l,type:"POST",cache:!1,beforeSend:function(){n.disabled=1,n.options.length=0,n.options[0]=new Option(t.loading_states)},success:function(e){n.options.length=0;for(var a in e){n.options[n.options.length]=new Option(t.please_choose);break}for(var a in e)e.hasOwnProperty(a)&&(n.options[n.options.length]=new Option(e[a],a));0===n.options.length?n.disabled=1:n.disabled=0},error:function(){console.log("Error: The called url is not available - if you use TYPO3 in a subfolder, please use config.baseURL in TypoScript")}})},o=n.dataset.triggerFields;void 0!==o?o.split(",").forEach(function(e){var a=document.getElementById(e);void 0!==a&&a.addEventListener("change",i)}):n.addEventListener("change",i),i()})}),window.Femanager={},window.Femanager.getBaseUrl=function(){var e;if(jQuery("base").length>0)e=jQuery("base").prop("href");else if(window.location.hostname.indexOf("localhost")!==-1)e="";else{var a="";window.location.port.length>0&&(a=":"+window.location.port),e="https:"!==window.location.protocol?"http://"+window.location.hostname+a+"/":"https://"+window.location.hostname+a+"/"}return e}; \ No newline at end of file +function createUploader(e){if(0!=e("#femanager_field_fine-uploader").length){var a={imageNames:{},getImageNames:function(){return e.map(this.imageNames,function(e){return e}).join(",")},addImageName:function(a,t){this.imageNames[a]=t,e("#femanager_field_image").val(this.getImageNames())},deleteImageName:function(a){delete this.imageNames[a],e("#femanager_field_image").val(this.getImageNames())}};new qq.FineUploader({element:document.getElementById("femanager_field_fine-uploader"),request:{endpoint:Femanager.getBaseUrl()+"index.php?eID=femanagerFileUpload&id="+e("#femanagerPid").val(),customHeaders:{Accept:"application/json"}},multiple:!0,template:e(".image_container_template:first").html(),fileTemplate:'
  • {cancelButtonText}{retryButtonText}{deleteButtonText}{statusText}
  • ',deleteFile:{enabled:!0,forceConfirm:!0,endpoint:Femanager.getBaseUrl()+"index.php?eID=femanagerFileDelete&id="+e("#femanagerPid").val()},classes:{success:"alert alert-success",fail:"alert alert-error"},validation:{allowedExtensions:getValueFromField("#uploadFileExtension","jpeg, jpg, gif, png, bmp","array"),sizeLimit:getValueFromField("#uploadSize",25e6,"int"),itemLimit:getValueFromField("#uploadAmount",1,"int")},callbacks:{onComplete:function(t,n,i){if(i.success){var l=e("").addClass("fileupload_image").prop("src",e("#uploadFolder").val()+"/"+i.uploadName).prop("alt",i.uploadName);l.appendTo(this.getItemByFileId(t)),a.addImageName(t,i.uploadName)}},onDeleteComplete:function(e,t,n){a.deleteImageName(e)}}});return a}}function getValueFromField(e,a,t){var n=a;return $(e).length&&(n=$(e).val()),void 0!==t&&("int"===t?n=parseInt(n):"array"===t&&(n=n.toString(),n=n.replace(/[\s,]+/g,","),n=n.split(","))),n}jQuery(document).ready(function(e){function a(e){e+="";var a=e.charAt(0).toLowerCase();return a+e.substr(1)}var t;t=null!=document.querySelector(".tx-femanager[data-labels]")?JSON.parse(document.querySelector(".tx-femanager[data-labels]").dataset.labels):[],e(".feManagerValidation").femanagerValidation(e);var n=createUploader(e);e("#femanager_field_image").length>0&&e.each(e("#femanager_field_image").val().split(","),function(e,a){a.trim().length>0&&n.addImageName(a,a)}),e("#femanager_field_preview-image").find(".qq-upload-delete").click(function(a){a.preventDefault();var t=e(a.target).parent();n.deleteImageName(t.find(".qq-upload-file").text()),t.fadeOut("",function(){e(this).remove()})}),e("*[data-confirm]").click(function(a){var t=e(this).attr("data-confirm");confirm(t)||a.preventDefault()}),document.querySelectorAll("[data-data-endpoint]").forEach(function(n){var i=function(i){var l=n.dataset.dataEndpoint,o={"tx_femanager_pi1[action]":l,"tx_femanager_pi1[controller]":"Data"};arguments=JSON.parse(JSON.stringify(n.dataset));for(var r in arguments)if(arguments.hasOwnProperty(r)&&r.match("arguments")){var s=document.getElementById(arguments[r]);if(s){var d=a(r.substr(9));o["tx_femanager_pi1["+d+"]"]=s.value}}var p=Femanager.getBaseUrl()+"index.php?id="+e("#femanagerPid").val()+"&type=1594138042";e.ajax({url:p,data:o,type:"POST",cache:!1,beforeSend:function(){n.disabled=1,n.options.length=0,n.options[0]=new Option(t.loading_states)},success:function(e){n.options.length=0;for(var a in e){n.options[n.options.length]=new Option(t.please_choose);break}for(var a in e)e.hasOwnProperty(a)&&(n.options[n.options.length]=new Option(e[a],a));0===n.options.length?n.disabled=1:n.disabled=0},error:function(){console.log("Error: The called url is not available - if you use TYPO3 in a subfolder, please use config.baseURL in TypoScript")}})},l=n.dataset.triggerFields;void 0!==l?l.split(",").forEach(function(e){var a=document.getElementById(e);void 0!==a&&a.addEventListener("change",i)}):n.addEventListener("change",i),i()})}),window.Femanager={},window.Femanager.getBaseUrl=function(){var e;if(jQuery("base").length>0)e=jQuery("base").prop("href");else if(window.location.hostname.indexOf("localhost")!==-1)e="";else{var a="";window.location.port.length>0&&(a=":"+window.location.port),e="https:"!==window.location.protocol?"http://"+window.location.hostname+a+"/":"https://"+window.location.hostname+a+"/"}return e}; \ No newline at end of file diff --git a/ext_emconf.php b/ext_emconf.php index 22a9d7aec3..de32f37d4c 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -23,7 +23,7 @@ 'modify_tables' => '', 'clearCacheOnLoad' => 0, 'lockType' => '', - 'version' => '6.1.1', + 'version' => '6.1.2', 'constraints' => [ 'depends' => [ 'typo3' => '10.0.0-10.4.99', diff --git a/readme.md b/readme.md index 3f69085e9b..271b05df63 100644 --- a/readme.md +++ b/readme.md @@ -34,10 +34,14 @@ Official support (fee-based) via https://www.in2code.de/kontakt | Version | Date | State | Description | | ---------- | ---------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- | +| 6.1.2 | 2020-12-03 | Bugfix | Prevent JS Validation error | | 6.1.1 | 2020-08-13 | Bugfix | Prevent some notices and errors, exception during file upload and changed method call | | 6.1.0 | 2020-08-13 | Minor | Add Support for country select options | | 6.0.1 | 2020-05-26 | Major | Drop false declared support for TYPO3 9 in V6 Branch | | 6.0.0 | 2020-05-26 | Major | !!!Support TYPO3 10 LTS only | +| 5.4.2 | 2020-12-03 | Bugfix | Prevent JS Validation error | +| 5.4.1 | 2020-10-26 | Bugfix | Prevents Exception when uploading a file which is not allowed | +| 5.4.0 | 2020-08-30 | Minor update | New validation option for countries with state subselection (TYPO3 V8/V9) | | 5.3.1 | 2020-08-06 | Bugfix | Allow validation with captcha | | 5.2.0 | 2019-05-26 | Security | !!!Implement CSFR Protection - please check upgrade instructions | | 5.1.1 | 2019-05-26 | Bugfix | Repair Admin Confirmation for TYPO3 9 | @@ -66,12 +70,15 @@ Official support (fee-based) via https://www.in2code.de/kontakt ## Your Contribution -**Pull requests** are welcome in general! Nevertheless please don't forget to add a description to your pull requests. This -is very helpful to understand what kind of issue the **PR** is going to solve. +**Pull requests** are welcome in general! Please note these requirements: +* Unit Tests must still work +* Behaviour Tests must still work +* Describe how to test your pull request +* TYPO3 coding guidelines must be respected -- Bugfixes: Please describe what kind of bug your fix solve and give us feedback how to reproduce the issue. We're going +- **Bugfixes**: Please describe what kind of bug your fix solve and give us feedback how to reproduce the issue. We're going to accept only bugfixes that can be reproduced. -- Features: Not every feature is relevant for the bulk of the users. In addition: We don't want to make the extension +- **Features**: Not every feature is relevant for the bulk of the users. In addition: We don't want to make the extension even more complicated in usability for an edge case feature. Please discuss a new feature before. ## Screenshots