Page 4 of 7

Re: chrome scrolling bug

Posted: Sun Jul 29, 2018 9:27 am
by axew3
Always there is a solution. There are bad, good, or still unknown, but ever exist a solution!

Seem that there is an error into the code you added into your phpBB overall_footer.html, so maybe for this the behavior.
Into your overall_footer.php
substantially you miss a closing bracket char on code

Check your code where:

Code: Select all

   if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,mfs);
  }
  if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
change into

Code: Select all

   if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,mfs);
  }
  if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
}
remember to recompile stale template of phpBB if it is set to no. Probably the mess is coming out just due to this.

Re: chrome scrolling bug

Posted: Sun Jul 29, 2018 12:23 pm
by kiro
i added the code and recompile but nothing happenned :(
just in case, i just installed this extension, but only works in full forum not the iframe page

Re: chrome scrolling bug

Posted: Sun Jul 29, 2018 8:39 pm
by axew3

Code: Select all

SyntaxError: expected expression, got ')'
The code you've add on overall_footer.html still contain problems and return error.
document.domain also contain wrong value.
Your code should be this:

Code: Select all

<script type="text/javascript">
	
document.domain = 'neomundos.net'; // THIS IS MANDATORY! Set/Change this value to your domain (example: axew3.com (or leave localhost if on localhost)) 
 
var w3all_doc_domain = document.domain;
 
  $(document).on("click", "a", function() {
   var href = $(this).attr("href");
  $(this).attr("href", href.replace('iframe=true&', '')); // remove! or get loop in htaccess if our var has been appended before ...
   var w3allappend = href;
   var w3all_parent_element_id = $(this).parent().get( 0 ).id; // detect click x ... (ex: return ID smiley-box, onclick post smiles) ... // detect and avoid/allow certain behaviors
   var w3all_onclick_smile  = (w3all_parent_element_id.indexOf('smiley-box') > -1);
   var w3all_onview_topic  = (href.indexOf('viewtopic.php') > -1);
   var w3all_onview_attach  = (href.indexOf('file.php') > -1);
   var w3all_onview_post = /#p[0-9]+/ig.exec(href);
   var w3all_ck_quickmod  = (href.indexOf('quickmod') > -1);
   var w3all_onreply_topic  = (href.indexOf('mode=reply') > -1);
   var w3all_ck_onindex  = (href.indexOf('index.php') > -1);
   var w3all_onsubmit_post = /^post?/ig.exec(href);
   var w3all_onclick_editor  = (w3all_parent_element_id.indexOf('cke_1_top') > -1);
var mfs = $(this.window).scrollTop() + 0; // may change to 100, or 200 the 0 value here, to better fit your WP theme on scroll 
   if ( w3all_onclick_smile === false && w3all_onview_attach === false || w3all_onclick_editor === false && w3all_onview_attach === false ) {
   if ('parentIFrame' in window) window.parentIFrame.scrollTo(0,mfs);
  }
  if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
 
///////////////////////////////////////////////////////////////////////////
// w3all Ajax UPDATES for phpBB events
 
if (window.frameElement) { // if in iframe mode ... to avoid js error w3all_ajaxup_from_phpbb is not a function when forum called not iframe mode (that you can also trascure maybe) if phpBB is surfed by full address and not iframe
 
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);
}
 
///////////////////////////////////////////////////////////////////////////
// htaccess trick for right click /copy/paste/ links
// to apply htaccess rules and rewrite urls for this and email notification, please read this tutorial:
// https://www.axew3.com/w3/2017/04/wp_w3all-htaccess-javascript-rewrite-links-point-iframe-how-to/
 
// remove starting /* and ending */ 
// that wrap the code here below to activate
 
/* // remove this line to activate click /copy/paste/ links x htaccess
 
$( "a" ).contextmenu(function() {
  var href = $(this).attr("href");
  var shortlink = /^#p[0-9]+/ig.exec(href);
	var ck  = (href.indexOf('iframe=true') > -1);
	var ckl = /^(http[s]?:\/\/[-a-z0-9\.]+)/ig.exec(href); // check if link point to external resource: a passed phpBB url (attr("href")) is relative, not absolute: so we assume that if http(s) is present, 
	// than it should be a link that point to an external iframe resource. Can be improved further more using this same pattern result.
	
	 if ( ck == false && ckl == null && shortlink == null ){ // not re-append // not append if short link like #p49 (link of the post on viewtopic) or passed link point to an external resource
	 	  var href0 = href.split('?');
	 	  if(href0[1] == null){ href0[1] = ''; } else { href0[1] = '&' + href0[1]; }
      var href1 = href0[0] + '?iframe=true' + href0[1];
    $(this).attr("href", href1); // send out before mouseup ...
   }
});
$( "a" ).mouseup(function() { // but remove on mouseup, or leaving iframe=true we'll loop with htaccess ...
  var href = $(this).attr("href");
  $(this).attr("href", href.replace('iframe=true&', ''));
});
 
*/  // remove this line to activate click /copy/paste/ links x htaccess
///////////////////////////////////////////////////////////////////////////
 
// TO ACTIVATE phpBB lightbox events remove /* and */ here below
// NOTE: Due to last update fix, this should not be more required, as in any other phpBB mod
/* 
$(document).on('mouseup', '.postimage', function(){
 //var w3allappend = "getw3all_lightbox";
 if ('parentIFrame' in window) window.parentIFrame.scrollToOffset(0,0);
 //if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
*/
 
} // END if (window.frameElement) {
</script>
<script type="text/javascript" src="http://neomundos.net/wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer/iframeResizer.contentWindow.min.js" defer></script>
Check to correctly remove all previous code, and just paste this above right BEFORE the closing </body> tag.
Recompile phpBB template.

Re: chrome scrolling bug

Posted: Sun Jul 29, 2018 10:50 pm
by kiro
i tested and:
if i use this new overall_footer, it fixes the urls and the refresh & links problem is solved BUT the scroll when clicking on editor bug returns, even if i add the code you gave me here
later i tried adding the } bracket you gave me here. with the bracket the scrolling bug fixes but the url and refresh problem came back again LOL
there has to be a point where both things are fixed

Re: chrome scrolling bug

Posted: Mon Jul 30, 2018 12:20 am
by axew3
actually i've test your forum working well into chrome also, even if on chrome console it still return this error:
Unable to preventDefault inside passive event listener invocation.
wheel @ SmoothScroll.js?assets_version=19:1
that is given by the smoothScroll plugin.

Re: chrome scrolling bug

Posted: Mon Jul 30, 2018 2:25 am
by kiro
hmm, i dont know what to do now
overall_footer.php

Code: Select all

  if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
 
without bracket: the internal links or buttons scrolls to top

Code: Select all

  if ('parentIFrame' in window) window.parentIFrame.sendMessage(w3allappend);
});
}
with bracket: the url is always http://xxxxxxxxxxxx.net/forum

i dont know how or where to disable the smooth scroll plugin