Page 2 of 4

Re: pre - 2.8.9 logs

Posted: Sun Jul 14, 2024 6:33 am
by axew3
Hello, but it is given by the same old extension you want to use
/* Add resize attach in phpBB3.1 && Anvar bb3.mobi */

Code: Select all

<script type="text/javascript">
$(document).ready(function() {
/* Add resize attach in phpBB3.1 && Anvar bb3.mobi */
	$('dl.thumbnail img, dt.attach-image img').load(function() {
		var w  = $(this).width();
		var h = $(this).height();
		var rh = $(this).height();
		if (w > h) {
			h = w;
			w = w*(h/rh);
		}
		$(this).width(w*(2/3));
		$(this).height(h*(2/3));
	});
	$('dl.thumbnail img, dt.attach-image img').each(function() {
		var src = $(this).attr('src');
		$(this).attr('src', '');
		$(this).attr('src', src);
	});
});
</script>

Code: Select all

$('dl.thumbnail img, dt.attach-image img').load(function() {
This line throw error that make it so fail all the subsequent JS code that run after on page.
It is easily solvable ifyou find out the file of this extension that inject into the DOM the code above, that run even when (i assume) there is not an image attached. So just a little addition of code to fix this would make the extension work fine.

PS
If you find out the file where the above is outputted into the extension code files, it probably should be changed into this to work (or something like, that check for the existence of the element before to execute code, not sure if this fix the issue, or do not let it fire at all even when there are attachments, in that case the code should be little modified to achieve the fact, that it should run only when really needed so to not cause an error):

Code: Select all

<script type="text/javascript">
$(document).ready(function() {
/* Add resize attach in phpBB3.1 && Anvar bb3.mobi */
 if($('dl.thumbnail img, dt.attach-image img').length){
	$('dl.thumbnail img, dt.attach-image img').load(function() {
		var w  = $(this).width();
		var h = $(this).height();
		var rh = $(this).height();
		if (w > h) {
			h = w;
			w = w*(h/rh);
		}
		$(this).width(w*(2/3));
		$(this).height(h*(2/3));
	});
	$('dl.thumbnail img, dt.attach-image img').each(function() {
		var src = $(this).attr('src');
		$(this).attr('src', '');
		$(this).attr('src', src);
	});
 }
});
</script>

Re: pre - 2.8.9 logs

Posted: Sun Jul 14, 2024 7:52 pm
by Ezrael
The mention Plugin is causing an error message which I started to ignore but it's not causing the issue! I deactivated the extension, merged the cache and deleted the browser cache. The issue was still there.

Re: pre - 2.8.9 logs

Posted: Mon Jul 15, 2024 4:56 pm
by axew3
I see that you are using a custom extension that add a popup, be more explicit about this next time.

i assume that to fix your problem so, you need to change the code that reposition others default phpBB popups, adding to it the specific one, in this case
#bbcode_wizard for the div to be repositioned, and .abbc3_button that's the class of all the editor buttons
so change this into the overall_footer.html added code

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);
});
into

Code: Select all

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

Re: pre - 2.8.9 logs

Posted: Mon Jul 15, 2024 5:04 pm
by Ezrael

Code: Select all

// Lightbox scroll fix, #phpbb_confirm scroll fix, #phpbb_alert scroll fix
$(".abbc3_button,.postimage,.dropdown-contents li a,#add_files").on("click", function(e) {
  var g = $($(this.getBoundingClientRect().top));
  var t = parseInt(g[Object.keys(g)[0]]);
  $("#bbcode_wizard,#phpbb_alert,#phpbb_confirm,#lightbox").animate({top: t+'px'}, 100);
});
This solved an issue which I didn't mean. If I subscribe or unsubscribe a topic the message still didn't show up at the bottom.

Common overall_footer questions help

Posted: Mon Jul 15, 2024 8:21 pm
by axew3
then change into

Code: Select all

// Lightbox scroll fix, #phpbb_confirm scroll fix, #phpbb_alert scroll fix
$(".dropdown-contents-cp,.abbc3_button,.postimage,.dropdown-contents li a,#add_files").on("click", function(e) {
  var g = $($(this.getBoundingClientRect().top));
  var t = parseInt(g[Object.keys(g)[0]]);
  $("#bbcode_wizard,#phpbb_alert,#phpbb_confirm,#lightbox").animate({top: t+'px'}, 100);
});
unfortunately the coder of the extension or theme changed the default .dropdown-contents selector into .dropdown-contents-cp so it need to be added into the jQuery onclick, while the popup that it fire in this case is phpBB default #phpbb_alert, so it's not required any other addition into the second animate jQuery.

Re: Common overall_footer.html js questions help

Posted: Mon Jul 15, 2024 9:20 pm
by Ezrael
Perfect! Now everything is working like it should