PageSourceSearch

https://www.estproperty.com.au/wc/7.0.0/plugins/form-editor/js/form-page/form.js?current_gen=290926-7215c1fa

js estproperty.com.au collected 2026-10-04 02:43:31 UTC 11,774 bytes, 23 lines download raw bytes

1$(function(){$.extend(VALIDATION_RULES,{"file-extensions":{check:function(value,extensions,input){var files=input[0].files,file=files.length>0?files[0]:null;if(file){var names=file.name.split("."),fileExt=names.length>1?names.pop():undefined,isFound=extensions.indexOf(fileExt);if(isFound<0)return{msg_params:[extensions.join(", ")]}}return true},msg_template:"invalid.file.extension"},"file-size":{check:function(value,params,input){var size=parseFloat(params[0])*(params[1].trim()=="kb"?1024:1024*1024),
2files=input[0].files,file=files.length>0?files[0]:null;if(file&&file.size>size)return{msg_params:[params[0]+params[1]]};return true},msg_template:"size.limit.exceeded"},"date-range":{check:function(value,params,input){value=value?value.split(" ")[0]:"";var startDate=params[0]&&params[0]!=" "?new Date(params[0]):"";var endDate=params[1]&&params[1]!=" "?new Date(params[1]):"";var selectedDate=value&&value!=" "?new Date(value):"";if(!(selectedDate>=startDate&&selectedDate<=endDate)&&startDate&&endDate)return{msg_template:"date.not.in.range",
3msg_params:[params[0],params[1]]};else if(startDate==""&&endDate&&selectedDate>endDate)return{msg_template:"date.not.less",msg_params:[params[1]]};else if(endDate==""&&startDate&&selectedDate<startDate)return{msg_template:"date.not.greater",msg_params:[params[0]]};return true}},"time-range":{check:function(value,params,input){var startTime,endTime,selectedTime;value=!isNaN(new Date(value))?value.split(" ")[1]:value;startTime=getTimeInMinute(params[0]);endTime=getTimeInMinute(params[1].split(":")[0]==
4"00"?params[1].replace("00:","24:"):params[1]);selectedTime=getTimeInMinute(value);function getTimeInMinute(time){var arr=time&&time!=" "?time.split(":"):[];var hour=parseInt(arr[0]);var minute=parseInt(arr[1]);var period=arr[2]?arr[2].toLowerCase():arr[2];var result=null;if(period=="am"||period=="pm")result=period=="am"?(hour==12?0:hour)*60+minute:(hour==12?hour:hour+12)*60+minute;else result=hour*60+minute;return result}if(!(selectedTime>=startTime&&selectedTime<=endTime)&&startTime&&endTime)return{msg_template:"time.not.in.range",
5msg_params:[params[0],params[1]]};else if(!startTime&&endTime&&selectedTime>endTime)return{msg_template:"time.not.less",msg_params:[params[1]]};else if(!endTime&&startTime&&selectedTime<startTime)return{msg_template:"time.not.greater",msg_params:[params[0]]};return true}}});app.config.form_editor_submission_response_display_time=5E3;$(".custom-form").each(function(){var thisForm=$(this);if(thisForm.is(".redemption-form-template"))thisForm.find(".form-row.file.mandatory input").attr("validation","skip@if{self:hidden}");
6var beforeHandler=thisForm.find("span.before-form-submit").text();var msgBlock=thisForm.find("span.before-form-submit"),senderEmail=thisForm.find("[type=hidden].sender-email-hidden-filed"),senderEmailFieldUUID=thisForm.find("[type=hidden][name=senderEmailFieldUUID]").val(),conditionsHolder=JSON.parse(thisForm.find(".conditions-cache").text());thisForm.find(senderEmailFieldUUID?"#ff-"+senderEmailFieldUUID:"").on("change",function(){senderEmail.val($(this).val())});function applyCondition(fieldId){var conditions=
7conditionsHolder[fieldId],field=thisForm.find("#fw-"+fieldId+" [name^='submit.']"),fieldValue=field.attr("type")=="radio"?field.filter(":checked").val():field.val();conditions.everyCustomFunc(function(index,condition){var dependent=thisForm.find("#fw-"+condition.dependentFieldUUID),result;if(condition.targetOption==fieldValue)result=condition.action;else result=condition.action=="show"?"hide":"show";
7if(result=="show"){dependent.find("input, select").removeAttr("disabled");dependent.show()}else{dependent.find("input, select").attr("disabled",
8"disabled");dependent.hide();thisForm.updateValidator()}})}$.each(conditionsHolder,function(key,value){applyCondition(key);thisForm.find("#fw-"+key+" [name^='submit.']").on("change",function(){applyCondition(key)})});thisForm.form({preSubmit:function(){try{var form=thisForm;thisForm.find(".form-row.dropDown select").trigger("change");if(thisForm.find(".validation-error").length)return false;if(thisForm&&thisForm.is(".should-show-loader-on-submit"))thisForm.loader();eval(beforeHandler)}catch(error){}},
9ajax:{success:function(response){thisForm.find("table.redemption-items-preview-table").remove();if(response&&response.redirect_url)window.location.href=response.redirect_url;else{if(thisForm&&thisForm.is(".should-show-loader-on-submit"))thisForm.loader(false);thisForm.trigger("reset");var msgDiv=$('<div class="message-block info-message">'+response.message+"</div>");thisForm.find(".message-block").remove();msgBlock.before(msgDiv);if(response.hasCaptcha)app.captchaUtil.reloadCaptcha(response.captchaType);
10var afterHandler=thisForm.find("span.after-form-submit").text();try{var form=thisForm;eval(afterHandler)}catch(error){}setTimeout(function(){msgDiv.remove()},app.config.form_editor_submission_response_display_time)}},error:function(a,b,response){if(thisForm&&thisForm.is(".should-show-loader-on-submit"))thisForm.loader(false);var msgDiv=$('<div class="message-block error-message">'+response.message+"</div>");thisForm.find(".message-block").remove();msgBlock.before(msgDiv);msgDiv.scrollHere();if(response.hasCaptcha)app.captchaUtil.reloadCaptcha(response.captchaType);
11setTimeout(function(){msgDiv.remove()},app.config.form_editor_submission_response_display_time)}}});function showFileInfo(dropzone,file){dropzone.find(":not(.dropzone-text)").remove();var preview='<div class="file-preview"><span class="file-name">'+file.name+"</span><span>"+file.size.toByteNotation()+"</span></div>";dropzone.append(preview);dropzone.find(".dropzone-text").hide();dropzone.addClass("file-added")}function removeFileInfo(dropzone){dropzone.find(":not(.dropzone-text)").remove();dropzone.removeClass("file-added");
12dropzone.find(".dropzone-text").show()}var fileFields=thisForm.find("input[type=file]");fileFields.on("change",function(evt){var file=this.files[0];var dropzone=$(this).siblings(".dropzone");if(file)showFileInfo(dropzone,file);else removeFileInfo(dropzone)});thisForm.on("reset",function(){setTimeout(function(){fileFields.each(function(){var dropzone=$(this).siblings(".dropzone");removeFileInfo(dropzone)});resetRedemptionForm();thisForm.updateValidator()},100)});thisForm.find(".auto-address-suggest").each(function(){bm.initAutoAddressSuggest(thisForm,
13this.jqObject)});thisForm.find(".save-redemption-with-multi-products").on("click",function(){if($(this).hasClass("disable")){bm.notify("Please select product and proceed","alert");throw new Error("product table required");}thisForm.find(".form-row.product select").removeAttr("validation");thisForm.updateValidator()});function resetRedemptionForm(){thisForm.find("table.redemption-items-preview-table").remove();thisForm.find(".product-variation-for-form").remove();if(thisForm.find(".add-to-proceed").length)thisForm.find(".save-redemption-with-multi-products").nat.setAttribute("disabled",
14"")}function renderPreview(productEle,variationEle,imageData){var product=productEle.val(),variation=variationEle.val();var _thisForm=thisForm.find(".before-btn");if(!_thisForm.find("table.redemption-items-preview-table").length)_thisForm.append("<table class='redemption-items-preview-table'><tbody class='redemption-items-preview-body'><tr class='redemption-items-preview-header'><td class='product-header'>Product</td><td class='variation-header'>Card Number</td><td class='image-header'>Order Photo</td><td class='action-header'>Action</td></></tr></tbody></table>");
15var previewDom="<tr class='item-preview'><td class='product-col'><input type='hidden' name='products' value="+product+">"+productEle.find("option:selected").text()+"</td>"+"<td class='variation-col'><input type='hidden' name='productVariations' value="+variation+">"+variationEle.find("option:selected").text()+"</td><td class='photo-col'>";if(imageData)previewDom+="<input type='hidden' name='orderPhotos' value="+imageData+"> <img class='order-photo-preview' src="+imageData+">";var trashIconDom=thisForm.find(".copy-trash-icon").nat;
16previewDom+="</td><td class='action-col'><span class='remove-item'>"+trashIconDom.innerHTML+"</span></span></td></tr>";_thisForm.find("table .redemption-items-preview-body").append(previewDom);_thisForm.find("table .redemption-items-preview-body .remove-item").on("click",function(){this.parentElement.parentElement.remove();if(_thisForm.find("table .item-preview").length===0){_thisForm.find("table.redemption-items-preview-table").remove();thisForm.find(".save-redemption-with-multi-products").nat.setAttribute("disabled",
17"")}});productEle.reset();thisForm.find(".product-variation-for-form").remove();if(imageData){thisForm.find("input[name='submit.orderPhoto']").reset();thisForm.find(".file-preview").remove();thisForm.find(".dropzone-text").show()}thisForm.find(".save-redemption-with-multi-products").removeAttr("disabled")}thisForm.find(".add-to-proceed").on("click",async function(){var productEle=thisForm.find(".wc-product-field");if(productEle&&productEle.length&&!productEle.val()){bm.notify("Select product","alert");
18return}var variationEle=thisForm.find(".product-variation");if(variationEle&&variationEle.length&&!variationEle.val()){bm.notify("Select variation","alert");return}var imageData;var file=thisForm.find("input[name='submit.orderPhoto']").get(0).files[0];if(file){var reader=new FileReader;
18reader.readAsDataURL(file);reader.onload=function(){imageData=reader.result;renderPreview(productEle,variationEle,imageData)};reader.onerror=function(error){console.log("Error: ",error)}}else if(thisForm.find(".form-row.file.mandatory").length)bm.notify("Add order photo",
19"alert");else renderPreview(productEle,variationEle,imageData)});thisForm.find(".wc-product-field").on("change",function(){var _self=this;thisForm.loader();if(_self.jqObject.parent().parent().parent().find(".product-variation-for-form").length)_self.jqObject.parent().parent().parent().find(".product-variation-for-form").remove();var productId=this.jqObject.val();if(productId)bm.ajax({url:app.baseUrl+"formPage/hasProductDependencyForAction",dataType:"JSON",data:{productId:productId},success:function(resp){var hasDependency=
20resp.hasDependency;var dependencies=resp.dependencies;if(hasDependency)if(dependencies.childProduct)bm.ajax({url:app.baseUrl+"formPage/getProductVariationDataList",dataType:"html",data:{productId:productId},success:function(resp){_self.jqObject.parent().parent().after(resp);thisForm.loader(false);thisForm.updateValidator()}});else bm.renderSitePopup(app.baseUrl+"formPage/getProductDependencyDataUI",$.i18n.prop("proceed.with.fill.up"),"",{productId:productId},{clazz:"wc-form-product-dependency-data-ui",
21events:{content_loaded:function(popup){var popupBody=popup.el;var doneButton=popupBody.find(".done-button");thisForm.loader(false);doneButton.on("click",function(){var dependencyForm=popupBody.find("form");if(dependencyForm.valid()){var hiddenFields="";dependencyForm.serializeArray().forEach(function(item){hiddenFields+='<input type="hidden" name="'+item.name+'" value="'+item.value+'">'});thisForm.find(".wc-product-field-dependency-panel").html(hiddenFields);popup.close()}})}}});else thisForm.loader(false)},
22error:function(jqXHR,textStatus,errorThrown){thisForm.loader(false)}});else thisForm.loader(false)})});bm.onReady(window,"moment",function(){bm.onReady($.fn,"combodate",function(){$(".dropdown-time-picker").each(function(){$(this).combodate({firstItem:"name",minuteStep:1})});$(".dropdown-date-picker").each(function(){$(this).combodate({firstItem:"name",smartDays:true,maxYear:(new Date).getFullYear()})});$(".dropdown-date-time-picker").each(function(){$(this).combodate({firstItem:"name",smartDays:true,
23maxYear:(new Date).getFullYear(),minuteStep:1})})})})});

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.