inter-mediator-plugin-jqueryfileupload
Advanced tools
Comparing version 1.2.4 to 1.3.0
25
index.js
@@ -27,2 +27,3 @@ /* | ||
multiFileInPostOnly: false, | ||
fileExtRequirements: null, // or ['csv'] | ||
@@ -170,2 +171,13 @@ instanciate: function (targetNode) { | ||
return function (e, data) { | ||
if (IMParts_Catalog.jquery_fileupload.fileExtRequirements) { | ||
let hasMatchExt = false | ||
for (const ext of IMParts_Catalog.jquery_fileupload.fileExtRequirements) { | ||
if (new RegExp(`\.(${ext})$/i`).test(data.files[0].name)) { | ||
hasMatchExt = true | ||
} | ||
} | ||
if (!hasMatchExt) { | ||
return | ||
} | ||
} | ||
$('#' + idValue + '-filename').text(data.files[0].name) | ||
@@ -290,6 +302,17 @@ $('#' + idValue + '-filenamearea').css('display', 'block') | ||
let targetFile = data.files[0], sign, another, previewNode | ||
if (IMParts_Catalog.jquery_fileupload.fileExtRequirements) { | ||
let hasMatchExt = false | ||
for (const ext of IMParts_Catalog.jquery_fileupload.fileExtRequirements) { | ||
if (new RegExp(`\.(${ext})$/i`).test(targetFile.name)) { | ||
hasMatchExt = true | ||
} | ||
} | ||
if (!hasMatchExt) { | ||
return | ||
} | ||
} | ||
$('#' + idValue + '-filenamearea').css('display', 'block') | ||
if (!Array.isArray(IMParts_Catalog.jquery_fileupload.values[idValue])) { | ||
const fnStr = $('#' + idValue + '-filename').text() | ||
if(fnStr){ | ||
if (fnStr) { | ||
$('#' + idValue + '-filename').text(`${fnStr}, ${targetFile.name}`) | ||
@@ -296,0 +319,0 @@ } else { |
{ | ||
"name": "inter-mediator-plugin-jqueryfileupload", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "INTER-Mediator plug-in to use the JQuery FileUpload.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node_modules/jest/bin/jest.js test.js" | ||
}, | ||
@@ -18,2 +18,5 @@ "repository": { | ||
], | ||
"devDependencies": { | ||
"jest": ">=26.6.3" | ||
}, | ||
"dependencies": { | ||
@@ -20,0 +23,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
# inter-mediator-plugin-jqueryfileupload | ||
# inter-mediator-plugin-jqueryfileupload [![Build Status](https://github.com/INTER-Mediator/inter-mediator-plugin-jqueryfileupload/actions/workflows/node.js.yml/badge.svg)](https://github.com/INTER-Mediator/inter-mediator-plugin-jqueryfileupload/actions/workflows/node.js.yml) | ||
INTER-Mediator plug-in to use the JQuery FileUpload. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
19149
77
361
0
1
6
1
1