PageSourceSearch

https://efre-bw.de/site/pbs-bw-rebrush2024/resourceCached/258/prjbawue/js/formValidation.min.js

js efre-bw.de collected 2026-10-02 05:46:11 UTC 5,954 bytes, 14 lines download raw bytes

1var defaultAllowedExtensions="jpg jpeg png bmp gif pdf doc docx tif tiff xlsx odt ods txt".split(" "),defaultAllowedExtensionsString="jpg, jpeg, png, bmp, gif, pdf, doc, docx, xlsx, tif, tiff, odt, ods und txt",attachmentList=[],attachmentCount=1,attachmentMax=5,attachmentName="",maxFileSize=15728640,fileSizes={};
2$(document).on("change",".customform input[type\x3dfile]",function(){$(".formButtonContainer #waitstatus").remove();$(".formButtonContainer button").removeAttr("disabled").css("opacity","1");$(".form__field--status").remove();$(".form__buttons .button").removeAttr("disabled").css("opacity","1");var a=$(this),b=a.attr("data-position");b||(b=attachmentCount-1,a.attr("data-position",b));var e=this.files[0];if(e){var c=e.name.split(".").pop().toLowerCase();fileSizes[b]=e.size;checkFileSizes();var f=/^[\u00C0-\u00FF\u0100-\u017Fa-zA-Z0-9_.\u0020]*$/,
3d=a.val(),g=d.lastIndexOf("\\");-1<g&&(d=d.substring(g+1));-1===getAllowedExtensions().indexOf(c)?(a.val(""),attachmentList[b]=null,a=getAllowedExtensionsString(),alert("Dieses Dateiformat ist nicht erlaubt.\nErlaubt sind "+a+".")):""==d||f.test(d)?(c=a.attr("name"),readUploadedFileAsText(e,c,b),"1"!==a.attr("fa-set")&&attachmentCount<attachmentMax&&(c.match(/\d+$/)?(attachmentCount++,c=attachmentName+attachmentCount):(attachmentName=c,attachmentCount++,c+=""+attachmentCount),f=a.clone(),f.val("").attr("name",
4c).insertAfter(a),f.attr("data-position",attachmentCount-1),resizeFileInput(f,94)),a.attr("fa-set","1"),$(".data-position-"+b+"").remove(),c="icon-"+b+"-title",e="\x3cdiv class\x3d'form__field--fileRemove data-position-"+b+"'\x3e\x3csmall\x3eDateigr\x26ouml;\x26szlig;e: "+getSizeStringAuto(e.size)+"\x3c/small\x3e\x3c/div\x3e",a.after(e),a.after("\x3cbutton class\x3d'button button--icon remove-attachment-button data-position-"+b+"' type\x3d'button' onclick\x3dremove_file("+b+");\x3e   \x3csvg class\x3d'icon icon--trash button__icon' viewBox\x3d'0 0 200 200' role\x3d'img' aria-labelledby\x3d'"+
5c+"'\x3e     \x3ctitle id\x3d'"+c+"'\x3eAnlage entfernen\x3c/title\x3e     \x3cuse xlink:href\x3d'#icon-trash' href\x3d'#icon-trash'\x3e\x3c/use\x3e   \x3c/svg\x3e\x3c/button\x3e"),768<=$(window).width()&&resizeFileInput(a,94)):(a.val(""),alert("Der Dateiname: \n"+d+"\nenthält Sonderzeichen und ist ungültig.\nErlaubt sind a-z, A-Z, 0-9, akzentuierte Buchstaben, Punkt, Unterstrich und Leerzeichen."))}else attachmentList[b]=null,fileSizes[b]=0,checkFileSizes()});
6function remove_file(a){$(".data-position-"+a+"").prev().remove();$(".data-position-"+a+"").remove();attachmentList.splice(a,1);var b=0;attachmentCount=1;fileSizes={};$(".customform input[type\x3dfile]").each(function(){var a=$(this);0<b?(attachmentCount++,a.attr("data-position",b),a.attr("name",attachmentName+(b+1)),""!=a.val()&&(a.next().attr("class","button button--icon remove-attachment-button data-position-"+b),a.next().attr("onclick","remove_file("+b+");"),a.next().next().attr("class","form__field--fileRemove data-position-"+
7b),a=this.files[0],fileSizes[b]=a.size)):(a.attr("data-position",0),a.attr("name",attachmentName),""!=a.val()&&(a.next().attr("class","button button--icon remove-attachment-button data-position-0"),a.next().attr("onclick","remove_file(0);"),a.next().next().attr("class","form__field--fileRemove data-position-0"),a=this.files[0],fileSizes[b]=a.size));b++;checkFileSizes()});""!=$(".customform input[type\x3dfile]").last().val()&&(attachmentCount++,a=$(".customform input[type\x3dfile]").first().clone(),
8a.val("").attr("name",attachmentName+($(".customform input[type\x3dfile]").length+1)).insertAfter($(".customform input[type\x3dfile]").last().next().next()),a.attr("data-position",attachmentCount-1),a.removeAttr("fa-set"));1===attachmentCount&&$(".customform input[type\x3dfile]").removeAttr("style")}function getSizeStringAuto(a){var b="";$.isNumeric(a)&&(1024>a?b=""+a+" B":1048576>a?b=""+Math.round(a/1024)+" KB":1073741824>a&&(b=""+(a/1024/1024).toFixed(2)+" MB"));return b}
9function checkFileSizes(){var a=0,b;for(b in fileSizes)a+=fileSizes[b];a>maxFileSize?(fileSizeWarningOff(),fileSizeWarning()):fileSizeWarningOff()}
10function fileSizeWarning(){$(".input-Anhang").parent().children(".labelrechts").first().append('\x3clabel id\x3d"anhangwarnung" style\x3d"color: red; font-weight: bold;"\x3eAchtung: Die Dateien sind insgesamt größer als 15 MB.\x3c/label\x3e');$(".formButtonContainer button").attr("disabled","true").css("opacity","0.3");$(".form__field--file").append('\x3cspan id\x3d"anhangwarnung" style\x3d"color: red; font-weight: bold;"\x3eAchtung: Die Dateien sind insgesamt größer als 15 MB.\x3c/span\x3e');$(".form__buttons .button").attr("disabled",
11"true").css("opacity","0.3")}function fileSizeWarningOff(){$("#anhangwarnung").remove();$(".formButtonContainer button").removeAttr("disabled").css("opacity","1");$(".form__buttons .button").removeAttr("disabled").css("opacity","1")}
12function readUploadedFileAsText(a,b,e){var c=new FileReader;$(".overlay").show();return new Promise(function(f,d){c.onerror=function(){c.abort();d(new DOMException("Problem parsing input file."))};c.onload=function(d){d={name:a.name,value:new Uint8Array(d.target.result),fieldname:b};attachmentList[e]=d;f(c.result);$(".overlay").hide()};c.readAsArrayBuffer(a)})}function getAllowedExtensions(){return Array.isArray(window.allowedExtensions)?window.allowedExtensions:defaultAllowedExtensions}
13function getAllowedExtensionsString(){return window.allowedExtensionsString?window.allowedExtensionsString:defaultAllowedExtensionsString}function resizeFileInput(a,b){768>$(window).width()?a.removeAttr("style"):a.attr("style","width: "+b+"% !important;")}function resizeFileInput(a,b){var e=0<a.siblings(".remove-attachment-button").length||1<attachmentCount&&768<=$(window).width();768<=$(window).width()&&e?a.attr("style","width: "+b+"% !important;"):a.removeAttr("style")}
14$(window).resize(function(){var a=$(".input__attachment");resizeFileInput(a,94)});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.