Button not working in Cookies
1 month 2 weeks ago #72818
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Button not working in Cookies
ok if you have a test website, then I can also play with the settings and the files to find the issue
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
1 month 1 week ago #72859
by EsDeeEm
Replied by EsDeeEm on topic Button not working in Cookies
Hello,
I'm having the exact same problem.
Button for selecting cookies is not working. And my website is running Nicepage too. Not sure this is a coincidence... I noticed a jQuery component in the plugin directory. As Joomla and Nicepage are also using jQuery, could that be an issue?
I'm running on a 1:1 copy of my production site as test environment. test.hetnagellakje.be , feel free to nose around.
Error:
Uncaught TypeError: Cannot read properties of null (reading 'querySelectorAll')
at initinterface (front.js?ver=3.5.2:79:28)
at new Cookiesck (front.js?ver=3.5.2:20:3)
at HTMLDocument.<anonymous> ((index):195:3)
Line 64 -> 96: (at initinterface (front.js?ver=3.5.2:79:28))
function initInterface() {
let cookie = readCookie('cookiesck');
document.getElementById('cookiesck').style.display = 'none';
document.getElementById('cookiesck_overlay').style.display = 'none';
// cookies not set, display the bar
if(cookie == null) {
document.getElementById('cookiesck').style.display = 'block';
document.getElementById('cookiesck_overlay').style.display = 'block';
} else {
COOKIESCK.VALUE = decodeURIComponent(decodeURIComponent(cookie));
debug('COOKIESCK.VALUE : ' + COOKIESCK.VALUE);
}
var cookieArray = toObject();
let interfac = document.getElementById('cookiesck_interface');
let platforms = interfac.querySelectorAll('.cookiesck-platform');
debug('platforms :');
debug(platforms);
platforms.forEach(function(platform) {
let platformName = platform.getAttribute('data-platform');
let buttons = platform.querySelectorAll('.cookiesck_button');
buttons.forEach(function(button) {
button.onclick = function() {
if (this.classList.contains('cookiesck-accept')) {
doAction(this, 'accept');
} else {
doAction(this, 'decline');
}
interfac.querySelectorAll('.cookiesck-main-buttons .cookiesck_button').forEach(function(btn) { btn.classList.remove('cookiesck-active'); });
highlightAllButton();
}
});
line 7 -> 23: (at new Cookiesck (front.js?ver=3.5.2:20:3))
var Cookiesck = function (options) {
//set default options
var defaults = {
lifetime: ''
,layout: ''
,reload: ''
};
if (!(this instanceof Cookiesck)) return new Cookiesck(options);
opts = Object.assign(defaults, options);
initHtml();
initInterface();
initEvents();
initIframes();
}
Line 191 -> 196: (at HTMLDocument.<anonymous> ((index):195:3))
if( document.readyState !== "loading" ) {
new Cookiesck({lifetime: "365", layout: "layout1", reload: "0"});
} else {
document.addEventListener("DOMContentLoaded", function () {
new Cookiesck({lifetime: "365", layout: "layout1", reload: "0"});
});
I'm having the exact same problem.
Button for selecting cookies is not working. And my website is running Nicepage too. Not sure this is a coincidence... I noticed a jQuery component in the plugin directory. As Joomla and Nicepage are also using jQuery, could that be an issue?
I'm running on a 1:1 copy of my production site as test environment. test.hetnagellakje.be , feel free to nose around.
Error:
Uncaught TypeError: Cannot read properties of null (reading 'querySelectorAll')
at initinterface (front.js?ver=3.5.2:79:28)
at new Cookiesck (front.js?ver=3.5.2:20:3)
at HTMLDocument.<anonymous> ((index):195:3)
Line 64 -> 96: (at initinterface (front.js?ver=3.5.2:79:28))
function initInterface() {
let cookie = readCookie('cookiesck');
document.getElementById('cookiesck').style.display = 'none';
document.getElementById('cookiesck_overlay').style.display = 'none';
// cookies not set, display the bar
if(cookie == null) {
document.getElementById('cookiesck').style.display = 'block';
document.getElementById('cookiesck_overlay').style.display = 'block';
} else {
COOKIESCK.VALUE = decodeURIComponent(decodeURIComponent(cookie));
debug('COOKIESCK.VALUE : ' + COOKIESCK.VALUE);
}
var cookieArray = toObject();
let interfac = document.getElementById('cookiesck_interface');
let platforms = interfac.querySelectorAll('.cookiesck-platform');
debug('platforms :');
debug(platforms);
platforms.forEach(function(platform) {
let platformName = platform.getAttribute('data-platform');
let buttons = platform.querySelectorAll('.cookiesck_button');
buttons.forEach(function(button) {
button.onclick = function() {
if (this.classList.contains('cookiesck-accept')) {
doAction(this, 'accept');
} else {
doAction(this, 'decline');
}
interfac.querySelectorAll('.cookiesck-main-buttons .cookiesck_button').forEach(function(btn) { btn.classList.remove('cookiesck-active'); });
highlightAllButton();
}
});
line 7 -> 23: (at new Cookiesck (front.js?ver=3.5.2:20:3))
var Cookiesck = function (options) {
//set default options
var defaults = {
lifetime: ''
,layout: ''
,reload: ''
};
if (!(this instanceof Cookiesck)) return new Cookiesck(options);
opts = Object.assign(defaults, options);
initHtml();
initInterface();
initEvents();
initIframes();
}
Line 191 -> 196: (at HTMLDocument.<anonymous> ((index):195:3))
if( document.readyState !== "loading" ) {
new Cookiesck({lifetime: "365", layout: "layout1", reload: "0"});
} else {
document.addEventListener("DOMContentLoaded", function () {
new Cookiesck({lifetime: "365", layout: "layout1", reload: "0"});
});
Please Log in or Create an account to join the conversation.
1 month 1 week ago #72873
by zucha.imz
Replied by zucha.imz on topic Button not working in Cookies
Hi, test website is running at
www.imzdev.com
, is clean joomla instalation with CK cookies and nicepage ...
If you need admin login, write me and i send it to you.
If you need admin login, write me and i send it to you.
Please Log in or Create an account to join the conversation.
1 month 1 week ago #72891
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Button not working in Cookies
Hi to all
It seems that you are all running Nicepage ... and I don't think that this is a coincidence
I have checked and the code that shall be rendered in the page using the plugin (PHP method using the native joomla plugin event onAfterRender) is absolutely not rendered in your pages
Not sure if the problem is Nicepage, so please switch to the template Cassiopeia and tell me if it works. If possible it would be great if you can assign Cassiopeia to a page of your website so that I can also check the code
Let me know
CEd
It seems that you are all running Nicepage ... and I don't think that this is a coincidence
I have checked and the code that shall be rendered in the page using the plugin (PHP method using the native joomla plugin event onAfterRender) is absolutely not rendered in your pages
Not sure if the problem is Nicepage, so please switch to the template Cassiopeia and tell me if it works. If possible it would be great if you can assign Cassiopeia to a page of your website so that I can also check the code
Let me know
CEd
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
1 month 1 week ago - 1 month 1 week ago #72896
by zucha.imz
Replied by zucha.imz on topic Button not working in Cookies
Yes, I tested it and problem is nicepage. You may see at
www.imzdev.com
( page ABOUT is cassiopeia theme ) and everything work. I read your code and little testing. Code is succefully add to page via event onAfterRender, but for some unknown reason final procesing of page cut your code...
Last edit: 1 month 1 week ago by zucha.imz.
Please Log in or Create an account to join the conversation.
1 month 1 week ago #72897
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Button not working in Cookies
thank you for your test and feedback !
it's a shame that Nicepage does not ues the native joomla process, because I can not change the way it works in my plugin
it's a shame that Nicepage does not ues the native joomla process, because I can not change the way it works in my plugin
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
Time to create page: 0.263 seconds