Train GraphicClick on the map to explore geographics
 
I need help
FAQ
Emergency
About .
Travel & transport from BBC stories as at 20:55 06 Jan 2025
 
- Taxi driver who stoked Southport riots jailed
- Works on 'road from hell' to end after 23 years
- 'Second chance at life' after UK's first liver transplant for advanced bowel cancer
Read about the forum [here].
Register [here] - it's free.
What do I gain from registering? [here]
 08/01/25 - Steam loco restoration - IRTE
09/01/25 - Bath Railway Society
24/01/25 - Westbury Station reopens
24/01/25 - LTP4 Wilts / Consultation end

On this day
6th Jan (1968)
Hixon Railway accident (link)

Train RunningCancelled
20:37 Looe to Liskeard
20:42 Bedwyn to London Paddington
20:51 Bristol Temple Meads to Bristol Parkway
21:05 Liskeard to Looe
21:37 Looe to Liskeard
Short Run
19:59 Cheltenham Spa to London Paddington
21:21 Bristol Parkway to Trowbridge
Delayed
20:22 Reading to Shalford
20:38 Maidenhead to Marlow
21:30 Shalford to Reading
07/01/25 04:50 Fratton to Salisbury
Abbreviation pageAcronymns and abbreviations
Stn ComparatorStation Comparator
Rail newsNews Now - live rail news feed
Site Style 1 2 3 4
Next departures • Bristol Temple MeadsBath SpaChippenhamSwindonDidcot ParkwayReadingLondon PaddingtonMelksham
Exeter St DavidsTauntonWestburyTrowbridgeBristol ParkwayCardiff CentralOxfordCheltenham SpaBirmingham New Street
January 06, 2025, 21:03:32 *
Welcome, Guest. Please login or register.

Login with username, password and session length
Forgotten your username or password? - get a reminder
Most recently liked subjects
[97] New Adlestrop Railway Atlas update
[56] Mining in Cornwall
[43] DFT - Where is the South Devon Railway
[41] 2024 - Service update and amendment log, Swindon <-> Westbury...
[39] Bridport branch reopening proposal
[39] Bath to Bridgnorth and back 4/1/25
 
News: the Great Western Coffee Shop ... keeping you up to date with travel around the South West
 
   Home   Help Search Calendar Login Register  
Pages: 1 2 3 [4]
  Print  
Author Topic: Mobile friendly site  (Read 22727 times)
Richard Fairhurst
Global Moderator
Hero Member
*****
Posts: 1264


View Profile Email
« Reply #45 on: October 06, 2014, 13:18:19 »

Richard, it's not hard coded anywhere I can see - changes back at the source would need to be made to code that's filtered by PHP and then run by JavaScript before being rendered - so it's easy enough to change as BigNoseMac has done at his browser, on a one-off, but rather harder to do so two levels back. I fear that if I start something during the daytime and then end up with an effect wider than I expect, I would be likely to render the whole forum unstable in what's proving to be out rush-hour today ... in fact rather like cutting a signalling cable and then having to struggle to repair it.   And I'm not honestly sure that I still have the skills to do the repair.  If you're familiar with SMF (Simple Machines Forum - The software we use on this site) and can confidently point in the right direction or do the job, great - but even then in the middle of the night.
I'm not a PHP person, I'm afraid, let alone one who knows about SMF! But on a quick Googling...

It's clearly a known problem: see here and here. They seem to suggest it's a problem with the theme rather than SMF itself.

If you look through the JavaScript in each forum page, you'll see that there's a function smf_codeFix. This is setting the element height to (...offsetHeight + 20) + "px"; .

My guess is that, at the time this code is executed, offsetHeight is 0 because Chrome hasn't rendered it yet. Hence it's setting the height to 20px.

My suggested quick-and-dirty fix would be either not to run this code for elements with an offsetHeight of 0, or not to run it at all for Webkit browsers (Chrome/Safari). So you could change the code to:

(to stop the code executing at all under Webkit:)
			function smf_codeFix()
{
if ('WebkitAppearance' in document.documentElement.style) return;

var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}


or to:

(to stop it running for objects with offsetHeight of zero)
			function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20 && codeFix[i].offsetHeight)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}

« Last Edit: October 06, 2014, 13:24:23 by Richard Fairhurst » Logged
grahame
Administrator
Hero Member
*****
Posts: 43052



View Profile WWW Email
« Reply #46 on: October 06, 2014, 13:33:20 »


If you look through the JavaScript in each forum page, you'll see that there's a function smf_codeFix. This is setting the element height to (...offsetHeight + 20) + "px"; .

My guess is that, at the time this code is executed, offsetHeight is 0 because Chrome hasn't rendered it yet. Hence it's setting the height to 20px.

My suggested quick-and-dirty fix would be either not to run this code for elements with an offsetHeight of 0, or not to run it at all for Webkit browsers (Chrome/Safari). So you could change the code to:

Having a play with that ... first glance it looks good but let's wait and see what feedback we get ... whether it's upset something else, and / or is only partial in what it's done.

I have previewed this on Safari and it now looks better.

THANKS ... and fingers crossed!
Logged

Coffee Shop Admin, Chair of Melksham Rail User Group, TravelWatch SouthWest Board Member
JayMac
Data Manager
Hero Member
******
Posts: 19245



View Profile
« Reply #47 on: October 06, 2014, 13:36:24 »

Full height preview box here using Chrome.

Thanks, and fingers crossed also.  Grin

Logged

"A clear conscience laughs at a false accusation."
"Treat everyone the same until you find out they're an idiot."
"Moral indignation is a technique used to endow the idiot with dignity."
paul7575
Transport Scholar
Hero Member
******
Posts: 5335


View Profile
« Reply #48 on: October 06, 2014, 15:44:08 »

Full height preview box here using Chrome.

Thanks, and fingers crossed also.  Grin


Also working as you'd expect for me on Safari 7.1 for Mac OSX.

Thanks for checking it out so quickly.

Paul
Logged
Chris from Nailsea
Administrator
Hero Member
*****
Posts: 19073


Justice for Cerys Piper and Theo Griffiths please!


View Profile Email
« Reply #49 on: October 06, 2014, 17:29:06 »

While I honestly didn't understand a word of all the technical discussion above, I am delighted that I can now preview my posts again in a full height box.  Cheesy

I seem to remember that I used to be able to do so, until perhaps one of our server outrages caused it to become discomnadgerated (my own technical term)?  Roll Eyes
Logged

William Huskisson MP (Member of Parliament) was the first person to be killed by a train while crossing the tracks, in 1830.  Many more have died in the same way since then.  Don't take a chance: stop, look, listen.

"Level crossings are safe, unless they are used in an unsafe manner."  Discuss.
Do you have something you would like to add to this thread, or would you like to raise a new question at the Coffee Shop? Please [register] (it is free) if you have not done so before, or login (at the top of this page) if you already have an account - we would love to read what you have to say!

You can find out more about how this forum works [here] - that will link you to a copy of the forum agreement that you can read before you join, and tell you very much more about how we operate. We are an independent forum, provided and run by customers of Great Western Railway, for customers of Great Western Railway and we welcome railway professionals as members too, in either a personal or official capacity. Views expressed in posts are not necessarily the views of the operators of the forum.

As well as posting messages onto existing threads, and starting new subjects, members can communicate with each other through personal messages if they wish. And once members have made a certain number of posts, they will automatically be admitted to the "frequent posters club", where subjects not-for-public-domain are discussed; anything from the occasional rant to meetups we may be having ...

 
Pages: 1 2 3 [4]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
This forum is provided by customers of Great Western Railway (formerly First Great Western), and the views expressed are those of the individual posters concerned. Visit www.gwr.com for the official Great Western Railway website. Please contact the administrators of this site if you feel that the content provided by one of our posters contravenes our posting rules (email link to report). Forum hosted by Well House Consultants

Jump to top of pageJump to Forum Home Page