PageSourceSearch

https://vacancies.mfat.govt.nz/platform/js/j2w/min/j2w.agent.min.js?h=275f70e9

js mfat.govt.nz collected 2026-09-24 08:26:04 UTC 3,621 bytes, 9 lines download raw bytes

1var j2w=j2w||{};
2j2w.Agent=function(){var e={},f=!1,g=function(a){a=a.replace(/(\r\n|\n|\r)/gm," ");a.trim();return a},h=function(){this.location=this.keywords=this.label=this.type="";this.frequency=7;this.filterString=this.latitude=this.longitude=this.units=this.radius=this.geolocation="";this.facets={};this.getFilterString=function(){return this.filterString};this.setFilterString=function(a){this.filterString=a};this.getKeywords=function(){return this.keywords};this.setKeywords=function(a){this.keywords=a};this.getFacets=
3function(){return this.facets};this.setFacets=function(a){this.facets=a};this.getLocation=function(){return this.location};this.setLocation=function(a){this.location=a};this.getFrequency=function(){return this.frequency};this.setFrequency=function(a){this.frequency=parseInt(a,10)};this.getType=function(){return this.type};this.setType=function(a){this.type=a};this.getLabel=function(){return this.label};this.setLabel=function(a){this.label=a};this.getGeolocation=function(){return this.geolocation};
4this.setGeolocation=function(a){this.geolocation=a};this.getRadius=function(){return this.radius};this.setRadius=function(a){this.radius=Number(a)};this.getUnits=function(){return this.units};this.setUnits=function(a){this.units=a};this.getLongitude=function(){return this.longitude};this.setLongitude=function(a){this.longitude=Number(a)};this.getLatitude=function(){return this.latitude};this.setLatitude=function(a){this.latitude=Number(a)};return!0};return{init:function(a){f?a=!1:(e=a,a=f=!0);return a},
5Args:{get:function(a){return j2w.Args.get(a,e)}},buildAgentFromSearchForm:function(a){function b(a){var b=$.grep(d,function(b){return b.name==a});return 0==b.length?"":b[0].value}var d=a.serializeArray(),c=new h;c.setType(b("searchby")||"location");switch(c.getType()){case "distance":c.setGeolocation(b("geolocation"));c.setRadius(b("d"));c.setUnits(a.find("[name=d]").find(":selected").text().split(" ").pop());c.setLongitude(b("lon"));c.setLatitude(b("lat"));break;default:c.setLocation(b("locationsearch"))}c.setKeywords(b("q"));
6c.setFrequency(b("frequency"));c.setLabel(b("label"));return c},getValidationErrors:function(a,b){var d=[],c;for(c in a)if(a.hasOwnProperty(c)&&!a[c])switch(c){case "keywordOrLocation":d.push(b.tcmustprovidekeywordorloc);break;case "frequencyNumeric":d.push(b.tcfreqmustbenumeric);break;case "frequencyWithinRange":d.push(b.tcfreqmustbegtone);break;case "uniqueAgent":d.push(b.tcagentalreadyexists)}return d},setValidFrequency:function(a){var b=a.value;j2w.Validation.isInteger(b)&&99<b&&(a.value=b.slice(0,
72))},validateFrequency:function(a){var b=[];j2w.Validation.isInteger(a)||b.push(jsStr.tcfreqmustbenumeric);j2w.Validation.isInteger(a)&&(1>a||99<a)&&b.push(jsStr.tcfreqmustbegtone);return b},validateAgent:function(a){var b={valid:!0,validations:{keywordOrLocation:!0,frequencyNumeric:!0,frequencyWithinRange:!0,uniqueAgent:!0}};a.setKeywords(g(a.getKeywords()));a.setLocation(g(a.getLocation()));0==a.getKeywords().length&&("location"===a.getType()&&0===a.getLocation().length||"distance"===a.getType()&&
8(0===a.getGeolocation().length||0===a.getRadius().length))&&(b.validations.keywordOrLocation=!1);j2w.Validation.isInteger(a.getFrequency())||(b.validations.frequencyNumeric=!1);j2w.Validation.isInteger(a.getFrequency())&&(1>a.getFrequency()||99<a.getFrequency())&&(b.validations.frequencyWithinRange=!1);for(var d in b.validations)if(b.validations.hasOwnProperty(d)&&!b.validations[d]){b.valid=!1;break}return b},validateFrequencyForSubscribeWidget:function(a){a=this.validateFrequency(a.value);a.length&&
9alert(a.join("\n"))}}}();

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.