Train GraphicClick on the map to explore geographics
 
I need help
FAQ
Emergency
About .
No recent travel & transport from BBC stories as at 12:15 27 Apr 2024
Read about the forum [here].
Register [here] - it's free.
What do I gain from registering? [here]
 22/05/24 - WWRUG / TransWilts update
02/06/24 - Summer Timetable starts
17/08/24 - Bus to Imber
27/09/25 - 200 years of passenger trains

No 'On This Day' events reported for 27th Apr

Train RunningCancelled
27/04/24 12:01 Severn Beach to Bristol Temple Meads
27/04/24 13:51 Worcester Foregate Street to Bristol Temple Meads
13:52 St Erth to St Ives
14:06 St Ives to St Erth
Short Run
09:58 Great Malvern to London Paddington
27/04/24 11:38 Bristol Temple Meads to Worcester Foregate Street
12:02 Westbury to Gloucester
27/04/24 12:49 Worcester Foregate Street to Bristol Temple Meads
12:52 London Paddington to Worcester Foregate Street
14:02 Westbury to Gloucester
14:10 Gloucester to Frome
27/04/24 14:38 Bristol Temple Meads to Worcester Foregate Street
14:59 Cardiff Central to Penzance
27/04/24 15:38 Bristol Temple Meads to Worcester Foregate Street
17:43 Bristol Temple Meads to Salisbury
18:12 Salisbury to Cheltenham Spa
18:23 Portsmouth Harbour to Cardiff Central
19:13 Salisbury to Worcester Shrub Hill
Delayed
08:51 Penzance to Cardiff Central
11:12 Salisbury to Worcester Foregate Street
13:22 St Erth to St Ives
13:36 St Ives to St Erth
15:59 Cardiff Central to Taunton
An additional train service has been planned to operate as shown 20:57 Bristol Temple Meads to Cardiff Central
PollsThere are no open or recent polls
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
April 27, 2024, 12:15:09 *
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] Labour to nationalise railways within five years of coming to ...
[50] access for all at Devon stations report
[32] Who we are - the people behind firstgreatwestern.info
[11] Bonaparte's at Bristol Temple Meads
[2] Lack of rolling stock due to attacks on shipping in the Red Se...
[1] Cornish delays
 
News: A forum for passengers ... with input from rail professionals welcomed too
 
   Home   Help Search Calendar Login Register  
Pages: 1 2 3 [4]
  Print  
Author Topic: Mobile friendly site  (Read 20080 times)
Richard Fairhurst
Global Moderator
Hero Member
*****
Posts: 1209


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: 40835



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, Acting Chair of Melksham Rail User Group, Option 24/7 Melksham Rep
JayMac
Data Manager
Hero Member
******
Posts: 18923



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

"Build a man a fire and he'll be warm for the rest of the day. Set a man on fire and he'll be warm for the rest of his life."

- Sir Terry Pratchett.
paul7575
Transport Scholar
Hero Member
******
Posts: 5318


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: 17895


I am not railway staff


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