1"undefined" == typeof window.EasyStore && (window.EasyStore = {}), EasyStore.bind = function(t, e) { 2 return function() { 3 return t.apply(e, arguments) 4 } 5}, EasyStore.setSelectorByValue = function(t, e) { 6 for (var n = 0, r = t.options.length; r > n; n++) { 7 var i = t.options[n]; 8 if (e == i.value || e == i.innerHTML) return t.selectedIndex = n, n 9 } 10}, EasyStore.addListener = function(t, e, n) { 11 t.addEventListener ? t.addEventListener(e, n, !1) : t.attachEvent("on" + e, n) 12}, EasyStore.postLink = function(t, e) { 13 e = e || {}; 14 var n = e.method || "post", 15 r = e.parameters || {}, 16 i = document.createElement("form"); 17 i.setAttribute("method", n), i.setAttribute("action", t); 18 for (var o in r) { 19 var a = document.createElement("input"); 20 a.setAttribute("type", "hidden"), a.setAttribute("name", o), a.setAttribute("value", r[o]), i.appendChild(a) 21 } 22 document.body.appendChild(i), i.submit(), document.body.removeChild(i) 23}, EasyStore.CountryProvinceSelector = function(t, e, n) { 24 this.countryEl = document.getElementById(t), 25 this.provinceEl = document.getElementById(e), 26 this.provinceContainer = document.getElementById(n.hideElement || e), 27 this.provinceContainer2 = document.getElementById(n.hideElement+'2' || e+'2'), 28 this.subDistrictContainer = n.hideElement_sub_district ? document.getElementById(n.hideElement_sub_district) : null, 29 this.villageContainer = n.hideElement_village ? document.getElementById(n.hideElement_village) : null, 30 EasyStore.addListener(this.countryEl, "change", 31 EasyStore.bind(this.countryHandler, this)), 32 this.initCountry(), 33 this.initProvince() 34}, EasyStore.CountryProvinceSelector.prototype = { 35 initCountry: function() { 36 var t = this.countryEl.getAttribute("data-default"); 37 EasyStore.setSelectorByValue(this.countryEl, t), this.countryHandler() 38 }, 39 initProvince: function() { 40 var t = this.provinceEl.getAttribute("data-default"); 41 t && this.provinceEl.options.length > 0 && EasyStore.setSelectorByValue(this.provinceEl, t) 42 }, 43 countryHandler: function(t) { 44 var e = this.countryEl.options[this.countryEl.selectedIndex], 45 n = e.getAttribute("data-provinces"), 46 r = JSON.parse(n), 47 have_sub_district = ["PH", "ID"], 48 have_village = ["ID"]; 49 50 if(this.subDistrictContainer) this.subDistrictContainer.style.display = "none"; 51 if(this.subDistrictContainer && have_sub_district.includes(e.value)) this.subDistrictContainer.style.display = ""; 52 53 if(this.villageContainer) this.villageContainer.style.display = "none"; 54 if(this.villageContainer && have_village.includes(e.value)) this.villageContainer.style.display = ""; 55 56 if (this.clearOptions(this.provinceEl), r && 0 == r.length) { 57 this.provinceContainer.style.display = "none"; 58 this.provinceContainer2.style.display = ""; 59 } 60 else { 61 for (var i = 0; i < r.length; i++) { 62 var e = document.createElement("option"); 63 e.value = r[i][0], e.innerHTML = r[i][1], this.provinceEl.appendChild(e) 64 } 65 this.provinceContainer.style.display = ""; 66 this.provinceContainer2.style.display = "none"; 67 } 68 }, 69 clearOptions: function(t) { 70 for (; t.firstChild;) t.removeChild(t.firstChild) 71 }, 72 setOptions: function(t, e) { 73 var n = 0; 74 for (e.length; n < e.length; n++) { 75 var r = document.createElement("option"); 76 r.value = e[n], r.innerHTML = e[n], t.appendChild(r) 77 } 78 } 79};
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.