To register on the gatemaster website/app you either need to use your exisitng Woo ID or create a new one (see below).
Sign Up
Why sign up?
Get access to Registered User's priviledges, which may include hidden pages, special features and special pricing, if they exist, on this website.
Get access to all sites powered by Woo without having to enter your details everytime.
Sign In
Email Address (Woo ID)PasswordForgot Your Password?
User Name or Password is incorrect.
What is a Woo ID help
menu
shopping_cart
0
Cookies are disabled in your browser. This site requires cookies to manage your shopping cart.
Learn how to enable cookies.
Automatic Gate Openers
Make your life a whole lot easier...
Pedestrian
These gates are all galvanised and Powder coated to provide corrosion resistance and long life. We can build these to your specific dimension and design and they can be provided throughout New Zealand already set up for automation and or security. All you need to do is concrete them into the ground and connect the power if required. Typical freight from Christchurch to Auckland is around the $50.
Provided below are a sample of the different gates available. If you can’t find the gate you are looking for please send us photos of the design you require with approximate dimensions and let us provide you with a quotation.
And of course if you don't require automation we can provide you with a price for the Gate style you require. Dont forget to Check out our gallery for other example of our gates.
var woo_appProperties = (function() {
var woo_appProperties_Global = {};
var self = document.getElementById('woo_appProperties');
self.classList.add("woo-ui-gadget");
woo_appProperties_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded woo_appProperties");
}
return woo_appProperties_Global;
})();var gkxwvsqf_20248415557__820_857 = (function() {
var self = document.getElementById('gkxwvsqf_20248415557__820_857');
var gkxwvsqf_20248415557__820_857_Global = {};
gkxwvsqf_20248415557__820_857_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_20248415557__820_857");
}
return gkxwvsqf_20248415557__820_857_Global;
})();var gkxwvsqf_202494204618_139 = (function() {
var self = document.getElementById('gkxwvsqf_202494204618_139');
var gkxwvsqf_202494204618_139_Global = {};
gkxwvsqf_202494204618_139_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_202494204618_139");
}
return gkxwvsqf_202494204618_139_Global;
})();var gkxwvsqf_202382815548_882_561_699 = (function() {
var self = document.getElementById('gkxwvsqf_202382815548_882_561_699');
//self.classList.add("sun_editor_content");
var gkxwvsqf_202382815548_882_561_699_Global = {};
gkxwvsqf_202382815548_882_561_699_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_202382815548_882_561_699");
}
return gkxwvsqf_202382815548_882_561_699_Global;
})();var gkxwvsqf_2024919134944_840 = (function() {
var self = document.getElementById('gkxwvsqf_2024919134944_840');
var gkxwvsqf_2024919134944_840_Global = {};
gkxwvsqf_2024919134944_840_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_2024919134944_840");
}
function handleBreadcrumbClick(event) {
event.preventDefault(); // Prevent the default anchor behavior
var key = this.dataset.key;
var linked = this.dataset.linked; // Access the linked status from data attribute
var linkID = this.dataset.linkID; // Access the linkID from data attribute
var url = this.dataset.url; // Access the URL from data attribute
if (linked === "true") {
if (linkID !== "") {
// If linked is true and linkID is not empty, update the current page
Promise.all([woo.updateCurrentPage(linkID)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0; // Scroll to top
});
} else {
window.location = url; // Fallback navigation if linkID is empty
}
} else {
// If linked is false, just update the current page
Promise.all([woo.updateCurrentPage(key)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0; // Scroll to top
});
}
}
woo.getFullPageStructure().then((response) => {
console.log(response);
const result = findKeyAndParents(response, woo.getCurrentPage());
if (result) {
console.log(result);
var breadcrumbHTML = generateBreadcrumbHTML(result.path);
$(self).html(breadcrumbHTML);
} else {
console.log("Key not found");
}
});
function findKeyAndParents(obj, targetKey, path = []) {
for (var key in obj) {
if (obj.hasOwnProperty(key) && obj[key].props && obj[key].props.name) {
// Add key-name pair and linked-related info to the path
var currentPath = path.concat({
key: key,
name: obj[key].props.name,
linked: obj[key].props.linked || false, // Check if 'linked' is true
linkID: obj[key].props.linked ? obj[key].props.linkID : null, // Return linkID if linked is true
linkURL: obj[key].props.linked ? obj[key].props.linkURL : null // Return linkURL if linked is true
});
// Check if the key matches the targetKey
if (key === targetKey) {
return { value: obj[key].props.name, path: currentPath }; // Return the key-value pair
}
// If 'children' exist, recursively check them (async)
if (obj[key].children) {
var result = findKeyAndParents(obj[key].children, targetKey, currentPath);
if (result) {
return result;
}
}
}
}
return null; // Return null if targetKey is not found
}
function generateBreadcrumbHTML(path) {
if (!path || path.length === 0) return '';
var breadcrumbContainer = document.createElement('div'); // Create a container for breadcrumbs
for (var i = 0; i < path.length; i++) {
var item = path[i];
// If it's the last item, display it without a link
if (i === path.length - 1) {
var finalItem = document.createElement('span'); // Use a span for the final item
finalItem.textContent = item.name; // Just the name for the final item
breadcrumbContainer.appendChild(finalItem);
} else {
var linkElement = document.createElement('a'); // Create an anchor element
linkElement.className = "woo_breadcrumbLink";
linkElement.textContent = item.name; // Set the link text
linkElement.href = "#"; // Set href to '#' to avoid page jumps
linkElement.dataset.key = item.key; // Store linked status in a data attribute
linkElement.dataset.linked = item.linked; // Store linked status in a data attribute
linkElement.dataset.linkID = item.linkID; // Store linkID in a data attribute
linkElement.dataset.url = item.url; // Store url in a data attribute
// Add event listener to handle the click event
linkElement.addEventListener('click', handleBreadcrumbClick);
breadcrumbContainer.appendChild(linkElement); // Add link to the container
// Append separator " > " unless it's the last item
if (i < path.length - 1) { // Avoid adding a separator after the last link
breadcrumbContainer.appendChild(document.createTextNode(' > '));
}
}
}
return breadcrumbContainer; // Return the breadcrumb container element
}
return gkxwvsqf_2024919134944_840_Global;
})();var gkxwvsqf_202442913326_365 = (function() {
var self = document.getElementById('gkxwvsqf_202442913326_365');
var gkxwvsqf_202442913326_365_Global = {};
gkxwvsqf_202442913326_365_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_202442913326_365");
}
var pageData = {};
var subPages = document.querySelector("#gkxwvsqf_202442913326_365subPages");
var isSelected = false;
var subPageLimit = 10000;
gkxwvsqf_202442913326_365_Global.selected = () => {
//console.log("gadget selected");
gadgetSelected();
isSelected = true;
}
function gadgetSelected(){
console.log("running select");
document.querySelectorAll(".woo_childPageP").forEach(function(element){
//console.log(element.id);
element.contentEditable = 'true';
element.addEventListener("focusout", function(){
if (pageData[element.id]) {
pageData[element.id].description = element.innerHTML;
} else {
pageData[element.id] = { "description" : element.innerHTML };
}
savePageData();
});
});
document.querySelectorAll(".woo_childPageSpan").forEach(function(element){
var imgProps = document.createElement('span');
imgProps.className = "pageChildren-material-symbols-outlined";
imgProps.classList.add("woo_childPageImgProp");
imgProps.append("settings");
element.appendChild(imgProps);
var pageId = element.getAttribute("pageid");
imgProps.addEventListener("click", imageSelector.bind(this, pageId));
});
}
function updateImage(pageId, image){
if (pageData[pageId]) {
pageData[pageId].image = image;
} else {
pageData[pageId] = { "image" : image };
}
savePageData();
}
gkxwvsqf_202442913326_365_Global.unselect = () => {
//console.log("gadget unselected");
isSelected = false;
document.querySelectorAll(".woo_childPageP").forEach(function(element){
element.contentEditable = 'false';
})
document.querySelectorAll(".woo_childPageImgProp").forEach(function(element){
element.remove();
});
}
//var dateBeingSaved = false;
function savePageData(){
//dateBeingSaved = true;
woo.updateGadgetProperty("gkxwvsqf_202442913326_365", woo.instanceDB, "pageData", pageData, woo.getCurrentPage()).then(() => {
console.log("Page Data Updated");
woo.showGadget("gkxwvsqf_202442913326_365").then(() => {
var gadgetID = $("#gkxwvsqf_202442913326_365").attr('class').split(' ')[0];
property_toolbar.getProperties(gadgetID, "gkxwvsqf_202442913326_365");
});
}).catch((err) => {
console.error(err);
alert("Value not saved!");
});
}
function loadSubPages() {
return new Promise((resolve, reject) => { // Ensure this promise is returned
var parentPage = woo.getCurrentPage();
if ("" != ""){
parentPage = "";
}
woo.getDoc(woo.appDB, parentPage).then((doc) => {
var childIDs = doc.childPageIDs;
//console.log(childIDs);
var subPageLimitCount = 1;
var promises = Object.entries(childIDs).map((child) => {
if (subPageLimitCount <= subPageLimit){
subPageLimitCount = subPageLimitCount + 1;
return woo.getDoc(woo.appDB, child[1]).then((docChild) => {
//console.log(docChild);
if (docChild.hidden == false) {
var pageName = docChild.pageName;
var description = "Edit this description...";
if (docChild.metaDescription) {
description = docChild.metaDescription.replaceAll(".", ". ").replaceAll(". ", ". ").replaceAll(". . . ", "...");
}
if (pageData[docChild._id]) {
if (pageData[docChild._id].description){
description = pageData[docChild._id].description;
}
}
var url = docChild._id;
if (docChild.linked == true) {
if (docChild.linkURL != "") {
url = docChild.linkURL;
} else {
url = docChild.linkID;
}
}
var childSpan = document.createElement('span');
childSpan.id = docChild._id + "_span";
childSpan.setAttribute('pageid', docChild._id);
childSpan.className = "woo_childPageSpan";
if (pageData[docChild._id]) {
if (pageData[docChild._id].image) {
var childImg = document.createElement('div');
childImg.className = "woo_childPageImg";
childImg.style.backgroundImage = "url('" + pageData[docChild._id].image + "')";
childSpan.appendChild(childImg);
}
}
var childH2 = document.createElement('h2');
childH2.className = "woo_childPageH2";
childH2.addEventListener('click', function() {
if (docChild.linked == "true") {
if (docChild.linkID != "") {
Promise.all([woo.updateCurrentPage(url)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
} else {
window.location = url;
}
} else {
Promise.all([woo.updateCurrentPage(url)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
}
});
childH2.innerHTML = pageName;
childSpan.appendChild(childH2);
var childP = document.createElement('div');
childP.id = docChild._id;
childP.className = "woo_childPageP";
childP.innerHTML = description;
childSpan.appendChild(childP);
if ("true" == "true") {
var childButton = document.createElement('span');
childButton.className = "woo_childPageButton";
childButton.innerHTML = "Find Out More";
childButton.addEventListener('click', function() {
if (docChild.linked == "true") {
if (docChild.linkID != "") {
//woo.updateCurrentPage(url);
Promise.all([woo.updateCurrentPage(url)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
} else {
window.location = url;
}
} else {
//woo.updateCurrentPage(url);
Promise.all([woo.updateCurrentPage(url)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
}
});
childSpan.appendChild(childButton);
}
subPages.appendChild(childSpan);
}
});
}
});
// Ensure all promises from the map are resolved before resolving the main promise
Promise.all(promises).then(() => {
resolve("done");
}).catch(reject);
}).catch(reject);
});
}
function getSubPages() {
woo.getGadgetProperty("gkxwvsqf_202442913326_365", woo.instanceDB, "pageData").then((results) => {
if (results) {
pageData = results;
//console.log(pageData);
loadSubPages().then((results) => {
if (isSelected){
gadgetSelected();
}
}).catch((error) => {
console.error("Error loading sub pages:", error);
});
} else {
loadSubPages().then((results) => {
if (isSelected){
gadgetSelected();
}
}).catch((error) => {
console.error("Error loading sub pages:", error);
});
}
}).catch((error) => {
console.error("Error getting gadget property:", error);
});
}
getSubPages();
function closeButtonPressed(){
$(".woo-dialogBox").remove();
}
function makeModal(content){
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose';
closeBox.classList.add('prop-tb-material-symbols-outlined');
closeBox.addEventListener('click', closeButtonPressed);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
}
function imageSelector(pageId){
//console.log("got here");
$(".woo-dialogBox").remove();
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Upload Image";
form.appendChild(title);;
var span1 = document.createElement('span');
form.appendChild(span1);
var label1 = document.createElement('label');
label1.textContent = "Select Image:";
span1.appendChild(label1);
var idInput = document.createElement('input');
idInput.className = "file_upload_input";
idInput.type = "file";
//idInput.setAttribute("multiple","");
idInput.required = "true";
span1.appendChild(idInput);
var span2 = document.createElement('span');
form.appendChild(span2);
var submitInput = document.createElement('input');
submitInput.type = "button";
submitInput.value = "Upload";
submitInput.addEventListener('click', uploadImage.bind(this, form, idInput, pageId));
form.appendChild(submitInput);
makeModal(form);
}
function uploadImage(form, idInput, pageId){
var imageFile = "";
var formData = new FormData();
formData.append("name", "Images");
for(let i=0; i < idInput.files.length; i++) {
formData.append("files", idInput.files[i]);
imageFile = idInput.files[i].name;
}
uploadFiles(formData).then((response) => {
console.log(response);
updateImage(pageId, "/resources/gatemaster/uploads/" + imageFile);
alert(response);
$(".woo-dialogBox").remove();
}).catch((error) => {
console.log(error);
alert("Something went wrong");
});
}
function uploadFiles(formData) {
return $.ajax({
type: "POST",
url: woo.getAuthServer() + "/app/upload_Files",
headers: {
//"Content-Type": "multipart/form-data",
"Authorization": "Bearer " + woo.sessionData.token + ":" + woo.sessionData.password
},
xhrFields: {
withCredentials: true
},
processData: false,
contentType: false,
crossDomain: true,
cache: false,
data: formData,
timeout: 10000
});
}
return gkxwvsqf_202442913326_365_Global;
})();var gkxwvsqf_202523153125_846 = (function() {
var self = document.getElementById('gkxwvsqf_202523153125_846');
var gkxwvsqf_202523153125_846_Global = {};
var merchantCouchDB,
merchantPouchDB,
invoiceSettingsData;
var thisUsersRoles = [];
if (woo.sessionData){
thisUsersRoles = woo.sessionData.roles;
};
function formatDollar(value) {
var tlS = "en-NZ";
var code = "NZD";
if (invoiceSettingsData) {
tlS = invoiceSettingsData.defaultCurrencyTLS;
code = invoiceSettingsData.defaultCurrencyType;
}
return parseFloat(value).toLocaleString(tlS, {
style: 'currency',
currency: code,
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
}
function getInvoiceData(){
return new Promise((resolve) => {
var url = woo.getRemoteCouch() + "/gatemaster$public/gatemaster-invoice-settings";
var data = {}
resolve(woo.queryCouch(url, "GET", data));
});
}
function getStockTemplateById(queryStr, bookmark, resultsArr) {
return new Promise((resolve, reject) => {
$.ajax({
type: "POST",
url: woo.getRemoteCouch() + "/stock$gatemaster-stock-templates/_find",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
xhrFields: {
withCredentials: true
},
crossDomain: true,
json: true,
processData: true,
cache: false,
timeout: 10000,
data: JSON.stringify({
selector: {
$or: [
{
"keyWords": { "$regex": "(?i)" + queryStr }
}
]
},
"bookmark": bookmark,
"fields": ["stockName", "stockCode", "nameUrl", "shortDescription", "images"]
})
}).then((page) => {
resultsArr.push(page.docs);
if (page.bookmark && page.docs.length == 25) {
return getStockTemplateById(queryStr, page.bookmark, resultsArr);
} else {
return true;
}
}).then(() => {
resolve(resultsArr);
}).catch((error) => {
reject(error);
});
});
}
function getStockPricingById(queryStr) {
return new Promise((resolve, reject) => {
$.ajax({
type: "POST",
url: woo.getAuthServer() + "/app/stock/gatemaster-stock-pricing/get",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
xhrFields: {
withCredentials: true
},
crossDomain: true,
json: true,
processData: true,
cache: false,
timeout: 10000,
data: JSON.stringify({
"docID": queryStr
})
}).then((data) => {
resolve(data);
}).catch((error) => {
reject(error);
});
});
}
function fetchWooPricing(stockCode) {
return new Promise((resolve) => {
let pricing = {};
thisUsersRoles.push("gatemaster$everyone");
// Filter user roles that start with the given wooAppId
let userRoles = thisUsersRoles.filter(role => role.startsWith("gatemaster$"));
Promise.all(
userRoles.map(function (userRole) {
var roleName = userRole === "everyone" ? "everyone" : userRole.split("$")[1];
if (!roleName) return Promise.resolve(); // Skip if roleName is undefined
return getStockPricingById(stockCode + "-" + roleName)
.then((priceData) => {
if (priceData && Array.isArray(priceData.pricingData)) {
// Filter out non-live prices
priceData.pricingData = priceData.pricingData.filter(entry => entry.priceLive === true);
}
// Store only if there are live prices
pricing[userRole] = (priceData && priceData.pricingData.length > 0) ? priceData : null;
})
.catch((error) => {
if (error.status === 404 || error.status === 403) {
console.warn("No pricing found for " + roleName + ". Skipping.");
pricing[userRole] = null; // Assign null instead of crashing
} else {
console.error("Error fetching pricing for " + roleName + ": ", error);
}
});
})
).then(() => {
resolve(pricing);
});
});
}
function findLowestPrice(pricingObject) {
let lowestPrice = Infinity;
Object.values(pricingObject).forEach(roleData => {
if (roleData && roleData.pricingData) {
roleData.pricingData.forEach(entry => {
if (entry.forVariationType !== "multi") {
let price = parseFloat(entry.priceFinal);
if (!isNaN(price) && price < lowestPrice) {
lowestPrice = price;
}
}
});
}
});
return lowestPrice === Infinity ? null : lowestPrice === -2 ? "POA" : lowestPrice;
}
function getPageId(){
const url = window.location.href;
const lastValue = url.split("/").pop();
const result = lastValue
.split("-")
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
return result;
}
async function populateStock(){
invoiceSettingsData = await getInvoiceData();
console.log(invoiceSettingsData);
var keyWord = "";
if (keyWord == "") {
keyWord = getPageId();
}
getStockTemplateById(keyWord, "", []).then(function(data) {
data[0].map(stock => {
var stockCode = stock.stockCode;
html = "
";
console.log(stock.images);
if (stock.images && Object.keys(stock.images).length > 0) {
console.log("true");
if ("true" == "true") {
var url = "/resources/gatemaster/uploads/" + stock.images[0];
var quotedUrl = "'" + url + "'";
html += '
';
} else {
html += "";
}
}
html += "" + stock.stockName + "" +
"
" + stock.shortDescription + "
" +
"
Loading Price...
" +
"View Product" +
"
";
$(self).append(html);
fetchWooPricing(stockCode).then(pricing => {
var lowestPrice = findLowestPrice(pricing);
if (lowestPrice == "POA"){
$("#price-" + stock.stockCode).html("From: POA");
} else {
if ("false" == "false"){
$("#price-" + stock.stockCode).html("From: " + formatDollar(lowestPrice) + " + " + invoiceSettingsData.salesTaxName);
} else {
$("#price-" + stock.stockCode).html("From: " + formatDollar(lowestPrice));
}
}
});
});
}).catch(function(error) {
console.error("An error occurred:", error);
});
}
$(document).on('click', '.stockItem .stockButton', function () {
var stockUrl = $(this).attr("data-nameUrl");
woo.updateCurrentPage("stock-details", null, "/" + stockUrl);
});
populateStock();
gkxwvsqf_202523153125_846_Global.unload = () => {
//Unload callbacks here
$(document).off('click', '.stockItem .stockButton');
console.log("Unloaded gkxwvsqf_202523153125_846");
}
return gkxwvsqf_202523153125_846_Global;
})();var gkxwvsqf_2024526154916__908_802 = (function() {
var self = document.getElementById('gkxwvsqf_2024526154916__908_802');
var gkxwvsqf_2024526154916__908_802_Global = {};
gkxwvsqf_2024526154916__908_802_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_2024526154916__908_802");
}
var imageFileData = "";
var divCount = 0;
function loadImages(){
$("#gkxwvsqf_2024526154916__908_802").empty();
Promise.all([woo.getGadgetProperty("gkxwvsqf_2024518104845", woo.gadgetDB, "imageFileData"), woo.getGadgetProperty("gkxwvsqf_2024526154916__908_802", woo.instanceDB, "imageFileData"), woo.getGadgetProperty("gkxwvsqf_2024526154916__908_802", woo.pageDB, "imageFileData")]).then((results) => {
if (results){
var defaultValues = results[0];
if (defaultValues != ""){
imageFileData = defaultValues;
}
var instanceValues = results[1];
if (instanceValues != ""){
imageFileData = instanceValues;
}
var pageValues = results[2];
if (pageValues != ""){
imageFileData = pageValues;
}
if ("false" == "false"){
} else {
var imageContainerDiv = document.createElement('div');
imageContainerDiv.className = "image_Container_div";
self.appendChild(imageContainerDiv);
}
//console.log(imageFileData);
if (imageFileData != ""){
divCount = Object.keys(imageFileData).length - 1;
Object.entries(imageFileData).map((imageFile) => {
//console.log(imageFile);
if ("false" == "false"){
var imageFileDiv = document.createElement('div');
imageFileDiv.className = "image_File_Div";
imageFileDiv.id = "imageFile_" + imageFile[0];
imageFileDiv.style.backgroundImage= "url('/resources/gatemaster/uploads/" + imageFile[1].name + "')";
imageFileDiv.setAttribute("caption", imageFile[1].caption);
/*var caption = document.createElement('span');
caption.className = "image_caption";
caption.textContent = imageFile[1].caption;
imageFileDiv.appendChild(caption);*/
self.appendChild(imageFileDiv);
} else {
var imageFileDiv = document.createElement('img');
imageFileDiv.className = "image_File_img";
imageFileDiv.id = "imageFile_" + imageFile[0];
imageFileDiv.src= "/resources/gatemaster/uploads/" + imageFile[1].name;
imageFileDiv.setAttribute("caption", imageFile[1].caption);
imageContainerDiv.appendChild(imageFileDiv);
}
imageFileDiv.addEventListener('click', openImage.bind(this, imageFile[0]));
});
}
}
}).catch((err) => {
console.error(err);
});
}
function openImage(imageIndex){
var img = document.querySelector("#gkxwvsqf_2024526154916__908_802 #imageFile_" + imageIndex);
var bi = "";
// Check if the element is an tag or a
if (img.tagName.toLowerCase() === 'img') {
// If it's an img tag, just get the src attribute
bi = img.src;
} else {
// If it's a div, extract the URL from the background-image style
var style = img.currentStyle || window.getComputedStyle(img, false);
bi = style.backgroundImage.slice(4, -1).replace(/"/g, "").replace(/['"]/g, "");
}
console.log(bi);
var imageCaption = img.getAttribute('caption');
$(".woo-dialogBox").remove();
var form = document.createElement('div');
form.id = "image_parent";
var imageFileDiv = document.createElement('img');
imageFileDiv.className = "image_File_Div_modal";
imageFileDiv.src = bi;
form.appendChild(imageFileDiv);
var caption = document.createElement('span');
caption.className = "image_caption";
caption.textContent = imageCaption;
form.appendChild(caption);
var formLeft = document.createElement('div');
formLeft.className = "imageGallery_left";
var formRight = document.createElement('div');
formRight.className = "imageGallery_right";
form.appendChild(formLeft);
form.appendChild(formRight);
var nextImage = parseInt(imageIndex) + 1;
var previousImage = parseInt(imageIndex) - 1;
if (nextImage > divCount){
nextImage = 0;
}
if (previousImage < 0){
previousImage = divCount;
}
formLeft.addEventListener('click', openImage.bind(this, previousImage));
formRight.addEventListener('click', openImage.bind(this, nextImage));
makeModal(form, "woo-dialogContent_gallery");
}
function makeModal(content, extraClass){
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose';
closeBox.classList.add('material-symbols-outlined');
closeBox.addEventListener('click', closeButtonPressed);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
if (extraClass){
dialogContent.classList.add(extraClass);
}
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
}
function closeButtonPressed(){
$(".woo-dialogBox").remove();
}
function updateValues(values){
var saveLevel = property_toolbar.getSaveLevel;
switch (saveLevel){
case "instance":
typeDB = woo.instanceDB;
break;
case "page":
typeDB = woo.pageDB;
break;
case "user":
typeDB = woo.pageDB;
break;
default:
typeDB = woo.pageDB;
}
woo.updateGadgetProperty("gkxwvsqf_2024526154916__908_802", typeDB, "imageFileData", values, woo.getCurrentPage()).then(() => {
loadImages();
}).catch((err) => {
console.log(err);
alert("Images not saved!");
});
}
function updateCaptions(captionNo, valueField){
imageFileData[captionNo]["caption"] = valueField.value;
console.log(imageFileData);
var saveLevel = property_toolbar.getSaveLevel;
switch (saveLevel){
case "instance":
typeDB = woo.instanceDB;
break;
case "page":
typeDB = woo.pageDB;
break;
case "user":
typeDB = woo.userDB;
break;
default:
typeDB = woo.pageDB;
}
woo.updateGadgetProperty("gkxwvsqf_2024526154916__908_802", typeDB, "imageFileData", imageFileData, woo.getCurrentPage()).then(() => {
loadImages();
}).catch((err) => {
console.log(err);
alert("Images not saved!");
});
}
function editCaptions(){
$(".woo-dialogBox").remove();
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Edit Captions";
form.appendChild(title);
if (imageFileData != ""){
Object.entries(imageFileData).map((imageFile) => {
var span1 = document.createElement('span');
form.appendChild(span1);
var label1 = document.createElement('label');
label1.className = "image_caption_input_label";
label1.textContent = "Image " + imageFile[0] + " Caption:";
span1.appendChild(label1);
var idInput = document.createElement('input');
idInput.className = "image_caption_input";
idInput.type = "text";
idInput.value = imageFile[1].caption;
span1.appendChild(idInput);
var imageName = document.createElement('span');
imageName.className = "image_name_label";
imageName.append("Image: " + imageFile[1].name);
span1.appendChild(imageName);
idInput.addEventListener('focusout', updateCaptions.bind(this, imageFile[0], idInput));
idInput.addEventListener('keypress', function (e) {
if (e.key === 'Enter') {
updateCaptions(imageFile[0], idInput);
}
});
});
} else {
var Error = document.createElement('span');
Error.className = "dialog_title";
Error.textContent = "Please upload image first!";
form.appendChild(Error);
}
makeModal(form);
}
function imageFileManager(){
$(".woo-dialogBox").remove();
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Upload Image";
form.appendChild(title);;
var span1 = document.createElement('span');
form.appendChild(span1);
var label1 = document.createElement('label');
label1.textContent = "Select Image:";
span1.appendChild(label1);
var idInput = document.createElement('input');
idInput.className = "file_upload_input";
idInput.type = "file";
idInput.setAttribute("multiple","");
idInput.required = "true";
span1.appendChild(idInput);
var span2 = document.createElement('span');
form.appendChild(span2);
var submitInput = document.createElement('input');
submitInput.type = "button";
submitInput.value = "Upload";
submitInput.addEventListener('click', uploadImage.bind(this, form, idInput));
form.appendChild(submitInput);
makeModal(form);
}
function uploadImage(form, idInput){
var formData = new FormData();
formData.append("name", "Images");
var fileLength = 0;
if (imageFileData != "") {
fileLength = Object.keys(imageFileData).length;
} else {
imageFileData = {};
}
for(let i = fileLength; i < (idInput.files.length + fileLength); i++) {
formData.append("files", idInput.files[i - fileLength]);
imageFileData[i] = {};
imageFileData[i]["name"] = idInput.files[i - fileLength].name;
imageFileData[i]["caption"] = "";
}
uploadFiles(formData).then((response) => {
console.log(response);
updateValues(imageFileData);
alert(response);
$(".woo-dialogBox").remove();
}).catch((error) => {
console.log(error);
alert("Something went wrong");
});
}
function uploadFiles(formData) {
console.log(formData);
return $.ajax({
type: "POST",
url: woo.getAuthServer() + "/app/upload_Files",
headers: {
//"Content-Type": "multipart/form-data",
"Authorization": "Bearer " + woo.sessionData.token + ":" + woo.sessionData.password
},
xhrFields: {
withCredentials: true
},
processData: false,
contentType: false,
crossDomain: true,
cache: false,
data: formData,
timeout: 10000
});
}
loadImages();
gkxwvsqf_2024526154916__908_802_Global.imageFileManager = () => {
imageFileManager();
}
gkxwvsqf_2024526154916__908_802_Global.editCaptions = () => {
editCaptions();
}
return gkxwvsqf_2024526154916__908_802_Global;
})();var login_125_594 = (function() {
var login_125_594_Global = {};
var loginDom = document.getElementById('login-text_login_125_594');
var loginDomMob = document.getElementById('mob_icon_login_125_594');
var loggedIn = false;
var loggingInOrOut = false;
var openModal = false;
var whatIs = document.querySelector(".woo_whatIsWooID_login_125_594");
var forgotPass = document.querySelector(".forgot_pass_login_125_594");
function getAppData(){
return new Promise((resolve) => {
var url = woo.getRemoteCouch() + "/gatemaster$public/gatemaster-invoice-settings";
var data = {}
resolve(woo.queryCouch(url, "GET", data));
}).catch((error) => {
return null;
});
}
getAppData().then((data) => {
if (data){
$("#login_125_594 .website_name").html(data.brandName);
$("#login_125_594 #fullLogoImage").attr("src", "/resources/gatemaster/uploads/" + data.logoImage);
}
})
function forgotPass_login_125_594(){
woo.updateCurrentPage("forgot-password");
}
function whatIsClick_login_125_594(){
var note = "
What is the Woo ID?
With a growing awareness of on-line privacy and security issues, further tightening of the spam laws worldwide and the need for businesses to have more robust collection of data systems in place, Woo has risen to the challenge by creating a universal ID for users on the platform - called a Woo ID.
The Woo ID provides you with the security that Woo is dedicated, and bound by law, to ensure your information is kept private and that all anti-spam laws are adhered to. Every user added to a Woo website gets to verify their email address. This ensures issues with data entry and out-of-date email accounts are spotted early.
The Woo ID universal ID is the market leader: creating a safe and spam free environment for you.