| Server IP : 103.48.194.25 / Your IP : 216.73.216.231 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/ngoaingusonganh.com-bk/public_html/skin/js/ |
Upload File : |
function floatToString(t, r) {
var e = t.toFixed(r).toString();
return e.match(/^\.\d+/) ? "0" + e : e
}
function attributeToString(t) {
return "string" != typeof t && (t += "", "undefined" === t && (t = "")), jQuery.trim(t)
}
"undefined" == typeof Myweb && (Myweb = {});
Myweb.mediaDomainName = site;
Myweb.money_format = "${{amount}}", Myweb.onError = function (XMLHttpRequest, textStatus) {
var data = eval("(" + XMLHttpRequest.responseText + ")");
alert(data.message ? data.message + "(" + data.status + "): " + data.description : "Error : " + Myweb.fullMessagesFromErrors(data).join("; ") + ".")
}, Myweb.fullMessagesFromErrors = function (t) {
var r = [];
return jQuery.each(t, function (t, e) {
jQuery.each(e, function (e, o) {
r.push(t + " " + o)
})
}), r
}, Myweb.onCartUpdate = function (t) {
alert("There are now " + t.item_count + " items in the cart.")
}, Myweb.onCartShippingRatesUpdate = function (t, r) {
var e = "";
r.zip && (e += r.zip + ", "), r.province && (e += r.province + ", "), e += r.country, alert("There are " + t.length + " shipping rates available for " + e + ", starting at " + Myweb.formatMoney(t[0].price) + ".")
}, Myweb.onItemAdded = function (t) {
alert(t.title + " was added to your shopping cart.")
}, Myweb.onProduct = function (t) {
alert("Received everything we ever wanted to know about " + t.title)
}, Myweb.formatMoney = function (amount, moneyFormat) {
function getDefault(value, defaultValue) {
if (typeof value == "undefined")
return defaultValue;
return value;
}
function formatMoney(amount, decimal, thousandSeperate, decimalSeperate) {
decimal = getDefault(decimal, 2);
thousandSeperate = getDefault(thousandSeperate, ",");
decimalSeperate = getDefault(decimalSeperate, ".");
if (isNaN(amount) || null == amount)
return 0;
amount = amount.toFixed(decimal);
var amountParts = amount.split(".");
var integer = amountParts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + thousandSeperate);
var decimal = amountParts[1] ? decimalSeperate + amountParts[1] : "";
return integer + decimal;
}
if (typeof amount == "string") {
amount = amount.replace(".", "");
amount = amount.replace(",", "");
}
var result = "";
var moneyRegex = /\{\{\s*(\w+)\s*\}\}/;
moneyFormat = moneyFormat || this.money_format;
switch (moneyFormat.match(moneyRegex)[1]) {
case "amount":
result = formatMoney(amount, 2);
break;
case "amount_no_decimals":
result = formatMoney(amount, 0);
break;
case "amount_with_comma_separator":
result = formatMoney(amount, 2, ".", ",");
break;
case "amount_no_decimals_with_comma_separator":
result = formatMoney(amount, 0, ".", ",")
}
return moneyFormat.replace(moneyRegex, result)
}, Myweb.resizeImage = function (t, r) {
try {
if ("original" == r)
return t;
var thumbDomain = Myweb.mediaDomainName + "thumb/" + r + "/";
return t.replace(Myweb.mediaDomainName, thumbDomain).split('?')[0];
} catch (o) {
return t
}
}, Myweb.addItem = function (t, r, e) {
var r = r || 1,
o = {
type: "POST",
url: "/sanpham/cart/add",
data: "quantity=" + r + "&VariantId=" + t,
dataType: "json",
success: function (t) {
"function" == typeof e ? e(t) : Myweb.onItemAdded(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(o)
}, Myweb.addItemFromForm = function (t, r) {
var e = {
type: "POST",
url: "/sanpham/cart/add",
data: jQuery("#" + t).serialize(),
dataType: "json",
success: function (t) {
"function" == typeof r ? r(t) : Myweb.onItemAdded(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(e)
}, Myweb.getCart = function (t) {
jQuery.getJSON("/sanpham/cart/get", function (r) {
"function" == typeof t ? t(r) : Myweb.onCartUpdate(r)
})
}, Myweb.pollForCartShippingRatesForDestination = function (t, r, e) {
e = e || Myweb.onError;
var o = function () {
jQuery.ajax("/sanpham/cart/shipping", {
dataType: "json",
success: function (e, n, a) {
200 === a.status ? "function" == typeof r ? r(e.shipping_rates, t) : Myweb.onCartShippingRatesUpdate(e.shipping_rates, t) : setTimeout(o, 500)
},
error: e
})
};
return o
}, Myweb.getCartShippingRatesForDestination = function (t, r, e) {
e = e || Myweb.onError;
var o = {
type: "POST",
url: "/cart/prepare_shipping_rates",
data: Myweb.param({
shipping_address: t
}),
success: Myweb.pollForCartShippingRatesForDestination(t, r, e),
error: e
};
jQuery.ajax(o)
}, Myweb.getProduct = function (t, r) {
jQuery.getJSON("/products/" + t + ".js", function (t) {
"function" == typeof r ? r(t) : Myweb.onProduct(t)
})
}, Myweb.changeItem = function (t, r, e) {
var o = {
type: "POST",
url: "/sanpham/cart/change",
data: "quantity=" + r + "&variantId=" + t,
dataType: "json",
success: function (t) {
"function" == typeof e ? e(t) : Myweb.onCartUpdate(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(o)
}, Myweb.removeItem = function (t, r) {
var e = {
type: "POST",
url: "/sanpham/cart/change",
data: "quantity=0&variantId=" + t,
dataType: "json",
success: function (t) {
"function" == typeof r ? r(t) : Myweb.onCartUpdate(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(e)
}, Myweb.clear = function (t) {
var r = {
type: "POST",
url: "/sanpham/cart/clear",
data: "",
dataType: "json",
success: function (r) {
"function" == typeof t ? t(r) : Myweb.onCartUpdate(r)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(r)
}, Myweb.updateCartFromForm = function (t, r) {
var e = {
type: "POST",
url: "/sanpham/cart/update",
data: jQuery("#" + t).serialize(),
dataType: "json",
success: function (t) {
"function" == typeof r ? r(t) : Myweb.onCartUpdate(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(e)
}, Myweb.updateCartAttributes = function (t, r) {
var e = "";
jQuery.isArray(t) ? jQuery.each(t, function (t, r) {
var o = attributeToString(r.key);
"" !== o && (e += "attributes[" + o + "]=" + attributeToString(r.value) + "&")
}) : "object" == typeof t && null !== t && jQuery.each(t, function (t, r) {
e += "attributes[" + attributeToString(t) + "]=" + attributeToString(r) + "&"
});
var o = {
type: "POST",
url: "/sanpham/cart/update",
data: e,
dataType: "json",
success: function (t) {
"function" == typeof r ? r(t) : Myweb.onCartUpdate(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(o)
}, Myweb.updateCartNote = function (t, r) {
var e = {
type: "POST",
url: "/sanpham/cart/update",
data: "note=" + attributeToString(t),
dataType: "json",
success: function (t) {
"function" == typeof r ? r(t) : Myweb.onCartUpdate(t)
},
error: function (t, r) {
Myweb.onError(t, r)
}
};
jQuery.ajax(e)
}, jQuery.fn.jquery >= "1.4" ? Myweb.param = jQuery.param : (Myweb.param = function (t) {
var r = [],
e = function (t, e) {
e = jQuery.isFunction(e) ? e() : e, r[r.length] = encodeURIComponent(t) + "=" + encodeURIComponent(e)
};
if (jQuery.isArray(t) || t.jquery) jQuery.each(t, function () {
e(this.name, this.value)
});
else
for (var o in t) Myweb.buildParams(o, t[o], e);
return r.join("&").replace(/%20/g, "+")
}, Myweb.buildParams = function (t, r, e) {
jQuery.isArray(r) && r.length ? jQuery.each(r, function (r, o) {
rbracket.test(t) ? e(t, o) : Myweb.buildParams(t + "[" + ("object" == typeof o || jQuery.isArray(o) ? r : "") + "]", o, e)
}) : null != r && "object" == typeof r ? Myweb.isEmptyObject(r) ? e(t, "") : jQuery.each(r, function (r, o) {
Myweb.buildParams(t + "[" + r + "]", o, e)
}) : e(t, r)
}, Myweb.isEmptyObject = function (t) {
for (var r in t) return !1;
return !0
});