Opened 11 years ago

Closed 11 years ago

#2794 closed defect (invalid)

Retain scroll position (changeset 5616) on auto page refresh on status page don't work on sh4

Reported by: Nimloth Owned by: alno
Priority: minor Component: Webinterface
Severity: medium Keywords: webif scroll refresh
Cc: Admin Sensitive: no

Description

Revision

Testing at 7419 but old and new one behave same way

Issue Description

Retain scroll position (changeset 5616) on auto page refresh on status page don't work on sh4.
It works very good on i.e. ppc old, i686

When the issue occurs

When you scroll to bottom and wait for auto refresh

How the issue is reproducable

Start webpage on sh4 box and scroll to down. Wait for autorefresh and it will go back to top

Change History (11)

comment:1 by gf, 11 years ago

Are you sure you were using the same browser when you observe the different behaviors? Because what you describe sound like a browser functionality.

comment:2 by gf, 11 years ago

Oh, I see the changeset.

comment:3 by Admin, 11 years ago

Do you have some custom javascript active on your sh4 which is not active on other platforms? That's the only thing I could think of. Because you need to add it there if you have a custom javascript defined.

comment:4 by Nimloth, 11 years ago

Nope no custom js ... just using default one build in into oscam.
Browser always same when viewing webif.
I have server on i386 and clients on ppc and sh and problem is only on sh4 ... always scrolling back to top

comment:5 by Admin, 11 years ago

What happens if you open

http://<oscam-url>/oscam.js

in your browser? Is there anything inside?

comment:6 by gf, 11 years ago

Can you save working page from sh4 and non-working and post a diff?

comment:7 by Nimloth, 11 years ago

SH4:

function addUnloadHandler(){var a,e;if(window.attachEvent){a=window.attachEvent;e='on';}else{a=window.addEventListener;e=;}a(e+'load',function(){loadScroll();if(typeof Sys!='undefined' && typeof Sys.WebForms!='undefined')Sys.WebForms.PageRequestManager.getInstance().add_endRequest(loadScroll);},false);}function loadScroll(){var c=document.cookie.split(';');for(var i=0;i<c.length;i++){var p=c[i].split('=');if(p[0]=='scrollPosition'){p=unescape(p[1]).split('/');for(var j=0;j<p.length;j++){var e=p[j].split(',');try{if(e[0]=='window'){window.scrollTo(e[1],e[2]);}}catch(ex){}}return;}}}function saveScroll(){var s='scrollPosition=';var l,t;if(window.pageXOffset!==undefined){l=window.pageXOffset;t=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollLeft!==undefined){l=document.documentElement.scrollLeft;t=document.documentElement.scrollTop;}else{l=document.body.scrollLeft;t=document.body.scrollTop;}if(l
t){s+='window,'+l+','+t+'/';}document.cookie=s+';';}

i386:

function addUnloadHandler(){var a,e;if(window.attachEvent){a=window.attachEvent;e='on';}else{a=window.addEventListener;e=;}a(e+'load',function(){loadScroll();if(typeof Sys!='undefined' && typeof Sys.WebForms!='undefined')Sys.WebForms.PageRequestManager.getInstance().add_endRequest(loadScroll);},false);}function loadScroll(){var c=document.cookie.split(';');for(var i=0;i<c.length;i++){var p=c[i].split('=');if(p[0]=='scrollPosition'){p=unescape(p[1]).split('/');for(var j=0;j<p.length;j++){var e=p[j].split(',');try{if(e[0]=='window'){window.scrollTo(e[1],e[2]);}}catch(ex){}}return;}}}function saveScroll(){var s='scrollPosition=';var l,t;if(window.pageXOffset!==undefined){l=window.pageXOffset;t=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollLeft!==undefined){l=document.documentElement.scrollLeft;t=document.documentElement.scrollTop;}else{l=document.body.scrollLeft;t=document.body.scrollTop;}if(l
t){s+='window,'+l+','+t+'/';}document.cookie=s+';';}

PPC OLD:

function addUnloadHandler(){var a,e;if(window.attachEvent){a=window.attachEvent;e='on';}else{a=window.addEventListener;e=;}a(e+'load',function(){loadScroll();if(typeof Sys!='undefined' && typeof Sys.WebForms!='undefined')Sys.WebForms.PageRequestManager.getInstance().add_endRequest(loadScroll);},false);}function loadScroll(){var c=document.cookie.split(';');for(var i=0;i<c.length;i++){var p=c[i].split('=');if(p[0]=='scrollPosition'){p=unescape(p[1]).split('/');for(var j=0;j<p.length;j++){var e=p[j].split(',');try{if(e[0]=='window'){window.scrollTo(e[1],e[2]);}}catch(ex){}}return;}}}function saveScroll(){var s='scrollPosition=';var l,t;if(window.pageXOffset!==undefined){l=window.pageXOffset;t=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollLeft!==undefined){l=document.documentElement.scrollLeft;t=document.documentElement.scrollTop;}else{l=document.body.scrollLeft;t=document.body.scrollTop;}if(l
t){s+='window,'+l+','+t+'/';}document.cookie=s+';';}

@gf what you mean by save working page?

When I refresh sh4 webpage manually (hit simply F5 on webbrowser) page position is kept ... but this is maybe simply browser funct. and not related to this bug :)

comment:9 by Admin, 11 years ago

He means the html code of the page itself. As the JS is the same, there must be some difference there.
Please also check if your browser blocks the cookie and try with an absolutely clean config folder to make sure that it's not some config issue.

If you hit F5 it is simply a browser functionality to retain window position. This invalidates the cache (browser rerequests all images/js on the page), the same does a meta-refresh tag that we had before this JS code.

comment:10 by Nimloth, 11 years ago

@admin
Of course U were right ... I deleted cookie for sh4 connection ip from Firefox and it's ok ... really sorry for such lame ticked ... this should be verified before creating ticket :/

comment:11 by Nimloth, 11 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.