PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5.1
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5.1
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / build / frontend / media.field.restrictions.js
jetformbuilder / assets / build / frontend Last commit date
advanced.reporting.asset.php 1 month ago advanced.reporting.js 1 month ago calculated.field.asset.php 1 month ago calculated.field.js 1 month ago conditional.block.asset.php 1 month ago conditional.block.js 1 month ago dynamic.value.asset.php 1 month ago dynamic.value.js 1 month ago main.asset.php 2 weeks ago main.css 1 month ago main.js 2 weeks ago media.field.asset.php 1 month ago media.field.js 1 month ago media.field.restrictions.asset.php 2 weeks ago media.field.restrictions.js 2 weeks ago multi.step.asset.php 1 month ago multi.step.js 1 month ago
media.field.restrictions.js
1 lines
1 (()=>{"use strict";const{AdvancedRestriction:t}=JetFormBuilderAbstract;function e(){t.call(this),this.watchedAttrs.push("max_files"),this.isSupported=function(t){return"file"===t?.type},this.validate=function(){var t;const{max_files:e}=this.reporting.input.attrs;let{current:i}=this.reporting.input.value;return i=null!==(t=i?.length)&&void 0!==t?t:0,!i||i<=e.value.current},this.getRawMessage=function(){return this.getMessageBySlug("max_files")}}e.prototype=Object.create(t.prototype);const i=e,{AdvancedRestriction:r}=JetFormBuilderAbstract;function n(){r.call(this)}n.prototype=Object.create(r.prototype),n.prototype.file=null,n.prototype.setFile=function(t){this.file=t};const o=n;function s(){o.call(this),this.watchedAttrs.push("max_size"),this.validate=function(){const{max_size:t}=this.reporting.input.attrs;return this.file.size<=t.value.current},this.getRawMessage=function(){return this.getMessageBySlug("file_max_size")}}s.prototype=Object.create(o.prototype);const l=s;function u(){o.call(this),this.watchedAttrs.push("file_ext"),this.isSupported=function(t,e){const{file_ext:i=!1}=e.input.attrs;return!1!==i},this.validate=function(){const{file_ext:t}=this.reporting.input.attrs;return t.value.current.includes(this.file.type)},this.getRawMessage=function(){return this.getMessageBySlug("file_ext")}}u.prototype=Object.create(o.prototype);const c=u,{applyFilters:a}=JetPlugins.hooks;let p=[];const{allRejected:f}=JetFormBuilderFunctions,{AdvancedRestriction:d}=JetFormBuilderAbstract;function h(){d.call(this),this.isSupported=function(t){return"file"===t?.type},this.getRawMessage=function(){return""}}h.prototype=Object.create(d.prototype),h.prototype.singleFileRestrictions=[],h.prototype.setReporting=function(t){d.prototype.setReporting.call(this,t),this.singleFileRestrictions=function(t){p.length||(p=a("jet.fb.restrictions.file",[l,c]));const e=[];for(const i of p){const r=new i;r.isSupported(t.getNode(),t)&&(r.setReporting(t),r.onReady(),e.push(r))}return e}(t)},h.prototype.validatePromise=async function(){var t;const e=this.reporting.input.callable,i=Array.from(null!==(t=this.reporting.input.value?.current)&&void 0!==t?t:[]),r=[];for(const t of i){if(!(t instanceof File))continue;const e=this.singleFileRestrictions.map(e=>(i,r)=>{e.setFile(t),e.validatePromise().then(i).catch(()=>r(e))});r.push((i,r)=>{Promise.allSettled(e.map(t=>new Promise(t))).then(e=>{const n=e.filter(({status:t})=>"rejected"===t).map(({reason:t,value:e})=>null!=t?t:e);n.length?r({file:t,rejected:n}):i()})})}if(!r?.length)return Promise.resolve();const n=await f(r);for(const t of i){const i=e.getFileNode(t.name).querySelector(".jet-form-builder-file-upload__file-invalid-marker"),[r={}]=n.filter(({file:e})=>e===t);i.style.display=r?.rejected?.length?"block":"none",i.title=r?.rejected?.length?r?.rejected[0].getMessage():""}return Boolean(n.length)?Promise.reject("validate is wrong"):Promise.resolve()};const g=h,m=window.wp.i18n,{Filter:y}=JetFormBuilderAbstract,{Kb_In_Bytes:b,Mb_In_Bytes:_,Gb_In_Bytes:j,Tb_In_Bytes:v}=JetFormBuilderConst,{getLanguage:B}=JetFormBuilderFunctions,F={[(0,m._x)("TB","unit symbol","jet-form-builder")]:v,[(0,m._x)("GB","unit symbol","jet-form-builder")]:j,[(0,m._x)("MB","unit symbol","jet-form-builder")]:_,[(0,m._x)("KB","unit symbol","jet-form-builder")]:b,[(0,m._x)("B","unit symbol","jet-form-builder")]:1},x=B();function w(){y.call(this),this.getSlug=function(){return"sizeFormat"},this.apply=function(t){if(t=+t,Number.isNaN(t)||0===t)return"0 B";for(const[e,i]of Object.entries(F))if(!(t<i))return t=(t/i).toFixed(2),new Intl.NumberFormat(x).format(t)+" "+e;return"0 B"}}w.prototype=Object.create(y.prototype);const R=w,{addFilter:A}=JetPlugins.hooks;A("jet.fb.restrictions","jet-form-builder/media-field",function(t){return[i,g,...t]}),A("jet.fb.filters","jet-form-builder/media-field",function(t){return t.push(R),t})})();