Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

We've uncovered a display problem with the timelines function on both websites. They've stopped working on Chrome, Safari, and FF, but still work fine on MS Edge #12

Open
prince-acs opened this issue Aug 3, 2019 · 1 comment

Comments

@prince-acs
Copy link

http://www.lfffoundation.com/article/timeline/id/78

http://www.makepublic.uk/campaign-timeline/8

Can you have a look at what might be happening here?

@tomcrane
Copy link
Contributor

Hi @prince-acs

Both of these examples are calling a function getParameterByName when they initialise the timeline. The Wellcome examples do this too. In your examples, this function is missing - it's not part of the timeline codebase. On the Wellcome site this function is part of a utils script package, and is bundled into https://wellcomelibrary.org/mergedscript/1e06f900/TimelineMergedScript.js.

Here's the code for this function - it extracts query string params:

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.search);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants