first commit

This commit is contained in:
2024-11-11 15:28:20 +01:00
commit 3f5649dbc7
6231 changed files with 999089 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/* eslint-disable func-names */
import stripHtml from "./stripHtml";
export default function msgMaxWords(val) {
const max = parseInt(val, 10);
if (max === 1) {
return `Wprowadź maksymalnie ${max} wyraz.`;
} else if (
(max % 10 === 2 && max % 100 !== 12) ||
(max % 10 === 3 && max % 100 !== 13) ||
(max % 10 === 4 && max % 100 !== 14)
) {
return `Wprowadź maksymalnie ${max} wyrazy.`;
}
return `Wprowadź maksymalnie ${max} wyrazów.`;
}
jQuery.validator.addMethod(
"max_words",
function(value, element, params) {
return (
this.optional(element) ||
stripHtml(value).match(/\b\w+\b/g).length <= params
);
},
msgMaxWords
);