iFrame integration doesn't work with phpbb Lightbox Extension

User avatar
axew3
w3all User
w3all User
Posts: 2881
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by axew3 »

I think that about lightbox and the #phpbb_alert the definitive updated code will be (will not be anymore necessary to activate the code for lightbox, if the extension is active the code will fire, if not, excluded) the following.
Note that this code should only fire when the phpBB display iframed into a parent page, so should be wrapped (like some other line of code into the overall_footer.html added js code) inside the

Code: Select all

if(window.self !== window.top){
so just after it, add

Code: Select all

 // Lightbox scroll fix
  $(".postimage").on("click", function(e){
	var topg = $($(this.getBoundingClientRect().top));
	 var t = parseInt(topg[Object.keys(topg)[0]]);
	$("#lightbox").animate({top: t+'px'}, 100);
  });
 // #phpbb_alert scroll fix
 $("#add_files").on("click", function(e) {
	var topg = $($(this.getBoundingClientRect().top));
	 var t = parseInt(topg[Object.keys(topg)[0]]);
	$("#phpbb_alert").animate({top: t+'px'}, 100);
 });
[EDITED]
User avatar
axew3
w3all User
w3all User
Posts: 2881
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by axew3 »

The overall_footer.html js code has been updated about the above:
https://www.axew3.com/w3/2020/01/phpbb- ... iframe-v5/

the code above has been EDITED, the wrapper

Code: Select all

if (typeof $(this).attr('data-lightbox') !== 'undefined' && $(this).attr('data-lightbox') !== false)
 ...  ....
}
is really not required: REMOVED
User avatar
Ezrael
w3 User
w3 User
Posts: 100
Joined: Wed Nov 15, 2023 9:11 pm
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by Ezrael »

axew3 wrote: Tue Jun 25, 2024 8:20 pm

Code: Select all

if(window.self !== window.top){
so just after it, add
Probably you mean the first code because exactly this line is twice in the code
User avatar
axew3
w3all User
w3all User
Posts: 2881
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by axew3 »

No there is only one (the other that could seem to you, is the comment line more below!? // END if(window.self !== window.top){ ).
Anyway

Code: Select all

#quickmod panel alerts
.watch-topic-link
.bookmark-link
confirm popups also, requires to to be fixed!
User avatar
axew3
w3all User
w3all User
Posts: 2881
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by axew3 »

axew3 wrote: Tue Jun 25, 2024 10:17 pm No there is only one (the other that could seem to you, is the comment line more below!? // END if(window.self !== window.top){ ).
Anyway

Code: Select all

#quickmod panel alerts
.watch-topic-link
.bookmark-link
confirm popups also, requires to to be fixed!
this old overall_footer.html piece of code

Code: Select all

$("#quickmod,.bookmark-link").on("click", function(event) {
var pos = window.scrollY + document.querySelector('#quickmod').getBoundingClientRect().top;
  $(parent.window).scllTop( 200 );
$("#darkenwrapper").on("click", function() {
  $(parent.window).scrollTop( pos );
});
 $("#darken").on("click", function() {
  $(parent.window).scrollTop( pos );
});
});
will be now replaced by this new code:

Code: Select all

// #phpbb_confirm scroll fix
$(".dropdown-contents li a").on("click", function(e) {
  var g = $($(this.getBoundingClientRect().top));
  var t = parseInt(g[Object.keys(g)[0]]);
  $("#phpbb_alert").animate({top: t+'px'}, 100);
});
p.s but i realize now, that all can be into one single instruction, for all classes and ids that fires same phpBB alerts pop ups. Let check...

going to check the page-forum.php, so to fix it definitively if there is something wrong with.
The next plugin version coming very soon, will fix the template integration under all aspects and will optimize the custom files use so to be easier for all to manage things without caring about plugin core updates.
User avatar
axew3
w3all User
w3all User
Posts: 2881
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iFrame integration doesn't work with phpbb Lightbox Extension

Post by axew3 »

So in fact all can be resumed into one single instruction, that will always works fine for all in once, like this:

Code: Select all

// Lightbox scroll fix, #phpbb_confirm scroll fix, #phpbb_alert scroll fix
$(".postimage,.dropdown-contents li a,#add_files").on("click", function(e) {
  var g = $($(this.getBoundingClientRect().top));
  var t = parseInt(g[Object.keys(g)[0]]);
  $("#phpbb_alert,#phpbb_confirm,#lightbox").animate({top: t+'px'}, 100);
});
stay tuned, it will be cool :D
Post Reply