iframe improvements coming soon ...

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

iframe improvements coming soon ...

Post by axew3 »

Time to improve a little bit the iframe mode. I'm around to fix all things about this time on these days

It was a bug about iframe i aimed from long time, the problem for example was coming out by clicking the link to view a last post which link point to phpBB viewtopic.php, where there are many posts to display, or maybe an inline image to display like this post) the result was this:
wrongTop1-forum.jpg
wrongTop1-forum.jpg (110.13 KiB) Viewed 1574 times
instead than the correct vertical alignment of the iframe, like this:
correctTop1-forum.jpg
correctTop1-forum.jpg (93.74 KiB) Viewed 1574 times
the solution seem to be this:
open overall_footer.html
where added the iframe resizer code, search for this:

Code: Select all

window.onload = function() {
var pmn = "{PRIVATE_MESSAGE_COUNT}";
var w3all_phpbb_u_logged = "{S_USER_LOGGED_IN}";
// to send to wp at once here, like this: #w3all_phpbbpmcount=val#w3all_phpbbnotifycount=val#etc etc etc
var w3appendevents = '#w3all_phpbbpmcount=' + pmn + '#w3all_phpbb_u_logged=' + w3all_phpbb_u_logged;
parent.w3all_ajaxup_from_phpbb(w3appendevents);
}
just after, add this code:

Code: Select all

// WoW! fix vertical align on viewtopic.php or preview, where # anchor etc
$(window).load(function() {
var bd = document.getElementsByTagName("body");
for (var i = 0; i < bd.length; i++) { 
    var bdID = bd[i].getAttribute("id"); 
}
var elt = document.getElementById(bdID);	
elt.setAttribute("style", "position:fixed;top:0%;left:0%;width:100%;");
});
Recompile phpBB template.
Even if it work and has been applied on this online example it has not been still added into overall_footer.html help page code.

The complete fix will be added on code of the procedure with all hints as soon tests finished. If any cool hint by someone about this would be nice ...
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: iframe improvements coming soon ...

Post by axew3 »

fix correct scroll gap space from top, to fix different WP themes header heights.
This fix has been already applied on the online how to overall_footer.html code, that has been a little bit changed:

Code: Select all

 if ( w3all_onclick_smile === false && w3all_onview_attach === false ) {
   if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,50); // change 50 to another value may 0 or 100 or 500. Top distance gap in px when page scroll top
  }
if you like to update, remember to recompile phpBB template.
More fixes are coming and logged here in the while, so all added on next 1.9.3 version, if any bug to be fixed to report, follow here
Post Reply