- Effortless Odoo Community Hosting with AI-Powered Automation —
- Scale Your Business Seamlessly
+ Effortless Odoo Community Hosting with AI-Powered Automation
+ — Scale Your Business Seamlessly
@@ -1732,16 +2010,18 @@
}
setTimeout(function () {
- document.getElementById("pop").style.display = "flex";
- }, 5000);
- function closepop() {
- document.getElementById("pop").style.display = "none";
- }
- document
- .getElementById("pop")
- .addEventListener("click", function (e) {
- if (e.target === this) closepop();
- });
+ var blogSection = document.getElementById("blog");
+ if (blogSection) {
+ function onBlogScroll() {
+ var rect = blogSection.getBoundingClientRect();
+ if (rect.top < window.innerHeight && rect.bottom > 0) {
+ openTrialWidget();
+ window.removeEventListener("scroll", onBlogScroll);
+ }
+ }
+ window.addEventListener("scroll", onBlogScroll);
+ }
+ }, 3000);
document.querySelectorAll(".tab-btn").forEach(function (b) {
b.addEventListener("click", function () {
@@ -1760,6 +2040,89 @@
});
});
+ /* ---- Order Widget ---- */
+ var orderPopupShown = false;
+ function openOrderWidget(
+ plan,
+ monthlyPrice,
+ yearlyPrice,
+ isEmpire,
+ ) {
+ document.getElementById("orderPanelTrial").style.display =
+ "none";
+ document.getElementById("orderPanelBuy").style.display =
+ "block";
+ var widget = document.getElementById("orderWidgetOverlay");
+ document.getElementById("orderPlanTitle").textContent = plan;
+ var yearly = yearlyMode;
+ var price = yearly ? yearlyPrice : monthlyPrice;
+ var amountEl = document.getElementById("orderPlanPrice");
+ var prefix = isEmpire ? ">$" : "$";
+ amountEl.textContent = prefix + " " + price.toFixed(2);
+ document.getElementById("orderPlanPeriod").textContent = yearly
+ ? "/ year"
+ : "/ month";
+ var couponMsg = document.getElementById("orderCouponMsg");
+ var yearlySave = document.getElementById("orderYearlySave");
+ if (!yearly) {
+ couponMsg.style.display = "block";
+ yearlySave.style.display = "none";
+ } else {
+ couponMsg.style.display = "none";
+ yearlySave.style.display = "block";
+ var saved = Math.round(
+ (1 - yearlyPrice / (monthlyPrice * 12)) * 100,
+ );
+ document.getElementById("orderSavePercent").textContent =
+ saved;
+ }
+ var buyBtn = document.getElementById("orderBuyBtn");
+ var loc = document.getElementById("orderServerLocation").value;
+ buyBtn.href =
+ "/3/" +
+ price.toFixed(2) +
+ "/4/" +
+ encodeURIComponent(plan) +
+ "?location=" +
+ encodeURIComponent(loc);
+ widget.style.display = "flex";
+ orderPopupShown = true;
+ }
+ function openTrialWidget() {
+ document.getElementById("orderPanelBuy").style.display = "none";
+ document.getElementById("orderPanelTrial").style.display =
+ "block";
+ document.getElementById("orderWidgetOverlay").style.display =
+ "flex";
+ orderPopupShown = true;
+ }
+ function switchToBuyPanel() {
+ openOrderWidget("On the Rise", 36.21, 395.0, false);
+ }
+ function closeOrderWidget() {
+ document.getElementById("orderWidgetOverlay").style.display =
+ "none";
+ }
+ document
+ .getElementById("orderServerLocation")
+ .addEventListener("change", function () {
+ var plan =
+ document.getElementById("orderPlanTitle").textContent;
+ var priceText = document
+ .getElementById("orderPlanPrice")
+ .textContent.replace(">$", "")
+ .replace("$", "")
+ .trim();
+ var price = parseFloat(priceText);
+ var loc = this.value;
+ document.getElementById("orderBuyBtn").href =
+ "/3/" +
+ price.toFixed(2) +
+ "/4/" +
+ encodeURIComponent(plan) +
+ "?location=" +
+ encodeURIComponent(loc);
+ });
/* ---- Billing Toggle ---- */
var yearlyMode = false;
var biSwitch = document.getElementById("billingSwitch");
@@ -1771,8 +2134,11 @@
var amounts = document.querySelectorAll(".price-amount");
for (var k = 0; k < amounts.length; k++) {
var el = amounts[k];
- var val = yearly ? el.getAttribute("data-yearly") : el.getAttribute("data-monthly");
- var prefix = el.textContent.trim().charAt(0) === ">" ? ">" : "";
+ var val = yearly
+ ? el.getAttribute("data-yearly")
+ : el.getAttribute("data-monthly");
+ var prefix =
+ el.textContent.trim().charAt(0) === ">" ? ">" : "";
el.textContent = prefix + "$ " + parseFloat(val).toFixed(2);
}
var periods = document.querySelectorAll(".price-period");
@@ -1815,51 +2181,108 @@
filteredPosts: [],
currentPage: 1,
perPage: 6,
- searchTerm: ""
+ searchTerm: "",
};
function formatDate(dateStr) {
var d = new Date(dateStr + "T00:00:00Z");
- var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
- return months[d.getUTCMonth()] + " " + d.getUTCDate() + ", " + d.getUTCFullYear();
+ var months = [
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+ ];
+ return (
+ months[d.getUTCMonth()] +
+ " " +
+ d.getUTCDate() +
+ ", " +
+ d.getUTCFullYear()
+ );
}
function badgeClass(area) {
- var m = {"speed-run":"speed-run","guide":"guide","howto":"howto","news":"news"};
+ var m = {
+ "speed-run": "speed-run",
+ guide: "guide",
+ howto: "howto",
+ news: "news",
+ };
return m[area] || "default";
}
function renderBlog() {
var grid = document.getElementById("blogGrid");
var search = (blogState.searchTerm || "").toLowerCase();
- blogState.filteredPosts = blogState.allPosts.filter(function(p) {
- if (!search) return true;
- return (p.headline + " " + p.teaser).toLowerCase().indexOf(search) !== -1;
- });
+ blogState.filteredPosts = blogState.allPosts.filter(
+ function (p) {
+ if (!search) return true;
+ return (
+ (p.headline + " " + p.teaser)
+ .toLowerCase()
+ .indexOf(search) !== -1
+ );
+ },
+ );
var total = blogState.filteredPosts.length;
- var totalPages = Math.max(1, Math.ceil(total / blogState.perPage));
- if (blogState.currentPage > totalPages) blogState.currentPage = totalPages;
+ var totalPages = Math.max(
+ 1,
+ Math.ceil(total / blogState.perPage),
+ );
+ if (blogState.currentPage > totalPages)
+ blogState.currentPage = totalPages;
var start = (blogState.currentPage - 1) * blogState.perPage;
- var pagePosts = blogState.filteredPosts.slice(start, start + blogState.perPage);
+ var pagePosts = blogState.filteredPosts.slice(
+ start,
+ start + blogState.perPage,
+ );
var html = "";
if (pagePosts.length === 0) {
- html = "
No posts match your search.
";
+ html =
+ '
No posts match your search.
';
} else {
for (var i = 0; i < pagePosts.length; i++) {
var p = pagePosts[i];
var bc = badgeClass(p.area);
var agentHtml = "";
- if (p.agent) agentHtml = "" + p.agent + "";
- html += "