Hard Light Productions Forums

Site Management => Site Support / Feedback => Topic started by: jr2 on August 13, 2018, 02:44:32 am

Title: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: jr2 on August 13, 2018, 02:44:32 am
See here (https://www.hard-light.net/forums/index.php?topic=94931.msg1871794#msg1871794).
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: ngld on August 13, 2018, 10:10:56 am
Someone should replace is_webkit && codeFix[ i ].offsetHeight < 20 with is_webkit && codeFix[ i ].offsetHeight < 20 && codeFix[ i ].offsetHeight > 0 in smf_codeBoxFix() (HLP's theme.js (https://www.hard-light.net/forums/Themes/HLP_20/scripts/theme.js?2013-06-29)).

That function tries to calculate the correct height for code blocks which fails if the code block is hidden. It then sets a fixed height of 20px which causes the problem. A proper fix would be to run the function after the code block becomes visible but that's much more complicated and AFAICT the fix isn't needed anymore either.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: Zacam on August 14, 2018, 03:06:26 pm
While this IS an issue specific to chrome (in that I at least could not replicate in FF/Edge/IE), I went ahead and made the changes, I also deployed it to the Themes/default one as well.

Took a while for cache purging and what all to update, but once it did, I verified that it worked in Chrome as intended and that previous browsers behaviour did not change.

Behaviour should now be uniform, please advise of any cases otherwise.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: jr2 on August 14, 2018, 04:38:36 pm
Doesn't seem to be working, even though I cleared the HLP site data and force-refreshed.  Maybe I'm getting an older copy from CloudFlare or something?  I'll try it again later to see if it changes.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: Zacam on August 14, 2018, 05:24:17 pm
Something is still cache serving the state of the file as of 2013-06-29, not sure what or where or how.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: ngld on August 14, 2018, 06:20:03 pm
The issue only ever appeared in Chrome (and probably Safari) since the is_webkit part of the condition means that the bugged code only runs in WebKit browsers (which Chrome and Safari are).
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: jr2 on August 15, 2018, 01:15:56 pm
Which is a significant amount.  I'm guessing about 60-65% of all users based on this (also, why isn't IE dead yet?! XP users??):

Hidden Text: Show
(http://www.statista.com/graphic/1/544400/market-share-of-internet-browsers-desktop.jpg)
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: Zacam on August 15, 2018, 02:54:11 pm
IE is still available in 10 (As well as 7/Vista) and Edge will 'failback' (or can) to IE if compatibility gets tripped or is otherwise elected.

Still doesn't explain how/why the changes I made to the theme.js file hasn't propigated correctly or in a uniform fashion. It randomly works, currently but it still never updates the direct file view version.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: jr2 on August 16, 2018, 06:00:46 am
IE is still available in 10 (As well as 7/Vista) and Edge will 'failback' (or can) to IE if compatibility gets tripped or is otherwise elected.

Still doesn't explain how/why the changes I made to the theme.js file hasn't propigated correctly or in a uniform fashion. It randomly works, currently but it still never updates the direct file view version.

Is theme.js stored in multiple locations, and some code references one location, and some another?  I'd do a search for theme.js in the HLP site files if that was possibly the case, and then search for the code referencing the location of the old file. 

Of course, I'm far from any sort of webdev / coder, so please ignore if that's not a possibility.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: Zacam on August 17, 2018, 04:57:39 am
There are 3 locations, HLP_20, default and core; I've modified all three. Outside of that, I haven't a clue.
Title: Re: [code] in [hidden] doesn't work correctly (does not expand; Chrome browser)
Post by: jr2 on August 18, 2018, 12:48:06 pm
There are 3 locations, HLP_20, default and core; I've modified all three. Outside of that, I haven't a clue.

Is there a way to override theme.js by explicitly calling for certain behavior in the code somewhere?  (Guessing if that's possible you could find it by searching for something that would have to be in the old version of that code, like
Code: [Select]
is_webkit && codeFix[ i ].offsetHeight or something)