const APIKey = 'KUSy1ZpxBSg5OFxzKjZuXcGJJMuYQpAmLREdivYnn0n23NphJygvOpLy0GHmg5dPrL6w6syi5M6HtcGbEtiYZdzyidk11eXqDDnbcsparrgr1SgI2PeEO4BsfsWeNOwi';
const APIEndpoint = 'https://cfgapi.devpartners.co.uk/production/api/';
const BaseURL = 'https://clubface-golf.com/';
/* S3 Bucket Details */
const S3_BUCKET = "clubfacebucket";
const S3_REGION = "eu-west-1";
const S3_ENVIRONMENT = "production"; //production
const S3_CLUBFACE_KEY = "clubfacegolf";
document.addEventListener('DOMContentLoaded', function() {
// Flash messages via PHP SESSION injected into hidden element
var flashElement = $('#flash_message');
if (flashElement.length > 0) {
Snackbar.show({ duration: 50000, pos: 'top-center', text: flashElement.val() });
}
$('.accordion').accordion();
});
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
}
$(document).ready(function() {
$('body').on('click', '.popover', function() {
let element = '#' + $(this).attr('data-po-element');
$(element)
.parent()
.toggleClass('edit-content--editable');
return false;
});
});
function getImageFromFileUpload( uploadId ) {
var reader = new FileReader();
var f = document.getElementById( uploadId ).files;
reader.onloadend = function () {
//console.log(reader.result);
}
//return reader.readAsDataURL(f[0]);
return reader.result;
}
function basename(path) {
return path.split('/').reverse()[0];
}